> For the complete documentation index, see [llms.txt](https://docs.udara360.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.udara360.io/udara360-docs-1/operations/upload-document.md).

# Upload Document

To upload a document, make a <mark style="color:yellow;">`POST`</mark> request to this endpoint as `multipart/form-data`, passing the document `Type`, a `ReferenceNumber`, and the file itself as `AttachedFile`.

A successful request returns a `data` object containing the document's `id`, a `url` to access it, and its `fileExtension`.

This process allows you to attach supporting documents (ID, proof of address, signature specimen, etc.) to a customer or account record. When an account or customer is created, a document identifier is returned, that identifier is what links an uploaded document to that entity, and can later be retrieved via the Search Account or Search Customer endpoints.

{% hint style="info" %}
**Note:** Maximum file size is **10MB**. Accepted file types: **jpg, png, jpeg, docx, pdf**.
{% endhint %}

<mark style="color:yellow;">`POST`</mark> `/api/Operations/v1/UploadDocument`

**Headers**

| Name                                                | Value                 | Description                                 |
| --------------------------------------------------- | --------------------- | ------------------------------------------- |
| Content-Type<mark style="color:red;">\*</mark>      | `multipart/form-data` | This endpoint takes form-data, not JSON     |
| Authorization<mark style="color:red;">\*</mark>     | `bearer {token}`      | Access token obtained from Get Access Token |
| request-reference<mark style="color:red;">\*</mark> | `{unique_reference}`  | A unique reference identifying this request |

**Body Parameters**

<table><thead><tr><th>Name</th><th>Data Type</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>Type</code></td><td>integer</td><td>true</td><td>The type of document being uploaded (see Document Types table below)</td></tr><tr><td><code>ReferenceNumber</code></td><td>string</td><td>true</td><td>The DocumentIdentifier returned when the account/customer was created links this document to that entity</td></tr><tr><td><code>AttachedFile</code></td><td>file</td><td>true</td><td>The actual file being uploaded</td></tr></tbody></table>

**Document Types**

| Value | Type                           |
| ----- | ------------------------------ |
| 1     | Signature Specimen             |
| 2     | Proof Of Address               |
| 3     | Driver's License               |
| 4     | National Identity Card         |
| 5     | Voters Card                    |
| 6     | National Identity Number (NIN) |
| 7     | International Passport         |
| 8     | Passport Photograph            |
| 9     | Reference Letter               |
| 10    | Loan Application Form          |
| 11    | Guarantor's Letter             |
| 12    | Credit Bureau Form             |
| 13    | Others                         |

**Body table**

| Field           | Data Type | Description                                |
| --------------- | --------- | ------------------------------------------ |
| `id`            | string    | Unique identifier of the uploaded document |
| `url`           | string    | URL to access the uploaded document        |
| `fileExtension` | string    | File extension of the uploaded document    |

Here is an example request and response with a sample payload sent to the endpoint in Curl format.

<details>

<summary>Sample Request</summary>

```json
curl --location -g '{{baseurl}}/api/Operations/v1/UploadDocument' \
--header 'Authorization: bearer {token}' \
--header 'request-reference: {unique_reference}' \
--header 'Content-Type: application/json' \
--form 'Type="1"' \
--form 'ReferenceNumber="1234567890"' \
--form 'AttachedFile=@"/path/to/file"'
```

</details>

<details>

<summary>Response : <code>200</code></summary>

```
{
  "status": true,
  "message": "string",
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "url": "string",
    "fileExtension": "string"
  }
}
```

</details>
