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 Param | Type | Description |
|---|---|---|
| file | file | [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. |
| type | string | [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 Param | Type | Description |
|---|---|---|
| file | file | [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. |
| type | string | [required] The type of the document you are trying to analyze. Example : social_security |
| checks | object | [optional] |
| checks[first_name] | string | The first name of the person you want to check. |
| checks[last_name] | string | The 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 rulesWhen providing a
first_nameand alast_name, we will compute afull_nameand compare it with the extracted data based on the following rules : Name Matching rules.
Updated 12 days ago