Developer Centre
Platform LoginStatus
  • Getting started
    • Integration types
    • Generating an authentication token
    • Using basic authentication
  • Applicants
    • Creating an applicant
    • Generating a verification link
    • Uploading documents to an applicant
      • Supported Documents and Types
    • Requesting to start the verification process
  • Applicant Results
    • Retrieving applicant verification results
      • Understanding applicant rejection labels
      • Setting up a webhook
    • Downloading verified documents
  • Entities
    • Check types and coverage
    • Creating an entity
    • Generating a verification link
    • Uploading documents to an entity
      • Supported Documents and Types
    • Linking a UBO to an entity
    • Requesting to start the verification process
  • Entity Results
    • Retrieving entity verification results
      • Understanding entity rejection labels
      • Setting up a webhook
    • Retrieving entity ownership structures
    • Retrieving entity questionnaire answers
  • Anti-Money Laundering
    • Retrieving AML results
  • Database Verification
    • Applicants
      • Verifying applicant identity data
    • Entities
      • Verifying entity information
  • Pages
    • Overview
    • Creating a Page
    • Verifying with Pages
  • Domain Names
    • Overview
    • Linking your domain
  • Flow Logic
    • Overview
  • Workspaces
    • Switching Workspaces
  • Modules
Powered by GitBook
On this page

Was this helpful?

  1. Applicants

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.

Name
Value

Content-Type

multipart/form-data

Authorization

Bearer YOUR_TOKEN

Body

Name
Type
Description

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

docFile

object

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

docFile fields

Name
Type
Description

filename

string

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

contents

string

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..."
    }
}'
var axios = require('axios');
var data = '{\r\n\t"applicantId": "4242424242424x424242424242424242",\r\n\t"docType": "ID_CARD",\r\n    "docSubType": "FRONT_SIDE",\r\n\t"docCountryISO": "AUS",\r\n\t"docFile": {\r\n        "filename": "idcard_australia.jpg",\r\n        "contents": "/9j/4AAQSkZJRgABAQAAAQABAAD..."\r\n    }\r\n}';

var config = {
  method: 'post',
maxBodyLength: Infinity,
  url: 'https://enterprise.personr.co/api/1.1/wf/api-document-upload',
  headers: { },
  data : data
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});
const url = "https://enterprise.personr.co/api/1.1/wf/api-document-upload";
        
        const payload = {
            "applicantId": "4242424242424x424242424242424242",
            "docType": "ID_CARD",
            "docSubType": "FRONT_SIDE",
            "docCountryISO": "AUS",
            "docFile": {
                "filename": "idcard_australia.jpg",
                "contents": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
            }
        };
require "uri"
require "net/http"

url = URI("https://enterprise.personr.co/api/1.1/wf/api-document-upload")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request.body = "{\r\n\t\"applicantId\": \"4242424242424x424242424242424242\",\r\n\t\"docType\": \"ID_CARD\",\r\n    \"docSubType\": \"FRONT_SIDE\",\r\n\t\"docCountryISO\": \"AUS\",\r\n\t\"docFile\": {\r\n        \"filename\": \"idcard_australia.jpg\",\r\n        \"contents\": \"/9j/4AAQSkZJRgABAQAAAQABAAD...\"\r\n    }\r\n}"

response = https.request(request)
puts response.read_body
import requests

url = "https://enterprise.personr.co/api/1.1/wf/api-document-upload"

payload = "{\r\n\t\"applicantId\": \"4242424242424x424242424242424242\",\r\n\t\"docType\": \"ID_CARD\",\r\n    \"docSubType\": \"FRONT_SIDE\",\r\n\t\"docCountryISO\": \"AUS\",\r\n\t\"docFile\": {\r\n        \"filename\": \"idcard_australia.jpg\",\r\n        \"contents\": \"/9j/4AAQSkZJRgABAQAAAQABAAD...\"\r\n    }\r\n}"
headers = {}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

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": []
}
{
    "statusCode": 400,
    "message": "Error: Cannot read docSets - invalid docType provided."
}

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.

PreviousGenerating a verification linkNextSupported Documents and Types

Last updated 1 year ago

Was this helpful?

3-letter , eg. AUS (required)

File content in format (required)

country code
base64 encoded