---
title: "Upload file"
slug: "upload-file"
updated: 2026-04-01T03:43:19Z
published: 2026-04-01T03:43:19Z
canonical: "docs.xendit.co/upload-file"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xendit.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload file

Post/files

Make a POST request to this endpoint to upload a file. We currently support uploading PNG, JPG/JPEG, PDF files that are less than 10 MB.

SecurityHTTPType Basic

Body parameters<select class='api-response-data' aria-label='Media type'><option value='2f770b74-e846-4379-8ac8-7eef0b140159'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='dca0247e-9f7a-40af-a999-afda2e06f5f8'>uploadKYCFile</option>
</select>uploadKYCFile

```json
{
  "purpose": "KYC_DOCUMENT",
  "file": "file=@/Users/johndoe/Documents/proof-of-business.pdf"
}
```

object  purposestring    

Purpose of the file

Valid values[
  "KYC_DOCUMENT",
  "CHARGEBACK_EVIDENCE"
]
filestring    

Path to the file to be uploaded. Supported types: `application/pdf`, `image/png`, `image/jpg`, `image/jpeg`

Responses200

Successful operation

<select class='api-response-data' aria-label='Media type'><option value='df5a65eb-0d4e-4c34-90f4-cf20c81426c1'>application/json</option>
</select><select class='select-example' aria-label='Media type'><option value='02358609-cca5-46f5-b005-f3c04c2db810'>postFileUpload</option>
</select>postFileUpload

```json
{
  "id": "file-ec700c1c-db17-4496-b1fb-04ebe551b412",
  "business_id": "ec700c1c-db17-4496-b1fb-04ebe551b412",
  "purpose": "KYC_DOCUMENT",
  "created": "2020-10-08T06:38:33.479Z",
  "updated": "2020-10-08T06:38:33.479Z",
  "type": "image/png",
  "size": 10000,
  "url": "https://files.xendit.co/file-ec700c1c-db17-4496-b1fb-04ebe551b412"
}
```

object  idstring    

Unique ID generated by Xendit for the particular file

business_idstring    

Unique ID generated by Xendit for the particular file

purposestring    

Purpose of the file

Valid values[
  "KYC_DOCUMENT",
  "CHARGEBACK_EVIDENCE"
]
createdstring    

UTC Timestamp of file upload in ISO format

updatedstring    

UTC Timestamp of last file update in ISO format

typestring    

Type of the file

sizeinteger    

Size of the file in bytes

urlstring    

URL to download the file

400

Inputs are failing validation. The errors field contains details about which fields are violating validation.

<select class='api-response-data' aria-label='Media type'><option value='165e443e-564c-4de5-b061-c4ad29c29640'>application/json</option>
</select>object  error_codestring    Valid values[
  "API_VALIDATION_ERROR",
  "FEATURE_NOT_AVAILABLE"
]
messagestring    
errors Array  OneOfstringstring
objectobject

403

API key in use does not have necessary permissions to perform the request. Please assign proper permissions for the key.

<select class='api-response-data' aria-label='Media type'><option value='ddc44ed4-9c96-4811-b6ab-901cfcf8e58e'>application/json</option>
</select>object  error_codestring    Valid values[
  "RATE_LIMIT_EXCEEDED"
]
messagestring    
errors Array  OneOfstringstring
objectobject

413

The file size is greater than 10MB and exceeded size limits. Please compress the payload before retrying

<select class='api-response-data' aria-label='Media type'><option value='c9323f39-d02a-4567-8261-4d95c6a3569d'>application/json</option>
</select>object  error_codestring    Valid values[
  "FILE_TOO_LARGE_EXCEEDED_ERROR"
]
messagestring    
errors Array  OneOfstringstring
objectobject

415

The file format is not supported. Please review the file type before retrying

<select class='api-response-data' aria-label='Media type'><option value='c7dae128-ab53-4c82-a136-d991a1c182d1'>application/json</option>
</select>object  error_codestring    Valid values[
  "UNSUPPORTED_CONTENT_TYPE_ERROR"
]
messagestring    
errors Array  OneOfstringstring
objectobject

429

The file format is not supported. Please review the file type before retrying

<select class='api-response-data' aria-label='Media type'><option value='c0b1a4d9-bbd4-4fab-b42b-8d7d4fcae4a6'>application/json</option>
</select>object  error_codestring    Valid values[
  "RATE_LIMIT_EXCEEDED"
]
messagestring    
errors Array  OneOfstringstring
objectobject
