Restore a Custom Dashboard Revision

POST /api/0/organizations/{organization_id_or_slug}/dashboards/{dashboard_id}/revisions/{revision_id}/restore/

Restore an organization's custom dashboard to the state saved in one of its revisions, replacing its title, widgets and saved settings such as filters, and return the restored dashboard.

The dashboard's current state is first recorded as a new revision with the source pre-restore, so a restore can itself be undone. Restoring again records another revision, so retrying a restore is not idempotent. The requesting user needs edit access to the dashboard. Returns 400 if the revision can no longer be restored, for example because its snapshot format is unsupported or it fails validation, and 409 if another dashboard already uses the revision's title.

Path Parameters

organization_id_or_slug (string)
REQUIRED

The ID or slug of the organization the resource belongs to.

dashboard_id (integer)
REQUIRED

The ID of the dashboard you'd like to retrieve.

revision_id (integer)
REQUIRED

The ID of the dashboard revision, from the dashboard's revision list.

Scopes

<auth_token> requires one of the following scopes:
  • org:admin
  • org:read
  • org:write
Copied
curl https://sentry.io/api/0/organizations/{organization_id_or_slug}/dashboards/{dashboard_id}/revisions/{revision_id}/restore/ \
 -H 'Authorization: Bearer <auth_token>'
RESPONSESCHEMA
Copied
{ "id": "1", "title": "Dashboard", "dateCreated": "2024-06-20T14:38:03.498574Z", "createdBy": { "id": "1", "name": "Admin", "username": "admin", "email": "admin@sentry.io", "avatarUrl": "www.example.com", "isActive": true, "isSuspended": false, "hasPasswordAuth": true, "isManaged": false, "dateJoined": "2021-10-25T17:07:33.190596Z", "lastLogin": "2024-07-16T15:28:39.261659Z", "has2fa": true, "lastActive": "2024-07-16T20:45:49.364197Z", "isSuperuser": false, "isStaff": false, "experiments": {}, "emails": [ { "id": "1", "email": "admin@sentry.io", "is_verified": true } ], "avatar": { "avatarType": "letter_avatar", "avatarUuid": null, "avatarUrl": "www.example.com" } }, "widgets": [ { "id": "658714", "title": "Custom Widget", "description": null, "displayType": "table", "thresholds": null, "interval": "5m", "dateCreated": "2024-07-16T15:36:46.048343Z", "dashboardId": "1", "datasetSource": "user", "queries": [ { "id": "1", "name": "", "fields": [ "avg(transaction.duration)", "transaction" ], "aggregates": [ "avg(transaction.duration)" ], "transformations": {}, "columns": [ "transaction" ], "fieldAliases": [ "", "" ], "conditions": "", "orderby": "-avg(transaction.duration)", "widgetId": "1", "onDemand": [ { "enabled": false, "extractionState": "disabled:not-applicable", "dashboardWidgetQueryId": 1 } ], "isHidden": false, "selectedAggregate": null, "linkedDashboards": [] } ], "limit": null, "widgetType": "transaction-like", "layout": { "w": 2, "y": 0, "h": 2, "minH": 2, "x": 0 }, "exploreUrls": null, "changedReason": null, "axisRange": null, "legendType": "default" } ], "projects": [ 1 ], "filters": {}, "environment": [ "alpha" ], "period": "7d", "permissions": { "isEditableByEveryone": true, "teamsWithEditAccess": [] }, "isFavorited": false, "prebuiltId": null, "queryPriority": "normal" }
Was this helpful?