Skip to main content
POST
/
api
/
v2
/
documents
/
legacy
/
extract
Python
import os
from samplehc import SampleHealthcare

client = SampleHealthcare(
    api_key=os.environ.get("SAMPLEHC_API_KEY"),  # This is the default and can be omitted
)
response = client.v2.documents.legacy.extract(
    answer_schemas=[{
        "label": "label",
        "question": "question",
        "type": "boolean",
    }],
    documents=[{
        "id": "id",
        "file_name": "fileName",
    }],
)
print(response.async_result_id)
{
  "asyncResultId": "<string>"
}

Body

application/json
documents
object[]
required

An array of documents to process.

answerSchemas
object[]
required

An array of answer schemas defining data to extract.

Response

Accepted. Legacy extraction process initiated.

Accepted. Legacy extraction process initiated.

asyncResultId
string
required

The ID to track the asynchronous legacy extraction task.