Metric APIs
Publish/Unpublish Metric
Publish or unpublish metrics in an embed configuration to control which metrics are visible to end users.
PUT
Control the visibility of metrics within an embed by publishing or unpublishing them. Published metrics are visible to end users, while unpublished metrics remain hidden but can be published later.Documentation Index
Fetch the complete documentation index at: https://docs.usedatabrain.com/llms.txt
Use this file to discover all available pages before exploring further.
This endpoint allows you to dynamically control metric visibility without deleting metrics or modifying embed configurations. Useful for staged rollouts, A/B testing, or hiding metrics temporarily.
Authentication
All API requests must include your API key in the Authorization header. Get your API token when creating a data app - see our data app creation guide for details. Finding your API token: For detailed instructions, see the API Token guide.Headers
Bearer token for API authentication. Use your API key from the data app.
Must be set to
application/json for all requests.Request Body
The embed configuration ID where the metric is located.
The ID of the metric to publish or unpublish.
Set the publication status of the metric.
true: Publish the metric (make it visible to end users)false: Unpublish the metric (hide it from end users)
Response
The metric ID that was successfully updated on success.
Error object returned only when the request fails. Not included in successful responses.
Examples
HTTP Status Code Summary
| Status Code | Description |
|---|---|
200 | OK - Metric publication status updated |
400 | Bad Request - Invalid request parameters |
401 | Unauthorized - Invalid or missing API key |
500 | Internal Server Error - Server error or invalid IDs |
Possible Errors
| Error Code | HTTP Status | Description |
|---|---|---|
INVALID_REQUEST_BODY | 400 | Missing or invalid parameters |
INVALID_DATA_APP_API_KEY | 401 | Invalid API key |
INVALID_METRIC_ID | 500 | Invalid metric or embed ID |
INTERNAL_SERVER_ERROR | 500 | Server error |

