Uploading documents to an applicant

Instead of using a verification link, use this endpoint to upload document images directly via API.

This endpoint allows you to upload document and selfie images directly via API. You may want to do this to fully customise the look and feel of the verification process within your website or application.

Note: You don't need to use this endpoint if you're verifying applicants using a verification link.

Each call can only receive one document. If you're uploading double-sided documents, make sure to send FRONT_SIDE and BACK_SIDE in the docSubType parameter. Verifications won't proceed until all required document images, sides and/or selfie images are uploaded - if applicable to your chosen flow.


Upload documents to your applicant

POST /api-document-upload

Upload documents in base64 format to your applicant, ready for processing.

NameValue

Content-Type

multipart/form-data

Authorization

Bearer YOUR_TOKEN

Body

NameTypeDescription

applicantId

string

Unique applicantId generated on applicant creation (required)

docType

string

Type of document being uploaded, see next page for supported documents and types (required)

docSubType

string

FRONT_SIDE, BACK_SIDE or null (optional)

docCountryISO

string

3-letter country code, eg. AUS (required)

docFile

object

An object representing the file being uploaded, see details below (required)

docFile fields

NameTypeDescription

filename

string

Name of the file, including extension - eg. Photo.jpg (required)

contents

string

File content in base64 encoded format (required)

Request

curl --location 'https://enterprise.personr.co/api/1.1/wf/api-document-upload' \
--data '{
	"applicantId": "4242424242424x424242424242424242",
	"docType": "ID_CARD",
    "docSubType": "FRONT_SIDE", // Remove this when docType is SELFIE
	"docCountryISO": "AUS",
	"docFile": {
        "filename": "idcard_australia.jpg",
        "contents": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
    }
}'

You must upload all required documents for your chosen Flow, otherwise the verification won't proceed. For example, if your Flow requires one identity document and a selfie, you'll need to upload the FRONT_SIDE and BACK_SIDE of the identity document and a selfie image in three separate endpoint calls.

Response

{
    "applicantId": "4242424242424x424242424242424242",
    "documentType": "ID_CARD",
    "documentSubType": "FRONT_SIDE",
    "country": "AUS",
    "errors": [],
    "warnings": []
}

Once all required documents and selfie images have been uploaded for your chosen flow, head to Requesting to start the verification process to confirm everything has been uploaded, and to start the verification check.

Last updated