Skip to Content

Datasource APIs

List datasources

Get the id, name and status of every datasource in your organization.

GET
/api/v2/datasource

Use the id to sync a datasource and the name in every other datasource call. Credentials are never returned.

curl "https://api.usedatabrain.com/api/v2/datasource?isPagination=true&pageNumber=1" \  --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN"

Auth

A service token. See Authentication.

Authorization

ApiToken
headerAuthorizationBearer <token>

A service token or a data app API token.

Query

true returns 10 datasources per page. Without it you get all of them.

One of: truefalse
pageNumberinteger

Page to return, from 1. Used only with isPagination=true

Range: 1 to

The order is not fixed, and there is no total count. Without pagination you get the full list in one response.

Response

{  "data": [    {      "id": "6f1c2b9e-4d3a-4f8e-9b7c-2a1d0e5f6c7b",      "name": "Sales warehouse",      "isAuthenticated": true,      "isDisabled": false    }  ]}
FieldTypeDescription
idstringThe datasource id
namestringThe datasource name
isAuthenticatedbooleanThe last connection test passed
isDisabledbooleanThe datasource is turned off

Errors

Statuserror.codeWhy
400INVALID_REQUEST_BODYpageNumber is not a whole number from 1

For errors that every endpoint returns, see Authentication.

Example Request
curl -X GET 'https://api.usedatabrain.com/api/v2/datasource'
Example Response
{  "data": [    {      "id": "6f1c2b9e-4d3a-4f8e-9b7c-2a1d0e5f6c7b",      "name": "Sales warehouse",      "isAuthenticated": true,      "isDisabled": false    }  ]}