https://api.squasher.ai/openapi.json.
Send your first request
/v1/projects/{project_id}.
Base URLs
https://api.squasher.aiis the REST API.GET /returns links to these docs, the OpenAPI contract, and the MCP server.https://ingest.squasher.aireceives telemetry from SDKs, log drains, and OpenTelemetry. See the Ingestion API.
Authenticate
Send a credential on every request, in one of these headers:
An API key can do only what its scopes allow. The
read scope reads project data, write
changes it, and narrower scopes such as errors:read or monitors:write limit a key to one
resource. See API keys for the full list.
The Setup page creates ingest keys only. An ingest key has the
events:ingest scope, so it
can send telemetry but cannot read it. To read data, use an OAuth token, or create a key with read
scopes through the API keys endpoint.401 with
OAuth ingest is unavailable or lacks events:ingest scope; use an API key with events:ingest.
When OAuth ingest is enabled, the token must allow events:ingest, *, or the default empty
scope list. The MCP server and the CLI get a token when you sign in.
Other clients can use the OAuth 2.0 authorization code flow with
PKCE: register at https://mcp.squasher.ai/register, then use https://mcp.squasher.ai/authorize
and https://mcp.squasher.ai/token. The access token lasts one hour.
Handle errors
A failed request returns an HTTP status and a JSON body. Most errors have oneerror field:
{ "error": "limit: Too big: expected number to be <=100" }.
Some operations add fields. Safe SQL queries return a stable code in error, with message and
hint. A rate-limited request returns type, code, message, retry_after, and doc_url.
Branch on the HTTP status first, then on the code when there is one.
For telemetry reads,
422 with error: "QUERY_BACKEND_LIMIT" includes a safe message and
hint. An unchanged request can fail again. This can affect releases, suspect commits, replay
stories, and runtime posture.
A telemetry read that the event store cannot finish in time returns 503 with
error: "QUERY_TEMPORARILY_UNAVAILABLE". Retry later, or narrow the time window or filters.
Every response has an X-Request-ID header. Include it when you report a problem.
Rate limits
Responses carry
RateLimit-Limit and RateLimit-Policy headers. A rate-limited response has status
429, a RateLimit header, and Retry-After: 60. Wait that long before you retry.
Ingest endpoints also have project, API key, and source IP limits. See
Ingest rate limits for the 429 response and retry headers.
Paginate lists
A list operation uses one of two patterns. Its resource page and the OpenAPI contract say which.- Cursor. Send
limit, and leave outcursoron the first request. Pass thenext_cursorfrom each response unchanged, until it isnull. Alert connector deliveries work this way. - Offset. Send
limitandoffset, and addlimittooffsetfor the next page. Logs and traces work this way.
Versioning
Every public path starts with/v1. Squasher adds operations, optional fields, response fields,
and enum values within v1. Ignore response fields that you do not use, and check an enum value
before you branch on it.
Find an operation
- Find the API for a task maps each task to its operations, CLI command, and MCP availability.
- Query guide and safe SQL tells an agent which query answers a question, and runs read-only SQL.
- The Resources section in the sidebar has one page for each resource.
Next steps
Find the API for a task
Map a task to its operations.
Query guide and safe SQL
Pick the right query, or run read-only SQL.
Connect the MCP server
Call the same operations from an AI assistant.
API keys
Create keys and choose scopes.
Safe retries for write requests
Write requests that need authentication may include anIdempotency-Key header. The key is optional for compatibility. When the server honors the key, the response has an Idempotency-Status header: stored for the first response, replayed for a retry that gets the stored response, and released for a 5xx error that happened before the change was saved, so you can retry. A response without this header means the server ignored the key, and a retry can repeat the change.
A retry with the same key and the same request, within 24 hours, returns the same status, headers, and body. Two cases return a 409 response with code IDEMPOTENT_REPLAY_SECRET_NOT_RETAINED instead of the body: a response that holds a secret (for example a new API key or a signing secret), and a response larger than 256 KiB. Squasher does not store these. The 409 response gives the original_status and, when it is safe, the resource_id. Read the resource, or rotate its secret, to get a new value. A request body larger than 1 MiB runs without a stored result, and the response has no Idempotency-Status header.
Reusing a key with a different request returns 422. A request that is still running returns 409 with a Retry-After header, in seconds. The CLI, MCP, and the TypeScript client create a key for every write automatically. The CLI and the TypeScript client send a write again only after a response showed that the server honors keys, or when the connection failed before the request went out. Keep a key stable when retrying one operation and create a new key for a new operation.