# List Documents

This endpoint provides comprehensive document metadata including file information, verification status, and administrative details for all documents belonging to the customer.

**Endpoint**

`GET/v2/customer/{customerId}/file`

**Link**

{% embed url="<https://stagep.tst-apidmndelss.com/openapi/v2.html#/operations/Customer_ListDocuments>" %}

### **Request**

#### **Path Parameters**

| Parameter        | Type     | Description                                | Required | Example        |
| ---------------- | -------- | ------------------------------------------ | -------- | -------------- |
| **`customerId`** | `string` | **Customer ID** to retrieve documents for. | Yes      | `"cust_12345"` |

#### **Query Parameters**

| Parameter           | Type      | Description                  | Required | Example |
| ------------------- | --------- | ---------------------------- | -------- | ------- |
| **`meta.page`**     | `integer` | Page number (starts from 0). | No       | `0`     |
| **`meta.pageSize`** | `integer` | Number of items per page.    | No       | `20`    |

#### **Headers**

| Key                 | Value              | Required |
| ------------------- | ------------------ | -------- |
| **`Authorization`** | `123`              | Yes      |
| **`Accept`**        | `application/json` | Yes      |

***

### **Response (200 OK)**

Returns a paginated list of document metadata with comprehensive information about each document.

#### **Response Fields**

**1. Items Array (Document List)**

| Field            | Type      | Description                                    | Example                             |
| ---------------- | --------- | ---------------------------------------------- | ----------------------------------- |
| **`id`**         | `string`  | Unique document identifier.                    | `"doc_abc123"`                      |
| **`customerId`** | `string`  | Customer ID who owns the document.             | `"cust_12345"`                      |
| **`fileName`**   | `string`  | Original filename.                             | `"passport_scan.pdf"`               |
| **`size`**       | `integer` | File size in bytes.                            | `2048576`                           |
| **`mime`**       | `string`  | MIME type of the document.                     | `"application/pdf"`                 |
| **`docType`**    | `string`  | Document type/category.                        | `"PASSPORT"`                        |
| **`info`**       | `string`  | Additional information/notes.                  | `"Primary identification document"` |
| **`isLock`**     | `boolean` | Whether document is locked from modifications. | `false`                             |
| **`createAt`**   | `string`  | Document creation timestamp.                   | `"2024-05-15T10:30:00Z"`            |
| **`status`**     | `string`  | Current verification status.                   | `"DST_APPROVED"`                    |

**2. Meta Object (Pagination)**

| Field          | Type      | Description                      | Example |
| -------------- | --------- | -------------------------------- | ------- |
| **`pageSize`** | `integer` | Number of items per page.        | `20`    |
| **`page`**     | `integer` | Current page number (0-indexed). | `0`     |
| **`total`**    | `string`  | Total number of documents.       | `"15"`  |

**Example Response:**

json

```
{
  "items": [
    {
      "id": "doc_pass123",
      "customerId": "cust_12345",
      "fileName": "passport_scan.pdf",
      "size": 2048576,
      "mime": "application/pdf",
      "docType": "PASSPORT",
      "info": "Primary identification - US passport",
      "isLock": true,
      "createAt": "2024-05-15T10:30:00Z",
      "status": "DST_APPROVED"
    },
    {
      "id": "doc_util456",
      "customerId": "cust_12345",
      "fileName": "utility_bill.jpg",
      "size": 1856320,
      "mime": "image/jpeg",
      "docType": "UTILITY_BILL",
      "info": "Address verification - electricity bill",
      "isLock": false,
      "createAt": "2024-05-18T09:15:00Z",
      "status": "DST_SUBMITTED"
    }
  ],
  "meta": {
    "pageSize": 20,
    "page": 0,
    "total": "15"
  }
}
```

***

### **Field Details**

#### **Document Type Values**

| Document Type                               | Description               | Common Use             |
| ------------------------------------------- | ------------------------- | ---------------------- |
| **`PASSPORT`**                              | Passport document         | Identity verification  |
| **`DRIVERS_LICENCE_FRONT`**                 | Driver's license (front)  | Identity verification  |
| **`DRIVERS_LICENCE_BACK`**                  | Driver's license (back)   | Identity verification  |
| **`GOVERNMENT_ID_FRONT`**                   | Government ID (front)     | Identity verification  |
| **`GOVERNMENT_ID_BACK`**                    | Government ID (back)      | Identity verification  |
| **`UTILITY_BILL`**                          | Utility bill              | Address verification   |
| **`BANK_STATEMENT`**                        | Bank statement            | Financial verification |
| **`INCORPORATION_DOCUMENTS`**               | Business incorporation    | Business verification  |
| **`ARTICLES_OF_INCORPORATION`**             | Articles of incorporation | Business verification  |
| **`FINANCIAL_STATEMENT`**                   | Financial statements      | Financial verification |
| **`LEASE_AGREEMENT`**                       | Lease agreement           | Address verification   |
| **`PAYSLIP`**                               | Payslip                   | Income verification    |
| **`OPERATION_DOCUMENT`**                    | Operation-related         | Transaction support    |
| **`OTHER_1`**, **`OTHER_2`**, **`OTHER_3`** | Miscellaneous             | Various purposes       |

