Datasource APIs
Delete a datasource
Remove a datasource that no workspace or datamart uses.
DELETE
Databrain removes the datasource and its tenancy settings. A datasource that a workspace or a datamart uses cannot be deleted.
curl --request DELETE \ "https://api.usedatabrain.com/api/v2/datasource?datasourceName=Sales%20warehouse" \ --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN"You cannot undo this. Metrics that used the datasource lose their link to it.
Auth
A service token. See Authentication.
ApiTokenheader
AuthorizationBearer <token>A service token or a data app API token.
Query
The datasource name, exactly as saved. Encode spaces in the URL.
Response
{ "message": "Datasource deleted successfully"}Errors
| Status | error.code | Why |
|---|---|---|
| 400 | INVALID_REQUEST_BODY | datasourceName is missing |
| 400 | DATASOURCE_NAME_ERROR | No datasource has this name |
| 400 | DATASOURCE_IN_USE | A workspace or a datamart uses the datasource. Remove it from them first |
| 404 | DATASOURCE_NOT_FOUND | The datasource was already removed |
For errors that every endpoint returns, see Authentication.
curl -X DELETE 'https://api.usedatabrain.com/api/v2/datasource?datasourceName=string'Example Response
{ "message": "Datasource deleted successfully"}