Skip to main content
curl --request DELETE \
  --url 'https://api.usedatabrain.com/api/v2/datasource?datasourceName=production-postgres' \
  --header 'Authorization: Bearer dbn_live_abc123...'
{
  "id": "uuid-of-deleted-datasource",
  "message": "Datasource deleted successfully"
}
DELETE
https://api.usedatabrain.com
/
api
/
v2
/
datasource
curl --request DELETE \
  --url 'https://api.usedatabrain.com/api/v2/datasource?datasourceName=production-postgres' \
  --header 'Authorization: Bearer dbn_live_abc123...'
{
  "id": "uuid-of-deleted-datasource",
  "message": "Datasource deleted successfully"
}
Permanently delete a datasource from your organization. This will remove the datasource and all its associated configurations, including cached schemas.
This action is irreversible. Once a datasource is deleted, all its configurations and cached schemas will be permanently removed. Ensure no datamarts or other resources depend on this datasource before deletion.

Endpoint

DELETE https://api.usedatabrain.com/api/v2/datasource?datasourceName={name}

Self-hosted Databrain Endpoint

DELETE <SELF_HOSTED_URL>/api/v2/datasource?datasourceName={name}

Authentication

This endpoint requires a service token in the Authorization header. Service tokens differ from data app API keys and provide organization-level permissions. To access your service token:
  1. Go to your Databrain dashboard and open Settings.
  2. Navigate to Settings.
  3. Find the Service Tokens section.
  4. Click the “Generate Token” button to generate a new service token if you don’t have one already. Use this token as the Bearer value in your Authorization header.

Headers

Authorization
string
required
Bearer token for API authentication. Use your API key from the data app.
Authorization: Bearer dbn_live_abc123...

Query Parameters

datasourceName
string
required
The name of the datasource to delete. Must match exactly as it was created.

Response

id
string
The ID of the deleted datasource for confirmation.
message
string
Success message confirming the deletion: “Datasource deleted successfully”.
error
null
Error field, null when successful. Not included in successful responses.

Examples

Error Codes

Error CodeHTTP StatusDescription
INVALID_REQUEST_BODY400Missing or invalid datasourceName parameter
DATASOURCE_NAME_ERROR400Datasource not found
DATASOURCE_IN_USE400Datasource is being used by other resources
AUTHENTICATION_ERROR401Invalid or missing service token
INTERNAL_SERVER_ERROR500Server error occurred

Next Steps