---
metadata:
  - name: generator
    content: Diplodoc Platform v5.48.2
alternate:
  - https://yandex.com.tr/dev/metrika/en/management/openapi/chats/upload_chats.md
  - https://yandex.com.tr/dev/metrika/ru/management/openapi/chats/upload_chats.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/dev/metrika/en/llms.txt

# Uploading information about chats

Uploads a file with chat conversions (the `CHATS` type).

It takes up to 2 hours to process the file. Returns an upload object with status 200.

Create a CSV file with the data and transmit it using this method. Make sure to include the OAuth token and the tag ID in your input data.

We recommend that you also automate your API queries using modules available in your programming language.

1. File format: CSV.

2. File size limit: 1 GB.

3. File encoding: UTF-8.

## Request {#request}

```
POST https://api-metrika.yandex.net/management/v1/counter/{counterId}/offline_conversions/upload?type=CHATS
```

### Path parameters {#path-parameters}

#|
||**Name** | **Description**||
|| counterId[*](*star) | **Type:** `integer<int32>`

ID of the tag for which you need to upload chat conversions.

Example: `2215573` ||
|#

### Query parameters {#query-parameters}

#|
||**Name** | **Description**||
|| comment | **Type:** string

Comment. Maximum 255 characters. You can use digits, Latin characters, and Cyrillic characters. ||
|#

### Body {#body-request}

{% cut "multipart/form-data" %}

```json
{
    "file": null
}
```

{% endcut %}

#|
||**Name** | **Description**||
|| file | **Type:** `string<binary>`

Chat conversions you want to upload, which are passed as multipart/form-data. The file size limit is 1 GB. The file encoding must be UTF-8.||

|#

## Responses {#responses}

## 200 OK {#200ok}

OK

### Body {#body-response}

{% cut "application/json" %}

```json
{
    "uploadings": [
        {
            "id": 0,
            "create_time": "2022-12-29T18:02:01Z",
            "source_quantity": 0,
            "line_quantity": 0,
            "comment": "string",
            "type": "string",
            "client_id_type": "USER_ID",
            "status": "string"
        }
    ]
}
```

{% endcut %}

#|
||**Name** | **Description**||
|| uploading[*](*star) | **Type:** [OfflineConversionUploading](#OfflineConversionUploading)[]

Information about an upload of chat conversions. ||
|#

### OfflineConversionUploading {#OfflineConversionUploading}

Information about an upload of chat conversions.

#|
||**Name** | **Description**||
|| client_id_type | **Type:** string

Type of user IDs. Possible values:

- `USER_ID`: Site user ID assigned by the site owner.

- `CLIENT_ID`: Site user ID assigned by Yandex Metrica.

- `YCLID`: The ID of a click on a Yandex Direct ad assigned by Yandex Direct.

Example: `USER_ID`||

|| comment | **Type:** string

Custom comment. The maximum number of characters is 255.

Min length: `0`

Max length: `255`||
|| create_time | **Type:** `string<date-time>`

Upload time.||
|| id | **Type:** integer<int64>

Upload ID.||
|| line_quantity | **Type:** `integer<int32>`

Number of rows that passed validation during upload.||
|| source_quantity | **Type:** `integer<int32>`

Number of rows in the source file.||
|| status | **Type:** string

Upload status:

- `PREPARED`: Upload prepared.

- `UPLOADED`: Upload complete.

- `EXPORTED`: Upload exported.

- `MATCHED`: Event IDs matched.

- `PROCESSED`: Upload processed.

- `LINKAGE_FAILURE`: Couldn't find a matching user ID. If you send data on static calls, they won't be attributed to sessions in Yandex Metrica, but they will appear in your call reports.||
|| string | **Type:** string ||
|#

[*star]: Required parameter