#### **Document Status Values**

| Status                      | Description        | Meaning                        |
| --------------------------- | ------------------ | ------------------------------ |
| **`DST_APPROVED`**          | Document approved  | Verified and accepted          |
| **`DST_SUBMITTED`**         | Document submitted | Awaiting review                |
| **`DST_CHANGES_REQUESTED`** | Changes requested  | Requires modifications         |
| **`DST_REJECTED`**          | Document rejected  | Failed verification            |
| **`DST_MISSING`**           | Document missing   | Required document not provided |

#### **Common MIME Types**

| MIME Type                | Description   | Typical Use                 |
| ------------------------ | ------------- | --------------------------- |
| **`application/pdf`**    | PDF document  | Contracts, statements       |
| **`image/jpeg`**         | JPEG image    | Photos, scans               |
| **`image/png`**          | PNG image     | Screenshots, digital images |
| **`application/msword`** | Word document | Agreements, letters         |

***

### **Examples**

#### **Request**

bash

```
curl -X GET 'https://stagep.tst-apidmndelss.com/v2/customer/cust_12345/file?meta.page=0&meta.pageSize=10' \
  -H 'Authorization: 123' \
  -H 'Accept: application/json'
```

#### **Complete Customer Document Set Example**

**Response:**

json

```
{
  "items": [
    {
      "id": "doc_pass123",
      "customerId": "cust_12345",
      "fileName": "us_passport.pdf",
      "size": 3120450,
      "mime": "application/pdf",
      "docType": "PASSPORT",
      "info": "Primary identification - US passport",
      "isLock": true,
      "createAt": "2024-05-10T14:20:00Z",
      "status": "DST_APPROVED"
    },
    {
      "id": "doc_dl_front456",
      "customerId": "cust_12345",
      "fileName": "drivers_license_front.png",
      "size": 2456789,
      "mime": "image/png",
      "docType": "DRIVERS_LICENCE_FRONT",
      "info": "California driver's license - front",
      "isLock": true,
      "createAt": "2024-05-12T13:20:00Z",
      "status": "DST_APPROVED"
    },
    {
      "id": "doc_dl_back789",
      "customerId": "cust_12345",
      "fileName": "drivers_license_back.png",
      "size": 2387654,
      "mime": "image/png",
      "docType": "DRIVERS_LICENCE_BACK",
      "info": "California driver's license - back",
      "isLock": true,
      "createAt": "2024-05-12T13:20:00Z",
      "status": "DST_APPROVED"
    },
    {
      "id": "doc_util321",
      "customerId": "cust_12345",
      "fileName": "electricity_bill_may_2024.jpg",
      "size": 1856320,
      "mime": "image/jpeg",
      "docType": "UTILITY_BILL",
      "info": "Address verification - electricity bill",
      "isLock": false,
      "createAt": "2024-05-18T09:15:00Z",
      "status": "DST_SUBMITTED"
    },
    {
      "id": "doc_bank654",
      "customerId": "cust_12345",
      "fileName": "bank_statement_q1_2024.pdf",
      "size": 2987654,
      "mime": "application/pdf",
      "docType": "BANK_STATEMENT",
      "info": "Financial verification - bank statement",
      "isLock": false,
      "createAt": "2024-05-20T11:30:00Z",
      "status": "DST_CHANGES_REQUESTED"
    }
  ],
  "meta": {
    "pageSize": 10,
    "page": 0,
    "total": "5"
  }
}
```

#### **Business Customer Documents Example**

**Response:**

json

```
{
  "items": [
    {
      "id": "doc_incorp123",
      "customerId": "cust_biz999",
      "fileName": "articles_of_incorporation.pdf",
      "size": 5120480,
      "mime": "application/pdf",
      "docType": "ARTICLES_OF_INCORPORATION",
      "info": "Delaware incorporation documents",
      "isLock": true,
      "createAt": "2024-04-15T08:45:00Z",
      "status": "DST_APPROVED"
    },
    {
      "id": "doc_benef456",
      "customerId": "cust_biz999",
      "fileName": "beneficial_ownership.pdf",
      "size": 3456789,
      "mime": "application/pdf",
      "docType": "BENEFICIAL_CERTIFICATE",
      "info": "Beneficial ownership certification",
      "isLock": true,
      "createAt": "2024-04-16T10:20:00Z",
      "status": "DST_APPROVED"
    },
    {
      "id": "doc_financial789",
      "customerId": "cust_biz999",
      "fileName": "financial_statements_2023.pdf",
      "size": 8120456,
      "mime": "application/pdf",
      "docType": "FINANCIAL_STATEMENT",
      "info": "Annual financial statements 2023",
      "isLock": false,
      "createAt": "2024-05-05T14:30:00Z",
      "status": "DST_SUBMITTED"
    },
    {
      "id": "doc_operation321",
      "customerId": "cust_biz999",
      "fileName": "invoice_contract.pdf",
      "size": 1987654,
      "mime": "application/pdf",
      "docType": "OPERATION_DOCUMENT",
      "info": "Client invoice and contract",
      "isLock": false,
      "createAt": "2024-05-18T16:45:00Z",
      "status": "DST_APPROVED"
    }
  ],
  "meta": {
    "pageSize": 10,
    "page": 0,
    "total": "4"
  }
}
```

