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": "Dupont",
"full_name": "Leo Dupont",
"social_security_number": "101111300509563"Failure to extract all data will result in an inconclusive status.
For the type : company_certificate , the following data will be extracted from the document.
"verification_number": "EHqrFQ8wOS",
"company_name": "TEST COMPANY",
"company_number": "451 456 120",
"registered_address": "Lorem Ipsum",
"issuance_date": "2021-03-07",
"legal_representatives": [
{
"type": "natural_person",
"first_name": "John",
"last_name": "Doe",
"full_name": "Jonh Doe",
"function": "Président",
"company_name": null,
"company_number": null
}
]
},You can use the
verification_numberto check the given document on the following website https://controle.infogreffe.fr/controle.
In case a legal representative is of type : legal_person first_name, last_name and full_name will be null.
How to check that a document belongs to a person ?
To check that a document belongs to a person you can call the following endpoint by passing the checks optional parameters in the payload :
For social_security type documents :
social_security type documents :| 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 for social |
| checks[last_name] | string | The last name of the person you want to check. |
For company_certificate type documents :
company_certificate type documents :For company_certificate type documents you can pass a list of legal representative first_names and last_names to confirm they appear on the document.
| 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 |
| legal_representatives | list of objects | [optional] |
| checks[legal_representatives][0][first_name] | string | The first name name of the legal representative you want to check. |
| checks[legal_representatives][0][last_name] | string | The last name name of the legal representative 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'curl --request POST \
--url '{baseUrl}/document_analyses' \
--header 'accept: application/json' \
--header 'content-type: multipart/form-data' \
--form type=company_certificate \
--form [legal_representative][0][first_name]=John \
--form [legal_representative][0][last_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.
Additionally, on company_certificate type documents we use the issuance_date to check that the document is at least 3 months old. To learn more on how to follow a Document Analysis results check the full guide on statuses here.
Updated 4 days ago