{"openapi":"3.1.0","info":{"title":"PDF Edit API Gateway","description":"Edit text inside existing PDFs: replace, delete, redact, insert and fill forms, keeping the original fonts and layout, with every change verified before it is returned.\n\n**Source.** The editing engine is free software under the AGPL-3.0; its complete source is served to API users at `GET /source` (a tar.gz of the engine package, its Dockerfile and the licence).\n\n## Error codes\n\nEvery error is `{\"error\": {\"code\", \"message\", \"hint\"}}` with one of these codes; `X-Request-Id` is on every response.\n\n| `error.code` | HTTP | Meaning |\n| --- | --- | --- |\n| `invalid_request` | 400 | The request is malformed, an edit is impossible as written, or an Idempotency-Key was reused with a different body. |\n| `unauthorized` | 401 | No key, an unknown key, or a revoked key. |\n| `quota_exceeded` | 402 | The month's allowance and any credit-pack pages are used up; buy a pack or upgrade on the account page. |\n| `forbidden_watermark_off` | 403 | options.watermark \"off\" on a flagged document needs a plan that allows it and accepted terms. |\n| `not_found` | 404 | No such file, job or route for this account. |\n| `conflict` | 409 | A request with this Idempotency-Key is still running; wait and re-poll, do not start another. |\n| `too_large` | 413 | The document exceeds the plan's size or page limit. |\n| `document_encrypted` | 422 | The PDF is encrypted and no (or a wrong) password was given. |\n| `document_unsupported` | 422 | The file is not a PDF the engine can open (damaged, a portfolio, a non-PDF). |\n| `signed_document` | 422 | The document carries a digital signature; pass options.break_signature true to edit it anyway. |\n| `edit_failed` | 422 | Every requested edit failed verification and was rolled back; see failed[] for the reasons. |\n| `rate_limited` | 429 | Over the plan's requests-per-minute, or the service is busy; honour Retry-After. |\n| `engine_error` | 500 | The engine crashed on this document; retry once, then report the X-Request-Id. |\n| `upstream_error` | 502 | source.url (or records_url) could not be fetched. |\n| `engine_timeout` | 504 | The synchronous run did not finish in time; send it again with options.async true. |\n\n## Headers\n\n`Idempotency-Key` on `POST /v1/edit` and `POST /v1/batch` makes retries safe. Rate-limited operations return `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`; a `429` adds `Retry-After`.\n\n## Webhooks\n\nSet `options.webhook_url` on an edit or a batch and the gateway POSTs the job's result body (plus `event` and `job_id`) to that URL when the job finishes, signed with `X-Signature` (HMAC-SHA256 of the raw body with your account's webhook secret from `GET /v1/limits`'s account tooling or the CLI), retrying at 1, 5 and 30 minutes on a non-2xx.","version":"0.1.0"},"paths":{"/healthz":{"get":{"summary":"Health check","operationId":"healthz_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}},"500":{"description":"error.code is one of: engine_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}}},"description":"`{\"status\": \"ok\"}` when the API and its database answer. No key needed.","security":[]}},"/v1/limits":{"get":{"tags":["meta"],"summary":"Get the plan's limits","operationId":"get_limits_v1_limits_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LimitsOut","additionalProperties":true,"type":"object","title":"Response Get Limits V1 Limits Get"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}}},"description":"What the calling key may do: monthly pages, concurrency, requests per minute, file and page size limits, whether `watermark: off` is allowed."}},"/v1/usage":{"get":{"tags":["meta"],"summary":"Get this period's usage","operationId":"get_usage_v1_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountUsageOut","additionalProperties":true,"type":"object","title":"Response Get Usage V1 Usage Get"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}}},"description":"Pages used, the allowance, credit-pack pages and what remains for the current period of the calling key's account. The same numbers the account page shows."}},"/source":{"get":{"tags":["meta"],"summary":"Download the engine's source (AGPL-3.0)","description":"The complete source of the editing engine this API runs, as a tar.gz, offered under the GNU AGPL-3.0 to the API's users: send your API key (a free `sk_test_` key is enough; the hosted MCP endpoint relays this for its keyless tier). This is the licence's network-use source offer; the gateway (keys, billing, storage) is a separate program and is not included.","operationId":"get_source_source_get","responses":{"200":{"description":"Successful Response","content":{"application/gzip":{}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}}}}},"/v1/files":{"post":{"tags":["files"],"summary":"Reserve an upload","description":"For documents you would rather not send inline: returns a `file_id` and a presigned `upload_url`. `PUT` the bytes there with the given `headers`, then pass `source.file_id` to `/v1/edit`. Uploads expire with the retention window.","operationId":"create_file_v1_files_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileCreateOut","additionalProperties":true,"type":"object","title":"Response Create File V1 Files Post"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}}}}},"/v1/files/{file_id}":{"delete":{"tags":["files"],"summary":"Delete a file","description":"Remove an uploaded or produced document before its 24-hour retention ends, together with the outputs and previews derived from it. Owner only.","operationId":"delete_file_v1_files__file_id__delete","parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}}],"responses":{"204":{"description":"Successful Response","headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"404":{"description":"error.code is one of: not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}}}}},"/v1/files/{file_id}/content":{"get":{"tags":["files"],"summary":"Download a file","operationId":"get_file_content_v1_files__file_id__content_get","parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}},{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"image/png":{"schema":{"type":"string","format":"binary"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}},"400":{"description":"error.code is one of: invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}},"404":{"description":"error.code is one of: not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}}},"description":"The bytes of an output, preview or uploaded document. The URL comes signed (`token`) from a response; no API key is needed and the link expires."},"put":{"tags":["files"],"summary":"Upload the file's bytes","description":"The second step of `POST /v1/files`: `PUT` the document to the presigned URL with the headers it returned. `204` when stored.","operationId":"put_file_content_v1_files__file_id__content_put","parameters":[{"name":"file_id","in":"path","required":true,"schema":{"type":"string","title":"File Id"}},{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"204":{"description":"Successful Response","headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}},"400":{"description":"error.code is one of: invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}},"404":{"description":"error.code is one of: not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}},"413":{"description":"error.code is one of: too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}}}}},"/v1/edit":{"post":{"tags":["edit"],"summary":"Edit a PDF","description":"Apply one or more edits (replace, delete, redact, insert, form fill) to a document and get the edited PDF back with every change verified. Send the document as a multipart upload (`file`) with `edits` as a JSON string, or as JSON with `source.url` or a `source.file_id` from an earlier upload. Small documents answer `200` with the result at once; larger ones (over the plan's sync page limit) and any request with `options.async` true answer `202` with a `job_id` to poll at `GET /v1/jobs/{job_id}` (or set `options.webhook_url` to be called when it finishes). Add `Accept: application/pdf` to receive the edited file itself instead of JSON. Each entry in `changes` says which font was written (`font_source`, `font_used`), whether the pixel check passed (`verified`, `collateral_pixels`) and links a before/after preview; `unmatched` and `failed` list what did not happen and why.","operationId":"post_edit_v1_edit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditRequest"}},"multipart/form-data":{"schema":{"properties":{"file":{"type":"string","format":"binary","title":"File","description":"The PDF to edit. The bytes are the source, so `source` is not sent."},"edits":{"type":"string","title":"Edits","description":"A JSON array of EditModel objects, as `EditRequest.edits` takes them."},"options":{"type":"string","title":"Options","description":"A JSON object of GatewayOptions, as `EditRequest.options` takes it."},"password":{"type":"string","title":"Password","description":"The document open password, when it has one."}},"additionalProperties":false,"type":"object","required":["file"],"title":"EditForm"}}},"required":true},"responses":{"200":{"description":"The edit ran","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EditResponse"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"202":{"description":"Accepted as a job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueuedResponse"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"422":{"description":"error.code is one of: document_encrypted, document_unsupported, signed_document, edit_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"400":{"description":"error.code is one of: invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"402":{"description":"error.code is one of: quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"403":{"description":"error.code is one of: forbidden_watermark_off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"409":{"description":"error.code is one of: conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"413":{"description":"error.code is one of: too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"description":"error.code is one of: engine_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"502":{"description":"error.code is one of: upstream_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"504":{"description":"error.code is one of: engine_timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255},"description":"Makes a retry safe. The same key with the same body returns the first request's result (a replay, never a second charge); a duplicate that arrives while the first is still running waits for it, then answers `409 conflict` if it has not finished; the same key with a different body is refused `400`. Without the header the gateway derives a key from the request's content, so a blind retry of a timed-out POST is still safe. Keys are scoped to the account and the key's mode."}]}},"/v1/jobs":{"get":{"tags":["jobs"],"summary":"List jobs","description":"The account's jobs, newest first, with status, kind, timings, pages billed and the number of changes. Filter with `since` and `status`; page with `cursor` and `limit`. Kept 30 days.","operationId":"list_jobs_v1_jobs_get","parameters":[{"name":"since","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"ISO 8601 lower bound on created_at","title":"Since"},"description":"ISO 8601 lower bound on created_at"},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"the job_id of the last row of the previous page","title":"Cursor"},"description":"the job_id of the last row of the previous page"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobListOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"400":{"description":"error.code is one of: invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}}}}},"/v1/jobs/{job_id}":{"get":{"tags":["jobs"],"summary":"Get a job","description":"The state of an async edit or batch. While it runs: `status` and `progress`. When it is done: the same body a synchronous edit returns (`changes`, `output`, `warnings`, `usage`), and `records` for a batch. Output links are valid for 24 hours.","operationId":"get_job_v1_jobs__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResponse"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"404":{"description":"error.code is one of: not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}}}}},"/v1/batch":{"post":{"tags":["batch"],"summary":"Run the same edits over many records","description":"One template document, one set of edits with `{placeholders}`, many records (inline or from `records_url`): one output document per record, as a job. Answers `202` with a `job_id`; `GET /v1/jobs/{job_id}` returns one entry per record once it is done, or set `options.webhook_url`.","operationId":"post_batch_v1_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRequest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"422":{"description":"error.code is one of: document_encrypted, document_unsupported, signed_document, edit_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"400":{"description":"error.code is one of: invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"402":{"description":"error.code is one of: quota_exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"403":{"description":"error.code is one of: forbidden_watermark_off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"413":{"description":"error.code is one of: too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"502":{"description":"error.code is one of: upstream_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":255},"description":"Makes a retry safe. The same key with the same body returns the first request's result (a replay, never a second charge); a duplicate that arrives while the first is still running waits for it, then answers `409 conflict` if it has not finished; the same key with a different body is refused `400`. Without the header the gateway derives a key from the request's content, so a blind retry of a timed-out POST is still safe. Keys are scoped to the account and the key's mode."}]}},"/v1/text":{"post":{"tags":["text"],"summary":"Read the text of a PDF","description":"Every text span with its page, box, font and `span_id`, plus form fields, for the whole document or a page range. Use it to find what to edit and to scope an edit to one exact span (`scope.span_ids`). Free: reading does not bill pages.","operationId":"post_text_v1_text_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TextResponse"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"422":{"description":"error.code is one of: document_encrypted, document_unsupported, signed_document, edit_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"400":{"description":"error.code is one of: invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"404":{"description":"error.code is one of: not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"413":{"description":"error.code is one of: too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"description":"error.code is one of: engine_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"502":{"description":"error.code is one of: upstream_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"504":{"description":"error.code is one of: engine_timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}}}}},"/v1/preview":{"post":{"tags":["preview"],"summary":"Render a page as a PNG","description":"A PNG of one page (or a region of it), optionally with highlight boxes, to look before editing or to show a person what changed. At most 200 KB. Free.","operationId":"post_preview_v1_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewRequest"}}},"required":true},"responses":{"200":{"description":"The rendered page, at most 200 KB.","content":{"image/png":{"schema":{"type":"string","format":"binary"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"422":{"description":"error.code is one of: document_encrypted, document_unsupported, signed_document, edit_failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"400":{"description":"error.code is one of: invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"404":{"description":"error.code is one of: not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"413":{"description":"error.code is one of: too_large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"500":{"description":"error.code is one of: engine_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"502":{"description":"error.code is one of: upstream_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"504":{"description":"error.code is one of: engine_timeout","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}}}}},"/v1/fonts":{"get":{"tags":["fonts"],"summary":"List fonts","description":"The fonts this deployment can write with by name, for `style.font` and for reading `font_used` in a change. The document's own embedded fonts are always preferred when they carry the needed glyphs.","operationId":"get_fonts_v1_fonts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FontsResponse"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}}}}},"/v1/billing/webhook/creem":{"post":{"tags":["billing"],"summary":"Merchant webhook (called by Creem)","description":"Receives payment, subscription, refund and dispute events from Creem, verifies the `creem-signature` HMAC and applies them to the account. Not for clients: deliveries without a valid signature are refused.","operationId":"creem_webhook_v1_billing_webhook_creem_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAckOut","additionalProperties":true,"type":"object","title":"Response Creem Webhook V1 Billing Webhook Creem Post"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}},"400":{"description":"error.code is one of: invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}}}}},"security":[]}},"/v1/billing/checkout":{"post":{"tags":["billing"],"summary":"Create a checkout link","description":"A merchant-of-record checkout URL for a subscription plan or a credit pack, bound to the calling key's account. Open it in a browser; payment applies to the account through the webhook within a minute. The account page offers the same links without an API call.","operationId":"checkout_v1_billing_checkout_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutOut","additionalProperties":true,"type":"object","title":"Response Checkout V1 Billing Checkout Post"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"400":{"description":"error.code is one of: invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"401":{"description":"error.code is one of: unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}},"429":{"description":"error.code is one of: rate_limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"502":{"description":"error.code is one of: upstream_error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorOut"}}},"headers":{"X-Request-Id":{"description":"A unique id for this request; quote it to support.","schema":{"type":"string"}},"X-RateLimit-Limit":{"description":"Requests allowed per minute for this key's plan.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current minute.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix time at which the window refills.","schema":{"type":"integer"}}}}}}}},"components":{"schemas":{"AccountUsageOut":{"properties":{"period":{"type":"string","title":"Period","description":"`yyyy-mm` for live keys, `yyyy-mm-dd` for test keys."},"pages_used":{"type":"integer","title":"Pages Used"},"pages_allowance":{"type":"integer","title":"Pages Allowance"},"overage_pages":{"type":"integer","title":"Overage Pages","description":"Recorded for information; never invoiced."},"credit_pages":{"type":"integer","title":"Credit Pages","description":"Credit-pack pages left; spent before the allowance, never expire."},"pages_remaining":{"type":"integer","title":"Pages Remaining"},"mode":{"type":"string","title":"Mode","description":"`live` or `test`."}},"additionalProperties":true,"type":"object","required":["period","pages_used","pages_allowance","overage_pages","credit_pages","pages_remaining","mode"],"title":"AccountUsageOut"},"AtModel":{"properties":{"page":{"type":"integer","minimum":1.0,"title":"Page"},"x":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"X","description":"Baseline origin x. Points from the page's left edge, or a fraction of the page width when units='fraction'."},"y":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Y","description":"Baseline origin y: where the first line sits, measured from the page's TOP edge (PDF viewer convention, as every bbox and span origin in this API). A fraction of the page height when units='fraction'."},"after":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After","description":"Anchor text to insert after; the first occurrence on the page wins, and the style is inherited from it."},"units":{"type":"string","enum":["pt","fraction"],"title":"Units","default":"pt"},"placement":{"type":"string","enum":["inline","below"],"title":"Placement","description":"With `after`: 'inline' writes one space past the anchor's right edge on its own baseline; 'below' writes at the anchor line's left edge, one leading down.","default":"inline"}},"additionalProperties":false,"type":"object","required":["page"],"title":"AtModel","description":"Where an `insert` writes: a point, or a piece of text to hang off.\n\nThe point is the BASELINE ORIGIN of the first line written -- where the bottom left\nof the first glyph sits, not the top left of a text box. That is how every\ncoordinate in this engine is expressed (a span's `origin`, `/v1/text`'s span\ngeometry), so the x/y of a span read out of a document can be used here unchanged;\nand it is the one of the two that does not move when `fit` shrinks the size."},"BatchOptions":{"properties":{"dry_run":{"type":"boolean","title":"Dry Run","default":false},"strict":{"type":"boolean","title":"Strict","default":false},"atomic":{"type":"boolean","title":"Atomic","default":true},"font":{"$ref":"#/components/schemas/FontOptions"},"collateral_threshold":{"type":"integer","minimum":0.0,"title":"Collateral Threshold","default":8},"tidy":{"type":"boolean","title":"Tidy","default":true},"preview":{"type":"string","enum":["changes","pages","none"],"title":"Preview","default":"changes"},"redact_style":{"type":"string","enum":["box","text"],"title":"Redact Style","default":"box"},"redact_metadata":{"type":"boolean","title":"Redact Metadata","default":false},"redact_verify_ocr":{"type":"boolean","title":"Redact Verify Ocr","default":true},"ocr":{"type":"string","enum":["auto","on","off"],"title":"Ocr","default":"auto"},"ocr_lang":{"items":{"type":"string","enum":["zh","en"]},"type":"array","title":"Ocr Lang"},"watermark":{"type":"string","enum":["auto","on","off"],"title":"Watermark","default":"auto"},"async":{"type":"boolean","title":"Async","default":false},"webhook_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Webhook Url","description":"Called with POST when the job finishes: the body is the job's result (what GET /v1/jobs/{id} returns) plus `event` (job.done, job.failed, batch.done ...) and `job_id`, signed in `X-Signature` (hex HMAC-SHA256 of the raw body with the account's webhook secret). Non-2xx answers are retried after 1, 5 and 30 minutes. https only."},"retain":{"type":"boolean","title":"Retain","default":true},"break_signature":{"type":"boolean","title":"Break Signature","default":false},"output":{"type":"string","enum":["zip","files"],"title":"Output","default":"files"},"filename":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filename"},"fail_fast":{"type":"boolean","title":"Fail Fast","default":false}},"additionalProperties":false,"type":"object","title":"BatchOptions","description":"``/edit``'s options plus the three only a batch has (spec §6).\n\nLike the rest of ``GatewayOptions`` these never reach the engine, so\ntheir names are in ``runner.GATEWAY_ONLY_OPTIONS`` too."},"BatchRecordOut":{"properties":{"index":{"type":"integer","title":"Index"},"status":{"type":"string","title":"Status"},"output":{"anyOf":[{"$ref":"#/components/schemas/OutputOut"},{"type":"null"}]},"changes_count":{"type":"integer","title":"Changes Count","default":0},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"additionalProperties":true,"type":"object","required":["index","status"],"title":"BatchRecordOut","description":"One record of a batch, as ``GET /v1/jobs/{id}`` reports it (spec §6)."},"BatchRequest":{"properties":{"source":{"$ref":"#/components/schemas/SourceModel"},"edits":{"items":{"$ref":"#/components/schemas/EditModel"},"type":"array","maxItems":200,"minItems":1,"title":"Edits"},"records":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Records"},"records_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Records Url"},"options":{"$ref":"#/components/schemas/BatchOptions"}},"additionalProperties":false,"type":"object","required":["source","edits"],"title":"BatchRequest","description":"``POST /v1/batch``'s JSON body (spec §6).\n\n``records`` inline xor ``records_url`` (a CSV or JSONL file fetched with\nthe same SSRF rules as ``source.url``). The per-record count limit is\n``limits.batch_max_records``, which the route applies -- it depends on\nthe caller's plan, so it cannot be a model constraint."},"ChangeOut":{"properties":{"edit":{"type":"integer","title":"Edit"},"op":{"type":"string","title":"Op"},"page":{"type":"integer","title":"Page"},"page_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Label"},"span_ids":{"items":{"type":"string"},"type":"array","title":"Span Ids"},"bbox":{"items":{"type":"number"},"type":"array","title":"Bbox"},"before":{"type":"string","title":"Before","default":""},"after":{"type":"string","title":"After","default":""},"context":{"type":"string","title":"Context","default":""},"font_source":{"type":"string","title":"Font Source","default":""},"font_used":{"type":"string","title":"Font Used","default":""},"fit":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Fit"},"is_ocr":{"type":"boolean","title":"Is Ocr","default":false},"ocr_confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Ocr Confidence"},"collateral_pixels":{"type":"integer","title":"Collateral Pixels","default":0},"verified":{"type":"boolean","title":"Verified","default":true},"notes":{"items":{"type":"string"},"type":"array","title":"Notes"},"preview_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preview Url"}},"additionalProperties":true,"type":"object","required":["edit","op","page"],"title":"ChangeOut","description":"One verified change: ``Change.to_dict()`` plus ``preview_url``.\n\n``preview_url`` is null when the change has no preview -- ``preview:\n\"none\"``, or the per-response cap (``settings.preview_cap``) was reached,\nin which case ``warnings`` carries ``preview_capped``."},"CheckoutOut":{"properties":{"url":{"type":"string","title":"Url","description":"Open in a browser to pay."},"item":{"type":"string","title":"Item"},"kind":{"type":"string","title":"Kind","description":"`plan` or `pack`."}},"type":"object","required":["url","item","kind"],"title":"CheckoutOut"},"CheckoutRequest":{"properties":{"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan","description":"starter | growth | scale"},"pack":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pack","description":"pack_500 | pack_5k"}},"type":"object","title":"CheckoutRequest"},"EditModel":{"properties":{"op":{"type":"string","enum":["replace","delete","redact","insert","form"],"title":"Op","default":"replace"},"find":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Find"},"replace":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Replace"},"text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text"},"at":{"anyOf":[{"$ref":"#/components/schemas/AtModel"},{"type":"null"}]},"fields":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Fields"},"flatten":{"type":"boolean","title":"Flatten","default":false},"scope":{"$ref":"#/components/schemas/ScopeModel"},"match":{"$ref":"#/components/schemas/MatchModel"},"style":{"anyOf":[{"$ref":"#/components/schemas/StyleModel"},{"type":"null"}]},"fit":{"type":"string","enum":["auto","reflow","strict"],"title":"Fit","default":"auto"}},"additionalProperties":false,"type":"object","title":"EditModel"},"EditResponse":{"properties":{"status":{"type":"string","title":"Status"},"job_id":{"type":"string","title":"Job Id"},"output":{"anyOf":[{"$ref":"#/components/schemas/OutputOut"},{"type":"null"}]},"changes":{"items":{"$ref":"#/components/schemas/ChangeOut"},"type":"array","title":"Changes"},"unmatched":{"items":{"$ref":"#/components/schemas/UnmatchedOut"},"type":"array","title":"Unmatched"},"failed":{"items":{"$ref":"#/components/schemas/FailedOut"},"type":"array","title":"Failed"},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"usage":{"$ref":"#/components/schemas/UsageOut"},"error":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Error"}},"additionalProperties":true,"type":"object","required":["status","job_id"],"title":"EditResponse","description":"A sync edit's body: 200 for done/partial, 422 for failed.\n\nA failed edit keeps all three lists (the spec requires them for\ndebugging) and additionally carries the ``error`` envelope."},"ErrorOut":{"properties":{"error":{"additionalProperties":true,"type":"object","title":"Error"}},"additionalProperties":false,"type":"object","required":["error"],"title":"ErrorOut","description":"The error envelope (``errors.envelope``), for the OpenAPI schema."},"FailedOut":{"properties":{"edit":{"type":"integer","title":"Edit"},"reason":{"type":"string","title":"Reason"},"hint":{"type":"string","title":"Hint","default":""},"page":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page"},"collateral_pixels":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Collateral Pixels"}},"additionalProperties":true,"type":"object","required":["edit","reason"],"title":"FailedOut","description":"An edit the engine applied and then rolled back (``Failed.to_dict()``).\n\nCarries the reason's own structured detail flattened in alongside these\nfields -- hence ``extra=\"allow\"``."},"FieldOut":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"type":{"type":"string","title":"Type","default":""},"value":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Value"},"page":{"type":"integer","title":"Page","default":1},"bbox":{"items":{"type":"number"},"type":"array","title":"Bbox"},"xref":{"type":"integer","title":"Xref","default":0},"options":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Options"},"readonly":{"type":"boolean","title":"Readonly","default":false}},"additionalProperties":true,"type":"object","title":"FieldOut","description":"One form widget, as ``/v1/text`` lists them with ``layers: [\"forms\"]``."},"FileCreateOut":{"properties":{"file_id":{"type":"string","title":"File Id","description":"Pass as `source.file_id` once the bytes are uploaded."},"upload_url":{"type":"string","title":"Upload Url","description":"PUT the document here."},"headers":{"additionalProperties":true,"type":"object","title":"Headers","description":"Headers the PUT must carry."},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At","description":"ISO 8601; the upload slot and the file expire then."}},"type":"object","required":["file_id","upload_url"],"title":"FileCreateOut"},"FontOptions":{"properties":{"policy":{"type":"string","enum":["auto","metric_only","exact_only"],"title":"Policy","default":"auto"}},"additionalProperties":false,"type":"object","title":"FontOptions"},"FontOut":{"properties":{"name":{"type":"string","title":"Name"},"family":{"type":"string","title":"Family","default":""},"styles":{"items":{"type":"string"},"type":"array","title":"Styles"},"scripts":{"items":{"type":"string"},"type":"array","title":"Scripts"},"source":{"type":"string","title":"Source","default":""}},"additionalProperties":true,"type":"object","required":["name"],"title":"FontOut","description":"One font family ``style.font`` can name (``fonts.list_fonts``)."},"FontsResponse":{"properties":{"fonts":{"items":{"$ref":"#/components/schemas/FontOut"},"type":"array","title":"Fonts"}},"additionalProperties":true,"type":"object","title":"FontsResponse","description":"``GET /v1/fonts``: the families ``style.font`` can name here."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthOut":{"properties":{"status":{"type":"string","title":"Status","description":"\"ok\" when the API and its database answer.","default":"ok"}},"type":"object","title":"HealthOut"},"JobListOut":{"properties":{"jobs":{"items":{"$ref":"#/components/schemas/JobSummaryOut"},"type":"array","title":"Jobs"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Pass as `cursor` for the next page; null on the last."}},"type":"object","required":["jobs"],"title":"JobListOut"},"JobResponse":{"properties":{"status":{"type":"string","title":"Status"},"job_id":{"type":"string","title":"Job Id"},"kind":{"type":"string","title":"Kind","default":"edit"},"progress":{"additionalProperties":true,"type":"object","title":"Progress"},"records":{"anyOf":[{"items":{"$ref":"#/components/schemas/BatchRecordOut"},"type":"array"},{"type":"null"}],"title":"Records"}},"additionalProperties":true,"type":"object","required":["status","job_id"],"title":"JobResponse","description":"``GET /v1/jobs/{id}``: the sync body once the job is finished.\n\nWhile the job is queued or running only ``status``, ``job_id`` and\n``progress`` are present; a finished job carries everything the sync\nresponse carries (plus ``records`` for a batch)."},"JobSummaryOut":{"properties":{"job_id":{"type":"string","title":"Job Id"},"kind":{"type":"string","title":"Kind"},"status":{"type":"string","title":"Status"},"created_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created At"},"finished_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Finished At"},"pages_billed":{"type":"integer","title":"Pages Billed","default":0},"changes":{"type":"integer","title":"Changes","default":0},"warnings":{"items":{"type":"string"},"type":"array","title":"Warnings"},"error_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Code"},"webhook_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook State"}},"additionalProperties":true,"type":"object","required":["job_id","kind","status"],"title":"JobSummaryOut"},"LimitsOut":{"properties":{"monthly_pages":{"type":"integer","title":"Monthly Pages"},"overage_allowed":{"type":"boolean","title":"Overage Allowed","description":"Always false: every plan is prepaid."},"watermark_off_allowed":{"type":"boolean","title":"Watermark Off Allowed"},"concurrency":{"type":"integer","title":"Concurrency"},"rate_per_minute":{"type":"integer","title":"Rate Per Minute"},"max_file_mb":{"type":"integer","title":"Max File Mb"},"max_pages":{"type":"integer","title":"Max Pages"},"sync_max_edited_pages":{"type":"integer","title":"Sync Max Edited Pages","description":"Edits touching more pages than this run as a job."}},"additionalProperties":true,"type":"object","required":["monthly_pages","overage_allowed","watermark_off_allowed","concurrency","rate_per_minute","max_file_mb","max_pages","sync_max_edited_pages"],"title":"LimitsOut"},"MatchModel":{"properties":{"mode":{"type":"string","enum":["exact","icase","word","regex"],"title":"Mode","default":"exact"},"normalize":{"type":"boolean","title":"Normalize","default":true},"across_lines":{"type":"boolean","title":"Across Lines","default":false}},"additionalProperties":false,"type":"object","title":"MatchModel"},"OutputOut":{"properties":{"file_id":{"type":"string","title":"File Id"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"},"pages":{"type":"integer","title":"Pages","default":0},"bytes":{"type":"integer","title":"Bytes","default":0}},"additionalProperties":true,"type":"object","required":["file_id"],"title":"OutputOut","description":"The edited document (absent on ``dry_run`` and on a failed edit)."},"PreviewRequest":{"properties":{"source":{"$ref":"#/components/schemas/SourceModel"},"page":{"type":"integer","minimum":1.0,"title":"Page","default":1},"region":{"anyOf":[{"items":{"type":"number"},"type":"array","maxItems":4,"minItems":4},{"type":"null"}],"title":"Region"},"scale":{"type":"integer","enum":[1,2,3],"title":"Scale","default":2},"highlight":{"anyOf":[{"items":{"items":{"type":"number"},"type":"array"},"type":"array","maxItems":200},{"type":"null"}],"title":"Highlight"}},"additionalProperties":false,"type":"object","required":["source"],"title":"PreviewRequest","description":"``POST /v1/preview``'s body (spec §2.2)."},"QueuedResponse":{"properties":{"status":{"type":"string","const":"queued","title":"Status","default":"queued"},"job_id":{"type":"string","title":"Job Id"}},"additionalProperties":true,"type":"object","required":["job_id"],"title":"QueuedResponse","description":"The 202 body of an async edit or a batch: the worker has the job."},"RegionModel":{"properties":{"x0":{"type":"number","title":"X0"},"y0":{"type":"number","title":"Y0"},"x1":{"type":"number","title":"X1"},"y1":{"type":"number","title":"Y1"},"units":{"type":"string","enum":["fraction","pt"],"title":"Units","default":"fraction"}},"additionalProperties":false,"type":"object","required":["x0","y0","x1","y1"],"title":"RegionModel"},"ScopeModel":{"properties":{"pages":{"anyOf":[{"type":"string"},{"items":{"type":"integer"},"type":"array"}],"title":"Pages","default":"all"},"page_labels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Page Labels"},"region":{"anyOf":[{"$ref":"#/components/schemas/RegionModel"},{"type":"null"}]},"after":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"After"},"before":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"title":"Before"},"occurrence":{"anyOf":[{"type":"string","enum":["all","first","last"]},{"type":"integer"}],"title":"Occurrence","default":"all"},"span_ids":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Span Ids"},"layers":{"items":{"type":"string","enum":["content","forms","annotations"]},"type":"array","title":"Layers","description":"Page layers to match in. All three are implemented; a match on the 'forms' layer is applied to the field's value, not to the page."}},"additionalProperties":false,"type":"object","title":"ScopeModel"},"SourceModel":{"properties":{"url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Url"},"file_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Id"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"}},"additionalProperties":false,"type":"object","title":"SourceModel"},"StyleModel":{"properties":{"font":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Font"},"size":{"anyOf":[{"type":"number","maximum":200.0,"minimum":1.0},{"type":"null"}],"title":"Size"},"color":{"anyOf":[{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},{"type":"null"}],"title":"Color"}},"additionalProperties":false,"type":"object","title":"StyleModel"},"TextRequest":{"properties":{"source":{"$ref":"#/components/schemas/SourceModel"},"query":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Query"},"match":{"$ref":"#/components/schemas/MatchModel"},"pages":{"anyOf":[{"type":"string"},{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Pages"},"layers":{"items":{"type":"string","enum":["content","forms","annotations"]},"type":"array","minItems":1,"title":"Layers"},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"},"limit":{"type":"integer","maximum":1000.0,"minimum":1.0,"title":"Limit","default":200}},"additionalProperties":false,"type":"object","required":["source"],"title":"TextRequest","description":"``POST /v1/text``'s body (spec §2.1).\n\n``match`` is the engine's own ``MatchModel``, so ``query`` accepts\nexactly the four modes an edit's ``find`` does -- a caller searches with\na string and then edits with the same string and the same ``match``."},"TextResponse":{"properties":{"spans":{"items":{"$ref":"#/components/schemas/TextSpanOut"},"type":"array","title":"Spans"},"page_count":{"type":"integer","title":"Page Count","default":0},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"fields":{"anyOf":[{"items":{"$ref":"#/components/schemas/FieldOut"},"type":"array"},{"type":"null"}],"title":"Fields"}},"additionalProperties":true,"type":"object","title":"TextResponse","description":"``POST /v1/text``'s body.\n\n``next_cursor`` is present only when there is another page of results --\na cursor on the last page is an invitation to make one more empty\nrequest. ``fields`` only when ``layers`` included ``forms``."},"TextSpanOut":{"properties":{"span_id":{"type":"string","title":"Span Id"},"page":{"type":"integer","title":"Page"},"page_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Page Label"},"block_id":{"type":"string","title":"Block Id"},"line_id":{"type":"string","title":"Line Id"},"text":{"type":"string","title":"Text"},"bbox":{"items":{"type":"number"},"type":"array","title":"Bbox"},"font":{"type":"string","title":"Font","default":""},"size":{"type":"number","title":"Size","default":0},"color":{"type":"string","title":"Color","default":"#000000"},"dir":{"items":{"type":"number"},"type":"array","title":"Dir"},"is_ocr":{"type":"boolean","title":"Is Ocr","default":false},"in_shared_xobject":{"type":"boolean","title":"In Shared Xobject","default":false},"layer":{"type":"string","title":"Layer","default":"content"},"field":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Field"}},"additionalProperties":true,"type":"object","required":["span_id","page","block_id","line_id","text"],"title":"TextSpanOut","description":"One span of the document, as ``/v1/text`` reports it (spec §2.1)."},"UnmatchedOut":{"properties":{"edit":{"type":"integer","title":"Edit"},"reason":{"type":"string","title":"Reason"},"hint":{"type":"string","title":"Hint","default":""},"suggestions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Suggestions"}},"additionalProperties":true,"type":"object","required":["edit","reason"],"title":"UnmatchedOut","description":"An edit that found nothing (``Unmatched.to_dict()``)."},"UsageOut":{"properties":{"pages_billed":{"type":"integer","title":"Pages Billed","default":0},"weights":{"additionalProperties":true,"type":"object","title":"Weights"},"remaining":{"type":"integer","title":"Remaining","default":0}},"additionalProperties":true,"type":"object","title":"UsageOut","description":"What the request cost (spec §5.2's ``usage``)."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookAckOut":{"properties":{"status":{"type":"string","title":"Status","description":"`applied` or `ignored`."},"kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Kind"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"},"credit_pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Credit Pages"}},"type":"object","required":["status"],"title":"WebhookAckOut"}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"sk_live_… or sk_test_…","description":"Your API key from the account page, as `Authorization: Bearer <key>`."}}},"security":[{"bearerAuth":[]}],"tags":[{"name":"edit","description":"Apply edits to a document, synchronously or as a job."},{"name":"text","description":"Read a document: spans, span ids, form fields."},{"name":"preview","description":"Render one page as a PNG, optionally highlighted."},{"name":"batch","description":"One template, many records, one output per record."},{"name":"jobs","description":"Poll a job and read the 30-day audit log."},{"name":"files","description":"Upload, download and delete documents."},{"name":"fonts","description":"Fonts this deployment can resolve by name."},{"name":"meta","description":"Plan limits, usage, and the engine's source offer."},{"name":"billing","description":"Checkout links, and the merchant of record's webhook."}]}