API Tokens
List API tokens
See the API tokens of a data app, by name and last 4 characters.
GET
curl "https://api.usedatabrain.com/api/v2/data-app/api-tokens?dataAppName=Customer%20portal" \ --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN"Auth
A service token. See Authentication.
ServiceTokenheader
AuthorizationBearer <token>A service token. A data app API token is refused.
Query
Tokens are listed oldest first.
Response
{ "data": [ { "key": null, "keyId": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f", "keyLast4": "5a6b", "name": "Production backend", "description": "API key for data app Customer portal", "createdAt": "2026-11-18T09:00:00.000Z" } ]}| Field | Description |
|---|---|
keyId | The public id of the token. It is not a credential |
keyLast4 | The last 4 characters of the token |
key | Deprecated. null for every token made since tokens are stored as a hash. The full token only for an older token |
name, description, createdAt | The token's label, description and creation time |
key will be removed. Use keyId and keyLast4. Every successful response has a Deprecation header and a Sunset header; the Sunset header gives the removal date. Until then the list can return the full value of an older token, so keep the response out of logs.
The list does not say whether a token is expired.
Errors
| Status | error.code | Why |
|---|---|---|
| 400 | INVALID_REQUEST_BODY | dataAppName is missing |
| 400 | DATA_APP_NOT_FOUND | No data app has this name |
| 403 | AUTHENTICATION_ERROR | You used a data app API token |
For errors that every endpoint returns, see Authentication.
curl -X GET 'https://api.usedatabrain.com/api/v2/data-app/api-tokens?dataAppName=string'Example Response
{ "data": [ { "key": null, "keyId": "c1d2e3f4-a5b6-4c7d-8e9f-0a1b2c3d4e5f", "keyLast4": "5a6b", "name": "Production backend", "description": "API key for data app Customer portal", "createdAt": "2026-11-18T09:00:00.000Z" } ]}