#### **Customer with Mixed Status Documents Example**

**Response:**

json

```
{
  "items": [
    {
      "id": "doc_pass111",
      "customerId": "cust_mixed555",
      "fileName": "passport.pdf",
      "size": 2876543,
      "mime": "application/pdf",
      "docType": "PASSPORT",
      "info": "UK passport",
      "isLock": true,
      "createAt": "2024-05-01T09:00:00Z",
      "status": "DST_APPROVED"
    },
    {
      "id": "doc_bill222",
      "customerId": "cust_mixed555",
      "fileName": "water_bill.jpg",
      "size": 1654321,
      "mime": "image/jpeg",
      "docType": "UTILITY_BILL",
      "info": "Water bill for address proof",
      "isLock": false,
      "createAt": "2024-05-10T11:15:00Z",
      "status": "DST_REJECTED"
    },
    {
      "id": "doc_bank333",
      "customerId": "cust_mixed555",
      "fileName": "bank_statement.pdf",
      "size": 3456789,
      "mime": "application/pdf",
      "docType": "BANK_STATEMENT",
      "info": "Recent bank statement",
      "isLock": false,
      "createAt": "2024-05-15T13:45:00Z",
      "status": "DST_CHANGES_REQUESTED"
    },
    {
      "id": "doc_payslip444",
      "customerId": "cust_mixed555",
      "fileName": "payslip_april.pdf",
      "size": 1234567,
      "mime": "application/pdf",
      "docType": "PAYSLIP",
      "info": "April 2024 payslip",
      "isLock": false,
      "createAt": "2024-05-20T15:30:00Z",
      "status": "DST_SUBMITTED"
    }
  ],
  "meta": {
    "pageSize": 10,
    "page": 0,
    "total": "4"
  }
}
```

#### **Empty Document List Example**

**Response:**

json

```
{
  "items": [],
  "meta": {
    "pageSize": 20,
    "page": 0,
    "total": "0"
  }
}
```

#### **Pagination Example (Second Page)**

**Request:**

bash

```
curl -X GET 'https://stagep.tst-apidmndelss.com/v2/customer/cust_12345/file?meta.page=1&meta.pageSize=5'
```

**Response:**

json

```
{
  "items": [
    {
      "id": "doc_lease555",
      "customerId": "cust_12345",
      "fileName": "lease_agreement.pdf",
      "size": 4123456,
      "mime": "application/pdf",
      "docType": "LEASE_AGREEMENT",
      "info": "Rental agreement for current address",
      "isLock": false,
      "createAt": "2024-05-22T10:00:00Z",
      "status": "DST_SUBMITTED"
    },
    {
      "id": "doc_other666",
      "customerId": "cust_12345",
      "fileName": "additional_info.pdf",
      "size": 987654,
      "mime": "application/pdf",
      "docType": "OTHER_1",
      "info": "Additional supporting documents",
      "isLock": false,
      "createAt": "2024-05-22T14:20:00Z",
      "status": "DST_SUBMITTED"
    }
  ],
  "meta": {
    "pageSize": 5,
    "page": 1,
    "total": "7"
  }
}
```

***

### **Error Responses**

1. **Customer Not Found**:

   json

   ```
   { "error": "Customer not found: cust_99999" }
   ```
2. **Unauthorized**:

   json

   ```
   { "error": "Unauthorized" }
   ```
3. **Invalid Pagination**:

   json

   ```
   { "error": "Invalid page number: -1" }
   ```

***

### **Notes**

* **Pagination**: Use `meta.page` and `meta.pageSize` for large document sets
* **Default Page Size**: If not specified, default page size is typically 20 items
* **Total Count**: `meta.total` provides the complete count for pagination calculations
* **Document Order**: Documents are typically returned by creation date (newest first)
* **Status Filtering**: All statuses are included in the list; filter client-side if needed

**Common Use Cases**:

* Customer onboarding progress tracking
* Compliance auditing and reporting
* Document verification status monitoring
* File management and organization
* KYC/AML compliance checking

**Document Status Summary**:

* **Approved**: Ready for use in transactions
* **Submitted**: Awaiting verification
* **Changes Requested**: Requires customer action
* **Rejected**: Cannot be used, needs replacement
* **Missing**: Required document not yet provided

<br>


---

# 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://docs.delos.financial/documents/list-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.
