# Upload a Document

**POST** `/documents`

Base URL: `https://api.uat.triple-a.io/api/fiat-payout/v1`

This endpoint allows API users to upload documents (for KYC).

## Authorization

- oauth2 (http, bearer)

## Body

Content type: `multipart/form-data`

- `external_id` (string)
  A reference to the document given by API caller
- `owner_id` (string<uuid>)
  The ID of an individual or company who owns the document, required if category is `identity_verification` or `business_verification`
- `transfer_id` (string<uuid>)
  The ID of a transfer which this document is related to, required if category is `transfer_purpose`
- `category` ("identity_verification" | "business_verification" | "transfer_purpose", required)
  More categories will be added over time.
- `document_type` ("passport" | "national_id" | "driving_license" | "selfie_photo" | "kyc_provider_result" | "business_incorporation" | "invoice" | "payroll" | "bank_statement", required)
  The type `kyc_provider_result` can be used to upload reports from the 3rd party KYC providers.
- `file` (string<binary>, required)
  The actual file to be uploaded (Max 5MB)

Example:

```json
{
  "external_id": "string",
  "owner_id": "00000000-0000-0000-0000-000000000000",
  "transfer_id": "00000000-0000-0000-0000-000000000000",
  "category": "identity_verification",
  "document_type": "passport",
  "file": "@passport.pdf"
}
```

## Responses

### 201

Created

- `id` (string<uuid>)
- `external_id` (string)
  A reference to the document given by API caller
- `owner_id` (string<uuid>)
  The ID of an individual or company who owns the document.
- `category` ("identity_verification")
  More categories will be added over time.
- `document_type` ("passport" | "national_id" | "selfie_photo" | "kyc_provider_result")
  The type `kyc_provider_result` can be used to upload reports from the 3rd party KYC providers.
- `mime_type` (string)
  The type `kyc_provider_result` can be used to upload reports from the 3rd party KYC providers.
- `file_name` (string)
- `file_id` (string)
- `status` ("none" | "valid" | "pending" | "rejected" | "expired")
- `expires_at` (string<date-time>)
  Time of expiry of the validity of this identity document.
- `created_at` (string<date-time>)
- `updated_at` (string<date-time>)

Example:

```json
{
  "id": "00000000-0000-0000-0000-000000000000",
  "external_id": "string",
  "owner_id": "00000000-0000-0000-0000-000000000000",
  "category": "identity_verification",
  "document_type": "passport",
  "mime_type": "string",
  "file_name": "string",
  "file_id": "string",
  "status": "pending",
  "expires_at": "1970-01-01T00:00:00.000Z",
  "created_at": "1970-01-01T00:00:00.000Z",
  "updated_at": "1970-01-01T00:00:00.000Z"
}
```

### 400

Error defines errors may be returned from the system.

- `message` (string)
- `errors` (object[])
  - `errorCode` (string)
  - `message` (string)

Example:

```json
{
  "message": "string",
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ]
}
```

### 409

Error defines errors may be returned from the system.

- `message` (string)
- `errors` (object[])
  - `errorCode` (string)
  - `message` (string)

Example:

```json
{
  "message": "string",
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ]
}
```

### 500

Error defines errors may be returned from the system.

- `message` (string)
- `errors` (object[])
  - `errorCode` (string)
  - `message` (string)

Example:

```json
{
  "message": "string",
  "errors": [
    {
      "errorCode": "string",
      "message": "string"
    }
  ]
}
```