---
title: "Add document asynchronously"
url: "https://developer.incode.com/api-reference/add-document-async/"
section: "api-reference"
group: "Document capture"
version: "v1.1"
status: "live"
endpoint: "POST /omni/add/document/async"
---
# Add document asynchronously

`POST /omni/add/document/async`

Base URL: `https://demo-api.incodesmile.com` — Incode demo environment

Upload document image and store data asynchronously.

## Path & query parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `type` | query | string | yes | - **signature**: Upload user's digital signature. This can be later fetched in get images endpoint. - **document**: Upload user's proof of address document. This can be later fetched in get images endpoint. - **addressStatement**: (Legacy) Upload user's proof of address document. Used for backward compatibility. Use type 'document' instead. - **medicalDoc**: Upload user's medical document. - **thirdId**: Upload user's third ID. - **contract**: Upload contract image. Enum: `signature`, `document`, `medicalDoc`, `thirdId`, `contract` |
| `title` | query | string |  | Only if type is contract. Title of contract. |
| `format` | query | string |  | Only if type is document. Possible values are image (jpg and png supported) or pdf. Default is image. Enum: `image`, `pdf` |
| `api-version` | header | string | yes |  |

## Request body

Content-Type: `application/json`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `base64Image` | string |  | Image in base64 format. One of base64Image or imageUrl is required |
| `imageUrl` | string |  | URL of the image. One of base64Image or imageUrl is required |

## Responses

### 200

OK

Response body (`application/json`):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `success` | boolean |  | Flag indicating request passed successfully. |
| `sessionStatus` | string |  | Session status Enum: `Alive`, `Closed`, `Deleted` |

### 400

Bad Request

Response body (`application/json`):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `timestamp` | integer (int64) |  | UTC timestamp in milliseconds |
| `status` | integer (int32) |  | Custom error code or HTTP status code |
| `error` | string |  | HTTP status error |
| `message` | string |  | Custom error message |
| `path` | string |  | Endpoint path |
| `details` | object |  | Custom error details |

## Code samples

Generated from this endpoint's method, path, and the conventional Incode headers. The base URL is the Incode demo environment; replace `<YOUR_API_KEY>` with a key for your region.

### cURL

```bash
curl -X POST https://demo-api.incodesmile.com/omni/add/document/async \
  -H "x-api-key: <YOUR_API_KEY>" \
  -H "api-version: 1.0" \
  -H "Content-Type: application/json" \
  -d '{
    "base64Image": "",
    "imageUrl": ""
  }'
```

### Node

```js
const res = await fetch("https://demo-api.incodesmile.com/omni/add/document/async", {
  method: "POST",
  headers: {
      "x-api-key": "<YOUR_API_KEY>",
      "api-version": "1.0",
      "Content-Type": "application/json",
  },
    body: JSON.stringify({
      "base64Image": "",
      "imageUrl": ""
    }),
});
const data = await res.json();
```

### Python

```python
import requests

headers = {
    "x-api-key": "<YOUR_API_KEY>",
    "api-version": "1.0",
    "Content-Type": "application/json",
}
res = requests.post("https://demo-api.incodesmile.com/omni/add/document/async", headers=headers, json={
  "base64Image": "",
  "imageUrl": ""
})
data = res.json()
```

### Java

```java
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://demo-api.incodesmile.com/omni/add/document/async"))
    .header("x-api-key", "<YOUR_API_KEY>")
    .header("api-version", "1.0")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\n  \"base64Image\": \"\",\n  \"imageUrl\": \"\"\n}"))
    .build();
HttpResponse<String> res = HttpClient.newHttpClient()
    .send(req, HttpResponse.BodyHandlers.ofString());
```

### Example response

```json
{
  "success": true,
  "status": "OK"
}
```
