Skip to Content

Data Retrieval

Roll back a dashboard release

Put a dashboard back the way an earlier release left it.

POST
/api/v2/data-app/dashboard-releases/rollback

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

Steps

  1. 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" }'
  2. Read data.checks and data.canRollBack. Copy data.expectedVersion.

  3. Send the same body with "dryRun": false and "expectedVersion": "<data.expectedVersion>".

You get the new release id in data.releaseId.

Authorization

ServiceToken
headerAuthorizationBearer <token>

A service token. A data app API token is refused.

Body

workspaceNamestringrequired

The workspace of the dashboard.

dashboardIdstringrequired

The dashboard's externalDashboardId

releasestringrequired

The release id or shortId to restore.

dryRunboolean

Only false rolls back. Default: a dry run.

Default: true

Required to roll back. The expectedVersion of your dry run.

Shared metrics you agree to change.

Default: []

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

Statuserror.codeWhy
400EXPECTED_VERSION_REQUIREDYou rolled back without expectedVersion
403AUTH_ERROR or FEATURE_NOT_ENABLEDNot a service token, or environments are off
404RELEASE_NOT_FOUNDRelease not found.
404DASHBOARD_NOT_FOUNDNo dashboard in the workspace has this id
409LIVE_CHANGEDThe dashboard changed after your dry run
409NO_CHANGESThe dashboard already matches that release.
422CHECKS_FAILEDThis roll back is blocked. The body has checks
500INTERNAL_SERVER_ERRORNothing was changed. Try again.

For errors that every endpoint returns, see Authentication.

Example Request
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    }  }}