Get query surfaces
- logs
- metrics and metric timelines
- traces
- errors and raw events
- AI observability
- monitors
- incidents
avg, count, sum, p50, p90, p95, and p99 over the same OTLP metric names instead of relying on product-specific endpoints.
Safe SQL schema
schema.get operation use the same model, so agents see the same column map that the validator enforces.
Queryable tables:
logsspansmetric_gauge_pointsmetric_sum_pointsmetric_histogram_pointsmetric_exponential_histogram_points
UNKNOWN_COLUMN and a suggested nearby column when one is available.
Safe SQL queries
sql field is required. long_range is optional and only extends the allowed time window for projects that need a 30-90 day query. Both endpoints validate the SQL against the public schema, inject the project scope, and reject unsupported fields or shapes with a structured 400 response instead of executing untrusted input directly.
Safe-query responses are limited to 10,000 rows and 8 MiB. If the serialized result exceeds the byte limit, the API returns 400 with error: "QUERY_RESULT_TOO_LARGE". Select fewer fields, aggregate before returning rows, or narrow the time window and retry. The TypeScript client exposes this response through the public QueryError type, and the CLI prints the same recovery guidance.
Every physical table scan must have a positive lower timestamp bound in its WHERE clause. A timestamp expression in SELECT, under NOT, or in only one side of an otherwise-unbounded OR does not satisfy the guard. Multi-table joins are rejected; issue separate bounded queries and correlate their returned IDs instead. This keeps agent-generated SQL inside predictable ClickHouse Cloud scan limits.
Use the CLI when an agent or script already has a safe SQL statement and needs JSON back from the public API:
--sql or --file. The CLI sends the same request body as the API examples above, and --long-range only adds "long_range": true when the flag is present.
Monitor queries
q- search name, target, linked component, incident id, and runbook URLkind- monitor kind such ashttp,ssl,dns, orheartbeatstatus-healthy,degraded,failed, orpausedenabled-trueorfalselimitoffset
{ name, kind, target, config, enabled?, linkedComponent?, runbookUrl? }. upsert matches by monitor name so scripts and agents can safely refresh declarative monitor config without double-creating the same check.
Incident queries
{incident_id}accepts the project-scoped incident ID returned by the API, for exampleinc_7. Existing UUID incident links remain accepted for compatibility.q- search title, summary, assignee, root cause, and monitor metadatastatus-investigating,identified,monitoring, orresolvedseverity-low,medium,high, orcriticalmonitor_id- limit results to one linked monitorlimitoffset
monitorId, monitorName, traceServiceName, explicitServiceName, statusComponentName, repository, runbookUrl, and alertFields entries such as { "path": "service.name", "value": "checkout-api" }. The response uses the same service attribution object returned by incident detail.
Use service ownership import candidates to preview operational services and link payloads from monitors and status components that are not assigned to a service yet. Each candidate includes a deterministic suggestedSlug, proposed monitor/status component IDs, source records, and existingServiceId when the slug already matches a service that should be linked instead of duplicated. Apply a candidate with POST /v1/projects/{project_id}/service-ownership/import-candidates/{suggested_slug}/apply to create the suggested service or merge its aliases and source links into the matching existing service.
Use the service ownership debt endpoint to find only ownership gaps Squasher can prove from current product data: services missing owner teams, services missing runbooks, monitors not linked to an operational service, and status components not linked to a service.
Use the service ownership teams endpoint to list owner teams available for service assignment. Create owner teams with { name, slug, description? }. If a retry hits an existing team with the same slug, the API returns that existing team. Patch the same fields on a team by id to keep ownership metadata current. Delete a team by id when it should no longer own operational services; existing service owner references are cleared.
Use the service ownership services endpoint to list the current operational service graph, including aliases, repositories, monitor links, status component links, dependency service ids, runbooks, dashboards, and owner-team metadata.
Create service ownership records with { name, slug, description?, ownerTeamId?, runbookUrl?, dashboardUrl? }. If a retry hits an existing service with the same slug, the API returns that existing service. Patch the same fields on a service by id to update ownership metadata without replacing links. Replace service links with { aliases, repositories, monitorIds, statusComponentIds, dependencyServiceIds }; the link update is a full replacement so pass empty arrays for link sets you want to clear. Delete a service by id when an operational service should no longer participate in incident ownership or routing.
Agent handoff
This should be the first API an agent calls when it is unsure which observability surface to use:search("queryGuide"), search("schema.get"), search("query.run"), or search("query.explain") before executing Code Mode snippets. Keep safe SQL bounded by time and project scope.