Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
title: Synoptic Customer Ask API
version: 1.0.0
description: 'Token-authenticated programmatic surface for Synoptic: dashboards (CRUD + widgets + preview + render), ask and direct context retrieval. Authenticate with an org-scoped API key (Settings → API Keys) as a bearer token. A key carries scopes — the access grant — and is org-scoped: every request derives its org ONLY from the key, and sees every record of the workspace''s workspace connections, and none of anyone''s personal connections.
Rate limits (per organization, per minute): 120 reads, 120 writes, 1,000 ingest calls, 10 pipeline-backed calls (ask / preview / render). Over the limit returns 429 with Retry-After. These are FLOORS, not exact ceilings: counters are held per web task and requests are not pinned to a task, so a caller is always allowed at least the stated number per minute and may in practice be allowed a small multiple of it. Do not build a client that depends on the extra headroom — it varies with how the service is scaled. Honour Retry-After instead.
Per-key query limits (exact, shared across the service): each key may make 600 context searches plus asks per minute and run 20 at once. Over the rate returns 429 rate_limited; a 21st call while 20 run returns 429 concurrency_limited. Both carry Retry-After. A workspace can ask for higher limits.'
servers:
- url: /api/v1
security:
- ApiKey: []
tags:
- name: Ask
paths:
/ask:
post:
summary: Grounded answer over the org's account-level corpus
description: 'Scope: ask. Rate tier: pipeline. ask, dashboards:read, dashboards:write, datasets:write, recordings:write, ingest are the available scopes. Lochless workspaces: /ask runs the same search as /context (from, to, metadata, read_limit_usd, mode; every date unless from/to narrow it), then writes a short answer from the results it kept. The response is answer (cites its evidence as [1], [2]), evidence (only the cited results: n, document_id, date, metadata, text, score), tokens_scanned, coverage {mode, documents_read, documents_total, complete} and request_id. read_limit_usd (default 1) caps what the call may cost, answer fee included: the search reads up to read_limit_usd less the fee, best-matching documents first, and a limit at or below the fee is a 400. Billed as the search''s tokens scanned plus the answer fee; a call that writes no answer is not billed. A call still running after about 15 s answers 200 at once and keeps the connection open with whitespace until its JSON is ready; an error after that point is the error envelope in that body. dry_run returns documents_matched, tokens_to_scan, price_usd (what the call would cost: the scan within the limit plus the answer fee), read_limit_usd and complete, for free.'
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- query
properties:
query:
type: string
since:
type:
- string
- 'null'
format: date
description: Lower bound on document date. Omit for the workspace default range (about one month); null searches everything Synoptic holds.
until:
type:
- string
- 'null'
format: date
description: Upper bound on document date.
responses:
'200':
description: 'answer + references + a formatted text block + `scope` (the range actually read: { since, until, scanned, total, complete, bounded_by }) + `tokens_scanned` (your text this answer read, each piece once)'
'400':
description: missing query, or a since/until that is neither a YYYY-MM-DD date nor null
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: missing/invalid/expired key
'402':
description: spend_cap_reached (monthly spend cap reached) or add_credit (balance used up; top up in the console)
'403':
description: key lacks the ask scope
'429':
description: rate limited — see info.description; honour Retry-After
tags:
- Ask
operationId: postAsk
x-operation-id-source: derived
components:
schemas:
Error:
type: object
properties:
error:
type: object
properties:
code:
type: string
description: Stable machine code. 400 invalid_request; 409 conflict (idempotency_conflict when an Idempotency-Key or call id is reused with different content); 413 payload_too_large.
message:
type: string
request_id:
type: string
required:
- code
- message
- request_id
required:
- error
securitySchemes:
ApiKey:
type: http
scheme: bearer
bearerFormat: sk_synoptic_*