Dashboards
/api/v1/organizations/{org_id}/dashboardsEvery dashboard in the active org, name-ordered. org_id in the
path resolves the session (see get_org_context's path-param
fallback) — the repository call below is still scoped from
org.organization_id, never the raw path value, matching every other
org-scoped route in this codebase.
Authorization
HTTPBearer In: header
Path Parameters
uuidResponse Body
application/json
application/json
curl -X GET "https://example.com/api/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/dashboards"{ "items": [ { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "manifest_path": "string", "commit": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z" } ]}/api/v1/organizations/{org_id}/dashboards/{dashboard_id}One dashboard by id, within the active org. A dashboard belonging
to another org is indistinguishable from one that does not exist —
404, never 403, matching DashboardRepository.get_by_id's own
docstring and issue_policies.py's precedent.
Authorization
HTTPBearer In: header
Path Parameters
uuiduuidResponse Body
application/json
application/json
curl -X GET "https://example.com/api/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/dashboards/497f6eca-6276-4993-bfeb-53cbbbba6f08"{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "manifest_path": "string", "commit": "string", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "definition": {}}/api/v1/organizations/{org_id}/dashboards/queryRun one query-plugin spec for a dashboard panel (#739). Declared
before /{dashboard_id} in this file's route order matters only for
FastAPI's matching — "query" is not a valid UUID, so there is no
actual ambiguity, but the ordering mirrors issue_policies.py's
/effective-before-/{policy_id} precedent for readability.
Read-only: this dispatches into TelemetryQueryService.metrics_range
(see _run_up0_telemetry_query) and nothing here writes to any table.
body.range (absent by default, resolving to the trailing hour) is
the dashboard's ambient time range — see DashboardQueryTimeRange's
own docstring (app/schemas/dashboard_query.py).
Authorization
HTTPBearer In: header
Path Parameters
uuidRequest Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
The envelope POST .../dashboards/query accepts — kind is a
dispatch discriminator, not a manifest field, matching the panel
spec.plugin.spec.queries[].kind shape a Perses panel actually
carries. Up0MonitorUptimeQuery is deliberately not a valid kind
value here — see dashboard_query_handlers in
app/api/v1/dashboards.py for exactly why and where the next entry
goes when it's built.
range is the dashboard's ambient time range — see
DashboardQueryTimeRange's own docstring, and this module's "Why the
time range lives on DashboardQueryRequest, not on the spec" section,
for why it sits here rather than on spec.
Response Body
application/json
application/json
curl -X POST "https://example.com/api/v1/organizations/497f6eca-6276-4993-bfeb-53cbbbba6f08/dashboards/query" \ -H "Content-Type: application/json" \ -d '{ "kind": "Up0TelemetryQuery", "spec": { "serviceName": "string", "metricName": "string", "aggregation": "errorRate" } }'{ "aggregation": "errorRate", "metric_name": "string", "service_name": "string", "bucket_width_seconds": 0, "series": [ { "labels": { "property1": "string", "property2": "string" }, "points": [ [ "2019-08-24T14:15:22Z", 0 ] ] } ], "truncated": false, "matched": true, "metric_known": true}