> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flashduty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get dashboard revision

> Fetch one historical revision with its full definition.



## OpenAPI

````yaml /api-reference/monitors.openapi.en.json post /monit/dashboard/revisions/get
openapi: 3.1.0
info:
  title: Flashduty Open API
  description: >-
    Public HTTP API for the Flashduty incident management platform — incidents,
    notification templates, channels, schedules, monitors, RUM, and platform
    administration. Every operation is authenticated with an `app_key` query
    parameter issued from the Flashduty console under Account → APP Keys.
    Responses follow a uniform envelope: `{ request_id, data }` on success, `{
    request_id, error }` on failure.
  version: 1.0.0
servers:
  - url: https://api.flashcat.cloud
    description: Flashduty Open API
security:
  - AppKeyAuth: []
tags:
  - name: Monitors/Alert rules
    description: >-
      Create, manage, and export monitor alert rules. Query rule counters and
      audit history.
  - name: Monitors/Data sources
    description: Manage monitoring data sources used by alert rules to query metrics.
  - name: Monitors/Diagnostics
    description: >-
      Diagnostic and query endpoints used by Flashduty AI SRE — ad-hoc data
      source queries, log/metric diagnostics, and target-side tool invocation.
  - name: Monitors/Monitor utilities
    description: Monitors service activation and data preview utilities.
  - name: Monitors/Dashboards
    description: >-
      Create, search, version and run Monitors dashboards, and resolve their
      variables and queries.
  - name: Monitors/Rule folders
    description: >-
      List the monitor folder tree that dashboards and alert rules are organised
      in.
