Usage
API

Identra API Documentation

Overview

The Identra API allows you to verify identity documents, such as passports and driver’s licenses, by submitting them for analysis. This guide details the usage of the /api/validate endpoint.

Endpoint

POST /api/validate

This endpoint processes identity documents submitted as multipart form data. It returns the verification results, including information extracted from the document and the verification status.

Request

Headers:

  • Content-Type: multipart/form-data
  • X-Api-Key: <Insert API Key>

Body:

  • file (required): The identity document to be validated. This should be uploaded as a file in the request body.

Example Request:

curl -X POST https://api.identra.com/api/validate \
  -H "X-Api-Key=example-key"
  -F "file=@path_to_your_file.jpg"

Response

The API returns a JSON object containing the following fields:

FieldTypeDescription
id_numberstringThe ID number extracted from the document.
birth_datestringThe date of birth of the individual (format: YYYY/MM/DD).
issuance_datestringThe date the document was issued (format: YYYY/MM/DD).
expiry_datestringThe expiration date of the document (format: YYYY/MM/DD).
birth_placestringThe place of birth of the individual.
countrystringThe country of the document.
genderstringThe gender of the individual (if available).
given_namesstringThe first names of the individual.
surnamestringThe last name of the individual.
mrzstringMachine Readable Zone data (if available).
is_forgerybooleanIndicates whether the document is detected as a forgery.
forgery_confidencefloatConfidence level of the forgery detection (0 to 1).
forgery_commentstringAdditional comments regarding the forgery assessment.
image_legiblebooleanIndicates if the document image is legible.
image_qualityfloatQuality score of the document image (0 to 1).
acceptbooleanIndicates if the document is accepted as valid.
decline_commentstringComments explaining why the document was declined (if applicable).

Example Response:

{
    "id_number": "MORGA753116SM9IJ",
    "birth_date": "1976/03/11",
    "issuance_date": "2021/01/01",
    "expiry_date": "2030/12/31",
    "birth_place": "UNITED KINGDOM",
    "country": "UNITED KINGDOM",
    "gender": "",
    "given_names": "SARAH MEREDYTH",
    "surname": "MORGAN",
    "mrz": "",
    "is_forgery": true,
    "forgery_confidence": 0.9,
    "forgery_comment": "Sample watermark present",
    "image_legible": true,
    "image_quality": 0.9,
    "accept": false,
    "decline_comment": "Document is a specimen."
}

Error Handling

If the request fails, the API will return a JSON object with an error message. Common error codes include:

Status CodeDescription
400Bad Request: The request was malformed.
401Unauthorized: Invalid API key or token.
415Unsupported Media Type: Ensure the file type is valid.

Example Error Response:

{
    "error": "Invalid file type. Please upload a valid image."
}