Skip to main content

Document

A Document represents a file uploaded by a user, such as an identity document, proof of address, or tax record.
Documents are often required as part of the Questionnaire Mechanism, where a question of type document expects a reference (document_id) to a previously uploaded file.


Uploading Documents

To upload a document, use one of the following endpoints depending on the entity type:

  • POST /persons/{person_id}/documents
  • POST /corporates/{corporate_id}/documents
  • POST /individuals/{individual_id}/documents

The document must be uploaded as multipart/form-data with the following fields:

FieldTypeDescription
categoryStringCategory of the document (see Document Categories).
orientationStringPhysical orientation of the document: front, back, or undetermined.
fileBinaryThe file itself.
View Example Request
curl -X POST "https://<kyc_domain>/api/v1/persons/8e9b9a45-6212-4a77-bb43-4b8d123a5e42/documents" \
-H "Authorization: Bearer <token>" \
-F "category=poa" \
-F "orientation=front" \
-F "file=@ElectricityBill.pdf"
View Example Response
{
"id": "c3f67a14-0a4a-4c52-bc69-2905f79dc41f",
"category": "poa",
"orientation": "front",
"name": "ElectricityBill.pdf",
"source": "project/person/8e9b9a45-6212-4a77-bb43-4b8d123a5e42/documentation/c3f67a14-0a4a-4c52-bc69-2905f79dc41f",
"owner_type": "person",
"owner_id": "8e9b9a45-6212-4a77-bb43-4b8d123a5e42",
"created_at": "2024-09-03T14:55:26.346500Z"
}

Listing Documents

Retrieves a paginated list of documents for a specific entity.

Endpoints:

  • GET /persons/{person_id}/documents
  • GET /corporates/{corporate_id}/documents
  • GET /individuals/{individual_id}/documents

Getting a Document

Retrieves metadata for a specific document.

Endpoints:

  • GET /persons/{person_id}/documents/{document_id}
  • GET /corporates/{corporate_id}/documents/{document_id}
  • GET /individuals/{individual_id}/documents/{document_id}

Downloading Documents

To download a document, you must first obtain a temporary signed URL.

Endpoints:

  • GET /persons/{person_id}/documents/{document_id}/download_link
  • GET /corporates/{corporate_id}/documents/{document_id}/download_link
  • GET /individuals/{individual_id}/documents/{document_id}/download_link

Example Response

{
"url": "https://storage.googleapis.com/kyc-bucket/project/person/.../c3f67a14?GoogleAccessId=...",
"expires_in": 3600
}

Linking Documents to Questionnaire Response

When a questionnaire contains a question of type document or multiple_documents, the application should:

  1. Prompt the user to upload the file using the /documents endpoint.
  2. Retrieve the returned document.id from the upload response.
  3. Submit that document.id as part of the questionnaire Response
Category must match the question

The uploaded document's category must be equal to the question's value. A response referencing a document whose category does not match is rejected with a 422 error ("Category 'X' of provided document ID ... does not match question's category 'Y'."). For example, the KYB Onboarding document questions each require a document of the matching corporate category (organizational_chart, commercial_register_extract, ...).

Example document question in a questionnaire:

{
"label": "Please upload your Proof of Address document.",
"value": "poaDocument",
"question_type": "document",
"position": 3,
"is_optional": false,
"id": "0b4e7db0-4ee2-4d74-b7c3-d0500497628c",
"options": []
}

Example answer for this question in a response:

{
"question_id": "0b4e7db0-4ee2-4d74-b7c3-d0500497628c",
"answer_document_id": "c3f67a14-0a4a-4c52-bc69-2905f79dc41f"
}

Document Categories

Valid values for the category field are:

CategoryDescription
id_documentProof of identity (e.g., passport, ID card).
residence_permitResidence permit or visa.
poaProof of address (e.g., utility bill, bank statement).
selfieUser selfie photo.
source_of_fundsDocument providing the source of funds.
retail_eddEnhanced Due Diligence for retail clients.
corporate_eddEnhanced Due Diligence for corporate clients.
article_of_associationArticles of Association of a company.
commercial_register_extractOfficial company register extract.
financial_statementCompany financial statements.
transparency_register_extractExtract from the transparency register.
organizational_chartChart showing the organizational structure.
proof_of_capabilityDocument proving professional capability or license.
rfi_documentDocument provided in response to a Request for Information.
pep_questionnairePolitically Exposed Person questionnaire.
carf_self_declarationCrypto-Asset Reporting Framework self-declaration.
contractSigned business contract or agreement.
power_of_attorneyDocument granting power of attorney.
cvCurriculum Vitae of key personnel.
bank_statementBank statement.
transaction_historyRecord of financial transactions.
kyt_reportKnow Your Transaction report.
tx_monitoring_reportTransaction monitoring report.
sarSuspicious Activity Report.
onboarding_reportCompliance report from the onboarding process.
cdd_reportCustomer Due Diligence report.
periodic_reviewPeriodic review document.
termination_noticeNotice of account or relationship termination.
aml_policyAnti-Money Laundering policy document.
proof_of_licenseProof of regulatory or business license.
other_corporate_documentMiscellaneous corporate document.
other_retail_documentMiscellaneous retail document.
genericGeneral or unclassified document.
trading_historyRecord of trading activities.
fourthline_cdd_reportCustomer Due Diligence report from Fourthline.
undeterminedUsed if no clear category applies.