Extract or retry document text extraction
curl --request POST \
--url https://api.healos.ai/ext-api/v1/patients/{patientId}/documents/{documentId}/extract \
--header 'X-API-Key: <api-key>'const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.healos.ai/ext-api/v1/patients/{patientId}/documents/{documentId}/extract', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.healos.ai/ext-api/v1/patients/{patientId}/documents/{documentId}/extract"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text){
"data": {
"id": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
"filename": "intake_form_maria_santos.pdf",
"file_type": "pdf",
"file_size": 245760,
"public_url": "<string>",
"upload_date": "2026-03-20T11:15:00.000Z",
"status": "pending",
"extracted_date": "2026-03-20T11:16:00.000Z",
"extraction_error": "No text could be extracted from the PDF",
"extraction_deferred": false,
"has_extracted_text": true,
"extracted_text_length": 2048,
"external_id": "PARTNER-DOC-456"
},
"success": true,
"message": "Text extracted successfully",
"error": "Text extraction failed",
"details": "No text could be extracted from the PDF"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Rate limit exceeded. Please retry after the window resets.",
"code": "daily_cap_reached",
"reset_at": "2026-10-28T00:00:00.000Z"
}{
"data": {
"id": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
"filename": "intake_form_maria_santos.pdf",
"file_type": "pdf",
"file_size": 245760,
"public_url": "<string>",
"upload_date": "2026-03-20T11:15:00.000Z",
"status": "pending",
"extracted_date": "2026-03-20T11:16:00.000Z",
"extraction_error": "No text could be extracted from the PDF",
"extraction_deferred": false,
"has_extracted_text": true,
"extracted_text_length": 2048,
"external_id": "PARTNER-DOC-456"
},
"success": true,
"message": "Text extracted successfully",
"error": "Text extraction failed",
"details": "No text could be extracted from the PDF"
}Documents
Extract or retry document text extraction
Starts or retries text extraction for a patient document and returns the latest extraction status. On reaching a terminal state a DOCUMENT_STATUS_CHANGED webhook fires (if registered) — see the upload endpoint. Each call on a document that is not yet completed counts against your organization’s daily document extraction limit, if one is set (per UTC day, shared with uploads); over it this endpoint returns 429 with code: daily_cap_reached and the reset time. A failed extraction still counts.
POST
/
patients
/
{patientId}
/
documents
/
{documentId}
/
extract
Extract or retry document text extraction
curl --request POST \
--url https://api.healos.ai/ext-api/v1/patients/{patientId}/documents/{documentId}/extract \
--header 'X-API-Key: <api-key>'const options = {method: 'POST', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.healos.ai/ext-api/v1/patients/{patientId}/documents/{documentId}/extract', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.healos.ai/ext-api/v1/patients/{patientId}/documents/{documentId}/extract"
headers = {"X-API-Key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text){
"data": {
"id": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
"filename": "intake_form_maria_santos.pdf",
"file_type": "pdf",
"file_size": 245760,
"public_url": "<string>",
"upload_date": "2026-03-20T11:15:00.000Z",
"status": "pending",
"extracted_date": "2026-03-20T11:16:00.000Z",
"extraction_error": "No text could be extracted from the PDF",
"extraction_deferred": false,
"has_extracted_text": true,
"extracted_text_length": 2048,
"external_id": "PARTNER-DOC-456"
},
"success": true,
"message": "Text extracted successfully",
"error": "Text extraction failed",
"details": "No text could be extracted from the PDF"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "Rate limit exceeded. Please retry after the window resets.",
"code": "daily_cap_reached",
"reset_at": "2026-10-28T00:00:00.000Z"
}{
"data": {
"id": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f8a",
"filename": "intake_form_maria_santos.pdf",
"file_type": "pdf",
"file_size": 245760,
"public_url": "<string>",
"upload_date": "2026-03-20T11:15:00.000Z",
"status": "pending",
"extracted_date": "2026-03-20T11:16:00.000Z",
"extraction_error": "No text could be extracted from the PDF",
"extraction_deferred": false,
"has_extracted_text": true,
"extracted_text_length": 2048,
"external_id": "PARTNER-DOC-456"
},
"success": true,
"message": "Text extracted successfully",
"error": "Text extraction failed",
"details": "No text could be extracted from the PDF"
}| Requirement | Detail |
|---|---|
| Scope | documents:write |
| Rate limit | About 60 requests per minute per API key (shared by all endpoints; approximate). Each call on a document that is not yet completed counts against your organization’s daily document extraction limit, if one is set (most organizations have none; shared with uploads); over it, 429 with code: daily_cap_reached. |
| Cost | Free |
Safety
- Writes data: Yes. Starts or restarts text extraction and updates the document’s extraction status.
- Safe to retry: Yes. A repeat runs extraction again on the same file and counts against the daily limit again (a call on a
completeddocument does not). - Contacts an outside system: None
- Dry run: Not available.
Path Parameters
Was this page helpful?

