{"openapi":"3.1.0","info":{"title":"Forms API","version":"0.1.0"},"paths":{"/":{"get":{"summary":"Health Check","description":"Health check endpoint for deployment verification.","operationId":"health_check__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/fill":{"post":{"summary":"Fill Form","description":"Enqueue a PDF fill job (async-only).\n\nRequires:\n- file_id: UUID of parsed file (from /parse, must be succeeded)\n- prompt: Natural language instructions\n\nReturns 202 with job_id and fill_id. Client polls GET /fill/{job_id}.","operationId":"fill_form_fill_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_fill_form_fill_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/fill/{job_id}":{"get":{"summary":"Get Fill Status","description":"Poll fill job status.\n\nReturns:\n- status: queued|running|succeeded|failed\n- error: error message if failed\n- fill_id: fills.id\n- download_url: shareable URL when succeeded\n- expires_at: download link expiration","operationId":"get_fill_status_fill__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/download/{token}":{"get":{"summary":"Download Shared File","description":"Download a file using a secure share token.\n\nThe token must be valid and not expired. No authentication required\nas the token itself provides access control.\n\nArgs:\n    token: Secure random token from file share\n    \nReturns:\n    PDF file as attachment with proper headers\n    \nRaises:\n    404: Token not found\n    410: Token has expired\n    500: Storage download failed","operationId":"download_shared_file_download__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/parse":{"post":{"summary":"Parse Form","description":"Enqueue a PDF parse job (async-only).\n\nAuthentication: X-API-Key header.\n\nFlow:\n1. Read and hash file\n2. Check cache\n3. Upload input.pdf to S3\n4. Insert DB record (get file_id)\n5. Create parse job (queued)\n6. Return 202 + job_id (client polls GET /parse/{job_id})","operationId":"parse_form_parse_post","parameters":[{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_parse_form_parse_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/parse/{job_id}":{"get":{"summary":"Get Parse Status","description":"Poll parse job status.\n\nReturns:\n- status: queued|running|succeeded|failed\n- error: error message if failed\n- file_id: parsed_files.id\n- record: parsed_files row (includes s3_repr_path when available)","operationId":"get_parse_status_parse__job_id__get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"X-API-Key","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Api-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Body_fill_form_fill_post":{"properties":{"file_id":{"type":"string","title":"File Id"},"prompt":{"type":"string","title":"Prompt"}},"type":"object","required":["file_id","prompt"],"title":"Body_fill_form_fill_post"},"Body_parse_form_parse_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"},"force":{"type":"boolean","title":"Force","default":false}},"type":"object","required":["file"],"title":"Body_parse_form_parse_post"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}
