API reference

Every REST endpoint: method, path, body fields, units consumed, and phase. The base URL is https://api.discatch.com.

Auth: Authorization: Bearer dk_live_... on every request. Keys are scoped: read, search, catches:write, billing:read. The MCP server uses OAuth 2.1 with PKCE when it ships.

POST /v1/quote

Price a request without running it. Body is any of the request bodies below. Returns a ceiling with locked unit prices; the charge never exceeds the ceiling.

FieldTypeNotes
querystringBoolean syntax: AND, OR, NOT, quotes, -term
sourcesstring[]Source names from GET /v1/sources
sincestring24h, 7d, or RFC 3339
limitintMax results, default 25

Units consumed: none. The quote itself is free.

POST /v1/search

One-off search across the waterfall. Returns quote, results, and coverage.

FieldTypeNotes
querystringBoolean syntax
sourcesstring[]web, news, hackernews, discourse, stackexchange, github in phase 1b
sincestring24h, 7d, RFC 3339
limitintMax results, default 25
classifyboolOpt-in classification
coveragestringfast or deep. deep lets the waterfall go further
budget_usdnumberHard cap. The planner stops before exceeding it
dry_runboolQuote only, same as POST /v1/quote
quote_idstringLock a previous quote

Units consumed: search (per call), result (per matched item). With classify: classify (per result classified).

POST /v1/capture

Fetch one URL with thread context. Returns a single Result with body populated.

FieldTypeNotes
urlstringThe URL to fetch
include_repliesboolInclude reply thread

Units consumed: capture (per call).

POST /v1/classify

Classify results you already have against your own criteria.

FieldTypeNotes
resultsResult[]The results to classify
criteriastringWhat relevant means for you: bug, question, feature request, or any labels

Units consumed: classify (per result).

Catches

MethodPathPurposeUnits
POST/v1/catchesCreate a catchalert on each firing, result per item
GET/v1/catchesList catchesnone
GET/v1/catches/{id}Read one, including last run and delivery statusnone
PATCH/v1/catches/{id}Update query, sources, interval, destinationnone
POST/v1/catches/{id}/pausePausenone
POST/v1/catches/{id}/resumeResumenone
POST/v1/catches/{id}/testFire the destination with a sample payloadnone
DELETE/v1/catches/{id}Deletenone
GET/v1/catches/{id}/resultsResults delivered so farnone
GET/v1/catches/{id}/deliveriesDelivery log with outcomesnone

Create body

POST /v1/catches

{
  "name": "string",
  "query": "string",
  "sources": ["hackernews", "discourse"],
  "interval": "5m | 15m | 1h | 6h | 24h",
  "classify": false,
  "min_prescore": 0.3,
  "destination": { "type": "webhook", "url": "https://...", "secret": "whsec_..." }
}

Destination types: webhook, claude_code, codex, doozy, github_dispatch, pane, email, slack.

Events

MethodPathPurposeUnits
GET/v1/events?since=&catch=&type=&min_prescore=&limit=&wait=Read the event log from a cursor. wait long-pollsnone
GET/v1/events/streamSSE, resumable with Last-Event-IDnone
POST/v1/subscriptionsRoute events to a webhook, Doozy, GitHub dispatch, Pane, email, Slacknone
GET/v1/subscriptionsList with delivery healthnone
DELETE/v1/subscriptions/{id}Removenone
GET/v1/subscriptions/{id}/deliveriesDelivery log and dead lettersnone

Other endpoints

MethodPathPurposeUnits
GET/v1/doctorThe orientation manifestnone
POST/v1/keys/trialGet a trial key with no email and no cardnone
POST/v1/keys/claimAttach an email to a trial keynone
GET/v1/sourcesSources with current availabilitynone
GET/v1/usageUnits consumed this period, by kind, with spendnone

Errors

Every error is { code, message, next_action, docs_url, request_id }. Agents act on next_action. 402 says the unit price refused and how to add funds. 429 says when to retry.

CodeMeaning
unauthorizedMissing or invalid key
scope_missingKey lacks the required scope
budget_exceededThe quote exceeds budget_usd
quote_expiredThe quote_id is no longer valid
source_unavailableA requested source is down or not yet available
invalid_queryQuery syntax error
rate_limitedToo many requests. Retry after the header says
destination_failedThe catch destination could not be reached

Last reviewed by , founder, dcouple. Copy from docs/onboarding.md, docs/query-language.md, docs/events.md, docs/api.md.