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.
Upload documents to your applicant
POST /api-entity-document-upload
Upload a document to an entity, ready for processing.
Content-Type
multipart/form-data or application/json
Authorization
Bearer YOUR_TOKEN
Body
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?