Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Uploading documents to an entity

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

This endpoint allows you to upload entity documents 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.

Each call can only receive one document. Make sure to send the necessary data in the docSubType parameter.

File size: up to 6 MB per file, as .pdf, .jpg, .jpeg or .png. Larger files fail with an error and aren't saved. If you need to send larger documents, contact us.

The entity must belong to the workspace your API key belongs to. If applicantId is empty, can't be found, or belongs to another workspace, nothing is uploaded and the endpoint returns entity_not_found (see the Not found response below).


Upload documents to your applicant

POST /api-entity-document-upload

Upload a document to an entity, ready for processing.

Name
Value

Content-Type

multipart/form-data or application/json

Authorization

Bearer YOUR_TOKEN

Body

Name
Type
Description

applicantId

string

Unique applicantId generated on applicant creation (required)

docSubType

string

The corporate document type - see next page for the different types.(optional)

docFile

file

The file being uploaded. Send it as a file part in a multipart/form-data request, or in JSON as an object: {"filename": "document.pdf", "contents": "<base64>", "private": true}. A publicly accessible URL also works. (required)

Request

curl -X POST https://enterprise.personr.co/api/1.1/wf/api-entity-document-upload \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -F "applicantId=4242424242424x424242424242424242" \
    -F "docSubType=Certificate of incorporation" \
    -F "docFile=@/path/to/your/file.pdf"
var axios = require('axios');
var FormData = require('form-data');
var fs = require('fs');

var formData = new FormData();

formData.append('applicantId', '4242424242424x424242424242424242');
formData.append('docSubType', 'Certificate of incorporation');
formData.append('docFile', fs.createReadStream('/path/to/your/file.pdf'), 'your_document.pdf');

var config = {
  method: 'post',
  url: 'https://enterprise.personr.co/api/1.1/wf/api-entity-document-upload',
  headers: { 
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    ...formData.getHeaders(), 
  },
  data: formData,
  maxBodyLength: 'Infinity',
  maxContentLength: 'Infinity'
};

axios(config)
.then(function (response) {
  console.log(JSON.stringify(response.data));
})
.catch(function (error) {
  console.log(error);
});

Response

Returned when applicantId is empty, can't be found, or belongs to another workspace. Nothing is uploaded.

Last updated

Was this helpful?