# KYC documents

Endpoints for uploading, retrieving, and managing KYC documents and metadata associated with a business relation.

## Retrieve stored document files with metadata

> Returns every stored document for the specified business relation, including metadata and the binary\
> representation. Each entry contains the metadata attributes (document type, issuer, expiration dates,\
> etc.), MIME type, size, and a base64-encoded payload that can be persisted to disk as PDF, JPEG, Word,\
> etc.\
> \
> Use the \`/v1.1/business-relations/{crmCode}/documents/metadata-only\` GET endpoint when you only need the\
> metadata without retrieving binary content.<br>

```json
{"openapi":"3.0.3","info":{"title":"Apentis API","version":"1.1.0"},"tags":[{"name":"KYC documents","description":"Endpoints for uploading, retrieving, and managing KYC documents and metadata associated with a business relation."}],"servers":[{"url":"https://www.riskquadrant.com/api","description":"API for Production environment - Luxembourg"},{"url":"https://www.riskquadrant.ch/api","description":"API for Production environment - Switzerland"},{"url":"https://www.rq-test.com/api","description":"API for Test environment (for sandbox integration)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"DocumentMetadata":{"type":"object","required":["documentName","documentType"],"properties":{"documentName":{"type":"string","maxLength":200},"documentType":{"$ref":"#/components/schemas/DocumentTypeEnum"},"hasPhysicalFile":{"type":"boolean","description":"Indicates whether a physical document file is stored alongside this metadata entry."},"issuanceDate":{"type":"string","format":"date","description":"Date of issuance of the document (YYYY-MM-DD). Optional."},"expirationDate":{"type":"string","format":"date","description":"Date of expiration of the document (YYYY-MM-DD). Optional."},"documentNumber":{"type":"string","maxLength":30,"description":"Document identification number (e.g., passport or ID card number)."},"isCertifiedTrueCopy":{"type":"boolean","description":"Indicates whether the uploaded document is a certified true copy."},"documentIssuer":{"type":"string","maxLength":2,"description":"ISO 2-letter country code of the country that has issued the document (e.g., 'US', 'FR')."}}},"DocumentTypeEnum":{"type":"string","description":"Document types. See the \"Document types\" reference list in GitBook.","enum":["account_valuation","Acknowledgement of receipt","Advisory mandate contract","AML risk assessment","aml_letter","Annual accounts (audited)","Annual accounts (unaudited)","Annual report","articles_of_incorporation","Bank account details","Bank statement","business_continuity_plan","Certificate of accommodation","Certificate of good standing","certificate of incorporation","Certificate of incumbency","Certificate of insurance","Civil partnership certificate","Client acceptance doc","client_profile","Collateral agreement","Consumer loan agreement","Copy of transaction notices","Corporate structure","Criminal record","CRS self-certification","DAC 6","death_certificate","declaration_of_BO","deed","Discretionary mandate contract","Divorce judgment","Driving licence","Eligibility assessment","Employment certificate","Employment contract","End of relationship doc","Engagement letter","entering business relationship","Family record book","FATCA classification","Financial statement","Financing plan","general_conditions","Health insurance card","ID card scan","investment_profile","KYC Form","kyc_report","Life insurance contract","list_authorized_signatures","Management agreement","Marriage certificate","Memorandum of association","MIFID classification","MIFID form","Mortgage loan agreement","name_check","Others","Passport","Pay slip","Phone subscription","power_of_attorney","Proof of domicile","Proof of listing","Proof of origin of capital","Proof of regulation","Proof of supervision","PV board of directors","PV BoD","PV general assembly","RCS","Register of beneficial owners","Register of directors","Register of shareholders","Resident card","RTO mandate contract","Separation agreement","Status","Structure chart","Tax notice","Tax registration number","termination_letter","Trade / Economic license","Transaction record","Tripartite agreement","Unique Identification Number","utility_bill","VAT registration certificate","VISA page","visit_report","W-8BEN","W-9"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Short description of the error"},"code":{"type":"integer","description":"Application-specific or HTTP error code"}}}}},"paths":{"/v1.1/business-relations/{crmCode}/documents":{"get":{"summary":"Retrieve stored document files with metadata","description":"Returns every stored document for the specified business relation, including metadata and the binary\nrepresentation. Each entry contains the metadata attributes (document type, issuer, expiration dates,\netc.), MIME type, size, and a base64-encoded payload that can be persisted to disk as PDF, JPEG, Word,\netc.\n\nUse the `/v1.1/business-relations/{crmCode}/documents/metadata-only` GET endpoint when you only need the\nmetadata without retrieving binary content.\n","tags":["KYC documents"],"parameters":[{"in":"path","name":"crmCode","required":true,"schema":{"type":"string"},"description":"Unique external identifier of the business relation."}],"responses":{"200":{"description":"Documents retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/DocumentMetadata"},{"type":"object","required":["contentType","fileSizeBytes","contentBase64"],"properties":{"contentType":{"type":"string","description":"MIME type of the stored file (e.g., application/pdf, image/jpeg)."},"fileSizeBytes":{"type":"integer","format":"int64","description":"Size of the document in bytes."},"contentBase64":{"type":"string","format":"byte","description":"Base64-encoded binary content of the document for direct retrieval via the API."}}}]}}}}},"401":{"description":"Unauthorized - Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Business relation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /v1.1/business-relations/{crmCode}/documents

> Upload one or more documents and associated metadata

````json
{"openapi":"3.0.3","info":{"title":"Apentis API","version":"1.1.0"},"tags":[{"name":"KYC documents","description":"Endpoints for uploading, retrieving, and managing KYC documents and metadata associated with a business relation."}],"servers":[{"url":"https://www.riskquadrant.com/api","description":"API for Production environment - Luxembourg"},{"url":"https://www.riskquadrant.ch/api","description":"API for Production environment - Switzerland"},{"url":"https://www.rq-test.com/api","description":"API for Test environment (for sandbox integration)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Short description of the error"},"code":{"type":"integer","description":"Application-specific or HTTP error code"}}}}},"paths":{"/v1.1/business-relations/{crmCode}/documents":{"post":{"summary":"Upload one or more documents and associated metadata","tags":["KYC documents"],"parameters":[{"in":"path","name":"crmCode","required":true,"schema":{"type":"string"},"description":"Unique external identifier of the business relation."}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["files","metadata"],"properties":{"files":{"type":"array","minItems":1,"items":{"type":"string","format":"binary"},"description":"One or more document files to upload (PDF, Word, etc.).\n\nExample: [passport.pdf, proof_of_domicile.pdf]\n"},"metadata":{"type":"string","description":"JSON string representing an array of document metadata.\n⚠️ The number of metadata entries **must exactly match** the number of uploaded files in `files[]`.\n\nExample:\n```json\n[\n  {\n    \"documentName\": \"Passport - Anna Nowak\",\n    \"documentType\": \"Passport\",\n    \"hasPhysicalFile\": true,\n    \"issuanceDate\": \"2019-05-01\",\n    \"expirationDate\": \"2029-05-01\",\n    \"documentNumber\": \"PA123456789\",\n    \"isCertifiedTrueCopy\": true,\n    \"documentIssuer\": \"PL\"\n  },\n  {\n    \"documentName\": \"Proof of Domicile - Anna Nowak\",\n    \"documentType\": \"Proof of domicile\",\n    \"hasPhysicalFile\": true,\n    \"issuanceDate\": \"2023-11-01\",\n    \"expirationDate\": \"2024-11-01\",\n    \"documentNumber\": \"DOM987654321\",\n    \"isCertifiedTrueCopy\": false,\n    \"documentIssuer\": \"PL\"\n  }\n]\n```\n"}}},"encoding":{"metadata":{"contentType":"application/json"}}}}},"responses":{"201":{"description":"Documents uploaded successfully","content":{"application/json":{"schema":{"type":"object","properties":{"uploadedDocumentsCount":{"type":"integer"},"status":{"type":"string"}}}}}},"400":{"description":"Invalid input or metadata count mismatch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Business relation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
````

## DELETE /v1.1/business-relations/{crmCode}/documents

> Delete documents associated with a business relation

```json
{"openapi":"3.0.3","info":{"title":"Apentis API","version":"1.1.0"},"tags":[{"name":"KYC documents","description":"Endpoints for uploading, retrieving, and managing KYC documents and metadata associated with a business relation."}],"servers":[{"url":"https://www.riskquadrant.com/api","description":"API for Production environment - Luxembourg"},{"url":"https://www.riskquadrant.ch/api","description":"API for Production environment - Switzerland"},{"url":"https://www.rq-test.com/api","description":"API for Test environment (for sandbox integration)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Short description of the error"},"code":{"type":"integer","description":"Application-specific or HTTP error code"}}}}},"paths":{"/v1.1/business-relations/{crmCode}/documents":{"delete":{"summary":"Delete documents associated with a business relation","tags":["KYC documents"],"parameters":[{"in":"path","name":"crmCode","required":true,"schema":{"type":"string"},"description":"Unique external identifier of the business relation."},{"in":"query","name":"documentType","required":false,"schema":{"type":"string"},"description":"If provided, only documents matching this type will be deleted."}],"responses":{"200":{"description":"Documents deleted successfully","content":{"application/json":{"schema":{"type":"object","properties":{"deletedDocumentsCount":{"type":"integer","description":"Number of documents deleted"},"status":{"type":"string"}}}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Business relation or documents not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Retrieve document metadata without binary files

> Returns only the metadata of the documents stored for the specified business relation. Use this\
> endpoint when you need to review document completeness, expiration dates, or issuers without\
> downloading the associated files.<br>

```json
{"openapi":"3.0.3","info":{"title":"Apentis API","version":"1.1.0"},"tags":[{"name":"KYC documents","description":"Endpoints for uploading, retrieving, and managing KYC documents and metadata associated with a business relation."}],"servers":[{"url":"https://www.riskquadrant.com/api","description":"API for Production environment - Luxembourg"},{"url":"https://www.riskquadrant.ch/api","description":"API for Production environment - Switzerland"},{"url":"https://www.rq-test.com/api","description":"API for Test environment (for sandbox integration)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"DocumentMetadata":{"type":"object","required":["documentName","documentType"],"properties":{"documentName":{"type":"string","maxLength":200},"documentType":{"$ref":"#/components/schemas/DocumentTypeEnum"},"hasPhysicalFile":{"type":"boolean","description":"Indicates whether a physical document file is stored alongside this metadata entry."},"issuanceDate":{"type":"string","format":"date","description":"Date of issuance of the document (YYYY-MM-DD). Optional."},"expirationDate":{"type":"string","format":"date","description":"Date of expiration of the document (YYYY-MM-DD). Optional."},"documentNumber":{"type":"string","maxLength":30,"description":"Document identification number (e.g., passport or ID card number)."},"isCertifiedTrueCopy":{"type":"boolean","description":"Indicates whether the uploaded document is a certified true copy."},"documentIssuer":{"type":"string","maxLength":2,"description":"ISO 2-letter country code of the country that has issued the document (e.g., 'US', 'FR')."}}},"DocumentTypeEnum":{"type":"string","description":"Document types. See the \"Document types\" reference list in GitBook.","enum":["account_valuation","Acknowledgement of receipt","Advisory mandate contract","AML risk assessment","aml_letter","Annual accounts (audited)","Annual accounts (unaudited)","Annual report","articles_of_incorporation","Bank account details","Bank statement","business_continuity_plan","Certificate of accommodation","Certificate of good standing","certificate of incorporation","Certificate of incumbency","Certificate of insurance","Civil partnership certificate","Client acceptance doc","client_profile","Collateral agreement","Consumer loan agreement","Copy of transaction notices","Corporate structure","Criminal record","CRS self-certification","DAC 6","death_certificate","declaration_of_BO","deed","Discretionary mandate contract","Divorce judgment","Driving licence","Eligibility assessment","Employment certificate","Employment contract","End of relationship doc","Engagement letter","entering business relationship","Family record book","FATCA classification","Financial statement","Financing plan","general_conditions","Health insurance card","ID card scan","investment_profile","KYC Form","kyc_report","Life insurance contract","list_authorized_signatures","Management agreement","Marriage certificate","Memorandum of association","MIFID classification","MIFID form","Mortgage loan agreement","name_check","Others","Passport","Pay slip","Phone subscription","power_of_attorney","Proof of domicile","Proof of listing","Proof of origin of capital","Proof of regulation","Proof of supervision","PV board of directors","PV BoD","PV general assembly","RCS","Register of beneficial owners","Register of directors","Register of shareholders","Resident card","RTO mandate contract","Separation agreement","Status","Structure chart","Tax notice","Tax registration number","termination_letter","Trade / Economic license","Transaction record","Tripartite agreement","Unique Identification Number","utility_bill","VAT registration certificate","VISA page","visit_report","W-8BEN","W-9"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Short description of the error"},"code":{"type":"integer","description":"Application-specific or HTTP error code"}}}}},"paths":{"/v1.1/business-relations/{crmCode}/documents/metadata-only":{"get":{"summary":"Retrieve document metadata without binary files","description":"Returns only the metadata of the documents stored for the specified business relation. Use this\nendpoint when you need to review document completeness, expiration dates, or issuers without\ndownloading the associated files.\n","tags":["KYC documents"],"parameters":[{"in":"path","name":"crmCode","required":true,"schema":{"type":"string"},"description":"Unique external identifier of the business relation."}],"responses":{"200":{"description":"Document metadata retrieved successfully","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentMetadata"}}}}},"401":{"description":"Unauthorized - Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Business relation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## POST /v1.1/business-relations/{crmCode}/documents/metadata-only

> Submit document metadata without file

```json
{"openapi":"3.0.3","info":{"title":"Apentis API","version":"1.1.0"},"tags":[{"name":"KYC documents","description":"Endpoints for uploading, retrieving, and managing KYC documents and metadata associated with a business relation."}],"servers":[{"url":"https://www.riskquadrant.com/api","description":"API for Production environment - Luxembourg"},{"url":"https://www.riskquadrant.ch/api","description":"API for Production environment - Switzerland"},{"url":"https://www.rq-test.com/api","description":"API for Test environment (for sandbox integration)"}],"security":[{"bearerAuth":[]}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"DocumentMetadata":{"type":"object","required":["documentName","documentType"],"properties":{"documentName":{"type":"string","maxLength":200},"documentType":{"$ref":"#/components/schemas/DocumentTypeEnum"},"hasPhysicalFile":{"type":"boolean","description":"Indicates whether a physical document file is stored alongside this metadata entry."},"issuanceDate":{"type":"string","format":"date","description":"Date of issuance of the document (YYYY-MM-DD). Optional."},"expirationDate":{"type":"string","format":"date","description":"Date of expiration of the document (YYYY-MM-DD). Optional."},"documentNumber":{"type":"string","maxLength":30,"description":"Document identification number (e.g., passport or ID card number)."},"isCertifiedTrueCopy":{"type":"boolean","description":"Indicates whether the uploaded document is a certified true copy."},"documentIssuer":{"type":"string","maxLength":2,"description":"ISO 2-letter country code of the country that has issued the document (e.g., 'US', 'FR')."}}},"DocumentTypeEnum":{"type":"string","description":"Document types. See the \"Document types\" reference list in GitBook.","enum":["account_valuation","Acknowledgement of receipt","Advisory mandate contract","AML risk assessment","aml_letter","Annual accounts (audited)","Annual accounts (unaudited)","Annual report","articles_of_incorporation","Bank account details","Bank statement","business_continuity_plan","Certificate of accommodation","Certificate of good standing","certificate of incorporation","Certificate of incumbency","Certificate of insurance","Civil partnership certificate","Client acceptance doc","client_profile","Collateral agreement","Consumer loan agreement","Copy of transaction notices","Corporate structure","Criminal record","CRS self-certification","DAC 6","death_certificate","declaration_of_BO","deed","Discretionary mandate contract","Divorce judgment","Driving licence","Eligibility assessment","Employment certificate","Employment contract","End of relationship doc","Engagement letter","entering business relationship","Family record book","FATCA classification","Financial statement","Financing plan","general_conditions","Health insurance card","ID card scan","investment_profile","KYC Form","kyc_report","Life insurance contract","list_authorized_signatures","Management agreement","Marriage certificate","Memorandum of association","MIFID classification","MIFID form","Mortgage loan agreement","name_check","Others","Passport","Pay slip","Phone subscription","power_of_attorney","Proof of domicile","Proof of listing","Proof of origin of capital","Proof of regulation","Proof of supervision","PV board of directors","PV BoD","PV general assembly","RCS","Register of beneficial owners","Register of directors","Register of shareholders","Resident card","RTO mandate contract","Separation agreement","Status","Structure chart","Tax notice","Tax registration number","termination_letter","Trade / Economic license","Transaction record","Tripartite agreement","Unique Identification Number","utility_bill","VAT registration certificate","VISA page","visit_report","W-8BEN","W-9"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string","description":"Short description of the error"},"code":{"type":"integer","description":"Application-specific or HTTP error code"}}}}},"paths":{"/v1.1/business-relations/{crmCode}/documents/metadata-only":{"post":{"summary":"Submit document metadata without file","tags":["KYC documents"],"parameters":[{"in":"path","name":"crmCode","required":true,"schema":{"type":"string"},"description":"Unique external identifier of the business relation."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentMetadata"}}}},"responses":{"201":{"description":"Document metadata saved successfully"},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Business relation not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apentis.gitbook.io/apentis-api/api-reference/kyc-documents.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
