{"openapi":"3.1.0","info":{"title":"Pepper ParseDocs API","description":"\nTurn a faxed or scanned clinical PDF into structured findings, each linked to the page and printed line that supports it.\n\n**Authentication.** Send your API key as `Authorization: Bearer pd_test_...`. Create and rotate keys in the workspace under API.\n\n**Flow.** `POST /v1/parse` uploads a PDF and starts a job. Poll `GET /v1/jobs/{id}` until `status` is `completed`, then read\n`GET /v1/jobs/{id}/result`. Long documents process in the background; nothing blocks the request.\n\n**Credit.** A job reserves its price when it starts and is charged once, when it completes. Failed jobs are not charged and retrying is free.\nIf credit does not cover a job the answer is `402`: the job is saved as `pending_funds` and starts by itself once credit is available.\n\n**Patient data.** Every upload declares `data_class`. Until an account has a signed agreement, approval and billing in place, only\n`deidentified` files (synthetic, or de-identified before upload) are accepted; `patient` uploads are refused before the file is read.\n\n**Errors.** Every error is `{\"error\": {\"code\", \"message\", \"request_id\", \"details\"}}`. `code` is stable; `message` says what to do next.\n","version":"1.0.0"},"servers":[{"url":"https://parsedocs.tathya.ai","description":"This instance"}],"paths":{"/v1/pricing":{"get":{"tags":["Reference"],"summary":"Prices, credit packs and billing rules","operationId":"get_pricing_v1_pricing_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Pricing V1 Pricing Get"}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/v1/examples":{"get":{"tags":["Reference"],"summary":"Built-in fictional example documents","operationId":"list_examples_v1_examples_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Examples V1 Examples Get"}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"security":[]}},"/v1/account":{"get":{"tags":["Account"],"summary":"Plan, what the account may do, and credit","operationId":"get_account_v1_account_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Account V1 Account Get"}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"tags":["Account"],"summary":"Credit balance and ledger entries","operationId":"get_usage_v1_usage_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Usage V1 Usage Get"}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/estimate":{"post":{"tags":["Jobs"],"summary":"Price of a job before you run it","operationId":"post_estimate_v1_estimate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Post Estimate V1 Estimate Post"}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/documents":{"post":{"tags":["Documents"],"summary":"Upload a PDF","operationId":"upload_document_v1_documents_post","responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"Missing data_class, or not a readable PDF (invalid_pdf, encrypted_pdf).","content":{"application/json":{"example":{"error":{"code":"data_class_required","message":"Say what this file is before sending it."}}}}},"403":{"description":"Patient data is not enabled for this account (baa_required). Nothing was received.","content":{"application/json":{"example":{"error":{"code":"baa_required","message":"Patient documents cannot be received on this account yet. Nothing was uploaded."}}}}},"413":{"description":"File too large or too many pages."}},"parameters":[{"name":"data_class","in":"query","required":true,"schema":{"type":"string","enum":["deidentified","patient"]},"description":"What the file is. `deidentified`: you state it contains no patient information (synthetic, or de-identified before upload). `patient`: refused with baa_required unless the account is enabled for patient data. The check happens before the file is read."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}}},"get":{"tags":["Documents"],"summary":"List uploaded documents","operationId":"list_documents_v1_documents_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Documents V1 Documents Get"}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/documents/{document_id}":{"get":{"tags":["Documents"],"summary":"One document","operationId":"get_document_v1_documents__document_id__get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Document V1 Documents  Document Id  Get"}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Documents"],"summary":"Delete a document and its stored file","operationId":"delete_document_v1_documents__document_id__delete","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Delete Document V1 Documents  Document Id  Delete"}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/documents/{document_id}/content":{"get":{"tags":["Documents"],"summary":"The original PDF","operationId":"get_document_content_v1_documents__document_id__content_get","parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/parse":{"post":{"tags":["Jobs"],"summary":"Upload a PDF and start parsing it in one call","operationId":"parse_v1_parse_post","responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"402":{"description":"The job is saved but not started: credit does not cover it. Nothing was charged. It starts automatically once credit is available (code insufficient_credit) or once payment and the agreement are complete (code upgrade_required).","content":{"application/json":{"example":{"error":{"code":"upgrade_required","message":"Your document is saved and nothing was charged...","details":{"job":{"id":"job_3fK...","status":"pending_funds"},"estimate":"$1.20","available_credit":"$0.14","action":"Continue with payment and BAA","action_url":"https://parsedocs.tathya.ai/app/upgrade"}}}}}},"409":{"description":"Idempotency-Key reused for a different request, or an account limit was reached."},"503":{"description":"Fresh processing is not available in this environment (engine_unavailable)."},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"data_class","in":"query","required":true,"schema":{"type":"string","enum":["deidentified","patient"]},"description":"What the file is. `deidentified`: you state it contains no patient information (synthetic, or de-identified before upload). `patient`: refused with baa_required unless the account is enabled for patient data. The check happens before the file is read."},{"name":"tier","in":"query","required":false,"schema":{"type":"string","enum":["standard","premium"],"default":"standard"}},{"name":"webhook_url","in":"query","required":false,"schema":{"type":"string"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Any unique string. Repeating the request with the same key returns the same job and never charges twice. Reusing a key for a different request is answered 409 idempotency_key_reused."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}},"required":["file"]}},"application/pdf":{"schema":{"type":"string","format":"binary"}}}}}},"/v1/jobs":{"post":{"tags":["Jobs"],"summary":"Start parsing an uploaded document or a built-in example","operationId":"create_job_v1_jobs_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"402":{"description":"The job is saved but not started: credit does not cover it. Nothing was charged. It starts automatically once credit is available (code insufficient_credit) or once payment and the agreement are complete (code upgrade_required).","content":{"application/json":{"example":{"error":{"code":"upgrade_required","message":"Your document is saved and nothing was charged...","details":{"job":{"id":"job_3fK...","status":"pending_funds"},"estimate":"$1.20","available_credit":"$0.14","action":"Continue with payment and BAA","action_url":"https://parsedocs.tathya.ai/app/upgrade"}}}}}},"409":{"description":"Idempotency-Key reused for a different request, or an account limit was reached."},"503":{"description":"Fresh processing is not available in this environment (engine_unavailable)."},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Any unique string. Repeating the request with the same key returns the same job and never charges twice. Reusing a key for a different request is answered 409 idempotency_key_reused."}]},"get":{"tags":["Jobs"],"summary":"List jobs, newest first","operationId":"list_jobs_v1_jobs_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"before","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Before"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Jobs V1 Jobs Get"}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{job_id}":{"get":{"tags":["Jobs"],"summary":"Job status and progress","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":{"type":"object","additionalProperties":true,"title":"Response Get Job V1 Jobs  Job Id  Get"}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{job_id}/cancel":{"post":{"tags":["Jobs"],"summary":"Cancel a waiting or running job (never charged)","operationId":"cancel_job_v1_jobs__job_id__cancel_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Cancel Job V1 Jobs  Job Id  Cancel Post"}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{job_id}/retry":{"post":{"tags":["Jobs"],"summary":"Retry a failed job (free)","operationId":"retry_job_v1_jobs__job_id__retry_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"402":{"description":"The job is saved but not started: credit does not cover it. Nothing was charged. It starts automatically once credit is available (code insufficient_credit) or once payment and the agreement are complete (code upgrade_required).","content":{"application/json":{"example":{"error":{"code":"upgrade_required","message":"Your document is saved and nothing was charged...","details":{"job":{"id":"job_3fK...","status":"pending_funds"},"estimate":"$1.20","available_credit":"$0.14","action":"Continue with payment and BAA","action_url":"https://parsedocs.tathya.ai/app/upgrade"}}}}}},"409":{"description":"Idempotency-Key reused for a different request, or an account limit was reached."},"503":{"description":"Fresh processing is not available in this environment (engine_unavailable)."},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{job_id}/result":{"get":{"tags":["Results"],"summary":"The structured result with source evidence","operationId":"get_result_v1_jobs__job_id__result_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Result V1 Jobs  Job Id  Result Get"}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"409":{"description":"The job has not completed (job_not_ready)."},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{job_id}/result.csv":{"get":{"tags":["Results"],"summary":"Findings as CSV","operationId":"get_result_csv_v1_jobs__job_id__result_csv_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"version","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Version"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{job_id}/versions":{"get":{"tags":["Results"],"summary":"Result versions (engine output and each staff review)","operationId":"get_versions_v1_jobs__job_id__versions_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Versions V1 Jobs  Job Id  Versions Get"}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{job_id}/review":{"post":{"tags":["Results"],"summary":"Accept, correct, hold or reject findings; saved as a new version","operationId":"post_review_v1_jobs__job_id__review_post","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Post Review V1 Jobs  Job Id  Review Post"}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"409":{"description":"Someone saved a newer version first (version_conflict)."},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/jobs/{job_id}/pages/{number}.png":{"get":{"tags":["Results"],"summary":"An image of one source page","operationId":"get_page_image_v1_jobs__job_id__pages__number__png_get","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}},{"name":"number","in":"path","required":true,"schema":{"type":"integer","title":"Number"}},{"name":"dpi","in":"query","required":false,"schema":{"type":"integer","default":110,"title":"Dpi"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"401":{"description":"Missing, invalid, expired or revoked API key.","content":{"application/json":{"example":{"error":{"code":"unauthenticated","message":"Sign in, or send a valid API key in the Authorization header."}}}}},"404":{"description":"Not found in this account.","content":{"application/json":{"example":{"error":{"code":"not_found","message":"That job was not found in this account."}}}}},"429":{"description":"Too many requests.","content":{"application/json":{"example":{"error":{"code":"rate_limited","message":"Slow down and retry.","details":{"retry_after_seconds":10}}}}}},"400":{"description":"The request is not valid. `error.code` is validation_error (or a more specific code) and `error.message` says what to fix.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"EstimateRequest":{"properties":{"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id"},"pages":{"anyOf":[{"type":"integer","maximum":150.0,"minimum":1.0},{"type":"null"}],"title":"Pages"},"tier":{"type":"string","title":"Tier","default":"standard"}},"type":"object","title":"EstimateRequest"},"JobCreate":{"properties":{"document_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Document Id","description":"A document you uploaded with POST /v1/documents."},"example_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Example Id","description":"A built-in fictional example, instead of document_id."},"tier":{"type":"string","title":"Tier","description":"standard or premium","default":"standard"},"webhook_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Webhook Url","description":"Optional https endpoint to notify when the job finishes."},"metadata":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Metadata","description":"Up to 20 short text values returned with the job."},"force":{"type":"boolean","title":"Force","description":"Process and pay again even though this document already has a completed result at this tier.","default":false}},"type":"object","title":"JobCreate"},"ReviewRequest":{"properties":{"base_version":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Base Version","description":"The result version you were looking at; a newer one makes the request fail with version_conflict."},"actions":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Actions"}},"type":"object","required":["actions"],"title":"ReviewRequest"},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"A stable identifier to branch on, for example validation_error or upgrade_required."},"message":{"type":"string","description":"What happened and what to do next, in plain words."},"request_id":{"type":"string"},"details":{"type":"object","additionalProperties":true}}}}}},"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"An API key from your account page, sent as `Authorization: Bearer pd_test_...`. The workspace uses a session cookie instead."}}},"tags":[{"name":"Jobs"},{"name":"Results"},{"name":"Documents"},{"name":"Account"},{"name":"Reference"}],"security":[{"apiKey":[]}]}