curl --request POST \
--url https://api.usedatabrain.com/api/v2/workspace/metrics \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"workspaceName": "my-workspace"
}'
{
"data": [
{
"name": "Monthly Revenue",
"metricId": "metric_abc123"
},
{
"name": "Active Users",
"metricId": "metric_def456"
}
],
"error": null
}
curl --request POST \
--url https://api.usedatabrain.com/api/v2/workspace/metrics \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"workspaceName": "my-workspace"
}'
{
"data": [
{
"name": "Monthly Revenue",
"metricId": "metric_abc123"
},
{
"name": "Active Users",
"metricId": "metric_def456"
}
],
"error": null
}
Retrieve metrics from a workspace with optional pagination support.
curl --request POST \
--url https://api.usedatabrain.com/api/v2/workspace/metrics \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"workspaceName": "my-workspace"
}'
{
"data": [
{
"name": "Monthly Revenue",
"metricId": "metric_abc123"
},
{
"name": "Active Users",
"metricId": "metric_def456"
}
],
"error": null
}
curl --request POST \
--url https://api.usedatabrain.com/api/v2/workspace/metrics \
--header 'Authorization: Bearer dbn_live_abc123...' \
--header 'Content-Type: application/json' \
--data '{
"workspaceName": "my-workspace"
}'
{
"data": [
{
"name": "Monthly Revenue",
"metricId": "metric_abc123"
},
{
"name": "Active Users",
"metricId": "metric_def456"
}
],
"error": null
}
Authorization: Bearer dbn_live_abc123...
application/json for all requests.Content-Type: application/json
Show Finding workspace names
true: Enable pagination with page-based retrieval (10 items per page)false (default): Return all metrics in a single responseShow When to use pagination
isPagination is set to true.| Status Code | Description |
|---|---|
200 | OK - Metrics retrieved successfully |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Invalid or missing API key |
500 | Internal Server Error - Server error occurred |
| Error Code | HTTP Status | Description |
|---|---|---|
INVALID_REQUEST_BODY | 400 | Missing or invalid request body parameters |
WORKSPACE_ID_ERROR | 400 | Workspace name does not exist |
INVALID_DATA_APP_API_KEY | 401 | Invalid or expired API key |
INTERNAL_SERVER_ERROR | 500 | Server error |