Press / to search

All documentation
docs Call it from your software Managed endpoints

Runs onWrit Cloud

rest ▸ published routes

Any workflow, a REST route.

Publish a workflow — or a saved page-extraction job — and Writ serves it at /v1/{slug}/{path}: no /api prefix, no server of yours to run, and callers hold their own consumer keys, never your credentials.

Writ runs on your own accounts, with your own credentials and data, on sites you are authorized to use.

route ▸ how a call resolves

The route, resolved.

The gateway has no fixed paths of its own: the slug names your tenant, the path matches an endpoint you registered, and anything that does not resolve is a 404.

PartHow it resolves
{slug}Your tenant’s public_id (canonical) or its vanity slug. The gateway also answers on the {slug}.api.usewrit.app subdomain and on verified custom domains.
{path}Matched against your registered endpoints on (method, path) — a literal like /products, or a pattern like /search/{query}.
MethodsGET · POST · PUT · DELETE · PATCH
BackendA saved workflow run, or a scrape_job — a saved page-extraction job.
Miss404 — unknown tenant, or no endpoint registered on that (method, path).

call ▸ post, read data

The first call.

POST the inputs, read the data back — these samples are the whole client:

call.sh

curl -X POST https://api.usewrit.app/v1/acme/price-check \
  -H "Authorization: Bearer $WRIT_CONSUMER_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/product/42"}'

Callers authenticate this lane with a csk_ consumer key you mint per caller; your own wt_ key stays on the /api management surface and never needs to reach them. Mint, cap, suspend and rotate keys under consumer keys.

wait ▸ sync by default

Synchronous by default, async on request.

There is no wait= parameter on this lane. A call runs synchronously up to the endpoint’s timeout_seconds (5–300, default 120) and answers 200 with the result inline; past the budget it answers 504 — still carrying the run handle, so nothing is lost.

Synchronous — the default

200 with the result inline, up to timeout_seconds.

Async on request

Send Prefer: respond-async (RFC 7240) or ?async=true202 plus a run handle.

Poll

GET /v1/{slug}/_runs/{run_id} — answers with Retry-After: 2 while the run is non-terminal.

Freshness

Send Cache-Control: max-age=N or ?max_age=N per call. 0 forces a fresh run; when absent, the endpoint’s own cache_ttl_seconds (0–86400) decides.

Control parameters never leak into your workflow: async and max_age are stripped before the remaining query string merges into the run’s inputs.

shape ▸ response_format

One of three envelopes.

Each endpoint chooses how its payload is wrapped:

response_formatShape
rawThe run output, unwrapped.
json_wrappedThe default — {"success":true,"data":…}.
with_metadata{"data":…,"metadata":{endpoint_id,latency_ms,cached,timestamp}}.

Errors never vary with the format: always {"success":false,"error":…,"detail":…}.

order ▸ the gates

The gate order, exactly.

Every call walks the same ordered checks. Knowing the order tells you which limit you hit and which header to read:

  1. 01
    Tenant

    Unknown {slug}404.

  2. 02
    Endpoint

    No registered endpoint on this (method, path) → 404.

  3. 03
    Consumer key

    Missing or invalid Bearer consumer key → 401.

  4. 04
    Per-key rate limit

    A sliding 60-second window — the key’s rate_limit_per_minute, else the endpoint’s rate_limit_override, else 60/min. Over it → 429 with X-RateLimit-* and Retry-After: 60.

  5. 05
    Daily fair-use

    An org-wide daily ceiling on relay calls to published endpoints — 2,000/day on Free up to 250,000/day on Enterprise. Over it → 429 with Retry-After: 3600.

  6. 06
    Per-key monthly quota

    The key’s monthly_quota, counted before dispatch — over it → 429 “Used {n}/{quota} calls this month”.

  7. 07
    Org monthly quota

    Your plan’s monthly managed-API call quota (managed_api_calls_per_month).

  8. 08
    Cache

    A cached result younger than the allowed age returns here, without starting a run.

  9. 09
    Dispatch

    The workflow — or saved extraction job — runs on its configured venue.

  10. 10
    Usage

    The call lands in per-key and per-endpoint usage analytics.

Quotas by plan

Published routes are capped as objects; calls are capped monthly per org and daily as fair use. Unknown-key and 404 traffic never counts against you:

PlanPublished endpointsCalls · monthRelay calls · day
Free210,0002,000
Starter550,00010,000
Pro15250,00025,000
Growth401,000,00050,000
Scale100Unlimited100,000
EnterpriseUnlimitedUnlimited250,000

faq

Questions, answered.

What is the difference between an endpoint and an MCP tool?
Two surfaces over the same workflow. A managed endpoint is a REST route at /v1/{slug}/{path}; an MCP tool is the same workflow spoken over the Model Context Protocol. Publish either, both, or neither.
Which key do callers use?
A csk_ consumer key — minted by you, restricted to your endpoints, rate-limited and quota-bounded per key. Your own wt_ API key manages endpoints on the /api surface; it is not what you hand to callers.
What happens when a run outlives the timeout?
The call answers 504 with the run handle still attached. Poll GET /v1/{slug}/_runs/{run_id} until the run is terminal — or skip the wait entirely with Prefer: respond-async and take the 202 up front.
Where does the run execute?
On your own local or self-hosted agent, free and unmetered, or on the managed cloud fleet metered by running time — you choose the venue per workflow. Writ runs on your own accounts, with your own credentials and data, on sites you are authorized to use.

go ▸ publish

Publish your first endpoint.

Pick a workflow, register a route, and hand your callers a URL that answers in one POST.