Request a Document Analysis

On this page, you will learn how to initiate a new Document Analysis request using the API.

Initiate a Document Analysis request

To initiate a Document Analysis you can call this endpoint with the following parameters :

POST /document_analyses

curl --location --request POST '{baseUrl}/document_analyses' \
--header 'Authorization: Bearer {apiKey}' \
--header 'Content-Type: multipart/form-data' \
--form 'file=@social_security_card.pdf' \
--form type='social_security' \
--form workspace_id='c0840991-848c-47ed-9bfa-68c9daca4793'
{
    "id": "@uuid@",
    "workspace_id": "@uuid@",
    "status": "done",
    "type": "social_security",
    "data_anonymized": false,
    "created_at": "@datetime@",
    "updated_at": "@datetime@",
    "extracted_from_document": {
        "first_name": "John",
        "last_name": "Doe",
        "social_security_number": "1234567890123",
        "full_name": "John Doe"
    },
    "checks" : null
}
Query ParamTypeDescription
filefile[required]The file containing the data to extract. Accepted formats: PDF, PNG, JPG, JPEG. Max size: 10 MB. Max number of pages for PDF: 2.
typestring[required] The type of the document you are trying to analyze. Example : social_security

In the response, you'll find the id. This value is required to retrieve the verification results.

What data are extracted ?

For the type : social_security , the following data will be extracted :

"first_name": "Leo",
"last_name": "Pignol",
"full_name": "Leo Pignol",
"social_security_number": "101111300509563"

Failure to extract all data will result in an inconclusive status.

How to check that a document belongs to a person ?

To check that Document belongs to a person you can call the following endpoint by passing the checks optional parameters in the payload :

Query ParamTypeDescription
filefile[required]The file containing the data to extract. Accepted formats: PDF, PNG, JPG, JPEG. Max size: 10 MB. Max number of pages for PDF: 2.
typestring[required] The type of the document you are trying to analyze. Example : social_security
checksobject[optional]
checks[first_name]stringThe first name of the person you want to check.
checks[last_name]stringThe last name of the person you want to check.
curl --location --request POST '{baseUrl}/document_analyses' \
--header 'Authorization: Bearer {apiKey}' \
--header 'Content-Type: multipart/form-data' \
--form 'file=@social_security_card.pdf' \
--form type='social_security' \
--form workspace_id='c0840991-848c-47ed-9bfa-68c9daca4793'
--form checks[first_name]:'John'
--form checks[first_name]:'Doe'
📘

Comparison rules

When providing a first_name and a last_name, we will compute a full_name and compare it with the extracted data based on the following rules : Name Matching rules.