Data Retrieval
Roll back a dashboard release
Put a dashboard back the way an earlier release left it.
POST
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": "Staging", "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.
ServiceTokenheader
AuthorizationBearer <token>A service token. A data app API token is refused.
Body
The workspace of the dashboard.
The dashboard's externalDashboardId
The release id or shortId to restore.
expectedVersionstring
Required to roll back. The expectedVersion of your dry run.
callbackUrlstring
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 } } }Errors
| Status | error.code | Why |
|---|---|---|
| 400 | EXPECTED_VERSION_REQUIRED | You rolled back without expectedVersion |
| 403 | AUTH_ERROR or FEATURE_NOT_ENABLED | Not a service token, or environments are off |
| 404 | RELEASE_NOT_FOUND | Release not found. |
| 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. |
| 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"}'Example Response
{ "data": { "releaseId": "5e6f7a8b-...", "shortId": "r-9p3q", "restored": "r-8k2m", "summary": { "added": 0, "updated": 2, "retired": 1, "unchanged": 5 }, "callback": { "delivered": true, "status": 200 } }}