openapi: 3.2.0 info: description: 'The Grafana backend exposes an HTTP API, the same API is used by the frontend to do everything from saving dashboards, creating users and updating data sources.' title: Grafana HTTP API. Versions API contact: name: Grafana Labs url: https://grafana.com email: hello@grafana.com version: 0.0.1 servers: - url: /api security: - basic: [] - api_key: [] tags: - name: Versions paths: /dashboards/uid/{uid}/restore: post: description: 'This API will be removed when /apis/dashboard.grafana.app/v1 is released. You can restore a dashboard by reading it from history, then creating it again.' tags: - Versions summary: Restore a dashboard to a given dashboard version using UID operationId: restoreDashboardVersionByUID deprecated: true parameters: - name: uid in: path required: true schema: type: string responses: '200': $ref: '#/components/responses/postDashboardResponse' '400': $ref: '#/components/responses/badRequestError' '401': $ref: '#/components/responses/unauthorisedError' '403': $ref: '#/components/responses/forbiddenError' '404': $ref: '#/components/responses/notFoundError' '500': $ref: '#/components/responses/internalServerError' requestBody: content: application/json: schema: $ref: '#/components/schemas/RestoreDashboardVersionCommand' required: true /dashboards/uid/{uid}/versions: get: tags: - Versions summary: Gets all existing versions for the dashboard using UID operationId: getDashboardVersionsByUID deprecated: true parameters: - name: uid in: path required: true schema: type: string - description: Maximum number of results to return name: limit in: query schema: type: integer format: int64 default: 0 - description: Version to start from when returning queries name: start in: query schema: type: integer format: int64 default: 0 responses: '200': $ref: '#/components/responses/dashboardVersionsResponse' '401': $ref: '#/components/responses/unauthorisedError' '403': $ref: '#/components/responses/forbiddenError' '404': $ref: '#/components/responses/notFoundError' '500': $ref: '#/components/responses/internalServerError' /dashboards/uid/{uid}/versions/{DashboardVersionID}: get: tags: - Versions summary: Get a specific dashboard version using UID operationId: getDashboardVersionByUID deprecated: true parameters: - name: DashboardVersionID in: path required: true schema: type: integer format: int64 - name: uid in: path required: true schema: type: string responses: '200': $ref: '#/components/responses/dashboardVersionResponse' '401': $ref: '#/components/responses/unauthorisedError' '403': $ref: '#/components/responses/forbiddenError' '404': $ref: '#/components/responses/notFoundError' '500': $ref: '#/components/responses/internalServerError' components: schemas: RestoreDashboardVersionCommand: type: object properties: version: type: integer format: int64 Json: type: object DashboardVersionMeta: description: 'DashboardVersionMeta extends the DashboardVersionDTO with the names associated with the UserIds, overriding the field with the same name from the DashboardVersionDTO model.' type: object properties: created: type: string format: date-time createdBy: type: string dashboardId: type: integer format: int64 data: $ref: '#/components/schemas/Json' id: type: integer format: int64 message: type: string parentVersion: type: integer format: int64 restoredFrom: type: integer format: int64 uid: type: string version: type: integer format: int64 ErrorResponseBody: type: object required: - message properties: error: description: Error An optional detailed description of the actual error. Only included if running in developer mode. type: string message: description: a human readable version of the error type: string status: description: 'Status An optional status to denote the cause of the error. For example, a 412 Precondition Failed error may include additional information of why that error happened.' type: string DashboardVersionResponseMeta: type: object properties: continueToken: type: string versions: type: array items: $ref: '#/components/schemas/DashboardVersionMeta' responses: dashboardVersionsResponse: description: (empty) content: application/json: schema: $ref: '#/components/schemas/DashboardVersionResponseMeta' unauthorisedError: description: UnauthorizedError is returned when the request is not authenticated. content: application/json: schema: $ref: '#/components/schemas/ErrorResponseBody' internalServerError: description: InternalServerError is a general error indicating something went wrong internally. content: application/json: schema: $ref: '#/components/schemas/ErrorResponseBody' notFoundError: description: NotFoundError is returned when the requested resource was not found. content: application/json: schema: $ref: '#/components/schemas/ErrorResponseBody' dashboardVersionResponse: description: (empty) content: application/json: schema: $ref: '#/components/schemas/DashboardVersionMeta' badRequestError: description: BadRequestError is returned when the request is invalid and it cannot be processed. content: application/json: schema: $ref: '#/components/schemas/ErrorResponseBody' postDashboardResponse: description: (empty) content: application/json: schema: type: object required: - status - title - version - id - uid - url properties: folderUid: description: FolderUID The unique identifier (uid) of the folder the dashboard belongs to. type: string id: description: ID The unique identifier (id) of the created/updated dashboard. type: integer format: int64 example: 1 status: description: Status status of the response. type: string example: success title: description: Slug The slug of the dashboard. type: string example: my-dashboard uid: description: UID The unique identifier (uid) of the created/updated dashboard. type: string example: nHz3SXiiz url: description: URL The relative URL for accessing the created/updated dashboard. type: string example: /d/nHz3SXiiz/my-dashboard version: description: Version The version of the dashboard. type: integer format: int64 example: 2 forbiddenError: description: ForbiddenError is returned if the user/token has insufficient permissions to access the requested resource. content: application/json: schema: $ref: '#/components/schemas/ErrorResponseBody' securitySchemes: api_key: type: apiKey name: Authorization in: header basic: type: http scheme: basic