paths:
  /monit/dashboard/revisions/get:
    post:
      tags:
        - Monitors/Dashboards
      summary: Get dashboard revision
      description: Fetch one historical revision with its full definition.
      operationId: monit-dashboard-revision-read-get
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DashboardRevisionGetRequest'
            example:
              dashboard_id: 01990d7a-9c5b-7ab0-9c18-33e38f6f2101
              revision: 6
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessEnvelope'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/DashboardRevisionResource'
              example:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                data:
                  dashboard_id: 01990d7a-9c5b-7ab0-9c18-33e38f6f2101
                  schema_version: dashboard.v1
                  revision: 6
                  folder_id: 12
                  definition:
                    title: Checkout service overview
                    description: Traffic, errors and dependencies for the checkout service.
                    default_time_range:
                      from: now-1h
                      to: now
                    refresh_interval: 1m
                    variables:
                      - kind: custom
                        name: env
                        label: Environment
                        selection:
                          mode: single
                          include_all: false
                        options:
                          - text: Production
                            value: prod
                          - text: Staging
                            value: staging
                        default:
                          kind: values
                          values:
                            - prod
                    tabs:
                      - id: 01990d7a-9c5b-7ab0-9c18-33e38f6f2202
                        title: Overview
                        description: Golden signals.
                        top_panels: []
                        sections:
                          - id: 01990d7a-9c5b-7ab0-9c18-33e38f6f2303
                            title: Traffic
                            description: Request rate and latency.
                            collapsed: false
                            panels:
                              - id: 01990d7a-9c5b-7ab0-9c18-33e38f6f2404
                                title: Request rate
                                grid:
                                  x: 0
                                  'y': 0
                                  w: 12
                                  h: 8
                                datasource_ref:
                                  kind: fixed
                                  datasource_id: 10
                                  datasource_type: prometheus
                                queries:
                                  - ref_id: A
                                    legend_alias: '{{env}} requests'
                                    query:
                                      mode: range
                                      expr: >-
                                        sum(rate(http_requests_total{env="{{env}}"}[5m]))
                                      args: {}
                                      min_step_seconds: 30
                                viz_config:
                                  kind: time_series
                                  options: {}
                                  unit: count_per_second
                                  decimals: 2
                                  threshold:
                                    mode: higher_is_worse
                                    warning: 1000
                                    critical: 2000
                  message: Initial import
                  actor:
                    id: 10023
                    name: Ada Lovelace
                  created_at: 1791000000
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    DashboardRevisionGetRequest:
      type: object
      description: Fetch one historical revision.
      properties:
        dashboard_id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: Canonical UUIDv7 of the dashboard.
        revision:
          type: integer
          format: uint64
          minimum: 1
          description: Revision number to fetch.
      required:
        - dashboard_id
        - revision
    SuccessEnvelope:
      type: object
      description: >-
        Success response envelope. On every 2xx response, `request_id`
        identifies the call (also mirrored in the `Flashcat-Request-Id` header)
        and `data` holds the endpoint-specific payload. Failure responses use a
        different shape — see `ErrorResponse`.
      properties:
        request_id:
          type: string
          description: >-
            Unique ID for this request. Mirrored in the Flashcat-Request-Id
            response header. Include it when reporting issues.
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
        data:
          description: Endpoint-specific payload. See each operation's 200 response schema.
      required:
        - request_id
        - data
    DashboardRevisionResource:
      type: object
      description: A historical revision with its full definition.
      properties:
        dashboard_id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: Dashboard ID.
        schema_version:
          type: string
          enum:
            - dashboard.v1
          description: >-
            Wire schema version of `definition`; only `dashboard.v1` is
            accepted.
        revision:
          type: integer
          format: uint64
          minimum: 1
          description: Revision number.
        folder_id:
          type: integer
          format: uint64
          minimum: 1
          description: Folder the dashboard sat in at that revision.
        definition:
          $ref: '#/components/schemas/DashboardDefinition'
        message:
          type: string
          maxLength: 1024
          description: Optional commit message.
        actor:
          $ref: '#/components/schemas/DashboardActor'
        created_at:
          type: integer
          format: int64
          description: Unix timestamp in seconds.
      required:
        - dashboard_id
        - schema_version
        - revision
        - folder_id
        - definition
        - actor
        - created_at
    DashboardDefinition:
      type: object
      description: >-
        Complete dashboard payload stored as a portable `dashboard.v1` document.
        Unknown keys, duplicate keys, NaN/Inf, over-range numbers and trailing
        values are rejected; the serialized form must stay within 1 MiB.
      properties:
        title:
          type: string
          minLength: 1
          maxLength: 189
          description: Dashboard title, 1–189 Unicode code points after trimming.
        description:
          type: string
          maxLength: 1024
          description: Optional description, at most 1024 Unicode code points.
        default_time_range:
          $ref: '#/components/schemas/DashboardRelativeTimeRange'
        refresh_interval:
          type: string
          enum:
            - 'off'
            - 30s
            - 1m
            - 5m
          description: >-
            Auto-refresh cadence applied by the console: `off` disables
            auto-refresh; `30s` = every 30 seconds; `1m` = every minute; `5m` =
            every 5 minutes.
        variables:
          type: array
          items:
            $ref: '#/components/schemas/DashboardVariable'
          maxItems: 20
          description: >-
            Dashboard variables, at most 20. Names must be unique within the
            definition and match the variable-name pattern.
        tabs:
          type: array
          items:
            $ref: '#/components/schemas/DashboardTab'
          minItems: 1
          maxItems: 10
          description: >-
            Tabs, 1–10. Every tab title is unique and every tab or section ID
            must be a canonical UUIDv7 used only once across the definition.
      required:
        - title
        - default_time_range
        - refresh_interval
        - variables
        - tabs
    DashboardActor:
      type: object
      description: Account member recorded as the creator, updater or revision author.
      properties:
        id:
          type: integer
          format: uint64
          description: Member ID.
        name:
          type: string
          description: Member display name.
      required:
        - id
        - name
    ErrorResponse:
      type: object
      description: Response envelope for errors. `error` is required; `data` is absent.
      properties:
        request_id:
          type: string
          example: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
          description: >-
            Unique trace ID of this request; include it when reporting issues so
            logs can be located.
        error:
          $ref: '#/components/schemas/DutyError'
      required:
        - request_id
        - error
    DashboardRelativeTimeRange:
      type: object
      description: >-
        Relative time window. `from` is one of the fixed presets the validator
        accepts; `to` is always the literal string `now`.
      properties:
        from:
          type: string
          enum:
            - now-15m
            - now-30m
            - now-1h
            - now-3h
            - now-6h
            - now-12h
            - now-24h
            - now-7d
          description: >-
            Start offset relative to `to`: `now-15m` = 15 minutes ago; `now-30m`
            = 30 minutes ago; `now-1h` = 1 hour ago; `now-3h` = 3 hours ago;
            `now-6h` = 6 hours ago; `now-12h` = 12 hours ago; `now-24h` = 24
            hours ago; `now-7d` = 7 days ago.
        to:
          type: string
          enum:
            - now
          description: End of the window; only `now` is accepted.
      required:
        - from
        - to
    DashboardVariable:
      description: A dashboard variable. Pick the arm with `kind`.
      oneOf:
        - $ref: '#/components/schemas/DashboardDatasourceVariable'
        - $ref: '#/components/schemas/DashboardCustomVariable'
        - $ref: '#/components/schemas/DashboardQueryVariable'
      discriminator:
        propertyName: kind
        mapping:
          datasource: '#/components/schemas/DashboardDatasourceVariable'
          custom: '#/components/schemas/DashboardCustomVariable'
          query: '#/components/schemas/DashboardQueryVariable'
    DashboardTab:
      type: object
      description: >-
        A top-level tab. Panels can sit directly on the tab (`top_panels`) or
        inside sections.
      properties:
        id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: Canonical UUIDv7 identifying the tab; unique across the definition.
        title:
          type: string
          minLength: 1
          maxLength: 189
          description: Tab title, 1–189 Unicode code points. Unique among tabs.
        description:
          type: string
          maxLength: 1024
          description: Optional tab description.
        top_panels:
          type: array
          items:
            $ref: '#/components/schemas/DashboardPanel'
          maxItems: 30
          description: Panels placed directly on the tab, at most 30.
        sections:
          type: array
          items:
            $ref: '#/components/schemas/DashboardSection'
          maxItems: 10
          description: Sections on the tab, at most 10.
      required:
        - id
        - title
        - top_panels
        - sections
    DutyError:
      type: object
      description: >-
        Error payload inside the response envelope. Present only on non-2xx
        responses.
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: >-
            Human-readable error message, localized by the caller's
            Accept-Language. May contain field names, IDs, or other context from
            the failing request.
          example: The specified parameter template_id is not valid.
        reason:
          description: >-
            Optional machine-readable rejection reason, including datasource
            tool failures. Inspect alongside HTTP status and code.
          type: string
          x-flashduty-preserve-absence: true
      required:
        - code
        - message
    DashboardDatasourceVariable:
      type: object
      description: >-
        Datasource selector variable. Its candidates are the account's
        datasources of `datasource_type`.
      properties:
        kind:
          type: string
          enum:
            - datasource
          description: >-
            Variable kind discriminator; always `datasource`, selecting a
            datasource.
        name:
          type: string
          pattern: ^[A-Za-z_][A-Za-z0-9_]{0,63}$
          description: Variable name used in `{{ }}` templates, at most 64 characters.
        label:
          type: string
          maxLength: 189
          description: Optional display label; falls back to `name`.
        datasource_type:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,63}$
          description: Datasource type the candidates are drawn from.
        name_patterns:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 189
          maxItems: 10
          description: >-
            Wildcard patterns narrowing the candidates; empty means every
            datasource of the type.
        default_datasource_id:
          type: integer
          format: uint64
          description: >-
            Default datasource ID. Without a usable default the runtime picks
            the first candidate by name, then ID.
      required:
        - kind
        - name
        - datasource_type
    DashboardCustomVariable:
      type: object
      description: Variable whose candidates come from a fixed list supplied inline.
      properties:
        kind:
          type: string
          enum:
            - custom
          description: >-
            Variable kind discriminator; always `custom`, with candidates from a
            fixed list supplied inline.
        name:
          type: string
          pattern: ^[A-Za-z_][A-Za-z0-9_]{0,63}$
          description: Variable name used in `{{ }}` templates, at most 64 characters.
        label:
          type: string
          maxLength: 189
          description: Optional display label; falls back to `name`.
        selection:
          $ref: '#/components/schemas/DashboardSelectionConfig'
        options:
          type: array
          items:
            $ref: '#/components/schemas/DashboardCandidate'
          minItems: 1
          maxItems: 1000
          description: >-
            Candidate list, 1–1000 entries. Values must be non-empty, unique and
            must not be `$__all`.
        default:
          $ref: '#/components/schemas/DashboardSelection'
      required:
        - kind
        - name
        - selection
        - options
    DashboardQueryVariable:
      type: object
      description: >-
        Variable whose candidates are resolved by running a query against a
        datasource.
      properties:
        kind:
          type: string
          enum:
            - query
          description: >-
            Variable kind discriminator; always `query`, with candidates
            resolved by running a query against a datasource.
        name:
          type: string
          pattern: ^[A-Za-z_][A-Za-z0-9_]{0,63}$
          description: Variable name used in `{{ }}` templates, at most 64 characters.
        label:
          type: string
          maxLength: 189
          description: Optional display label; falls back to `name`.
        selection:
          $ref: '#/components/schemas/DashboardSelectionConfig'
        default:
          $ref: '#/components/schemas/DashboardSelection'
        datasource_ref:
          $ref: '#/components/schemas/DashboardDatasourceRef'
        variable_query:
          $ref: '#/components/schemas/DashboardVariableQuery'
        refresh:
          type: string
          enum:
            - on_dashboard_load
            - on_time_range_change
          description: >-
            When the candidates are recomputed: `on_dashboard_load` = once when
            the dashboard loads; `on_time_range_change` = every time the time
            range changes.
      required:
        - kind
        - name
        - selection
        - datasource_ref
        - variable_query
        - refresh
    DashboardPanel:
      type: object
      description: >-
        A single visualization. Panels must not overlap inside the same
        container; the 24-column grid is validated on save.
      properties:
        id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: >-
            Canonical UUIDv7 identifying the panel; unique across the
            definition.
        title:
          type: string
          minLength: 1
          maxLength: 189
          description: Panel title.
        description:
          type: string
          maxLength: 1024
          description: Optional panel description.
        grid:
          $ref: '#/components/schemas/DashboardGridPosition'
        datasource_ref:
          $ref: '#/components/schemas/DashboardDatasourceRef'
        queries:
          type: array
          items:
            $ref: '#/components/schemas/DashboardPanelQuery'
          maxItems: 26
          description: >-
            Queries in the panel. `time_series` accepts 1–26, `text` accepts
            none, every other kind accepts exactly one.
        viz_config:
          $ref: '#/components/schemas/DashboardVizConfig'
      required:
        - id
        - title
        - grid
        - queries
        - viz_config
    DashboardSection:
      type: object
      description: A collapsible group of panels inside a tab.
      properties:
        id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: >-
            Canonical UUIDv7 identifying the section; unique across the
            definition.
        title:
          type: string
          minLength: 1
          maxLength: 189
          description: Section title.
        description:
          type: string
          maxLength: 1024
          description: Optional section description.
        collapsed:
          type: boolean
          description: Whether the section renders collapsed by default.
        panels:
          type: array
          items:
            $ref: '#/components/schemas/DashboardPanel'
          maxItems: 30
          description: Panels in the section, at most 30.
      required:
        - id
        - title
        - collapsed
        - panels
    ErrorCode:
      type: string
      description: >-
        Flashduty error code enum. Every failed API response sets `error.code`
        to one of these stable wire strings. HTTP status is informational — the
        authoritative signal is the enum value.


        | Code | HTTP | Meaning |

        |---|---|---|

        | `OK` | 200 | Reserved — not returned on real errors. |

        | `InvalidParameter` | 400 | A required parameter is missing or failed
        validation. |

        | `BadRequest` | 400 | Generic 400 used when no more specific code fits.
        |

        | `InvalidContentType` | 400 | The `Content-Type` header is not
        `application/json`. |

        | `ResourceNotFound` | 400 | The referenced resource does not exist.
        Note: returned as HTTP 400, not 404 (historical choice). |

        | `NoLicense` | 400 | The feature is license-gated and no active license
        was found. |

        | `ReferenceExist` | 400 | Deletion blocked — other entities still
        reference this resource. |

        | `Unauthorized` | 401 | `app_key` is missing, invalid, or expired. |

        | `BalanceNotEnough` | 402 | Billing-gated operation with insufficient
        account balance. |

        | `AccessDenied` | 403 | Authenticated but lacking the permission
        required for this operation. |

        | `RouteNotFound` | 404 | The request URL path is not a known route. |

        | `MethodNotAllowed` | 405 | The HTTP method is not allowed on this
        otherwise-known path. |

        | `UndonedOrderExist` | 409 | An outstanding billing order blocks this
        new one. Wait and retry. |

        | `RequestLocked` | 423 | Operation temporarily locked due to repeated
        failures. |

        | `EntityTooLarge` | 413 | Request body exceeds the configured max size.
        |

        | `RequestTooFrequently` | 429 | Rate limit hit — API-global,
        per-account, or per-integration. |

        | `RequestVerifyRequired` | 428 | Second-factor verification required
        but not supplied. |

        | `DangerousOperation` | 428 | High-risk operation requires MFA
        verification. |

        | `InternalError` | 500 | Unhandled server-side error. Include
        `request_id` in the bug report. |

        | `ServiceUnavailable` | 503 | A backend dependency is unavailable. Try
        again later. |
      enum:
        - OK
        - InvalidParameter
        - BadRequest
        - InvalidContentType
        - ResourceNotFound
        - NoLicense
        - ReferenceExist
        - Unauthorized
        - BalanceNotEnough
        - AccessDenied
        - RouteNotFound
        - MethodNotAllowed
        - UndonedOrderExist
        - RequestLocked
        - EntityTooLarge
        - RequestTooFrequently
        - RequestVerifyRequired
        - DangerousOperation
        - InternalError
        - ServiceUnavailable
      x-enumDescriptions:
        OK: Reserved — not returned on real errors.
        InvalidParameter: A required parameter is missing or failed validation.
        BadRequest: Generic 400 used when no more specific code fits.
        InvalidContentType: The `Content-Type` header is not `application/json`.
        ResourceNotFound: >-
          The referenced resource does not exist. Note: returned as HTTP 400,
          not 404 (historical choice).
        NoLicense: The feature is license-gated and no active license was found.
        ReferenceExist: Deletion blocked — other entities still reference this resource.
        Unauthorized: '`app_key` is missing, invalid, or expired.'
        BalanceNotEnough: Billing-gated operation with insufficient account balance.
        AccessDenied: Authenticated but lacking the permission required for this operation.
        RouteNotFound: The request URL path is not a known route.
        MethodNotAllowed: The HTTP method is not allowed on this otherwise-known path.
        UndonedOrderExist: An outstanding billing order blocks this new one. Wait and retry.
        RequestLocked: Operation temporarily locked due to repeated failures.
        EntityTooLarge: Request body exceeds the configured max size.
        RequestTooFrequently: Rate limit hit — API-global, per-account, or per-integration.
        RequestVerifyRequired: Second-factor verification required but not supplied.
        DangerousOperation: High-risk operation requires MFA verification.
        InternalError: Unhandled server-side error. Include `request_id` in the bug report.
        ServiceUnavailable: A backend dependency is unavailable. Try again later.
      example: InvalidParameter
    DashboardSelectionConfig:
      type: object
      description: Selection cardinality for a variable.
      properties:
        mode:
          type: string
          enum:
            - single
            - multi
          description: >-
            Selection cardinality: `single` makes the resolved selection hold
            exactly one value; `multi` allows multiple values.
        include_all:
          type: boolean
          description: When true the variable also offers an `all` selection.
      required:
        - mode
        - include_all
    DashboardCandidate:
      type: object
      description: One selectable option of a custom variable.
      properties:
        text:
          type: string
          minLength: 1
          maxLength: 1024
          description: Label shown in the picker.
        value:
          type: string
          minLength: 1
          maxLength: 1024
          description: Value substituted into templates.
      required:
        - text
        - value
    DashboardSelection:
      type: object
      description: >-
        A concrete selection of variable values. An empty `values` array is
        valid wire input and means unresolved — the server never substitutes a
        default for it.
      properties:
        kind:
          type: string
          enum:
            - values
            - all
          description: >-
            `values` selects the listed entries, `all` selects everything (only
            allowed when `include_all` is true).
        values:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 1024
          maxItems: 1000
          description: >-
            Selected values, unique and never `$__all`. Must be empty when
            `kind` is `all`.
      required:
        - kind
    DashboardDatasourceRef:
      type: object
      description: >-
        Points a panel or query variable at a datasource — either a fixed ID or
        a datasource variable evaluated at render time.
      properties:
        kind:
          type: string
          enum:
            - fixed
            - variable
          description: >-
            `fixed` uses `datasource_id`; `variable` resolves `name` against a
            datasource variable.
        datasource_id:
          type: integer
          format: uint64
          minimum: 1
          description: >-
            Datasource ID. Required when `kind` is `fixed`, forbidden when
            `kind` is `variable`.
        name:
          type: string
          pattern: ^[A-Za-z_][A-Za-z0-9_]{0,63}$
          description: >-
            Datasource variable name. Required when `kind` is `variable`,
            forbidden when `kind` is `fixed`.
        datasource_type:
          type: string
          pattern: ^[a-z][a-z0-9_]{0,63}$
          description: Datasource type identifier, e.g. `prometheus` or `victorialogs`.
      required:
        - kind
        - datasource_type
    DashboardVariableQuery:
      description: >-
        Variable query. Pick the arm with `kind`; the arm must match the
        referenced datasource type.
      oneOf:
        - $ref: '#/components/schemas/DashboardPrometheusVariableQuery'
        - $ref: '#/components/schemas/DashboardSQLVariableQuery'
        - $ref: '#/components/schemas/DashboardLogsVariableQuery'
      discriminator:
        propertyName: kind
        mapping:
          prometheus: '#/components/schemas/DashboardPrometheusVariableQuery'
          sql: '#/components/schemas/DashboardSQLVariableQuery'
          logs: '#/components/schemas/DashboardLogsVariableQuery'
    DashboardGridPosition:
      type: object
      description: >-
        24-column grid placement. `x` and `y` are zero-based; `x + w` must not
        exceed 24.
      properties:
        x:
          type: integer
          minimum: 0
          maximum: 23
          description: Zero-based column offset.
        'y':
          type: integer
          minimum: 0
          description: Zero-based row offset.
        w:
          type: integer
          minimum: 1
          maximum: 24
          description: Width in grid columns, 1–24.
        h:
          type: integer
          minimum: 1
          maximum: 100
          description: Height in grid rows, 1–100.
      required:
        - x
        - 'y'
        - w
        - h
    DashboardPanelQuery:
      type: object
      description: >-
        One query inside a panel. `ref_id` labels the series in the panel and
        must be unique within the panel.
      properties:
        ref_id:
          type: string
          pattern: ^[A-Z]$
          description: Single uppercase letter (A–Z) naming the query inside its panel.
        query:
          $ref: '#/components/schemas/DashboardQuery'
        legend_alias:
          type: string
          maxLength: 1024
          description: >-
            Optional legend label; supports the same variable templates as
            `expr`.
      required:
        - ref_id
        - query
    DashboardVizConfig:
      description: >-
        Visualization configuration. `kind` selects the arm and therefore which
        sibling config object is required; `time_series` also carries the shared
        numeric options.
      oneOf:
        - $ref: '#/components/schemas/DashboardTimeSeriesViz'
        - $ref: '#/components/schemas/DashboardTableViz'
        - $ref: '#/components/schemas/DashboardStatViz'
        - $ref: '#/components/schemas/DashboardBarViz'
        - $ref: '#/components/schemas/DashboardGaugeViz'
        - $ref: '#/components/schemas/DashboardLogsViz'
        - $ref: '#/components/schemas/DashboardTextViz'
      discriminator:
        propertyName: kind
        mapping:
          time_series: '#/components/schemas/DashboardTimeSeriesViz'
          table: '#/components/schemas/DashboardTableViz'
          stat: '#/components/schemas/DashboardStatViz'
          bar: '#/components/schemas/DashboardBarViz'
          gauge: '#/components/schemas/DashboardGaugeViz'
          logs: '#/components/schemas/DashboardLogsViz'
          text: '#/components/schemas/DashboardTextViz'
    DashboardPrometheusVariableQuery:
      type: object
      description: Prometheus label-values query.
      properties:
        kind:
          type: string
          enum:
            - prometheus
          description: >-
            Query kind discriminator; always `prometheus`, a label-values query
            against Prometheus.
        label:
          type: string
          pattern: ^[A-Za-z_][A-Za-z0-9_:.\-]{0,189}$
          description: Label whose values become candidates.
        metric:
          type: string
          description: Optional metric used to restrict the series considered.
        label_filters:
          type: array
          items:
            $ref: '#/components/schemas/DashboardLabelFilter'
          description: Optional matchers narrowing the series before label values are read.
      required:
        - kind
        - label
    DashboardSQLVariableQuery:
      type: object
      description: SQL query returning one column of candidates.
      properties:
        kind:
          type: string
          enum:
            - sql
          description: >-
            Query kind discriminator; always `sql`, a SQL query returning one
            column of candidates.
        expr:
          type: string
          description: SQL statement; may reference other variables through `{{ }}`.
        args:
          type: object
          additionalProperties:
            type: string
          description: Named query arguments; defaults to an empty object.
        text_field:
          type: string
          description: Column used as the candidate label; defaults to the value column.
        value_field:
          type: string
          minLength: 1
          description: Column used as the candidate value.
      required:
        - kind
        - expr
        - args
        - value_field
    DashboardLogsVariableQuery:
      type: object
      description: Logs query returning one field's values as candidates.
      properties:
        kind:
          type: string
          enum:
            - logs
          description: >-
            Query kind discriminator; always `logs`, a logs query returning one
            field's values as candidates.
        expr:
          type: string
          description: >-
            Logs query expression; may reference other variables through `{{
            }}`.
        args:
          type: object
          additionalProperties:
            type: string
          description: Named query arguments; defaults to an empty object.
        field:
          type: string
          minLength: 1
          description: Log field whose values become candidates.
      required:
        - kind
        - expr
        - args
        - field
    DashboardQuery:
      type: object
      description: Query payload shared by dashboards and drill-down entries.
      properties:
        mode:
          type: string
          enum:
            - instant
            - range
            - window
          description: >-
            Evaluation mode: `instant` evaluates at a single timestamp, `range`
            evaluates a stepped series, `window` returns raw rows inside a time
            window.
        expr:
          type: string
          description: >-
            Query expression in the target data source's language. May reference
            event labels through `{{ }}` templates.
        args:
          type: object
          additionalProperties:
            type: string
          description: >-
            Named query arguments; defaults to an empty object. Values are
            passed through verbatim and must not contain `{{ }}` templates.
        min_step_seconds:
          type:
            - integer
            - 'null'
          format: int64
          minimum: 1
          maximum: 9007199254740
          description: >-
            Minimum step, in seconds. Only accepted when `mode` is `range`, and
            must be greater than zero; omit or pass null to let the server
            decide.
      required:
        - mode
        - expr
        - args
    DashboardTimeSeriesViz:
      type: object
      description: Time-series visualization.
      properties:
        kind:
          type: string
          enum:
            - time_series
          description: Visualization kind discriminator; always `time_series`.
        options:
          type: object
          additionalProperties: true
          description: >-
            Open options object for the chosen visualization kind; the only part
            of the definition that round-trips losslessly. Missing or null
            normalizes to `{}`.
        unit:
          type: string
          enum:
            - unitless
            - ratio
            - percent
            - milliseconds
            - seconds
            - bytes
            - bits
            - count_per_second
            - bytes_per_second
            - bits_per_second
          description: >-
            Display unit for the panel's numeric values: `unitless` = raw
            number; `ratio` = fraction of 1; `percent` = percentage;
            `milliseconds` = duration in milliseconds; `seconds` = duration in
            seconds; `bytes` = size in bytes; `bits` = size in bits;
            `count_per_second` = per-second count; `bytes_per_second` = bytes
            per second; `bits_per_second` = bits per second.
        decimals:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Fixed decimal places; omit or send null to let the renderer decide.
        threshold:
          $ref: '#/components/schemas/DashboardThreshold'
      required:
        - kind
        - options
    DashboardTableViz:
      type: object
      description: Table visualization.
      properties:
        kind:
          type: string
          enum:
            - table
          description: Visualization kind discriminator; always `table`.
        options:
          type: object
          additionalProperties: true
          description: >-
            Open options object for the chosen visualization kind; the only part
            of the definition that round-trips losslessly. Missing or null
            normalizes to `{}`.
        column_options:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DashboardColumnOption'
          description: >-
            Per-column display overrides keyed by field name, at most 100
            entries.
        sort:
          type: array
          items:
            $ref: '#/components/schemas/DashboardFieldSort'
          maxItems: 2
          description: Initial sort keys; fields must be unique.
        link_columns:
          type: array
          items:
            $ref: '#/components/schemas/DashboardDataLink'
          maxItems: 5
          description: >-
            Drill-down links rendered as table columns. Together with per-column
            links a table allows at most 5.
      required:
        - kind
        - options
    DashboardStatViz:
      type: object
      description: Single-value (stat) visualization.
      properties:
        kind:
          type: string
          enum:
            - stat
          description: Visualization kind discriminator; always `stat`.
        options:
          type: object
          additionalProperties: true
          description: >-
            Open options object for the chosen visualization kind; the only part
            of the definition that round-trips losslessly. Missing or null
            normalizes to `{}`.
        unit:
          type: string
          enum:
            - unitless
            - ratio
            - percent
            - milliseconds
            - seconds
            - bytes
            - bits
            - count_per_second
            - bytes_per_second
            - bits_per_second
          description: >-
            Display unit for the panel's numeric values: `unitless` = raw
            number; `ratio` = fraction of 1; `percent` = percentage;
            `milliseconds` = duration in milliseconds; `seconds` = duration in
            seconds; `bytes` = size in bytes; `bits` = size in bits;
            `count_per_second` = per-second count; `bytes_per_second` = bytes
            per second; `bits_per_second` = bits per second.
        decimals:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Fixed decimal places; omit or send null to let the renderer decide.
        threshold:
          $ref: '#/components/schemas/DashboardThreshold'
        value_fields:
          type: array
          items:
            type: string
          description: Fields reduced to the displayed values.
        reducer:
          type: string
          enum:
            - last_non_null
            - min
            - max
            - mean
            - sum
          description: >-
            Reduction applied across the returned rows: `last_non_null` = most
            recent non-null value; `min` = minimum; `max` = maximum; `mean` =
            average; `sum` = sum.
      required:
        - kind
        - options
        - value_fields
        - reducer
    DashboardBarViz:
      type: object
      description: Bar-chart visualization.
      properties:
        kind:
          type: string
          enum:
            - bar
          description: Visualization kind discriminator; always `bar`.
        options:
          type: object
          additionalProperties: true
          description: >-
            Open options object for the chosen visualization kind; the only part
            of the definition that round-trips losslessly. Missing or null
            normalizes to `{}`.
        unit:
          type: string
          enum:
            - unitless
            - ratio
            - percent
            - milliseconds
            - seconds
            - bytes
            - bits
            - count_per_second
            - bytes_per_second
            - bits_per_second
          description: >-
            Display unit for the panel's numeric values: `unitless` = raw
            number; `ratio` = fraction of 1; `percent` = percentage;
            `milliseconds` = duration in milliseconds; `seconds` = duration in
            seconds; `bytes` = size in bytes; `bits` = size in bits;
            `count_per_second` = per-second count; `bytes_per_second` = bytes
            per second; `bits_per_second` = bits per second.
        decimals:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Fixed decimal places; omit or send null to let the renderer decide.
        threshold:
          $ref: '#/components/schemas/DashboardThreshold'
        category_field:
          type: string
          description: Field supplying the category axis.
        value_fields:
          type: array
          items:
            type: string
          description: Fields supplying the bar values.
        data_link:
          $ref: '#/components/schemas/DashboardDataLink'
      required:
        - kind
        - options
        - category_field
        - value_fields
    DashboardGaugeViz:
      type: object
      description: Gauge visualization.
      properties:
        kind:
          type: string
          enum:
            - gauge
          description: Visualization kind discriminator; always `gauge`.
        options:
          type: object
          additionalProperties: true
          description: >-
            Open options object for the chosen visualization kind; the only part
            of the definition that round-trips losslessly. Missing or null
            normalizes to `{}`.
        unit:
          type: string
          enum:
            - unitless
            - ratio
            - percent
            - milliseconds
            - seconds
            - bytes
            - bits
            - count_per_second
            - bytes_per_second
            - bits_per_second
          description: >-
            Display unit for the panel's numeric values: `unitless` = raw
            number; `ratio` = fraction of 1; `percent` = percentage;
            `milliseconds` = duration in milliseconds; `seconds` = duration in
            seconds; `bytes` = size in bytes; `bits` = size in bits;
            `count_per_second` = per-second count; `bytes_per_second` = bytes
            per second; `bits_per_second` = bits per second.
        decimals:
          type:
            - integer
            - 'null'
          minimum: 0
          description: Fixed decimal places; omit or send null to let the renderer decide.
        threshold:
          $ref: '#/components/schemas/DashboardThreshold'
        value_fields:
          type: array
          items:
            type: string
          description: Fields reduced to the gauge value.
        reducer:
          type: string
          enum:
            - last_non_null
            - min
            - max
            - mean
            - sum
          description: >-
            Reduction applied across the returned rows: `last_non_null` = most
            recent non-null value; `min` = minimum; `max` = maximum; `mean` =
            average; `sum` = sum.
        min:
          type:
            - number
            - 'null'
          description: Scale lower bound.
        max:
          type:
            - number
            - 'null'
          description: Scale upper bound; must exceed `min` when both are set.
      required:
        - kind
        - options
        - value_fields
        - reducer
    DashboardLogsViz:
      type: object
      description: Log-stream visualization.
      properties:
        kind:
          type: string
          enum:
            - logs
          description: Visualization kind discriminator; always `logs`.
        options:
          type: object
          additionalProperties: true
          description: >-
            Open options object for the chosen visualization kind; the only part
            of the definition that round-trips losslessly. Missing or null
            normalizes to `{}`.
        display_fields:
          type: array
          items:
            type: string
          description: Log fields rendered for each row.
      required:
        - kind
        - options
    DashboardTextViz:
      type: object
      description: Markdown text panel.
      properties:
        kind:
          type: string
          enum:
            - text
          description: Visualization kind discriminator; always `text`.
        options:
          type: object
          additionalProperties: true
          description: >-
            Open options object for the chosen visualization kind; the only part
            of the definition that round-trips losslessly. Missing or null
            normalizes to `{}`.
        markdown:
          type: string
          maxLength: 65536
          description: >-
            Markdown body, at most 64 KiB. Only a restricted node set (headings,
            lists, tables, links, code) survives validation.
      required:
        - kind
        - options
        - markdown
    DashboardLabelFilter:
      type: object
      description: Prometheus label matcher.
      properties:
        label:
          type: string
          pattern: ^[A-Za-z_][A-Za-z0-9_:.\-]{0,189}$
          description: Label name.
        op:
          type: string
          enum:
            - '='
            - '!='
            - '=~'
            - '!~'
          description: >-
            Matcher operator: `=` = equals; `!=` = not equals; `=~` = regex
            match; `!~` = regex does-not-match.
        value:
          type: string
          minLength: 1
          description: Matcher value; may reference other variables through `{{ }}`.
      required:
        - label
        - op
        - value
    DashboardThreshold:
      type: object
      description: >-
        Colour threshold for a numeric value. At least one of
        `warning`/`critical` is required, and with both set the pair must be
        ordered according to `mode`.
      properties:
        mode:
          type: string
          enum:
            - higher_is_worse
            - lower_is_worse
          description: >-
            Direction of the comparison: `higher_is_worse` = values at or above
            the bound breach it; `lower_is_worse` = values at or below the bound
            breach it.
        warning:
          type:
            - number
            - 'null'
          description: Warning bound; must be finite.
        critical:
          type:
            - number
            - 'null'
          description: Critical bound; must be finite.
      required:
        - mode
    DashboardColumnOption:
      type: object
      description: Per-column display override for a table.
      properties:
        display_name:
          type: string
          description: Header text replacing the raw field name.
        hidden:
          type:
            - boolean
            - 'null'
          description: Hide the column; omit to keep it visible.
        width_px:
          type:
            - integer
            - 'null'
          minimum: 80
          maximum: 1200
          description: Column width in pixels, 80–1200.
        unit:
          type: string
          enum:
            - unitless
            - ratio
            - percent
            - milliseconds
            - seconds
            - bytes
            - bits
            - count_per_second
            - bytes_per_second
            - bits_per_second
          description: >-
            Unit override for the column: `unitless` = raw number; `ratio` =
            fraction of 1; `percent` = percentage; `milliseconds` = duration in
            milliseconds; `seconds` = duration in seconds; `bytes` = size in
            bytes; `bits` = size in bits; `count_per_second` = per-second count;
            `bytes_per_second` = bytes per second; `bits_per_second` = bits per
            second.
        threshold:
          $ref: '#/components/schemas/DashboardThreshold'
        threshold_display:
          type: string
          enum:
            - text
            - background
          description: >-
            How the threshold is painted: `text` = colours the cell text;
            `background` = colours the cell background.
        data_link:
          $ref: '#/components/schemas/DashboardDataLink'
    DashboardFieldSort:
      type: object
      description: A single sort key.
      properties:
        field:
          type: string
          minLength: 1
          description: Field name to sort by.
        direction:
          type: string
          enum:
            - asc
            - desc
          description: 'Sort direction: `asc` = ascending; `desc` = descending.'
      required:
        - field
        - direction
    DashboardDataLink:
      type: object
      description: >-
        Drill-down link from a table column or bar panel into another dashboard.
        The target dashboard must exist and the mapping sources must match the
        source panel's shape.
      properties:
        dashboard_id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: Target dashboard ID.
        target_id:
          type: string
          pattern: >-
            ^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
          description: Optional tab, section or panel ID to focus in the target dashboard.
        pass_time:
          type: boolean
          description: When true the current time range is forwarded to the target.
        variable_mappings:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/DashboardLinkMapping'
          description: >-
            Maps target variable names to a source value such as a column or a
            source variable.
      required:
        - dashboard_id
        - pass_time
        - variable_mappings
    DashboardLinkMapping:
      type: object
      description: One entry of a drill-down variable mapping.
      properties:
        source:
          type: string
          enum:
            - variable
            - row_column
            - category
            - series
            - value
          description: >-
            Where the value comes from: `variable` = a dashboard variable;
            `row_column` = a table column (requires `column`); `category` = the
            bar category; `series` = the series name; `value` = the value
            itself. `category`, `series` and `value` are only valid for bar
            panels.
        column:
          type: string
          description: Source column name; required when `source` is `row_column`.
        name:
          type: string
          description: >-
            Source dashboard variable name; required when `source` is
            `variable`.
      required:
        - source
  responses:
    BadRequest:
      description: Invalid request — usually a missing or malformed parameter.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingParameter:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InvalidParameter
                  message: The specified parameter is not valid.
    Unauthorized:
      description: Missing or invalid app_key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingAppKey:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: Unauthorized
                  message: You are unauthorized.
    Forbidden:
      description: The app_key is valid but lacks permission for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            noEditPermission:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: AccessDenied
                  message: Access Denied.
    NotFound:
      description: >-
        The referenced resource does not exist or has been deleted. Note:
        Flashduty historically returns HTTP 400 with code `ResourceNotFound` for
        missing domain entities; a true 404 is reserved for unknown routes.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            resourceMissing:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: ResourceNotFound
                  message: The resource you request is not found
    TooManyRequests:
      description: >-
        Rate limit hit. Either the global API limit, a per-account limit, or a
        per-integration limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            rateLimited:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: RequestTooFrequently
                  message: Request too frequently.
    ServerError:
      description: Unexpected server-side error. Include the request_id when reporting.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            internal:
              value:
                request_id: 01HK8XQE3Z7JM2NTFQ5YJ8P9R4
                error:
                  code: InternalError
                  message: >-
                    We encountered an internal error, and it has been reported.
                    Please try again later.
  securitySchemes:
    AppKeyAuth:
      type: apiKey
      in: query
      name: app_key
      description: >-
        App key issued from the Flashduty console under Account → APP Keys.
        Required on every public API call. Keep it secret — it grants the same
        access as the owning account.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.