Skip to content

Documents

Endpoints for interacting with documents

Limits

These are the limits for documents in the EyeDP platform.

Accepted document types

BankStatement, Passport, DrivingLicence, Payslip and UtilityBill

File limits

Files has a size limit of 15MB and must be one of jpg, jpeg, png, gif, bmp, tiff, webp or pdf

IMPORTANT

Bank Statements can only be submitted as PDFs. We are working on accepting image bank statements, please bare with us!

Auto-Detect

Auto detect will attempt to find the file type from out predefined list of supported files automatically.

If auto detect is true you do not need to supply a document type, any document type supplied whilst auto detect is true will be ignored.

If auto detect is false document type must be supplied.

If RejectAllIfAutoDetectFailure all file uploads on the request will fail if one fails. If it is flase or null files that fail type detection will be set to "other" with their IDs returned in the response.

Bank statements still need to be PDF's, if auto detect finds a bank statement and the file is not PDF it will be rejected.

Upload documents

Upload documents to a case.

INFO

Like creating a case this endpoint receives a form data payload. It makes it easy to upload multiple documents at once but can be tricky to get going. You will need to check how to upload form data arrays in your chosen implementation.

Endpoint/api/documents
MethodPOST
Content typemultipart/form-data

Request

FieldDescriptionRequiredLimits
documents[0].typeType of the document, Required IfOptionalSee the limits section
documents[0].filesFile of the documentYesSee the limits section
documents[0].autoDetectBoolean, Auto-Detect document typeOptionalSee the auto-detect section
rejectAllIfAutoDetectFailureBoolean, reject the request if any fail auto-detection rather than classifying as "other"Optional - Defaults to false

Uploading documents in Postman:

Uploading multiple documents in Postman

Response

The response contains the ids of the successful uploaded documents. Along with any auto-detection failure reasons.

json
{
    "successDocumentIds": [
        1485
    ],
    "failureDocuments": [
        {
            "fileName": "example-bank.pdf",
            "error": "Unable to auto-detect document type."
        }
    ]
}

Upload documents and Create Case

Upload documents and create a case from the extacted data.

INFO

Like creating a case this endpoint receives a form data payload. It makes it easy to upload multiple documents at once but can be tricky to get going. You will need to check how to upload form data arrays in your chosen implementation.

Endpoint/api/documents
MethodPOST
Content typemultipart/form-data

Case Type

In order to create a case from a document extraction, we need to know whether the case belongs to a Person or an Entity.

You can specify a caseType in the payload and we'll use that. If caseType is omitted but you have specified the document type when uploading a document, we'll try to infer from that: E.g. If you upload a Passport, we know the case type is Person. If you don't specify the types at all, or we can't tell from the types you've provided, we'll try to detect it ourselves.

Unconfirmed Case Type

Should the Case Type detection process fail to identify, the case will be set to Person and a IsCaseTypeUnconfirmed flag will be set. Whilst in this state, only a select few checks can run. The type can either be confirmed, or the case can be deleted. You can also perform these actions in the portal.

Request

FieldDescriptionRequiredLimits
caseTypeType of the caseOptionalMust be either: 1 for 'Person' or 2 for 'Business'
documents[0].typeType of the document, Required IfOptionalSee the limits section
documents[0].filesFile of the documentYesSee the limits section
documents[0].autoDetectBoolean, Auto-Detect document typeOptionalSee the auto-detect section
rejectAllIfAutoDetectFailureBoolean, reject the request if any fail auto-detection rather than classifying as "other"Optional - Defaults to false

Uploading documents in Postman:

Uploading multiple documents in Postman

Response

The response contains the ids of the successful uploaded documents. Along with any auto-detection failure reasons.

json
{
    "successDocumentIds": [
        1485
    ],
    "failureDocuments": [
        {
            "fileName": "example-bank.pdf",
            "error": "Unable to auto-detect document type."
        }
    ]
}

Get document

Gets a document based on it's id. The response includes the extracted information of the document.

Endpoint/api/cases/{caseId}/documents/{documentId}
MethodGET

Response example

Response of a document while content extraction is in progress

json
{
    "id": 123,
    "name": "Bank Statement #1",
    "documentType": "BankStatement",
    "extractionStatus": "Pending",
    "summary":"The **Bank Statement #1** for the case involving **Frank Tank** is currently undergoing both **tamper detection** and **content validation** checks, which are still in progress. Additionally, the **IDV** check has not been run yet. As a result, there are no risks generated at this time, leaving a gap in the risk assessment for this document.\n\nThe document is currently undergoing extraction, and the relevant information will be accessible soon. Please hold on as we finalize the details to ensure a comprehensive summary. Your patience is appreciated, and we will provide the necessary insights as soon as they become available.",
    "extract": {}
}

Response of a document when content extraction has finished

json

{
    "id": 123,
    "name": "Bank Statement #1",
    "documentType": "BankStatement",
    "extractionStatus": "Completed",
    "extract": {
        "bankStatement": {
            "fullName": "James Smith",
            "fullAddress": "12 Golf Road, Cardiff, 123 123, GB",
            "address1": "12",
            "address4": "Golf Road",
            "address6": "Cardiff",
            "postcode": "123 123",
            "country": "GB",
            "periodStartDate": "2025-02-01T00:00:00",
            "periodEndDate": "2025-02-28T00:00:00",
            "openingBalance": 731.62,
            "closingBalance": 1392.29,
            "hasOverdraft": false,
            "bankName": "Monzo",
            "accountNumber": "99999999",
            "sortCode": "00-00-00",
            "currency": "GBP",
            "dailyBalances": [
                {
                    "date": "2025-02-01T00:00:00",
                    "balance": 853.50
                }
            ],
            "transactions": [
                {
                    "date": "2025-02-21T00:00:00",
                    "amount": -19.00,
                    "description": "Netflix subscription",
                    "category": "Entertainment",
                    "balance": 1313.72
                }}
            ]
        }
    }
}

Delete document

Deletes a document from the case.

Endpoint/api/cases/{caseId}/documents/{documentId}
MethodDELETE