Data Retrieval
Roll back a dashboard release
Put a dashboard back the way an earlier release left it.
A roll back is a new release that restores an old one. Every call is a dry run unless you send "dryRun": false.
Before you start
- You have a service token. See Authentication.
- You have the release
idorshortIdfrom List dashboard releases.
Steps
-
Run a dry run:
curl --request POST https://api.usedatabrain.com/api/v2/data-app/dashboard-releases/rollback \ --header "Authorization: Bearer $DATABRAIN_SERVICE_TOKEN" \ --header "Content-Type: application/json" \ --data '{ "workspaceName": "Production", "dashboardId": "sales-overview", "release": "r-8k2m" }' -
Read
data.checksanddata.canRollBack. Copydata.expectedVersion. -
Send the same body with
"dryRun": falseand"expectedVersion": "<data.expectedVersion>".
You get the new release id in data.releaseId. If you send the same roll back again, for example after a timeout, you
get the release it already made, with "replayed": true.
ServiceTokenAuthorizationBearer <token>A service token. A data app API token is refused.
Body
The workspace of the dashboard that the release changed. For a promote from Staging to Production, this is Production.
The dashboard's externalDashboardId
The release id or shortId to restore.
Required to roll back. The expectedVersion of your dry run.
An https URL that gets a signed POST afterwards, as on promote
Response
Dry run:
{ "data": { "releaseShortId": "r-8k2m", "summary": { "added": 0, "updated": 2, "retired": 1, "unchanged": 5 }, "metrics": [{ "name": "Churn", "action": "retired" }], "checks": [], "canRollBack": true, "noChanges": false, "expectedVersion": "4b1d..." }}Roll back:
{ "data": { "releaseId": "5e6f7a8b-...", "shortId": "r-9p3q", "restored": "r-8k2m", "summary": { "added": 0, "updated": 2, "retired": 1, "unchanged": 5 } } }With callbackUrl, the response also has callback: { "delivered": true, "status": 200 }.
Errors
| Status | error.code | Why |
|---|---|---|
| 400 | WORKSPACE_NOT_FOUND | No workspace, or more than one, has this name |
| 400 | EXPECTED_VERSION_REQUIRED | You rolled back without expectedVersion |
| 400 | INVALID_CALLBACK_URL | callbackUrl is not a public https URL |
| 403 | AUTHENTICATION_ERROR | Invalid Service Token: you used a data app API token |
| 403 | FEATURE_NOT_ENABLED | Dashboard environments are not on for your company |
| 404 | RELEASE_NOT_FOUND | Release not found. No release of this dashboard has this id or shortId |
| 404 | DASHBOARD_NOT_FOUND | No dashboard in the workspace has this id |
| 409 | LIVE_CHANGED | The dashboard changed after your dry run |
| 409 | NO_CHANGES | The dashboard already matches that release. |
| 409 | PUBLISH_IN_PROGRESS or RETRY | Someone changed this dashboard a moment ago, or Databrain was busy. Run the dry run again |
| 422 | CHECKS_FAILED | This roll back is blocked. The body has checks |
| 500 | INTERNAL_SERVER_ERROR | Nothing was changed. Try again. |
For errors that every endpoint returns, see Authentication.
curl -X POST 'https://api.usedatabrain.com/api/v2/data-app/dashboard-releases/rollback' \ -H 'Content-Type: application/json' \ -d '{ "workspaceName": "string", "dashboardId": "string", "release": "string"}'{ "data": { "releaseId": "5e6f7a8b-...", "shortId": "r-9p3q", "restored": "r-8k2m", "summary": { "added": 0, "updated": 2, "retired": 1, "unchanged": 5 }, "callback": { "delivered": true, "status": 200 } }}