# Upload File API

Used to upload related business documents. Partners can use this component to upload their business documents directly to the Partner API.&#x20;

## Endpoint

<table><thead><tr><th width="241">Type</th><th>Value</th></tr></thead><tbody><tr><td><strong>HTTP Method</strong></td><td>POST</td></tr><tr><td><strong>API endpoint (Test Mode)</strong></td><td><code>https://api-uat.doku.com/adv-core-api/partner/v1.0/file</code></td></tr><tr><td><strong>API endpoint (Production)</strong></td><td><code>https://api.doku.com/adv-core-api/partner/v1.0/file</code></td></tr></tbody></table>

## Authorization (Bearer Token)

Sample:

```json
eyJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJwYXlsb2FkIiwiZXhwIjoxNjk1MTg1NzQ0LCJ1c2VyIjp7ImJ1c2luZXNzU2VydmljZUNsaWVudElkIjoiQlJOLTAyNDEtMTY5NTAwODQwMTg5OSJ9LCJpYXQiOjE2OTUxODU0NDR9.fNpOOgQskTxZJwpuUM7STIFSua5d37LoadFoy57OlXhTWIUFSyiYbIMyUOEiPUiCnj8oOF1CdKyTGowXu2Kr1a35qVvoiCjvrzTTbmTULcPc6TRkHpCLNhgr099M8wBjgKOsAbarR6PoAyjc8XB7V8dmsDCfs1K03gmSvK1e4rf5O1bj0xwN6PFLUT8CaPmhWGeHdBw2AglkXBJGm41LpBT3QS-GgNLsg0IUOA1jZwaNar-bnhJLfuvHdfvoi9hBVf4P3H7pGETaPkx1xi-5yFh4xG8CcGm0goInZHSdQ1NBi1O9zXUEdQDEMDbPoUjGJCNLoPubtdvgwXHawHCISA
```

{% hint style="info" %}
Use [**`Generate Token API`**](generate-token-api) to generate `bearer token`
{% endhint %}

## Request Body (Form Data)

<table><thead><tr><th width="135">Parameter</th><th width="112">Type</th><th width="130">Mandatory</th><th>Possible Values</th></tr></thead><tbody><tr><td><code>category</code></td><td><code>text</code></td><td>Mandatory</td><td>e.g. <code>OWNER_LIVENESS</code>, <code>DOCUMENT</code>, etc.<br>(<a href="#possible-values-category">Possible Values</a>)</td></tr><tr><td><code>code</code></td><td><code>text</code></td><td>Conditional</td><td>only needed when <code>category</code> is <code>DOCUMENT</code><br>(<a href="#possible-values-code">Possible Values</a>)</td></tr><tr><td><code>file</code></td><td><code>file</code></td><td>Conditional</td><td>.JPG, .PNG (check requirements using  <a href="check-requirements-api">Check Requirements API</a>)<br>--<br>only needed when <code>file_url</code> is empty)</td></tr><tr><td><code>file_url</code></td><td><code>text</code></td><td>Conditional</td><td><p>Image URL (e.g. https://www.website.domain/assets-lna/images/logo.png)</p><p>--</p><p>only needed when <code>file</code> is empty</p></td></tr></tbody></table>

### Possible Values&#x20;

Applied for all `businessType` :

<details>

<summary>Possible values <code>category</code></summary>

* OWNER\_LIVENESS
* PHOTO\_PROOF
* LOGO
* DOCUMENT
* SERVICE\_AGREEMENT
* BANK\_ACCOUNT

</details>

<details>

<summary>Possible values <code>code</code></summary>

* AKTA\_PENDIRIAN\_PERUSAHAAN
* BPOM
* COMPANY\_REGISTRATION
* IZIN\_BLU
* IZIN\_BOPI
* IZIN\_DISPENDIK\_KEMENDIKBUD
* IZIN\_DISTRIBUTOR\_RESMI
* IZIN\_EDAR\_ALAT\_KESEHATAN, IZIN\_KERAMAIAN
* IZIN\_KOPERASI\_SIMPAN\_PINJAM
* IZIN\_PENYELENGGARAAN\_IBADAH\_HAJI\_DAN\_UMRAH
* IZIN\_PMB, IZIN\_PUB, IZIN\_USAHA
* IZIN\_USAHA\_PERSEORANGAN
* KITAS\_OR\_KITAP
* KTP
* LICENSE\_ASIC
* LICENSE\_CFTC
* LICENSE\_CYSEC
* LICENSE\_FCA
* LICENSE\_IFSC
* LISENSI\_BAPPEBTI
* LISENSI\_OJK
* NIB
* NIB\_PERSEORANGAN
* NPWP\_BADAN
* NPWP\_ORANG\_PRIBADI
* PASPOR
* SERTIFIKAT\_HALAL\_MUI
* SERTIFIKAT\_KEANGGOTAAN\_ASITA
* SK\_KEMENDIKBUDRISTEK
* SK\_KEMENKUMHAM
* SK\_PENDIRIAN\_YAYASAN
* TANDA\_DAFTAR\_PSE
* TANDA\_DAFTAR\_YAYASAN

</details>

## Response

```json
{
    "id": "CNT-0104-1676639713907",
    "link": "https://doku.com/12345566",
    "category": "OWNER_LIVENESS"
}
```

<table><thead><tr><th width="149">Parameter</th><th width="113">Type</th><th width="127">Mandatory</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td><code>string</code></td><td>Mandatory</td><td>Used for <a href="business-registration-api"><strong><code>Create Business API</code></strong></a></td></tr><tr><td><code>link</code></td><td><code>string</code></td><td>Mandatory</td><td>Link of file</td></tr><tr><td><code>category</code></td><td><code>string</code></td><td>Mandatory</td><td>Same as request</td></tr></tbody></table>

{% hint style="info" %}
File 'link' will be expired in 60 minutes, it does not delete the file data (file id).
{% endhint %}
