curl --request GET \
--url 'https://api.usedatabrain.com/api/v2/data-app/api-tokens?dataAppName=Customer%20Portal%20Analytics' \
--header 'Authorization: Bearer service_token_xyz...'
{
"data": [
{
"key": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production API Key",
"description": "API key for data app Customer Portal Analytics",
"createdAt": "2024-01-15T10:30:00Z"
},
{
"key": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Development Token",
"description": "API key for data app Customer Portal Analytics",
"createdAt": "2024-01-10T14:15:00Z"
},
{
"key": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"name": "Staging Environment",
"description": "API key for data app Customer Portal Analytics",
"createdAt": "2024-01-08T09:00:00Z"
}
]
}
curl --request GET \
--url 'https://api.usedatabrain.com/api/v2/data-app/api-tokens?dataAppName=Customer%20Portal%20Analytics' \
--header 'Authorization: Bearer service_token_xyz...'
{
"data": [
{
"key": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production API Key",
"description": "API key for data app Customer Portal Analytics",
"createdAt": "2024-01-15T10:30:00Z"
},
{
"key": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Development Token",
"description": "API key for data app Customer Portal Analytics",
"createdAt": "2024-01-10T14:15:00Z"
},
{
"key": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"name": "Staging Environment",
"description": "API key for data app Customer Portal Analytics",
"createdAt": "2024-01-08T09:00:00Z"
}
]
}
Retrieve a list of all API tokens associated with a specific Data App.
curl --request GET \
--url 'https://api.usedatabrain.com/api/v2/data-app/api-tokens?dataAppName=Customer%20Portal%20Analytics' \
--header 'Authorization: Bearer service_token_xyz...'
{
"data": [
{
"key": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production API Key",
"description": "API key for data app Customer Portal Analytics",
"createdAt": "2024-01-15T10:30:00Z"
},
{
"key": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Development Token",
"description": "API key for data app Customer Portal Analytics",
"createdAt": "2024-01-10T14:15:00Z"
},
{
"key": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"name": "Staging Environment",
"description": "API key for data app Customer Portal Analytics",
"createdAt": "2024-01-08T09:00:00Z"
}
]
}
curl --request GET \
--url 'https://api.usedatabrain.com/api/v2/data-app/api-tokens?dataAppName=Customer%20Portal%20Analytics' \
--header 'Authorization: Bearer service_token_xyz...'
{
"data": [
{
"key": "550e8400-e29b-41d4-a716-446655440000",
"name": "Production API Key",
"description": "API key for data app Customer Portal Analytics",
"createdAt": "2024-01-15T10:30:00Z"
},
{
"key": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"name": "Development Token",
"description": "API key for data app Customer Portal Analytics",
"createdAt": "2024-01-10T14:15:00Z"
},
{
"key": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"name": "Staging Environment",
"description": "API key for data app Customer Portal Analytics",
"createdAt": "2024-01-08T09:00:00Z"
}
]
}
GET https://api.usedatabrain.com/api/v2/data-app/api-tokens?dataAppName={name}
GET https://api.usedatabrain.com/api/v2/dataApp/api-tokens?dataAppName={name}
Authorization: Bearer service_token_xyz...
Show Finding Data App names
"true" to enable pagination with a limit of 10 per page.Note: Query parameters are passed as strings. Use "true" or "false"."true". Must be a numeric string (e.g., "1", "2").| Status Code | Description |
|---|---|
200 | OK - API tokens retrieved successfully |
400 | Bad Request - Invalid request parameters |
500 | Internal Server Error - Server error occurred |
| Error Code | HTTP Status | Description |
|---|---|---|
INVALID_REQUEST_BODY | 400 | Missing or invalid dataAppName |
DATA_APP_NOT_FOUND | 400 | Data App with given name not found |
AUTHENTICATION_ERROR | 400 | Invalid or missing service token |
INTERNAL_SERVER_ERROR | 500 | Server error |
Get your service token
Identify the Data App
curl --request GET \
--url 'https://api.usedatabrain.com/api/v2/data-app' \
--header 'Authorization: Bearer service_token_xyz...'
List API tokens
curl --request GET \
--url 'https://api.usedatabrain.com/api/v2/data-app/api-tokens?dataAppName=My%20Data%20App' \
--header 'Authorization: Bearer service_token_xyz...'
Manage your tokens
const tokens = await listApiTokens({ dataAppName: 'My Data App' });
tokens.data.forEach(token => {
console.log(`Token: ${token.name}`);
console.log(` Key: ${token.key}`);
console.log(` Created: ${token.createdAt}`);
// Check if token is old and might need rotation
const createdDate = new Date(token.createdAt);
const daysSinceCreation = (Date.now() - createdDate) / (1000 * 60 * 60 * 24);
if (daysSinceCreation > 90) {
console.log(` ⚠️ Consider rotating this token (${Math.floor(daysSinceCreation)} days old)`);
}
});