# Upload a Document

> Coming soon, upon request — this feature is turned on for your tenant by the Aurea team. [Contact us](https://www.aureahub.com/contact)

Upload a document — an identity document's page, a proof of address, a company file — for the customer's verifications to name.

## Overview

- **One file**, as the multipart field `file`: a **PDF or JPEG**, recognised by its bytes whatever its name or declared type, of at most **5 MB**. No file, another type or an empty one: `400` `BANK_RAMP_KYC_FILE_INVALID`; a larger upload: `413` before anything is read.
- With the `reliance` and the `identity_sharing` strategies, for a confirmed customer: the KYC off `403` `BANK_RAMP_FUNCTION_OFF`, `hosted_oauth` `403` `BANK_RAMP_KYC_STRATEGY_OFF`, no customer `404` `BANK_RAMP_CUSTOMER_NOT_FOUND`.
- The bank ramp receives it under a neutral name — never the user's file name. Aurea keeps its id, type, size and SHA-256, never its bytes.
- `201`: name its `fileId` in a verification's `documents` ([Send Verifications](https://docs.aureahub.com/docs/bank-customer-verifications.md)).

## Endpoint

### `POST /v1/ramp/bank/customer/files`

Authentication: bearer token required.

Uploads one document for the customer's verifications (multipart/form-data).

**Query parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `isTestnet` | boolean | no | `true` for the sandbox; `false` or omitted for production |

**Request body**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `file` | file | yes | The document: PDF or JPEG, at most 5 MB |

**Responses**

`201` Uploaded

```json
{
  "fileId": "c41e7a92-0d3b-4f86-a5e2-9b7d1c3f6e08",
  "contentType": "image/jpeg",
  "sizeBytes": 482113,
  "sha256": "5f2b9c1d8e4a7f3b0c6d2e9a1b8c4d7e3f0a5b2c9d6e1f8a4b7c0d3e6f9a2b5c",
  "environment": "sandbox",
  "createdAt": "2026-10-14T09:05:00.000Z"
}
```

`400` Not a PDF or JPEG

```json
{
  "statusCode": 400,
  "error": "BadRequestError",
  "message": "A document is a PDF or JPEG file of at most 5 MB.",
  "details": { "code": "BANK_RAMP_KYC_FILE_INVALID", "maxBytes": 5242880 }
}
```

## Implementation

```javascript
async function uploadDocument(token, blob, isTestnet) {
  const form = new FormData();
  form.append('file', blob, 'document.jpg'); // the name is not sent on

  const res = await fetch(`https://api.aureahub.com/v1/ramp/bank/customer/files?isTestnet=${isTestnet}`, {
    method: 'POST',
    headers: { Authorization: `Bearer ${token}` }, // let fetch set the multipart Content-Type
    body: form
  });
  const data = await res.json();
  if (!res.ok) throw new Error(`${res.status}: ${data.message}`);
  return data.fileId;
}
```

---

Web version: https://docs.aureahub.com/#bank-customer-file-upload
