{"openapi":"3.1.0","info":{"title":"fenfill agent API","description":"Turn blank PDF forms into structured, fillable schemas and manage per-recipient links. Authenticate with a workspace API key: `Authorization: Bearer ff_live_…`. Fill values never reach this API.","version":"1"},"servers":[{"url":"/v1"},{"url":"https://api.fenfill.com/v1","description":"Production"}],"paths":{"/templates":{"get":{"tags":["templates"],"summary":"List the workspace's templates","description":"Active templates, newest first. Frozen templates and unfinished drafts\n(still awaiting the owner's AI/manual setup choice) are not listed.","operationId":"list_templates","security":[{"ApiKey":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size (1–100).","default":50,"title":"Limit"},"description":"Page size (1–100)."},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"description":"next_cursor from the previous page.","title":"Cursor"},"description":"next_cursor from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateList"}}}},"401":{"description":"invalid_api_key / key_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"plan_required / template_frozen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/templates/{template_id}":{"get":{"tags":["templates"],"summary":"Get a template's agent schema","description":"The fillable inputs of a template, in reading order, as agent-schema v1.\n`updated_at` is the version to pass back when correcting it (PATCH).","operationId":"get_template","security":[{"ApiKey":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Template Id"}},{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^render$"},{"type":"null"}],"description":"`render` adds the raw v5 schema (page images blanked).","title":"Include"},"description":"`render` adds the raw v5 schema (page images blanked)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSchema"}}}},"401":{"description":"invalid_api_key / key_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"plan_required / template_frozen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"patch":{"tags":["templates"],"summary":"Correct a template's layout","description":"Save corrections to a template's fields, groups and sections: send the\nwhole edited v5 schema (as `?include=render` returns it) with the\n`updated_at` it was based on. Only layout and the form's own wording are\nstored (labels, descriptions, placeholders, options), never fill values:\nan unknown or value-bearing key is refused. Page images, sizes and the page\ncount stay as they are. If the template changed meanwhile, 409\ntemplate_conflict with `current_updated_at`: fetch it again and re-apply.\n422 template_needs_migration when the stored template carries data from an\nolder version that can't be saved back unchanged: make that edit in the\nweb editor.","operationId":"update_template","security":[{"ApiKey":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateUpdated"}}}},"401":{"description":"invalid_api_key / key_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"plan_required / template_frozen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"invalid_schema (with details: [{path, reason}]) / invalid_request / template_needs_migration (the stored template holds data from an older version that the API can't save back; edit it in the web editor)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"rate_limited (with Retry-After): too many updates, or too many in progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"template_conflict (with current_updated_at) / job_in_progress (a re-analysis is running)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"request_too_large (with max_bytes)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateUpdate"}}}}}},"/templates/{template_id}/pdf":{"get":{"tags":["templates"],"summary":"Download the blank template PDF","description":"The template's blank PDF (decrypted server-side), for filling locally.\nRate-limited per key per minute, and to a few at once across the\nservice: past either, 429 with Retry-After.","operationId":"get_template_pdf","security":[{"ApiKey":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Template Id"}}],"responses":{"200":{"description":"The blank template PDF.","content":{"application/pdf":{}}},"401":{"description":"invalid_api_key / key_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"plan_required / template_frozen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/account":{"get":{"tags":["account"],"summary":"The workspace behind this key","description":"Plan, remaining page scans, limits and branding flags. `scans_remaining`\nis the balance at the time of this request. `max_pages` is how far into a\ndocument the plan reads; `max_pages_per_job` is how many pages one AI analyze\njob may cover (split a longer document into several jobs with `pages`; a PDF\nwith native form fields is read whole, up to `max_pages`).","operationId":"get_account","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"invalid_api_key / key_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"plan_required / template_frozen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"ApiKey":[]}]}},"/account/logo":{"get":{"tags":["account"],"summary":"The workspace's branding logo","description":"The logo to stamp on filled PDFs; 404 when the plan has no custom\nbranding or no logo is uploaded.","operationId":"get_account_logo","responses":{"200":{"description":"The logo image.","content":{"image/png":{},"image/jpeg":{}}},"401":{"description":"invalid_api_key / key_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"plan_required / template_frozen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"ApiKey":[]}]}},"/templates/{template_id}/recipients":{"post":{"tags":["recipients"],"summary":"Create a per-recipient link","description":"A magic link for one recipient of a restricted template. The link's\nstatus moves pending → opened → completed as the recipient fills (no\nanswers are ever sent back).","operationId":"create_recipient","security":[{"ApiKey":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Template Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipientCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Recipient"}}}},"401":{"description":"invalid_api_key / key_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"plan_required / template_frozen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"template_not_restricted / template_frozen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"get":{"tags":["recipients"],"summary":"List a template's recipient links","description":"The template's live (not revoked) recipient links, newest first, at most\n500. Revoking happens in the fenfill app.","operationId":"list_recipients","security":[{"ApiKey":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecipientList"}}}},"401":{"description":"invalid_api_key / key_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"plan_required / template_frozen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/forms/analyze":{"post":{"tags":["forms"],"summary":"Analyze a blank PDF form","description":"Queue a blank PDF for analysis. Poll `Location` (GET /v1/jobs/{job_id})\nuntil it is done. A PDF with native form fields costs nothing (unless\n`detect_extra_blanks` adds a vision pass); otherwise one page scan per\nanalyzed page is reserved now and refunded if the job fails.","operationId":"analyze_form","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"type":"string","format":"binary","description":"The blank PDF form, at most your plan's max_file_mb."},"name":{"type":"string","maxLength":200,"description":"A name for the form. Defaults to the file name."},"pages":{"type":"string","description":"1-based pages to analyze, e.g. \"1-3,5\". Omit for every page. One AI job covers at most max_pages_per_job pages (GET /v1/account): split a longer document into several jobs. If the chosen pages carry native form fields, the PDF's native fields are read instead (every page up to max_pages, with no per-job cap), at no cost."},"save_as_template":{"type":"boolean","description":"true: save the result as a template in the workspace. false: keep it only as this job's result (24 h, or 1 h after the first fetch).","default":false},"access":{"type":"string","enum":["public","restricted"],"description":"The saved template's access; only with save_as_template=true. public (the default): anyone with the template's link can fill it. restricted: workspace members and per-recipient links only. Recipient links (POST /v1/templates/{id}/recipients) need a restricted template."},"detect_extra_blanks":{"type":"boolean","description":"Only for a PDF with native form fields (ignored otherwise: AI analysis already finds every blank). true: after reading the native fields, a vision pass over the chosen `pages` (at most max_pages_per_job) adds blanks that have no native field, such as a signature or date line; native fields win where they overlap. Costs one page scan per page (the job is then reported as mode `ai`). false: free; the 202 says whether such blanks seem likely (`extra_blanks_available`).","default":false}},"additionalProperties":false,"type":"object","required":["file"]}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeAccepted"}}}},"401":{"description":"invalid_api_key / key_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"plan_required / template_frozen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"not_pdf / pdf_password_required / pdf_fill_forbidden / filled_output / too_many_pages / invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"rate_limited / daily_limit / too_many_active_jobs / queue_full (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"402":{"description":"insufficient_scans (with need, have)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"408":{"description":"invalid_request (the upload was too slow)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"template_limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"413":{"description":"file_too_large (with max_bytes)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"ApiKey":[]}]}},"/forms/acroform":{"post":{"tags":["forms"],"summary":"Download a template as a fillable PDF","description":"A saved template's PDF with a fillable field on every blank, for any PDF\nreader. The fields are empty: this returns the blank form only and takes no\nvalues (fill it on your machine). Needs the Team plan or above. Shares the\nPDF download limits of GET /templates/{template_id}/pdf: past either, 429\nwith Retry-After.","operationId":"make_fillable","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcroformExportRequest"}}},"required":true},"responses":{"200":{"description":"The blank form with fillable fields, as an attachment.","content":{"application/pdf":{}}},"401":{"description":"invalid_api_key / key_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"plan_required / template_frozen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"pdf_password_required / pdf_fill_forbidden / invalid_schema / template_needs_migration / invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"security":[{"ApiKey":[]}]}},"/templates/{template_id}/analyze":{"post":{"tags":["templates"],"summary":"Re-analyze pages of a saved template","description":"Run AI again on chosen pages of a saved template, using the PDF already\nstored with it (nothing is uploaded). Analyze pages never analyzed\n(`pages[].analyzed` false on GET) with `scratch`; `find` adds missed blanks;\n`relabel` / `label_missing` fix labels. Poll `Location` (GET /v1/jobs/{id})\nuntil done: the result is the updated template. One page scan per page is\nreserved now and refunded if the job fails (`label_missing` uses the\nmonthly free-label pages first). With `estimate: true` the price is returned\n(200) and nothing starts.","operationId":"analyze_template","security":[{"ApiKey":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Template Id"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyzeAccepted"}}}},"401":{"description":"invalid_api_key / key_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"plan_required / template_frozen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"invalid_request / too_many_pages / kind_required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"rate_limited / daily_limit / too_many_active_jobs / queue_full (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"200":{"description":"With estimate=true: the price; nothing is started.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RerunEstimate"}}}},"402":{"description":"insufficient_scans (with need, have)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"409":{"description":"template_conflict (with current_updated_at) / job_in_progress","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TemplateAnalyze"}}}}}},"/jobs/{job_id}":{"get":{"tags":["jobs"],"summary":"Get an analyze job's status and result","description":"Status while queued/running, with a polling hint: `Retry-After: 10` while\nqueued, `3` while running (so three jobs polled as told stay under the 60/min\nkey limit). Once done, `result` is the agent schema. An unsaved result is kept\n24 hours after the job finishes and 1 hour after its first fetch, then 410\n(as is a saved one whose template was deleted).","operationId":"get_job","security":[{"ApiKey":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"title":"Job Id"}},{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^render$"},{"type":"null"}],"description":"`render` adds the raw v5 schema (page images blanked) once done.","title":"Include"},"description":"`render` adds the raw v5 schema (page images blanked) once done."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobStatus"}}}},"401":{"description":"invalid_api_key / key_revoked","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"403":{"description":"template_frozen (the saved template)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"404":{"description":"not_found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"422":{"description":"invalid_request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"429":{"description":"rate_limited (with Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"410":{"description":"result_expired","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}}},"components":{"schemas":{"Account":{"properties":{"workspace_id":{"type":"string","title":"Workspace Id"},"tier":{"type":"string","title":"Tier"},"scans_remaining":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Scans Remaining"},"max_pages":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Pages","description":"How far into a document the plan reads (its first N pages)."},"max_pages_per_job":{"type":"integer","title":"Max Pages Per Job","description":"The most pages one AI analyze job may cover; split a longer document with `pages`. A PDF with native form fields is read whole (up to max_pages), with no per-job cap."},"max_file_mb":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max File Mb"},"branding":{"$ref":"#/components/schemas/BrandingFlags"}},"additionalProperties":false,"type":"object","required":["workspace_id","tier","scans_remaining","max_pages","max_pages_per_job","max_file_mb","branding"],"title":"Account"},"AcroformExportRequest":{"properties":{"template_id":{"type":"string","pattern":"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$","format":"uuid","title":"Template Id","description":"The id of a template in this workspace."}},"additionalProperties":false,"type":"object","required":["template_id"],"title":"AcroformExportRequest","description":"POST /v1/forms/acroform: which saved template to download as a blank\nfillable PDF. Nothing else: no value can be sent."},"AgentPage":{"properties":{"page":{"type":"integer","title":"Page"},"width":{"anyOf":[{"type":"integer"},{"type":"number"},{"type":"null"}],"title":"Width"},"height":{"anyOf":[{"type":"integer"},{"type":"number"},{"type":"null"}],"title":"Height"},"analyzed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Analyzed","description":"Only on a saved template: false when no analysis has covered this page yet (its fields, if any, were added by hand). POST /v1/templates/{id}/analyze analyzes it."}},"additionalProperties":false,"type":"object","required":["page","width","height"],"title":"AgentPage"},"AgentSchema":{"properties":{"schema_version":{"type":"integer","const":1,"title":"Schema Version"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"updated_at":{"anyOf":[{"type":"string"},{"type":"null"}],"format":"date-time","title":"Updated At","description":"Only on a saved template: when its schema last changed. Pass it back unchanged as `expected_updated_at` to PATCH /v1/templates/{id}."},"page_count":{"type":"integer","title":"Page Count"},"pages":{"items":{"$ref":"#/components/schemas/AgentPage"},"type":"array","title":"Pages"},"fields":{"items":{"oneOf":[{"$ref":"#/components/schemas/ScalarEntry"},{"$ref":"#/components/schemas/SignatureEntry"},{"$ref":"#/components/schemas/CombEntry"},{"$ref":"#/components/schemas/ChoiceEntry"},{"$ref":"#/components/schemas/TableEntry"},{"$ref":"#/components/schemas/TableRowsEntry"}],"discriminator":{"propertyName":"type","mapping":{"checkbox":"#/components/schemas/ScalarEntry","comb":"#/components/schemas/CombEntry","date":"#/components/schemas/ScalarEntry","multiline":"#/components/schemas/ScalarEntry","multiselect":"#/components/schemas/ChoiceEntry","radio":"#/components/schemas/ChoiceEntry","signature":"#/components/schemas/SignatureEntry","table":"#/components/schemas/TableEntry","table_rows":"#/components/schemas/TableRowsEntry","text":"#/components/schemas/ScalarEntry"}}},"type":"array","title":"Fields"},"render":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Render","description":"Only with ?include=render: the raw v5 template schema, page images blanked."}},"additionalProperties":false,"type":"object","required":["schema_version","template_id","name","page_count","pages","fields"],"title":"AgentSchema"},"AnalyzeAccepted":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","const":"queued","title":"Status"},"mode":{"type":"string","enum":["ai","acroform"],"title":"Mode","description":"`acroform`: the PDF has native form fields, read for free. `ai`: page scans are reserved: analyzed with AI, or an AcroForm PDF analyzed with detect_extra_blanks=true (its native fields are still read free; the scans pay for the vision pass over extra_blanks_pages)."},"pages":{"items":{"type":"integer"},"type":"array","title":"Pages","description":"The 1-based pages the job covers, sorted."},"cost":{"type":"integer","title":"Cost","description":"Page scans reserved for this job (0 for acroform)."},"extra_blanks":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Extra Blanks","description":"Only on an AcroForm PDF analyzed with detect_extra_blanks=true: always true. The native fields are read free, then a vision pass over extra_blanks_pages adds blanks that have no native field (native fields win where they overlap). Costs one scan per page in extra_blanks_pages."},"extra_blanks_pages":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Extra Blanks Pages","description":"With extra_blanks: the 1-based pages the vision pass covers (what `cost` pays for)."},"extra_blanks_available":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Extra Blanks Available","description":"Only on a free AcroForm job: true when the chosen pages show blanks no native field covers (underscore runs, label-and-line blanks, signature/date captions). A free heuristic hint: analyze again with detect_extra_blanks=true to find them."}},"additionalProperties":false,"type":"object","required":["job_id","status","mode","pages","cost"],"title":"AnalyzeAccepted"},"Box":{"properties":{"x":{"type":"number","title":"X"},"y":{"type":"number","title":"Y"},"w":{"type":"number","title":"W"},"h":{"type":"number","title":"H"}},"additionalProperties":false,"type":"object","required":["x","y","w","h"],"title":"Box"},"BrandingFlags":{"properties":{"logo":{"type":"boolean","title":"Logo"},"watermark":{"type":"boolean","title":"Watermark"}},"additionalProperties":false,"type":"object","required":["logo","watermark"],"title":"BrandingFlags"},"ChoiceEntry":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"page":{"type":"integer","title":"Page"},"box":{"$ref":"#/components/schemas/Box"},"section":{"anyOf":[{"$ref":"#/components/schemas/SectionRef"},{"type":"null"}]},"required":{"type":"boolean","title":"Required"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"placeholder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Placeholder"},"autofill":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Autofill"},"type":{"type":"string","enum":["radio","multiselect"],"title":"Type"},"options":{"items":{"$ref":"#/components/schemas/ChoiceOption"},"type":"array","title":"Options"}},"additionalProperties":false,"type":"object","required":["id","label","page","box","section","required","description","placeholder","autofill","type","options"],"title":"ChoiceEntry"},"ChoiceOption":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"}},"additionalProperties":false,"type":"object","required":["id","label"],"title":"ChoiceOption"},"CombEntry":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"page":{"type":"integer","title":"Page"},"box":{"$ref":"#/components/schemas/Box"},"section":{"anyOf":[{"$ref":"#/components/schemas/SectionRef"},{"type":"null"}]},"required":{"type":"boolean","title":"Required"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"placeholder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Placeholder"},"autofill":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Autofill"},"type":{"type":"string","const":"comb","title":"Type"},"max_length":{"type":"integer","title":"Max Length"},"cell_type":{"anyOf":[{"type":"string","enum":["integer","char","date"]},{"type":"null"}],"title":"Cell Type"},"date_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Format"}},"additionalProperties":false,"type":"object","required":["id","label","page","box","section","required","description","placeholder","autofill","type","max_length"],"title":"CombEntry"},"ErrorDetail":{"properties":{"code":{"type":"string","title":"Code"},"message":{"type":"string","title":"Message"}},"additionalProperties":true,"type":"object","required":["code","message"],"title":"ErrorDetail"},"ErrorEnvelope":{"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}},"additionalProperties":false,"type":"object","required":["error"],"title":"ErrorEnvelope"},"JobError":{"properties":{"code":{"type":"string","title":"Code","description":"Stable: budget_exceeded, pdf_corrupt, pdf_fetch, pdf_too_large, no_fields_found, job_timeout, provider_unavailable, retry_exhausted, stuck_reaped, template_limit, internal."},"message":{"type":"string","title":"Message"}},"additionalProperties":false,"type":"object","required":["code","message"],"title":"JobError"},"JobStatus":{"properties":{"job_id":{"type":"string","title":"Job Id"},"status":{"type":"string","enum":["queued","running","done","error"],"title":"Status"},"mode":{"type":"string","enum":["ai","acroform"],"title":"Mode","description":"`acroform`: the PDF has native form fields, read for free. `ai`: page scans are reserved: analyzed with AI, or an AcroForm PDF analyzed with detect_extra_blanks=true (its native fields are still read free; the scans pay for the vision pass over extra_blanks_pages)."},"phase":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phase"},"progress":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Progress"},"pages":{"items":{"type":"integer"},"type":"array","title":"Pages"},"cost":{"type":"integer","title":"Cost"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"template_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Id","description":"Set when the job saved a template (save_as_template, or a template re-analysis)."},"error":{"anyOf":[{"$ref":"#/components/schemas/JobError"},{"type":"null"}]},"result":{"anyOf":[{"$ref":"#/components/schemas/AgentSchema"},{"type":"null"}],"description":"The agent schema, once the job is done."},"render":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Render","description":"Only with ?include=render on a done job: the raw v5 schema, page images blanked."}},"additionalProperties":false,"type":"object","required":["job_id","status","mode","phase","progress","pages","cost","created_at","template_id","error","result"],"title":"JobStatus"},"Recipient":{"properties":{"id":{"type":"string","title":"Id"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"url":{"type":"string","title":"Url"},"status":{"type":"string","enum":["pending","opened","completed","sent_back"],"title":"Status","description":"pending → opened → completed. `sent_back` is reserved (not yet emitted)."},"opened_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Opened At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"additionalProperties":false,"type":"object","required":["id","label","url","status","opened_at","completed_at","created_at","expires_at"],"title":"Recipient"},"RecipientCreate":{"properties":{"label":{"type":"string","maxLength":60,"minLength":1,"title":"Label","description":"Who the link is for, as the sender will see it (e.g. 'Anna K.')."},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At","description":"When the link stops working (ISO 8601, UTC if no offset). Omit for no expiry."}},"additionalProperties":false,"type":"object","required":["label"],"title":"RecipientCreate","description":"A new per-recipient magic link on a restricted template."},"RecipientList":{"properties":{"recipients":{"items":{"$ref":"#/components/schemas/Recipient"},"type":"array","title":"Recipients"}},"additionalProperties":false,"type":"object","required":["recipients"],"title":"RecipientList"},"RerunEstimate":{"properties":{"kind":{"type":"string","enum":["scratch","find","relabel","label_missing"],"title":"Kind"},"pages":{"items":{"type":"integer"},"type":"array","title":"Pages","description":"The 1-based pages the run would cover, sorted."},"cost":{"type":"integer","title":"Cost","description":"Page scans the run would charge now."},"free_label_pages":{"type":"integer","title":"Free Label Pages","description":"How many of `pages` the monthly free-label pages would cover (label_missing only)."},"free_label_pages_left":{"type":"integer","title":"Free Label Pages Left","description":"Free-label pages left this month after the run."},"scans_left":{"type":"integer","title":"Scans Left","description":"The workspace's page scans left now."},"insufficient":{"type":"boolean","title":"Insufficient","description":"true: the run would be refused with 402 insufficient_scans."}},"additionalProperties":false,"type":"object","required":["kind","pages","cost","free_label_pages","free_label_pages_left","scans_left","insufficient"],"title":"RerunEstimate"},"ScalarEntry":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"page":{"type":"integer","title":"Page"},"box":{"$ref":"#/components/schemas/Box"},"section":{"anyOf":[{"$ref":"#/components/schemas/SectionRef"},{"type":"null"}]},"required":{"type":"boolean","title":"Required"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"placeholder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Placeholder"},"autofill":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Autofill"},"type":{"type":"string","enum":["text","multiline","date","checkbox"],"title":"Type"},"date_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Format","description":"A date field's printed format (one of DD/MM/YYYY, MM/DD/YYYY, YYYY-MM-DD, DD.MM.YYYY, DD-MM-YYYY). Fill values stay ISO YYYY-MM-DD; the PDF prints this format."},"variant":{"anyOf":[{"type":"string","enum":["number","currency"]},{"type":"null"}],"title":"Variant","description":"A text field that takes a number or an amount; absent for plain text."}},"additionalProperties":false,"type":"object","required":["id","label","page","box","section","required","description","placeholder","autofill","type"],"title":"ScalarEntry"},"SectionRef":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"}},"additionalProperties":false,"type":"object","required":["id","title"],"title":"SectionRef"},"SignatureEntry":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"page":{"type":"integer","title":"Page"},"box":{"$ref":"#/components/schemas/Box"},"section":{"anyOf":[{"$ref":"#/components/schemas/SectionRef"},{"type":"null"}]},"required":{"type":"boolean","title":"Required"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"placeholder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Placeholder"},"autofill":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Autofill"},"type":{"type":"string","const":"signature","title":"Type"},"signing_requirement":{"type":"string","enum":["appearance","external"],"title":"Signing Requirement"}},"additionalProperties":false,"type":"object","required":["id","label","page","box","section","required","description","placeholder","autofill","type","signing_requirement"],"title":"SignatureEntry"},"TableCell":{"properties":{"id":{"type":"string","title":"Id"},"row":{"type":"integer","title":"Row"},"col":{"type":"integer","title":"Col"},"type":{"type":"string","enum":["text","multiline","date","checkbox","signature","comb"],"title":"Type"},"label":{"type":"string","title":"Label"},"date_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Format","description":"A date field's printed format (one of DD/MM/YYYY, MM/DD/YYYY, YYYY-MM-DD, DD.MM.YYYY, DD-MM-YYYY). Fill values stay ISO YYYY-MM-DD; the PDF prints this format."},"variant":{"anyOf":[{"type":"string","enum":["number","currency"]},{"type":"null"}],"title":"Variant","description":"A text field that takes a number or an amount; absent for plain text."}},"additionalProperties":false,"type":"object","required":["id","row","col","type","label"],"title":"TableCell"},"TableColumn":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"type":{"type":"string","enum":["text","multiline","date","checkbox","signature"],"title":"Type"},"date_format":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Format","description":"A date field's printed format (one of DD/MM/YYYY, MM/DD/YYYY, YYYY-MM-DD, DD.MM.YYYY, DD-MM-YYYY). Fill values stay ISO YYYY-MM-DD; the PDF prints this format."},"variant":{"anyOf":[{"type":"string","enum":["number","currency"]},{"type":"null"}],"title":"Variant","description":"A text field that takes a number or an amount; absent for plain text."}},"additionalProperties":false,"type":"object","required":["id","label","type"],"title":"TableColumn"},"TableEntry":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"page":{"type":"integer","title":"Page"},"box":{"$ref":"#/components/schemas/Box"},"section":{"anyOf":[{"$ref":"#/components/schemas/SectionRef"},{"type":"null"}]},"required":{"type":"boolean","title":"Required"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"placeholder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Placeholder"},"autofill":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Autofill"},"type":{"type":"string","const":"table","title":"Type"},"orientation":{"anyOf":[{"type":"string","enum":["col","row"]},{"type":"null"}],"title":"Orientation","description":"Which axis carries the data types: col = every column has one type (rows are labels), row = every row has one type."},"header_cols":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Header Cols","description":"Printed column headers."},"header_rows":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Header Rows","description":"Printed row labels."},"cells":{"items":{"$ref":"#/components/schemas/TableCell"},"type":"array","title":"Cells"}},"additionalProperties":false,"type":"object","required":["id","label","page","box","section","required","description","placeholder","autofill","type","cells"],"title":"TableEntry"},"TableRowsEntry":{"properties":{"id":{"type":"string","title":"Id"},"label":{"type":"string","title":"Label"},"page":{"type":"integer","title":"Page"},"box":{"$ref":"#/components/schemas/Box"},"section":{"anyOf":[{"$ref":"#/components/schemas/SectionRef"},{"type":"null"}]},"required":{"type":"boolean","title":"Required"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"placeholder":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Placeholder"},"autofill":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Autofill"},"type":{"type":"string","const":"table_rows","title":"Type"},"columns":{"items":{"$ref":"#/components/schemas/TableColumn"},"type":"array","title":"Columns"},"max_rows":{"type":"integer","title":"Max Rows"}},"additionalProperties":false,"type":"object","required":["id","label","page","box","section","required","description","placeholder","autofill","type","columns","max_rows"],"title":"TableRowsEntry"},"TemplateList":{"properties":{"templates":{"items":{"$ref":"#/components/schemas/TemplateSummary"},"type":"array","title":"Templates"},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Pass as ?cursor= for the next page; null at the end."}},"additionalProperties":false,"type":"object","required":["templates","next_cursor"],"title":"TemplateList"},"TemplateSummary":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"page_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Page Count"},"analyzed_pages":{"items":{"type":"integer"},"type":"array","title":"Analyzed Pages","description":"The 1-based pages an analysis has covered. A page missing here was never analyzed: POST /v1/templates/{id}/analyze with kind=scratch analyzes it."},"access":{"type":"string","enum":["public","restricted"],"title":"Access"},"status":{"type":"string","enum":["active","frozen"],"title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"additionalProperties":false,"type":"object","required":["id","name","page_count","analyzed_pages","access","status","created_at","updated_at"],"title":"TemplateSummary"},"TemplateUpdated":{"properties":{"template_id":{"type":"string","title":"Template Id"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"result":{"$ref":"#/components/schemas/AgentSchema"}},"additionalProperties":false,"type":"object","required":["template_id","updated_at","result"],"title":"TemplateUpdated"},"V5Cell":{"additionalProperties":false,"properties":{"x":{"maximum":10000,"minimum":-10000,"title":"X","type":"number"},"y":{"maximum":10000,"minimum":-10000,"title":"Y","type":"number"},"w":{"maximum":10000,"minimum":-10000,"title":"W","type":"number"},"h":{"maximum":10000,"minimum":-10000,"title":"H","type":"number"}},"required":["x","y","w","h"],"title":"Cell","type":"object"},"V5CheckboxFormat":{"additionalProperties":false,"properties":{"shape":{"$ref":"#/components/schemas/V5CheckboxShape","default":"square"},"symbol":{"default":"✗","maxLength":16,"title":"Symbol","type":"string"},"font_size":{"anyOf":[{"maximum":96,"minimum":6,"type":"number"},{"type":"null"}],"default":null,"title":"Font Size"}},"title":"CheckboxFormat","type":"object"},"V5CheckboxShape":{"enum":["square","round"],"title":"CheckboxShape","type":"string"},"V5ChoiceFormat":{"enum":["single","multiple"],"title":"ChoiceFormat","type":"string"},"V5DateFormat":{"additionalProperties":false,"properties":{"date_format":{"maxLength":64,"title":"Date Format","type":"string"},"font_size":{"anyOf":[{"maximum":96,"minimum":6,"type":"number"},{"type":"null"}],"default":null,"title":"Font Size"},"text_anchor":{"anyOf":[{"$ref":"#/components/schemas/V5TextAnchor"},{"type":"null"}],"default":null}},"required":["date_format"],"title":"DateFormat","type":"object"},"V5Field":{"additionalProperties":false,"properties":{"id":{"maxLength":200,"title":"Id","type":"string"},"label":{"maxLength":2000,"title":"Label","type":"string"},"type":{"$ref":"#/components/schemas/V5FieldType"},"format":{"anyOf":[{"$ref":"#/components/schemas/V5TextFormat"},{"$ref":"#/components/schemas/V5CheckboxFormat"},{"$ref":"#/components/schemas/V5DateFormat"},{"$ref":"#/components/schemas/V5SignatureFormat"},{"type":"null"}],"default":null,"title":"Format"},"primitive":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"title":"Primitive"},"page":{"title":"Page","type":"integer"},"section_id":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"title":"Section Id"},"xpct":{"maximum":10000,"minimum":-10000,"title":"Xpct","type":"number"},"ypct":{"maximum":10000,"minimum":-10000,"title":"Ypct","type":"number"},"wpct":{"maximum":10000,"minimum":-10000,"title":"Wpct","type":"number"},"hpct":{"maximum":10000,"minimum":-10000,"title":"Hpct","type":"number"},"cells":{"anyOf":[{"items":{"$ref":"#/components/schemas/V5Cell"},"type":"array"},{"type":"null"}],"default":null,"title":"Cells"},"group":{"anyOf":[{"maxLength":200,"type":"string"},{"type":"null"}],"default":null,"title":"Group"},"order":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Order"},"description":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}],"default":null,"title":"Description"},"placeholder":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}],"default":null,"title":"Placeholder"},"required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Required"},"autofill":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"title":"Autofill"},"signing_requirement":{"anyOf":[{"maxLength":32,"type":"string"},{"type":"null"}],"default":null,"title":"Signing Requirement"}},"required":["id","label","type","page","xpct","ypct","wpct","hpct"],"title":"Field","type":"object"},"V5FieldType":{"enum":["text","checkbox","date","signature"],"title":"FieldType","type":"string"},"V5Group":{"additionalProperties":false,"properties":{"id":{"maxLength":200,"title":"Id","type":"string"},"kind":{"$ref":"#/components/schemas/V5GroupKind"},"format":{"anyOf":[{"$ref":"#/components/schemas/V5ChoiceFormat"},{"$ref":"#/components/schemas/V5TableFormat"},{"type":"null"}],"default":null,"title":"Format"},"label":{"maxLength":2000,"title":"Label","type":"string"},"page":{"title":"Page","type":"integer"},"members":{"items":{"type":"string"},"maxItems":2000,"title":"Members","type":"array"},"cell_type":{"anyOf":[{"enum":["integer","char","date"],"type":"string"},{"type":"null"}],"default":null,"title":"Cell Type"},"date_format":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"title":"Date Format"},"orientation":{"anyOf":[{"enum":["col","row"],"type":"string"},{"type":"null"}],"default":null,"title":"Orientation"},"rows":{"anyOf":[{"maximum":1000,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"title":"Rows"},"cols":{"anyOf":[{"maximum":1000,"minimum":0,"type":"integer"},{"type":"null"}],"default":null,"title":"Cols"},"header_cols":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"title":"Header Cols"},"header_rows":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"default":null,"title":"Header Rows"},"grid":{"anyOf":[{"items":{"items":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":"array"},"type":"array"},{"type":"null"}],"default":null,"title":"Grid"},"order":{"anyOf":[{"type":"integer"},{"type":"null"}],"default":null,"title":"Order"},"description":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}],"default":null,"title":"Description"},"placeholder":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}],"default":null,"title":"Placeholder"},"required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Required"}},"required":["id","kind","label","page","members"],"title":"Group","type":"object"},"V5GroupKind":{"enum":["comb","choice","table"],"title":"GroupKind","type":"string"},"V5PageInfo":{"properties":{"page":{"title":"Page","type":"integer"},"width":{"title":"Width","type":"integer"},"height":{"title":"Height","type":"integer"},"image":{"maxLength":4096,"title":"Image","type":"string"},"sections":{"items":{"$ref":"#/components/schemas/V5Section"},"title":"Sections","type":"array"},"degraded":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Degraded"}},"required":["page","width","height","image"],"title":"PageInfo","type":"object","additionalProperties":false},"V5Section":{"additionalProperties":false,"properties":{"id":{"maxLength":200,"title":"Id","type":"string"},"title":{"maxLength":2000,"title":"Title","type":"string"},"description":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}],"default":null,"title":"Description"},"placeholder":{"anyOf":[{"maxLength":5000,"type":"string"},{"type":"null"}],"default":null,"title":"Placeholder"},"required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Required"}},"required":["id","title"],"title":"Section","type":"object"},"V5SignatureFormat":{"additionalProperties":false,"properties":{"scale":{"anyOf":[{"maximum":1.0,"minimum":0.25,"type":"number"},{"type":"null"}],"default":null,"title":"Scale"},"text_anchor":{"anyOf":[{"$ref":"#/components/schemas/V5TextAnchor"},{"type":"null"}],"default":null}},"title":"SignatureFormat","type":"object"},"V5TableFormat":{"enum":["classic","expandable","checkbox_matrix"],"title":"TableFormat","type":"string"},"V5TextAnchor":{"enum":["top-left","top-center","top-right","middle-left","middle-center","middle-right","bottom-left","bottom-center","bottom-right"],"title":"TextAnchor","type":"string"},"V5TextFormat":{"additionalProperties":false,"properties":{"variant":{"$ref":"#/components/schemas/V5TextVariant","default":"any"},"font_size":{"anyOf":[{"maximum":96,"minimum":6,"type":"number"},{"type":"null"}],"default":null,"title":"Font Size"},"text_anchor":{"anyOf":[{"$ref":"#/components/schemas/V5TextAnchor"},{"type":"null"}],"default":null},"uppercase":{"anyOf":[{"type":"boolean"},{"type":"null"}],"default":null,"title":"Uppercase"}},"title":"TextFormat","type":"object"},"V5TextVariant":{"enum":["any","number","currency","multiline"],"title":"TextVariant","type":"string"},"V5TemplateSchema":{"additionalProperties":false,"properties":{"version":{"default":5,"title":"Version","type":"integer"},"pages":{"items":{"$ref":"#/components/schemas/V5PageInfo"},"title":"Pages","type":"array"},"fields":{"items":{"$ref":"#/components/schemas/V5Field"},"maxItems":5000,"title":"Fields","type":"array"},"groups":{"items":{"$ref":"#/components/schemas/V5Group"},"maxItems":2000,"title":"Groups","type":"array"}},"required":["pages","fields","groups"],"title":"TemplateSchema","type":"object"},"TemplateUpdate":{"additionalProperties":false,"description":"PATCH /v1/templates/{id}: the edited v5 schema + the `updated_at` it was based on.","properties":{"schema":{"$ref":"#/components/schemas/V5TemplateSchema","description":"The full v5 template schema, as GET /v1/templates/{id}?include=render returns it, edited. Taken from it: `fields`, `groups` and each page's `sections`. Everything else (the page list, page images and sizes) stays the server's; the page count and `version` (5) must match."},"expected_updated_at":{"description":"The template's `updated_at` the edit is based on (from GET). A newer one is 409.","format":"date-time","maxLength":64,"title":"Expected Updated At","type":"string"}},"required":["schema","expected_updated_at"],"title":"TemplateUpdate","type":"object"},"TemplateAnalyze":{"additionalProperties":false,"description":"POST /v1/templates/{id}/analyze: re-analyze pages of a saved template, using\nthe blank PDF already stored with it (nothing is uploaded).","properties":{"pages":{"description":"The 1-based pages to analyze, e.g. \"2\" or \"1-3,5\".","maxLength":256,"minLength":1,"title":"Pages","type":"string"},"kind":{"anyOf":[{"enum":["scratch","find","relabel","label_missing"],"type":"string"},{"type":"null"}],"default":null,"description":"`scratch`: analyze the pages from nothing, replacing their fields, groups and sections (for a page never analyzed, or one whose layout is wrong). `find`: add blanks the first pass missed, keeping everything there (deleted items stay deleted). `relabel`: re-derive labels, types, groups and sections, keeping the geometry. `label_missing`: fill in only missing labels (free within the monthly free-label pages, then one scan per page). The others cost one scan per page. Omitted: `scratch`, allowed only when every chosen page has no fields.","title":"Kind"},"expected_updated_at":{"anyOf":[{"maxLength":64,"type":"string"},{"type":"null"}],"default":null,"description":"The template's `updated_at` from GET. Required unless `estimate` is true; a newer one is 409 template_conflict.","format":"date-time","title":"Expected Updated At"},"estimate":{"default":false,"description":"true: price the run (200 RerunEstimate) and start nothing.","title":"Estimate","type":"boolean"}},"required":["pages"],"title":"TemplateAnalyze","type":"object"}},"securitySchemes":{"ApiKey":{"type":"http","description":"A workspace API key: `Authorization: Bearer ff_live_…` (Settings → API keys).","scheme":"bearer"}}},"tags":[{"name":"forms","description":"Analyze a blank PDF form into a fillable schema, or download a template as a fillable PDF."},{"name":"jobs","description":"Poll an analyze job and fetch its result."},{"name":"templates","description":"The workspace's templates: their agent schemas and blank PDFs."},{"name":"recipients","description":"Per-recipient magic links on restricted templates."},{"name":"account","description":"The workspace behind the API key: plan, limits and branding."}]}