{ "error": "duplicate_document", "message": "This file is already on this profile", "document_id": "f8a1b2c3-d4e5-4f6a-8b8c-9d0e1f2a3b4c"}
Upload one file to a profile. Send it as multipart/form-data. Without extract_results, Aniva only
stores the file. With extract_results: true, Aniva also reads the lab values out of the file.You do not say what kind of report the file is. Aniva decides. A file without lab results, such as
a doctor’s letter, ends as stored and is not an error.Read the values with Get Document Results. You do not need to
poll: subscribe to the document.results.*webhooks.Requires the documents_upload scope on a profile group of the profile. extract_results: true
also requires the documents_extract_results scope on the same group. Ask Aniva to add them. The
document belongs to that group: keys with results_view on it read the document and its results.Send an optional Idempotency-Key header to make the upload safe to retry. See
Idempotency.
Aniva sends the file to its OCR and AI subprocessors to read the values.
The values appear in the member’s Aniva app, like every other result.
Each value carries origin: partner_upload and the same status as every other result. A value
Aniva’s automatic check doubts has status likely_wrong.
Without it, the file goes to no outside service when you also send document_date.
Accuracy and data protection
Automated reading can misread a value, a unit or a date. The original file stays the source of
truth. Check a value against it before you use it for a medical decision. Extracted values are
not a diagnosis.
The subprocessors are Mistral AI (OCR, EU) and Google Cloud Vertex AI, reached through the
Vercel AI Gateway (extraction, may process outside the EU). They process the file only to read
it.
You need a legal basis to upload a member’s health data, normally the member’s explicit
consent. You are responsible for it.
A form field is invalid, or the body is not multipart/form-data.
403
Your API key lacks a scope, the profile is outside your access context, or you sent extract_results: true without documents_extract_results.
404
Profile not found.
409
duplicate_document: the same file is already on this profile. document_id names it, or is null when you cannot read it. Also sent for an Idempotency-Key conflict.
413
file_too_large: the file is over 4 MB.
415
unsupported_media_type: the file is not a PDF, DOC, DOCX, PNG or JPEG. The file name must end in .pdf, .doc, .docx, .png, .jpg or .jpeg.
500
Internal server error. extraction_not_started: the file is stored as document_id, but extraction could not start. Contact Aniva.
{ "error": "duplicate_document", "message": "This file is already on this profile", "document_id": "f8a1b2c3-d4e5-4f6a-8b8c-9d0e1f2a3b4c"}
{"docsConfig":{"theme":"luma","$schema":"https://mintlify.com/docs.json","name":"Aniva Partner API","description":"REST API for lab testing in Germany and the EU: book blood draws at pharmacies and practices, ship home test kits, and get lab results.","colors":{"primary":"#e76c2b","light":"#e76c2b","dark":"#e76c2b"},"logo":"https://mintcdn.com/anivahealth/kdSs24SJO7DtrSol/images/asterisk-orange.svg?fit=max\u0026auto=format\u0026n=kdSs24SJO7DtrSol\u0026q=85\u0026s=b532223864bd76629cafac2434daecf7","favicon":"https://mintcdn.com/anivahealth/kdSs24SJO7DtrSol/images/icon.png?fit=max\u0026auto=format\u0026n=kdSs24SJO7DtrSol\u0026q=85\u0026s=529abd0ef8047c2c77676bd6526803ad","api":{"openapi":"https://anivahealth.com/api/v1/openapi.json","mdx":{"auth":{"method":"key","name":"x-api-key"}}},"navbar":{"links":[{"href":"/changelog","label":"Changelog"},{"href":"/status","label":"Status"}]},"footer":{"links":[{"items":[{"label":"Aniva Diagnostics","href":"https://anivahealth.com/diagnostics"},{"label":"hello@anivahealth.com","href":"mailto:hello@anivahealth.com"}]}]},"seo":{"metatags":{"og:locale":"en_US","og:site_name":"Aniva Partner API","keywords":"blood test API, lab testing API, home test kit API, lab results API, biomarker API, pharmacy blood test, Germany, EU"},"indexing":"navigable"},"fonts":{"heading":{"family":"Switzer","weight":600,"source":"https://anivahealth.com/fonts/Switzer-Variable.woff2","format":"woff2"},"body":{"family":"Switzer","source":"https://anivahealth.com/fonts/Switzer-Variable.woff2","format":"woff2"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"anivahealth","hasAudioNarration":false,"actualSubdomain":"anivahealth","customDomains":["docs.anivahealth.com"],"gitSource":{"type":"github","owner":"anivahealth","repo":"web","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6adcd6a4841101911046aa9c","collectionId":"f1d47d6e-7816-4488-b62b-27e508877daf","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6adcd6a4841101911046aa9c"},"entitlements":{},"buildId":"6adcd6a4841101911046aa9c","clientVersion":"0.0.3965","searchFilterCounts":[{"language":"default","tag":"API Reference","count":62},{"language":"default","tag":"Documentation","count":17},{"language":"default","tag":"Appointments","count":13},{"language":"default","tag":"Home Kit Orders","count":10},{"language":"default","tag":"Webhooks","count":9},{"language":"default","tag":"Core Concepts","count":9},{"language":"default","tag":"Shipments","count":8},{"language":"default","tag":"Locations","count":5},{"language":"default","tag":"Get Started","count":5},{"language":"default","tag":"Documents","count":4}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"[data-component-part=update-label]{background:0 0;color:rgb(107 114 128);padding-left:.25rem;padding-right:0;font-weight:400}.dark [data-component-part=update-label]{color:rgb(156 163 175)}[data-component-part=update-tag-list]{margin-top:.25rem;column-gap:.25rem}[data-component-part=update-tag]:not(:last-child)::after{content:'·';margin-left:.25rem}#footer>div>.h-px,[data-assistant-bar].invisible,[data-component-part=update-content] h2>.absolute{display:none}#content{margin-bottom:2rem}#footer>div{flex-direction:row;flex-wrap:wrap;align-items:center;gap:1rem 2rem;padding-top:5rem;padding-bottom:3rem}#footer>div>div:first-child{flex:1;flex-direction:row;align-items:center;min-height:0}#footer>div>div:first-child>div:last-child{display:flex;justify-content:flex-end}#footer>div>div:first-child>div:last-child>div{align-items:flex-end}#footer>div>div:first-child>div:last-child>div>div{flex-direction:row;gap:1.5rem}#footer>div>div:first-child a{max-width:none}#footer>div>div:last-child{gap:1.5rem}"}],"page":{"pagePath":"api/documents/upload-document","slug":"/api/documents/upload-document","pageMetadata":{"title":"Upload Document","description":"Upload a lab report or any other document to a profile, and optionally extract its lab values","api":"POST https://anivahealth.com/api/v1/documents","href":"/api/documents/upload-document"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Upload a lab report or any other document to a profile, and optionally extract its lab values\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,Heading,ParamField,ResponseField,Table}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Upload one file to a profile. Send it as `,_jsx(_components.code,{children:`multipart/form-data`}),`. Without `,_jsx(_components.code,{children:`extract_results`}),`, Aniva only\nstores the file. With `,_jsx(_components.code,{children:`extract_results: true`}),`, Aniva also reads the lab values out of the file.`]}),`\n`,_jsxs(_components.p,{children:[`You do not say what kind of report the file is. Aniva decides. A file without lab results, such as\na doctor’s letter, ends as `,_jsx(_components.code,{children:`stored`}),` and is not an error.`]}),`\n`,_jsxs(_components.p,{children:[`Read the values with `,_jsx(_components.a,{href:`/api/documents/get-document-results`,children:`Get Document Results`}),`. You do not need to\npoll: subscribe to the `,_jsx(_components.code,{children:`document.results.*`}),` `,_jsx(_components.a,{href:`/concepts/webhooks`,children:`webhooks`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Requires the `,_jsx(_components.code,{children:`documents_upload`}),` scope on a profile group of the profile. `,_jsx(_components.code,{children:`extract_results: true`}),`\nalso requires the `,_jsx(_components.code,{children:`documents_extract_results`}),` scope on the same group. Ask Aniva to add them. The\ndocument belongs to that group: keys with `,_jsx(_components.code,{children:`results_view`}),` on it read the document and its results.`]}),`\n`,_jsxs(_components.p,{children:[`Send an optional `,_jsx(_components.code,{children:`Idempotency-Key`}),` header to make the upload safe to retry. See\n`,_jsx(_components.a,{href:`/concepts/idempotency`,children:`Idempotency`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`what-extraction-does`,children:`What extraction does`}),`\n`,_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`extract_results: true`}),`:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Aniva sends the file to its OCR and AI subprocessors to read the values.`}),`\n`,_jsx(_components.li,{children:`The values appear in the member’s Aniva app, like every other result.`}),`\n`,_jsxs(_components.li,{children:[`Each value carries `,_jsx(_components.code,{children:`origin: partner_upload`}),` and the same `,_jsx(_components.code,{children:`status`}),` as every other result. A value\nAniva’s automatic check doubts has status `,_jsx(_components.code,{children:`likely_wrong`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Without it, the file goes to no outside service when you also send `,_jsx(_components.code,{children:`document_date`}),`.`]}),`\n`,_jsx(Accordion,{title:`Accuracy and data protection`,id:`accuracy-and-data-protection`,children:_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Automated reading can misread a value, a unit or a date. The original file stays the source of\ntruth. Check a value against it before you use it for a medical decision. Extracted values are\nnot a diagnosis.`}),`\n`,_jsx(_components.li,{children:`The subprocessors are Mistral AI (OCR, EU) and Google Cloud Vertex AI, reached through the\nVercel AI Gateway (extraction, may process outside the EU). They process the file only to read\nit.`}),`\n`,_jsx(_components.li,{children:`You need a legal basis to upload a member’s health data, normally the member’s explicit\nconsent. You are responsible for it.`}),`\n`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsx(Heading,{level:`3`,id:`form-fields`,children:`Form fields`}),`\n`,_jsx(ParamField,{body:`file`,type:`file`,required:true,id:`param-file`,children:_jsx(_components.p,{children:`The file. PDF, DOC, DOCX, PNG or JPEG, at most 4 MB.`})}),`\n`,_jsx(ParamField,{body:`profile_id`,type:`string`,required:true,id:`param-profile-id`,children:_jsx(_components.p,{children:`UUID of the profile the document belongs to.`})}),`\n`,_jsx(ParamField,{body:`extract_results`,type:`boolean`,default:`false`,id:`param-extract-results`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` to read the lab values out of the file. Send `,_jsx(_components.code,{children:`true`}),` or `,_jsx(_components.code,{children:`false`}),`.`]})}),`\n`,_jsx(ParamField,{body:`document_date`,type:`string`,id:`param-document-date`,children:_jsxs(_components.p,{children:[`The sample date in `,_jsx(_components.code,{children:`YYYY-MM-DD`}),` format, when you know it. Without it, Aniva reads the date from the\nfile.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`The API returns `,_jsx(_components.code,{children:`201 Created`}),` when it only stored the file, and `,_jsx(_components.code,{children:`202 Accepted`}),` when extraction runs.`]}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id`,children:_jsxs(_components.p,{children:[`Document ID (UUID). Use it with `,_jsx(_components.a,{href:`/api/documents/get-document-results`,children:`Get Document Results`}),` and\n`,_jsx(_components.a,{href:`/api/documents/download-document`,children:`Download Document`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,required:true,id:`param-status`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`processing`}),` while Aniva extracts the values, or `,_jsx(_components.code,{children:`stored`}),` when the file is only stored.`]})}),`\n`,_jsx(ResponseField,{name:`profile_id`,type:`string`,required:true,id:`param-profile-id-1`,children:_jsx(_components.p,{children:`The profile the document belongs to.`})}),`\n`,_jsx(ResponseField,{name:`document_date`,type:`string`,id:`param-document-date-1`,children:_jsxs(_components.p,{children:[`The sample date you sent, or the one Aniva read from a stored file. May be `,_jsx(_components.code,{children:`null`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`results_url`,type:`string`,required:true,id:`param-results-url`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/api/documents/get-document-results`,children:`Get Document Results`}),` URL of this document.`]})}),`\n`,_jsx(ResponseField,{name:`file_name`,type:`string`,required:true,id:`param-file-name`,children:_jsxs(_components.p,{children:[`File name for display, the same one `,_jsx(_components.a,{href:`/api/documents/download-document`,children:`Download Document`}),` sends.`]})}),`\n`,_jsx(ResponseField,{name:`original_file_name`,type:`string`,required:true,id:`param-original-file-name`,children:_jsx(_components.p,{children:`The file name you uploaded.`})}),`\n`,_jsx(ResponseField,{name:`origin`,type:`string`,required:true,id:`param-origin`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`partner_upload`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`content_type`,type:`string`,required:true,id:`param-content-type`,children:_jsxs(_components.p,{children:[`Media type of the file, e.g. `,_jsx(_components.code,{children:`application/pdf`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`etag`,type:`string`,id:`param-etag`,children:_jsxs(_components.p,{children:[`Version of the file content. May be `,_jsx(_components.code,{children:`null`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`size_bytes`,type:`integer`,id:`param-size-bytes`,children:_jsxs(_components.p,{children:[`File size in bytes. May be `,_jsx(_components.code,{children:`null`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`lab_code`,type:`string`,id:`param-lab-code`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`null`}),` for an uploaded document.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`error-responses`,children:`Error responses`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsxs(_components.td,{children:[`A form field is invalid, or the body is not `,_jsx(_components.code,{children:`multipart/form-data`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`403`})}),_jsxs(_components.td,{children:[`Your API key lacks a scope, the profile is outside your access context, or you sent `,_jsx(_components.code,{children:`extract_results: true`}),` without `,_jsx(_components.code,{children:`documents_extract_results`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`404`})}),_jsx(_components.td,{children:`Profile not found.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`409`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`duplicate_document`}),`: the same file is already on this profile. `,_jsx(_components.code,{children:`document_id`}),` names it, or is `,_jsx(_components.code,{children:`null`}),` when you cannot read it. Also sent for an `,_jsx(_components.code,{children:`Idempotency-Key`}),` conflict.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`413`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`file_too_large`}),`: the file is over 4 MB.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`415`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`unsupported_media_type`}),`: the file is not a PDF, DOC, DOCX, PNG or JPEG. The file name must end in `,_jsx(_components.code,{children:`.pdf`}),`, `,_jsx(_components.code,{children:`.doc`}),`, `,_jsx(_components.code,{children:`.docx`}),`, `,_jsx(_components.code,{children:`.png`}),`, `,_jsx(_components.code,{children:`.jpg`}),` or `,_jsx(_components.code,{children:`.jpeg`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`500`})}),_jsxs(_components.td,{children:[`Internal server error. `,_jsx(_components.code,{children:`extraction_not_started`}),`: the file is stored as `,_jsx(_components.code,{children:`document_id`}),`, but extraction could not start. Contact Aniva.`]})]})]})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Upload Document","description":"Upload a lab report or any other document to a profile, and optionally extract its lab values","api":"POST https://anivahealth.com/api/v1/documents","href":"/api/documents/upload-document"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Accordion,CodeBlock,Heading,ParamField,RequestExample,ResponseExample,ResponseField,Table}=_components;if(!Accordion)_missingMdxReference(`Accordion`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Upload one file to a profile. Send it as `,_jsx(_components.code,{children:`multipart/form-data`}),`. Without `,_jsx(_components.code,{children:`extract_results`}),`, Aniva only\nstores the file. With `,_jsx(_components.code,{children:`extract_results: true`}),`, Aniva also reads the lab values out of the file.`]}),`\n`,_jsxs(_components.p,{children:[`You do not say what kind of report the file is. Aniva decides. A file without lab results, such as\na doctor’s letter, ends as `,_jsx(_components.code,{children:`stored`}),` and is not an error.`]}),`\n`,_jsxs(_components.p,{children:[`Read the values with `,_jsx(_components.a,{href:`/api/documents/get-document-results`,children:`Get Document Results`}),`. You do not need to\npoll: subscribe to the `,_jsx(_components.code,{children:`document.results.*`}),` `,_jsx(_components.a,{href:`/concepts/webhooks`,children:`webhooks`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Requires the `,_jsx(_components.code,{children:`documents_upload`}),` scope on a profile group of the profile. `,_jsx(_components.code,{children:`extract_results: true`}),`\nalso requires the `,_jsx(_components.code,{children:`documents_extract_results`}),` scope on the same group. Ask Aniva to add them. The\ndocument belongs to that group: keys with `,_jsx(_components.code,{children:`results_view`}),` on it read the document and its results.`]}),`\n`,_jsxs(_components.p,{children:[`Send an optional `,_jsx(_components.code,{children:`Idempotency-Key`}),` header to make the upload safe to retry. See\n`,_jsx(_components.a,{href:`/concepts/idempotency`,children:`Idempotency`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`what-extraction-does`,children:`What extraction does`}),`\n`,_jsxs(_components.p,{children:[`With `,_jsx(_components.code,{children:`extract_results: true`}),`:`]}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsx(_components.li,{children:`Aniva sends the file to its OCR and AI subprocessors to read the values.`}),`\n`,_jsx(_components.li,{children:`The values appear in the member’s Aniva app, like every other result.`}),`\n`,_jsxs(_components.li,{children:[`Each value carries `,_jsx(_components.code,{children:`origin: partner_upload`}),` and the same `,_jsx(_components.code,{children:`status`}),` as every other result. A value\nAniva’s automatic check doubts has status `,_jsx(_components.code,{children:`likely_wrong`}),`.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Without it, the file goes to no outside service when you also send `,_jsx(_components.code,{children:`document_date`}),`.`]}),`\n`,_jsx(Accordion,{title:`Accuracy and data protection`,id:`accuracy-and-data-protection`,children:_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Automated reading can misread a value, a unit or a date. The original file stays the source of\ntruth. Check a value against it before you use it for a medical decision. Extracted values are\nnot a diagnosis.`}),`\n`,_jsx(_components.li,{children:`The subprocessors are Mistral AI (OCR, EU) and Google Cloud Vertex AI, reached through the\nVercel AI Gateway (extraction, may process outside the EU). They process the file only to read\nit.`}),`\n`,_jsx(_components.li,{children:`You need a legal basis to upload a member’s health data, normally the member’s explicit\nconsent. You are responsible for it.`}),`\n`]})}),`\n`,_jsx(Heading,{level:`2`,id:`request`,children:`Request`}),`\n`,_jsx(Heading,{level:`3`,id:`form-fields`,children:`Form fields`}),`\n`,_jsx(ParamField,{body:`file`,type:`file`,required:true,id:`param-file`,children:_jsx(_components.p,{children:`The file. PDF, DOC, DOCX, PNG or JPEG, at most 4 MB.`})}),`\n`,_jsx(ParamField,{body:`profile_id`,type:`string`,required:true,id:`param-profile-id`,children:_jsx(_components.p,{children:`UUID of the profile the document belongs to.`})}),`\n`,_jsx(ParamField,{body:`extract_results`,type:`boolean`,default:`false`,id:`param-extract-results`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`true`}),` to read the lab values out of the file. Send `,_jsx(_components.code,{children:`true`}),` or `,_jsx(_components.code,{children:`false`}),`.`]})}),`\n`,_jsx(ParamField,{body:`document_date`,type:`string`,id:`param-document-date`,children:_jsxs(_components.p,{children:[`The sample date in `,_jsx(_components.code,{children:`YYYY-MM-DD`}),` format, when you know it. Without it, Aniva reads the date from the\nfile.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsxs(_components.p,{children:[`The API returns `,_jsx(_components.code,{children:`201 Created`}),` when it only stored the file, and `,_jsx(_components.code,{children:`202 Accepted`}),` when extraction runs.`]}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id`,children:_jsxs(_components.p,{children:[`Document ID (UUID). Use it with `,_jsx(_components.a,{href:`/api/documents/get-document-results`,children:`Get Document Results`}),` and\n`,_jsx(_components.a,{href:`/api/documents/download-document`,children:`Download Document`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,required:true,id:`param-status`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`processing`}),` while Aniva extracts the values, or `,_jsx(_components.code,{children:`stored`}),` when the file is only stored.`]})}),`\n`,_jsx(ResponseField,{name:`profile_id`,type:`string`,required:true,id:`param-profile-id-1`,children:_jsx(_components.p,{children:`The profile the document belongs to.`})}),`\n`,_jsx(ResponseField,{name:`document_date`,type:`string`,id:`param-document-date-1`,children:_jsxs(_components.p,{children:[`The sample date you sent, or the one Aniva read from a stored file. May be `,_jsx(_components.code,{children:`null`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`results_url`,type:`string`,required:true,id:`param-results-url`,children:_jsxs(_components.p,{children:[`The `,_jsx(_components.a,{href:`/api/documents/get-document-results`,children:`Get Document Results`}),` URL of this document.`]})}),`\n`,_jsx(ResponseField,{name:`file_name`,type:`string`,required:true,id:`param-file-name`,children:_jsxs(_components.p,{children:[`File name for display, the same one `,_jsx(_components.a,{href:`/api/documents/download-document`,children:`Download Document`}),` sends.`]})}),`\n`,_jsx(ResponseField,{name:`original_file_name`,type:`string`,required:true,id:`param-original-file-name`,children:_jsx(_components.p,{children:`The file name you uploaded.`})}),`\n`,_jsx(ResponseField,{name:`origin`,type:`string`,required:true,id:`param-origin`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`partner_upload`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`content_type`,type:`string`,required:true,id:`param-content-type`,children:_jsxs(_components.p,{children:[`Media type of the file, e.g. `,_jsx(_components.code,{children:`application/pdf`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`etag`,type:`string`,id:`param-etag`,children:_jsxs(_components.p,{children:[`Version of the file content. May be `,_jsx(_components.code,{children:`null`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`size_bytes`,type:`integer`,id:`param-size-bytes`,children:_jsxs(_components.p,{children:[`File size in bytes. May be `,_jsx(_components.code,{children:`null`}),`.`]})}),`\n`,_jsx(ResponseField,{name:`lab_code`,type:`string`,id:`param-lab-code`,children:_jsxs(_components.p,{children:[`Always `,_jsx(_components.code,{children:`null`}),` for an uploaded document.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`error-responses`,children:`Error responses`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsxs(_components.td,{children:[`A form field is invalid, or the body is not `,_jsx(_components.code,{children:`multipart/form-data`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`403`})}),_jsxs(_components.td,{children:[`Your API key lacks a scope, the profile is outside your access context, or you sent `,_jsx(_components.code,{children:`extract_results: true`}),` without `,_jsx(_components.code,{children:`documents_extract_results`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`404`})}),_jsx(_components.td,{children:`Profile not found.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`409`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`duplicate_document`}),`: the same file is already on this profile. `,_jsx(_components.code,{children:`document_id`}),` names it, or is `,_jsx(_components.code,{children:`null`}),` when you cannot read it. Also sent for an `,_jsx(_components.code,{children:`Idempotency-Key`}),` conflict.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`413`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`file_too_large`}),`: the file is over 4 MB.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`415`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`unsupported_media_type`}),`: the file is not a PDF, DOC, DOCX, PNG or JPEG. The file name must end in `,_jsx(_components.code,{children:`.pdf`}),`, `,_jsx(_components.code,{children:`.doc`}),`, `,_jsx(_components.code,{children:`.docx`}),`, `,_jsx(_components.code,{children:`.png`}),`, `,_jsx(_components.code,{children:`.jpg`}),` or `,_jsx(_components.code,{children:`.jpeg`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`500`})}),_jsxs(_components.td,{children:[`Internal server error. `,_jsx(_components.code,{children:`extraction_not_started`}),`: the file is stored as `,_jsx(_components.code,{children:`document_id`}),`, but extraction could not start. Contact Aniva.`]})]})]})]}),`\n`,_jsx(RequestExample,{children:_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`7`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://anivahealth.com/api/v1/documents`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-api-key: YOUR_API_KEY'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Idempotency-Key: 5f0c2d9e-3b7a-4c1e-9f62-1d8a4e7b0c55'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --form`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'file=@lab-report.pdf'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --form`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'profile_id=b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --form`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'extract_results=true'`})]}),`\n`]})})})}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`202`,numberOfLines:`14`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`14`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"f8a1b2c3-d4e5-4f6a-8b8c-9d0e1f2a3b4c\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"processing\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"profile_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"document_date\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"results_url\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://anivahealth.com/api/v1/documents/f8a1b2c3-d4e5-4f6a-8b8c-9d0e1f2a3b4c/results\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"file_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"20261023 - lab-report.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"original_file_name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"lab-report.pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"origin\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"partner_upload\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"content_type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/pdf\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"etag\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"56104b36f860cfd5b41efc716fdf7b6f\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"size_bytes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`312480`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"lab_code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`null`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`409`,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"error\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"duplicate_document\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"This file is already on this profile\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"document_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"f8a1b2c3-d4e5-4f6a-8b8c-9d0e1f2a3b4c\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Upload Document","description":"Upload a lab report or any other document to a profile, and optionally extract its lab values","api":"POST https://anivahealth.com/api/v1/documents","href":"/api/documents/upload-document"}}}},"mdxExtracts":{"tableOfContents":[{"title":"What extraction does","slug":"what-extraction-does","depth":2,"children":[]},{"title":"Request","slug":"request","depth":2,"children":[{"title":"Form fields","slug":"form-fields","depth":3,"children":[]}]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Error responses","slug":"error-responses","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"7\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --request\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --url\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://anivahealth.com/api/v1/documents\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --header\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'x-api-key: YOUR_API_KEY'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --header\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Idempotency-Key: 5f0c2d9e-3b7a-4c1e-9f62-1d8a4e7b0c55'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --form\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'file=@lab-report.pdf'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --form\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'profile_id=b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --form\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'extract_results=true'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"202","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"14\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"f8a1b2c3-d4e5-4f6a-8b8c-9d0e1f2a3b4c\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"processing\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"profile_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"document_date\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"results_url\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://anivahealth.com/api/v1/documents/f8a1b2c3-d4e5-4f6a-8b8c-9d0e1f2a3b4c/results\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"file_name\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"20261023 - lab-report.pdf\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"original_file_name\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"lab-report.pdf\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"origin\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"partner_upload\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"content_type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"application/pdf\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"etag\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"56104b36f860cfd5b41efc716fdf7b6f\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"size_bytes\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">312480\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"lab_code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">null\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"409","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"5\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"error\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"duplicate_document\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"This file is already on this profile\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"document_id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"f8a1b2c3-d4e5-4f6a-8b8c-9d0e1f2a3b4c\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Upload Document","path":"/api/v1/documents","servers":[{"url":"https://anivahealth.com"}],"method":"post","request":{"security":[{"title":"API Key Auth","parameters":{"header":{"x-api-key":{"type":"apiKey"}},"query":{},"cookie":{}}}],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"file":[{"type":"file","description":"The file. PDF, DOC, DOCX, PNG or JPEG, at most 4 MB.","required":true}],"profile_id":[{"type":"string","description":"UUID of the profile the document belongs to.","required":true}],"extract_results":[{"type":"boolean","description":"`true` to read the lab values out of the file. Send `true` or `false` ."}],"document_date":[{"type":"string","description":"The sample date in `YYYY-MM-DD` format, when you know it. Without it, Aniva reads the date from the file."}]}}],"examples":{"example":{"value":{"profile_id":"\u003cstring>","extract_results":true,"document_date":"\u003cstring>"}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"id":[{"type":"string","description":"Document ID (UUID). Use it with Get Document Results and Download Document .","required":true}],"status":[{"type":"string","description":"`processing` while Aniva extracts the values, or `stored` when the file is only stored.","required":true}],"profile_id":[{"type":"string","description":"The profile the document belongs to.","required":true}],"document_date":[{"type":"string","description":"The sample date you sent, or the one Aniva read from a stored file. May be `null` ."}],"results_url":[{"type":"string","description":"The Get Document Results URL of this document.","required":true}],"file_name":[{"type":"string","description":"File name for display, the same one Download Document sends.","required":true}],"original_file_name":[{"type":"string","description":"The file name you uploaded.","required":true}],"origin":[{"type":"string","description":"Always `partner_upload` .","required":true}],"content_type":[{"type":"string","description":"Media type of the file, e.g. `application/pdf` .","required":true}],"etag":[{"type":"string","description":"Version of the file content. May be `null` ."}],"size_bytes":[{"type":"integer","description":"File size in bytes. May be `null` ."}],"lab_code":[{"type":"string","description":"Always `null` for an uploaded document."}]}}],"examples":{"example":{"value":{"id":"\u003cstring>","status":"\u003cstring>","profile_id":"\u003cstring>","document_date":"\u003cstring>","results_url":"\u003cstring>","file_name":"\u003cstring>","original_file_name":"\u003cstring>","origin":"\u003cstring>","content_type":"\u003cstring>","etag":"\u003cstring>","size_bytes":123,"lab_code":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"anivahealth","siteName":"Aniva Partner API","title":"Upload Document - Aniva Partner API","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-24T16:02:50.614Z","originalFileLocation":"api/documents/upload-document.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Upload a lab report or any other document to a profile, and optionally extract its lab values\">\u003cmeta data-mint-head name=\"keywords\" content=\"blood test API, lab testing API, home test kit API, lab results API, biomarker API, pharmacy blood test, Germany, EU\">\u003cmeta data-mint-head name=\"application-name\" content=\"Aniva Partner API\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/anivahealth/HlHhuNfIyhibeIlM/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/anivahealth/HlHhuNfIyhibeIlM/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/anivahealth/HlHhuNfIyhibeIlM/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/anivahealth/HlHhuNfIyhibeIlM/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/anivahealth/HlHhuNfIyhibeIlM/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/anivahealth/HlHhuNfIyhibeIlM/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/anivahealth/HlHhuNfIyhibeIlM/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/anivahealth/HlHhuNfIyhibeIlM/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/anivahealth/HlHhuNfIyhibeIlM/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Upload Document - Aniva Partner API\">\u003cmeta data-mint-head property=\"og:description\" content=\"Upload a lab report or any other document to a profile, and optionally extract its lab values\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Aniva Partner API\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.anivahealth.com/api/documents/upload-document\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://anivahealth.mintlify.app/_mintlify/api/og/v2?division=Documents\u0026amp;title=Upload+Document\u0026amp;description=Upload+a+lab+report+or+any+other+document+to+a+profile%2C+and+optionally+extract+its+lab+values\u0026amp;theme=9233d500f2c3e2797b1bbde7\u0026amp;signature=1dfca495da4bbc6e68db9fccb47a5bde465edb9e64af4493a3b02e563eb1c9ae\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Upload Document - Aniva Partner API\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Upload a lab report or any other document to a profile, and optionally extract its lab values\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://anivahealth.mintlify.app/_mintlify/api/og/v2?division=Documents\u0026amp;title=Upload+Document\u0026amp;description=Upload+a+lab+report+or+any+other+document+to+a+profile%2C+and+optionally+extract+its+lab+values\u0026amp;theme=9233d500f2c3e2797b1bbde7\u0026amp;signature=1dfca495da4bbc6e68db9fccb47a5bde465edb9e64af4493a3b02e563eb1c9ae\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/anivahealth/HlHhuNfIyhibeIlM/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Aniva Partner API\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#e76c2b\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.anivahealth.com/api/documents/upload-document\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api/documents/upload-document.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.anivahealth.com/#organization\",\"name\":\"Aniva Partner API\",\"url\":\"https://docs.anivahealth.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/anivahealth/kdSs24SJO7DtrSol/images/asterisk-orange.svg?fit=max\u0026auto=format\u0026n=kdSs24SJO7DtrSol\u0026q=85\u0026s=b532223864bd76629cafac2434daecf7\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.anivahealth.com#website\",\"name\":\"Aniva Partner API\",\"url\":\"https://docs.anivahealth.com\",\"publisher\":{\"@id\":\"https://docs.anivahealth.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.anivahealth.com/api/documents/upload-document#webpage\",\"url\":\"https://docs.anivahealth.com/api/documents/upload-document\",\"name\":\"Upload Document\",\"description\":\"Upload a lab report or any other document to a profile, and optionally extract its lab values\",\"dateModified\":\"2026-10-24T16:02:50.614Z\",\"isPartOf\":{\"@id\":\"https://docs.anivahealth.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.anivahealth.com/api/documents/upload-document#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.anivahealth.com/api/documents/upload-document#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Aniva Partner API\",\"item\":\"https://docs.anivahealth.com\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Upload Document\",\"item\":\"https://docs.anivahealth.com/api/documents/upload-document\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.anivahealth.com/api/documents/upload-document#apireference\",\"headline\":\"Upload Document\",\"name\":\"Upload Document\",\"description\":\"Upload a lab report or any other document to a profile, and optionally extract its lab values\",\"url\":\"https://docs.anivahealth.com/api/documents/upload-document\",\"mainEntityOfPage\":{\"@id\":\"https://docs.anivahealth.com/api/documents/upload-document#webpage\"},\"dateModified\":\"2026-10-24T16:02:50.614Z\",\"publisher\":{\"@id\":\"https://docs.anivahealth.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.anivahealth.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Aniva Partner API\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Aniva Partner API","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"Health","pages":[{"title":"Health Check","api":"GET https://anivahealth.com/api/v1/health","href":"/api/health/check-health"}]},{"group":"Profiles","pages":[{"title":"List Profiles","api":"GET https://anivahealth.com/api/v1/profiles","href":"/api/profiles/list-profiles"},{"title":"Create Profile","api":"POST https://anivahealth.com/api/v1/profiles","href":"/api/profiles/create-profile"},{"title":"Get Profile","api":"GET https://anivahealth.com/api/v1/profiles/{id}","href":"/api/profiles/get-profile"},{"title":"Update Profile","api":"PATCH https://anivahealth.com/api/v1/profiles/{id}","href":"/api/profiles/update-profile"}]},{"group":"Appointments","pages":[{"title":"List Appointments","api":"GET https://anivahealth.com/api/v1/appointments","href":"/api/appointments/list-appointments"},{"title":"Create Appointment","api":"POST https://anivahealth.com/api/v1/appointments","href":"/api/appointments/create-appointment"},{"title":"Get Appointment","api":"GET https://anivahealth.com/api/v1/appointments/{id}","href":"/api/appointments/get-appointment"},{"title":"Update Appointment","api":"PATCH https://anivahealth.com/api/v1/appointments/{id}","href":"/api/appointments/update-appointment"},{"title":"Cancel Appointment","api":"DELETE https://anivahealth.com/api/v1/appointments/{id}","href":"/api/appointments/cancel-appointment"},{"title":"Add Panels","api":"POST https://anivahealth.com/api/v1/appointments/{id}/panels","href":"/api/appointments/add-panels"},{"title":"Remove Panels","api":"DELETE https://anivahealth.com/api/v1/appointments/{id}/panels","href":"/api/appointments/remove-panels"},{"title":"Add Individual Biomarkers","api":"PATCH https://anivahealth.com/api/v1/appointments/{id}/biomarkers","href":"/api/appointments/add-individual-biomarkers"},{"title":"Remove Individual Biomarkers","api":"DELETE https://anivahealth.com/api/v1/appointments/{id}/biomarkers","href":"/api/appointments/remove-individual-biomarkers"},{"title":"Preview Appointment","api":"GET https://anivahealth.com/api/v1/appointments/{id}/preview","href":"/api/appointments/preview-containers"},{"title":"Confirm Blood Draw","api":"POST https://anivahealth.com/api/v1/appointments/{id}/confirm","href":"/api/appointments/confirm-blood-draw"},{"title":"Get Lab Results","api":"GET https://anivahealth.com/api/v1/appointments/{id}/results","href":"/api/appointments/get-results"},{"title":"Email Results","api":"POST https://anivahealth.com/api/v1/appointments/{id}/results/email","href":"/api/appointments/email-results"}]},{"group":"Home Kit Orders","pages":[{"title":"List Home Kit Orders","api":"GET https://anivahealth.com/api/v1/home-kit-orders","href":"/api/home-kit-orders/list-home-kits"},{"title":"Create Home Kit Order","api":"POST https://anivahealth.com/api/v1/home-kit-orders","href":"/api/home-kit-orders/create-home-kit"},{"title":"Get Home Kit Order","api":"GET https://anivahealth.com/api/v1/home-kit-orders/{id}","href":"/api/home-kit-orders/get-home-kit"},{"title":"Update Home Kit Order","api":"PATCH https://anivahealth.com/api/v1/home-kit-orders/{id}","href":"/api/home-kit-orders/update-home-kit"},{"title":"Cancel Home Kit Order","api":"DELETE https://anivahealth.com/api/v1/home-kit-orders/{id}","href":"/api/home-kit-orders/cancel-home-kit"},{"title":"Activate Home Kit Order","api":"POST https://anivahealth.com/api/v1/home-kit-orders/{id}/activate","href":"/api/home-kit-orders/activate-home-kit"},{"title":"Add Individual Biomarkers","api":"PATCH https://anivahealth.com/api/v1/home-kit-orders/{id}/biomarkers","href":"/api/home-kit-orders/add-individual-biomarkers"},{"title":"Remove Individual Biomarkers","api":"DELETE https://anivahealth.com/api/v1/home-kit-orders/{id}/biomarkers","href":"/api/home-kit-orders/remove-individual-biomarkers"},{"title":"Get Lab Results","api":"GET https://anivahealth.com/api/v1/home-kit-orders/{id}/results","href":"/api/home-kit-orders/get-results"},{"title":"Email Results","api":"POST https://anivahealth.com/api/v1/home-kit-orders/{id}/results/email","href":"/api/home-kit-orders/email-results"}]},{"group":"Biomarkers","pages":[{"title":"List Biomarkers","api":"GET https://anivahealth.com/api/v1/biomarkers","href":"/api/biomarkers/list-biomarkers"},{"title":"Get Biomarker","api":"GET https://anivahealth.com/api/v1/biomarkers/{id}","href":"/api/biomarkers/get-biomarker"}]},{"group":"Panels","pages":[{"title":"List Panels","api":"GET https://anivahealth.com/api/v1/panels","href":"/api/panels/list-panels"},{"title":"List Panels (v2)","api":"GET https://anivahealth.com/api/v2/panels","href":"/api/panels/list-panels-v2"},{"title":"Create Panel","api":"POST https://anivahealth.com/api/v1/panels","href":"/api/panels/create-panel"}]},{"group":"Pricing","pages":[{"title":"Get Rate Card","api":"GET https://anivahealth.com/api/v1/pricing/rate-card","href":"/api/pricing/get-rate-card"},{"title":"Quote Cart","api":"POST https://anivahealth.com/api/v1/pricing/quote","href":"/api/pricing/quote-cart"}]},{"group":"Units","pages":[{"title":"List Units","api":"GET https://anivahealth.com/api/v1/units","href":"/api/units/list-units"}]},{"group":"Locations","pages":[{"title":"List Locations","api":"GET https://anivahealth.com/api/v1/locations","href":"/api/locations/list-locations"},{"title":"Get Location","api":"GET https://anivahealth.com/api/v1/locations/{id}","href":"/api/locations/get-location"},{"title":"Get Availability","api":"GET https://anivahealth.com/api/v1/locations/{id}/availability","href":"/api/locations/get-availability"},{"title":"List Retail Prices","api":"GET https://anivahealth.com/api/v1/locations/retail-prices","href":"/api/locations/list-retail-prices"},{"title":"Get Retail Prices","description":"Retrieve the panel and single-biomarker prices one location charges walk-in customers","api":"GET https://anivahealth.com/api/v1/locations/{id}/retail-prices","href":"/api/locations/get-retail-prices"}]},{"group":"Documents","pages":[{"title":"Upload Document","api":"POST https://anivahealth.com/api/v1/documents","href":"/api/documents/upload-document"},{"title":"Get Document Results","description":"Read the status and the extracted lab values of a document you uploaded","api":"GET https://anivahealth.com/api/v1/documents/{id}/results","href":"/api/documents/get-document-results"},{"title":"Download Document","api":"GET https://anivahealth.com/api/v1/documents/{id}","href":"/api/documents/download-document"},{"title":"Delete Document","api":"DELETE https://anivahealth.com/api/v1/documents/{id}","href":"/api/documents/delete-document"}]},{"group":"Shipments","pages":[{"title":"Create Shipment","api":"POST https://anivahealth.com/api/v1/shipments","href":"/api/shipments/create-shipment"},{"title":"List Shipments","api":"GET https://anivahealth.com/api/v1/shipments","href":"/api/shipments/list-shipments"},{"title":"Get Shipment","api":"GET https://anivahealth.com/api/v1/shipments/{id}","href":"/api/shipments/get-shipment"},{"title":"Update Shipment","api":"PATCH https://anivahealth.com/api/v1/shipments/{id}","href":"/api/shipments/update-shipment"},{"title":"Cancel Shipment","api":"DELETE https://anivahealth.com/api/v1/shipments/{id}","href":"/api/shipments/cancel-shipment"},{"title":"List Shipment Appointments","api":"GET https://anivahealth.com/api/v1/shipments/{id}/appointments","href":"/api/shipments/list-shipment-appointments"},{"title":"Attach Appointments to Shipment","api":"POST https://anivahealth.com/api/v1/shipments/{id}/appointments","href":"/api/shipments/attach-appointments-to-shipment"},{"title":"Detach Appointments from Shipment","api":"DELETE https://anivahealth.com/api/v1/shipments/{id}/appointments","href":"/api/shipments/detach-appointments-from-shipment"}]},{"group":"Webhooks","pages":[{"title":"List Webhooks","api":"GET https://anivahealth.com/api/v1/webhooks","href":"/api/webhooks/list-webhooks"},{"title":"Create Webhook","api":"POST https://anivahealth.com/api/v1/webhooks","href":"/api/webhooks/create-webhook"},{"title":"Get Webhook","api":"GET https://anivahealth.com/api/v1/webhooks/{id}","href":"/api/webhooks/get-webhook"},{"title":"Update Webhook","api":"PATCH https://anivahealth.com/api/v1/webhooks/{id}","href":"/api/webhooks/update-webhook"},{"title":"Delete Webhook","api":"DELETE https://anivahealth.com/api/v1/webhooks/{id}","href":"/api/webhooks/delete-webhook"},{"title":"Rotate Secret","api":"POST https://anivahealth.com/api/v1/webhooks/{id}/rotate-secret","href":"/api/webhooks/rotate-secret"},{"title":"Send Test Event","api":"POST https://anivahealth.com/api/v1/webhooks/{id}/ping","href":"/api/webhooks/send-test-event"},{"title":"List Deliveries","api":"GET https://anivahealth.com/api/v1/webhooks/{id}/deliveries","href":"/api/webhooks/list-deliveries"},{"title":"Resend Delivery","api":"POST https://anivahealth.com/api/v1/webhooks/{id}/deliveries/{delivery_id}/resend","href":"/api/webhooks/resend-delivery"}]}]}]},"title":"Upload Document - Aniva Partner API","buildId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","deploymentId":"dpl_849ArpqvBiCczQiT1Y1stNGpbqHT","dynamics":["c2aa737661","b0f84f53ff","2b790eda92"],"chunks":["OpenApiReferenceProvider-Bbp7I60D.js","utils-C3RIvJha.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DqD-vLt8.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B31Loprg.js","snippetPresets-DKpk-b8t.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","Page-n7I5XbKb.js","ApiExamples-Cj65AhOR.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BXtn5gcC.js","shallow-RY2b03Cp.js","getApiPlaygroundDisplay-B0jeiPk3.js","CodeSnippet-CYgBjjwn.js","CodeSnippets-DOngDrYB.js","getPastedJson-DRQbJx-T.js","icon-CQiQCicY.js","MethodPill-BKTLdNtu.js","DuplicateIcon-B9jpAdat.js","createIcon-DCddRrXv.js","DynamicMarkdown-a8hUKrw6.js","SectionHeading-eECVV2eH.js","axios-vUo_bRtp.js"]}