Skip to Content

Datasource APIs

Delete a datasource

Remove a datasource that no workspace or datamart uses.

DELETE
/api/v2/datasource

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.

Authorization

ApiToken
headerAuthorizationBearer <token>

A service token or a data app API token.

Query

datasourceNamestringrequired

The datasource name, exactly as saved. Encode spaces in the URL.

Response

{  "message": "Datasource deleted successfully"}

Errors

Statuserror.codeWhy
400INVALID_REQUEST_BODYdatasourceName is missing
400DATASOURCE_NAME_ERRORNo datasource has this name
400DATASOURCE_IN_USEA workspace or a datamart uses the datasource. Remove it from them first
404DATASOURCE_NOT_FOUNDThe datasource was already removed

For errors that every endpoint returns, see Authentication.

Example Request
curl -X DELETE 'https://api.usedatabrain.com/api/v2/datasource?datasourceName=string'
Example Response
{  "message": "Datasource deleted successfully"}