Documents
Overview
Documents endpoints provide document listing, creation, management, and file operations.
Endpoint Summary
| Method | Route | Purpose |
|---|---|---|
GET | /v1/documents | List documents |
POST | /v1/documents | Create document |
GET | /v1/documents/{documentId} | Get document by ID |
PUT | /v1/documents/{documentId} | Update document |
DELETE | /v1/documents/{documentId} | Delete document |
GET | /v1/documents/{documentId}/files | List files |
POST | /v1/documents/{documentId}/files | Attach files |
DELETE | /v1/documents/{documentId}/files | Remove files |
GET | /v1/documents/{documentId}/files/{fileId}/download | Download attached file |
GET /v1/documents
Return paginated documents for the selected entity scope.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Accept | Yes | application/json |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
entity_type | string | Yes | Document scope entity type (for example case, task, expat, assignment). |
entity_id | number | Yes | Scoped entity identifier. |
page | number | No | Page number. |
per_page | number | No | Items per page. |
search_text | string | No | Search value. |
order | string | No | Sort field. |
order_direction | string | No | asc or desc. |
status | array | No | Status filter values. |
tag_ids | array<number> | No | Tag filter values. |
document_type_id | number | No | Document type filter. |
country_code | string | No | Country filter. |
linked_entity_type | string | No | Linked resource filter. |
include | array<string> | No | Include options (filters, details, files). |
Example Request
curl -X GET "{{BASE_URL}}/v1/documents?entity_type=case&entity_id=590&page=1&per_page=20" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"
Success Response (200)
{
"success": true,
"result": {
"currentPage": 1,
"perPage": 20,
"lastPage": 1,
"total": 1,
"items": [
{
"id": 1300,
"entity_id": 590,
"entity_type": "case",
"created_by": {
"id": 501,
"text": "John Manager"
},
"number": "DOC-2026-001",
"name": "Visa Approval",
"status_id": 1,
"status_label": "Active",
"expiration_date": "2027-05-31",
"created_at": "2026-05-02",
"document_type": {
"id": 7,
"text": "Immigration Document"
},
"file_type": "pdf",
"country": {
"id": 80,
"alpha2": "DE",
"name": "Germany"
},
"can_update": true,
"can_delete": true,
"service_category": {
"id": 3,
"name": "Immigration"
},
"expat_name": "Jane Doe",
"client_name": "Example Client Ltd",
"reminder_date": null,
"case_id": 590,
"tags": [],
"files": [
{
"id": 4501,
"type": "pdf",
"key_path": "documents/2026/05/visa-approval.pdf",
"size": 208734,
"file_path": "https://cdn.example.com/documents/2026/05/visa-approval.pdf",
"name": "visa-approval"
}
]
}
],
"filters": []
}
}
POST /v1/documents
Create a document in an entity scope.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Content-Type | Yes | multipart/form-data |
Accept | Yes | application/json |
Multipart Fields
| Field | Type | Required | Description |
|---|---|---|---|
entity_type | string | Yes | Document scope entity type. |
entity_id | number | Yes | Scoped entity identifier. |
file[] | file | Yes | One or more document files. |
document_type_id | number | Yes | Document type identifier. |
name | string | No | Document name. |
number | string | No | Document number. |
expiration_date | string | No | Expiration date (YYYY-MM-DD). |
country_code | string | No | Country ISO2 code. |
service_category_id | number | No | Service category identifier. |
status_id | number | No | Status identifier. |
multiple | boolean | No | Multiple file processing flag. |
case_id | number | No | Linked case identifier. |
Example Request
curl -X POST "{{BASE_URL}}/v1/documents" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json" \
-F "entity_type=case" \
-F "entity_id=590" \
-F "document_type_id=7" \
-F "name=Visa Approval" \
-F "number=DOC-2026-001" \
-F "expiration_date=2027-05-31" \
-F "country_code=DE" \
-F "file[]=@/path/to/visa-approval.pdf"
Success Response (200)
{
"success": true,
"result": {
"document": {
"id": 1300,
"entity_id": 590,
"created_by": {
"id": 501,
"text": "John Manager"
},
"number": "DOC-2026-001",
"name": "Visa Approval",
"status_id": 1,
"status_label": "Active",
"expiration_date": "2027-05-31",
"created_at": "2026-05-02",
"document_type": {
"id": 7,
"text": "Immigration Document"
},
"country": {
"id": 80,
"alpha2": "DE",
"name": "Germany"
},
"service_category": {
"id": 3,
"name": "Immigration"
},
"entity_type": "case",
"can_update": true,
"can_delete": true,
"reminder_date": null,
"case_id": 590,
"files": [
{
"id": 4501,
"type": "pdf",
"key_path": "documents/2026/05/visa-approval.pdf",
"size": 208734,
"file_path": "https://cdn.example.com/documents/2026/05/visa-approval.pdf",
"name": "visa-approval"
}
],
"tags": []
}
}
}
GET /v1/documents/{documentId}
Return one document by ID.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Accept | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | number | Yes | Document identifier. |
Example Request
curl -X GET "{{BASE_URL}}/v1/documents/{{DOCUMENT_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"
Success Response (200)
{
"success": true,
"result": {
"document": {
"id": 1300,
"entity_id": 590,
"created_by": {
"id": 501,
"text": "John Manager"
},
"number": "DOC-2026-001",
"name": "Visa Approval",
"status_id": 1,
"status_label": "Active",
"expiration_date": "2027-05-31",
"created_at": "2026-05-02",
"document_type": {
"id": 7,
"text": "Immigration Document"
},
"country": {
"id": 80,
"alpha2": "DE",
"name": "Germany"
},
"service_category": {
"id": 3,
"name": "Immigration"
},
"entity_type": "case",
"can_update": true,
"can_delete": true,
"reminder_date": null,
"case_id": 590,
"files": [
{
"id": 4501,
"type": "pdf",
"key_path": "documents/2026/05/visa-approval.pdf",
"size": 208734,
"file_path": "https://cdn.example.com/documents/2026/05/visa-approval.pdf",
"name": "visa-approval"
}
],
"tags": []
}
}
}
PUT /v1/documents/{documentId}
Update document metadata.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Content-Type | Yes | application/json |
Accept | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | number | Yes | Document identifier. |
Request Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
document_type_id | number | Yes | Document type identifier. |
name | string | No | Document name. |
number | string | No | Document number. |
expiration_date | string | No | Expiration date (YYYY-MM-DD). |
country_code | string | No | Country ISO2 code. |
service_category_id | number | No | Service category identifier. |
Example Request
curl -X PUT "{{BASE_URL}}/v1/documents/{{DOCUMENT_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"document_type_id": 7,
"name": "Visa Approval Updated",
"number": "DOC-2026-001A",
"expiration_date": "2027-06-30",
"country_code": "DE"
}'
Success Response (200)
{
"success": true,
"result": {
"document": {
"id": 1300,
"entity_id": 590,
"created_by": {
"id": 501,
"text": "John Manager"
},
"number": "DOC-2026-001A",
"name": "Visa Approval Updated",
"status_id": 1,
"status_label": "Active",
"expiration_date": "2027-06-30",
"created_at": "2026-05-02",
"document_type": {
"id": 7,
"text": "Immigration Document"
},
"country": {
"id": 80,
"alpha2": "DE",
"name": "Germany"
},
"service_category": {
"id": 3,
"name": "Immigration"
},
"entity_type": "case",
"can_update": true,
"can_delete": true,
"reminder_date": null,
"case_id": 590,
"files": [
{
"id": 4501,
"type": "pdf",
"key_path": "documents/2026/05/visa-approval.pdf",
"size": 208734,
"file_path": "https://cdn.example.com/documents/2026/05/visa-approval.pdf",
"name": "visa-approval"
}
],
"tags": []
}
}
}
DELETE /v1/documents/{documentId}
Delete a document.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Accept | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | number | Yes | Document identifier. |
Example Request
curl -X DELETE "{{BASE_URL}}/v1/documents/{{DOCUMENT_ID}}" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"
Success Response (200)
{
"success": true,
"result": {
"success": true
}
}
GET /v1/documents/{documentId}/files
Return attached files for a document.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Accept | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | number | Yes | Document identifier. |
Example Request
curl -X GET "{{BASE_URL}}/v1/documents/{{DOCUMENT_ID}}/files" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"
Success Response (200)
{
"success": true,
"result": {
"files": [
{
"id": 4501,
"type": "pdf",
"key_path": "documents/2026/05/visa-approval.pdf",
"size": 208734,
"file_path": "https://cdn.example.com/documents/2026/05/visa-approval.pdf",
"name": "visa-approval"
}
]
}
}
POST /v1/documents/{documentId}/files
Attach files to an existing document.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Content-Type | Yes | multipart/form-data |
Accept | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | number | Yes | Document identifier. |
Multipart Fields
| Field | Type | Required | Description |
|---|---|---|---|
file[] | file | Yes | One or more files to attach. |
Example Request
curl -X POST "{{BASE_URL}}/v1/documents/{{DOCUMENT_ID}}/files" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json" \
-F "file[]=@/path/to/appendix.pdf"
Success Response (200)
{
"success": true,
"result": {
"document": [
{
"id": 4501,
"type": "pdf",
"key_path": "documents/2026/05/visa-approval.pdf",
"size": 208734,
"file_path": "https://cdn.example.com/documents/2026/05/visa-approval.pdf",
"name": "visa-approval"
},
{
"id": 4502,
"type": "pdf",
"key_path": "documents/2026/05/appendix.pdf",
"size": 102300,
"file_path": "https://cdn.example.com/documents/2026/05/appendix.pdf",
"name": "appendix"
}
]
}
}
DELETE /v1/documents/{documentId}/files
Remove one or more attached files.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Content-Type | Yes | application/json |
Accept | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | number | Yes | Document identifier. |
Request Body Fields
| Field | Type | Required | Description |
|---|---|---|---|
file_ids | array<number> | Yes | File IDs to remove. |
Example Request
curl -X DELETE "{{BASE_URL}}/v1/documents/{{DOCUMENT_ID}}/files" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"file_ids": [4502]
}'
Success Response (200)
{
"success": true,
"result": {
"success": true
}
}
GET /v1/documents/{documentId}/files/{fileId}/download
Return a downloadable URL for a document file.
Headers
| Header | Required | Value |
|---|---|---|
Authorization | Yes | Bearer {{ACCESS_TOKEN}} |
Accept | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
documentId | number | Yes | Document identifier. |
fileId | number | Yes | File identifier. |
Example Request
curl -X GET "{{BASE_URL}}/v1/documents/{{DOCUMENT_ID}}/files/{{FILE_ID}}/download" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Accept: application/json"
Success Response (200)
{
"success": true,
"result": "https://cdn.example.com/signed/documents/2026/05/visa-approval.pdf?signature=..."
}