Qyra
ReferenceDashboards

Update dashboard custom metric

Edit a dashboard registry custom metric. Swaps the registry entry and re-versions every dashboard-owned chart that references it, atomically. With `dryRun` it only reports the charts that would change.

PATCH/api/v1/dashboards/{dashboardUuidOrSlug}/custom-metrics

Authentication: personal access token. The spec defines an api_key security scheme — send an Authorization: ApiKey <your-personal-access-token> header (value format: ApiKey <your key>). A session_cookie scheme (connect.sid) exists for browser sessions. Operations in this spec declare security: [], an artifact of the upstream spec generator — authentication is still enforced by the server.

Path parameters

NameTypeRequiredDescription
dashboardUuidOrSlugstringYesuuid or slug for the dashboard

Query parameters

NameTypeRequiredDescription
projectUuidstringNoproject to resolve a slug in, required when the slug exists in multiple projects (e.g. preview projects)

Request body

{
  "dryRun": true,
  "metric": {
    "label": "string",
    "type": "percentile",
    "description": "string",
    "sql": "string",
    "hidden": true,
    "round": 0,
    "compact": "auto",
    "format": "km",
    "separator": "default",
    "table": "string",
    "name": "string",
    "index": 0,
    "filters": [
      {
        "includeNull": true,
        "values": [
          "string"
        ],
        "operator": "isNull",
        "id": "string",
        "target": {
          "fieldRef": "string"
        },
        "settings": "string",
        "disabled": true,
        "required": true,
        "caseSensitive": true
      }
    ],
    "baseDimensionName": "string",
    "baseMetricName": "string",
    "uuid": "string",
    "percentile": 0,
    "distinctKeys": [
      "string"
    ],
    "formatOptions": {
      "type": "default",
      "round": 0,
      "separator": "default",
      "currency": "string",
      "compact": "auto",
      "prefix": "string",
      "suffix": "string",
      "timeInterval": "RAW",
      "custom": "string"
    },
    "generationType": "periodOverPeriod",
    "baseMetricId": "string",
    "timeDimensionId": "string",
    "granularity": "RAW",
    "periodOffset": 0
  }
}

Responses

200 — Success

{
  "results": {
    "dryRun": true,
    "affectedCharts": [
      {
        "name": "string",
        "uuid": "string"
      }
    ],
    "customMetrics": [
      {
        "label": "string",
        "type": "percentile",
        "description": "string",
        "sql": "string",
        "hidden": true,
        "round": 0,
        "compact": "auto",
        "format": "km",
        "separator": "default",
        "table": "string",
        "name": "string",
        "index": 0,
        "filters": [
          {
            "includeNull": true,
            "values": [
              "string"
            ],
            "operator": "isNull",
            "id": "string",
            "target": {
              "fieldRef": "string"
            },
            "settings": "string",
            "disabled": true,
            "required": true,
            "caseSensitive": true
          }
        ],
        "baseDimensionName": "string",
        "baseMetricName": "string",
        "uuid": "string",
        "percentile": 0,
        "distinctKeys": [
          "string"
        ],
        "formatOptions": {
          "type": "default",
          "round": 0,
          "separator": "default",
          "currency": "string",
          "compact": "auto",
          "prefix": "string",
          "suffix": "string",
          "timeInterval": "RAW",
          "custom": "string"
        },
        "generationType": "periodOverPeriod",
        "baseMetricId": "string",
        "timeDimensionId": "string",
        "granularity": "RAW",
        "periodOffset": 0
      }
    ]
  },
  "status": "ok"
}

default — Error

{
  "error": {
    "data": "string",
    "message": "string",
    "name": "string",
    "statusCode": 0
  },
  "status": "error"
}