/document/extractpost extract
Extract and validate information from documents
Request attributes
document_typeRequiredstringThe type of document to extract information from
Enum values
identityorganisation_docproof_of_addresstax_docinvoicepayloadConditionalstringBase64 encoded document payload (required if source is base64)
- Required when `source=base64`
sourceRequiredstringThe source of the document
Enum values
base64urlvalidationsOptionalobjectValidations to perform on the extracted information
Child attributes (2)
expiryOptionalobjectDocument expiry validation. This is used to validate that the document is not expired or will not expire within a certain number of months.
Child attributes (2)
minimum_months_until_expiryOptionalintegerMinimum number of months until the document expires
- Format: int64
- Minimum: 1
validate_not_expiredOptionalbooleanWhether to validate that the document is not expired
fieldsOptionalarray<object>Field-level validations. These are used to validate the extracted information against some expected values.
Child attributes (3)
validations.fields[].expected_valueConditionalstringThe expected value for the field
- Required when parent `fields` is present
validations.fields[].fieldConditionalstringThe field name to validate
Enum values
document_numbersurnamegiven_name- Required when parent `fields` is present
- Allowed values depend on the selected example context
validations.fields[].match_typeConditionalstringThe type of match to perform
Enum values
exactfuzzy- Required when parent `fields` is present
Response attributes
date_of_birthOptionalstringThe date of birth of the holder of the document. Could be YYYY-MM-DD, YYYY-MM, or YYYY.
document_date_of_issueOptionalstringThe date the document was issued. Could be YYYY-MM-DD, YYYY-MM, or YYYY.
document_expiry_dateOptionalstringThe date the document expires. Could be YYYY-MM-DD, YYYY-MM, or YYYY.
document_issuing_authorityOptionalstringAuthority that issued the document
document_numberOptionalstringThe document number
document_typeRequiredstringThe type of document that was extracted
Enum values
identityorganisation_docproof_of_addresstax_docinvoicegiven_nameOptionalstringThe given name of the holder of the document
idRequiredstringThe unique identifier of the object
issuing_countryOptionalstringThe country that issued the document in ISO 3166-1 alpha-2 format
- Min length: 2
- Max length: 2
livemodeRequiredbooleanIndicates whether the object was created in live mode (true) or sandbox mode (false)
objectRequiredstringThe type of object
place_of_birthConditionalstringThe place of birth of the holder of the document
- Required when `document_type=identity`
surnameOptionalstringThe surname of the holder of the document
validation_resultOptionalobjectThe result of the validations performed on the extracted information
Child attributes (4)
checksRequiredarray<object>The individual checks that were performed
Child attributes (9)
validation_result.checks[].check_nameConditionalstringThe name of the specific expiry check
Enum values
validate_document_not_expiredminimum_months_until_expiry- Required when `check_type=expiry_validation`
validation_result.checks[].check_typeRequiredstringThe type of check performed
Enum values
field_validationexpiry_validationrecency_validationstatement_coverage_validationstatement_recency_validationvalidation_result.checks[].document_expiry_dateConditionalstringThe expiry date of the document
- Required when `check_type=expiry_validation`
validation_result.checks[].expected_valueConditionalstringThe expected value for the field
- Required when `check_type=field_validation`
validation_result.checks[].extracted_valueConditionalstringThe actual value that was extracted from the document
- Required when `status=passed,failed`
validation_result.checks[].fieldConditionalstringThe field that was validated
- Required when `check_type=field_validation`
validation_result.checks[].match_typeConditionalstringThe type of match performed
Enum values
exactfuzzy- Required when `check_type=field_validation`
validation_result.checks[].months_until_expiryConditionalintegerThe number of months until the document expires
- Format: int64
- Required when `check_name=minimum_months_until_expiry`
validation_result.checks[].statusRequiredstringThe status of the check
Enum values
passedfailedskippednumber_of_checks_failedRequiredintegerThe number of checks that failed
- Format: int64
- Minimum: 0
number_of_checks_passedRequiredintegerThe number of checks that passed
- Format: int64
- Minimum: 0
number_of_checks_skippedRequiredintegerThe number of checks that were skipped
- Format: int64
- Minimum: 0
Request and response examples
Base URL: https://api.infraredaml.com
Document type
Request source
Extracting from Identity Document using base64 payload
{
"document_type": "identity",
"payload": "JVBERi0xLjYNJeLjz9MNCjg1NDU1IDAgb2JqDTw8L0xpbm",
"source": "base64",
"validations": {
"expiry": {
"minimum_months_until_expiry": 6,
"validate_not_expired": true
},
"fields": [
{
"expected_value": "ABC123456",
"field": "document_number",
"match_type": "exact"
},
{
"expected_value": "Banks",
"field": "surname",
"match_type": "fuzzy"
},
{
"expected_value": "Jordan",
"field": "given_name",
"match_type": "exact"
}
]
}
}Extraction result for an identity document
{
"date_of_birth": "1960-02-06",
"document_date_of_issue": "2025-02-06",
"document_expiry_date": "2035-02-06",
"document_issuing_authority": "San Francisco",
"document_number": "ABC123456",
"document_type": "identity",
"given_name": "Jordan",
"id": "dxr_V1StGXR8Z5jdHi6BmyT",
"issuing_country": "US",
"livemode": true,
"object": "document_extraction",
"place_of_birth": "San Francisco, CA",
"surname": "Banks",
"validation_result": {
"checks": [
{
"check_type": "field_validation",
"expected_value": "Banks",
"extracted_value": "Banks",
"field": "surname",
"match_type": "fuzzy",
"status": "passed"
},
{
"check_type": "field_validation",
"expected_value": "Jordan",
"extracted_value": "Jordan",
"field": "given_name",
"match_type": "exact",
"status": "passed"
},
{
"check_type": "field_validation",
"expected_value": "ABC123456",
"extracted_value": "ABC123456",
"field": "document_number",
"match_type": "exact",
"status": "passed"
},
{
"check_name": "validate_document_not_expired",
"check_type": "expiry_validation",
"document_expiry_date": "2025-02-06",
"status": "passed"
},
{
"check_name": "minimum_months_until_expiry",
"check_type": "expiry_validation",
"document_expiry_date": "2025-02-06",
"months_until_expiry": 48,
"status": "passed"
}
],
"number_of_checks_failed": 0,
"number_of_checks_passed": 5,
"number_of_checks_skipped": 0
}
}Responses
- 200 — OK response.