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

<!-- source: ru/management-src/Upravlenie-dannymi-o-klientah-i-zakazah-iz-CRM/uploadContacts.md -->
<div class="openapi">

# Загрузка данных о клиентах (CSV)

<!-- markdownlint-disable-file -->

Выполняет загрузку данных о клиентах.

Данные передаются как multipart/form-data в формате CSV. В первой строке запроса необходимо передать названия колонок. [Подробно о формате передаваемых данных](https://yandex.com.tr/dev/metrika/ru/data-import/contacts-data.md).

{% note info %}

Ограничение на размер файла — 1 Гб.

{% endnote %}

[Пример загружаемого файла](https://download.cdn.yandex.net/from/yandex.ru/support/ru/metrica/files/crm-clients.csv).

{% cut "Пример запроса" %}

```json translate=no
POST https://api-metrika.yandex.net/cdp/api/v1/counter/2215573/data/contacts/csv?
    merge_mode=SAVE&
    columns_mapping=
        "uniq_id":"ИД",
        "name":"Имя",
        "emails":"Почта",
        "age":"Возраст"&
    delimiter_type=COMMA
Content-Type: multipart/form-data; boundary=------------------------7zDUQOAIAE9hEWoV
Context-Length: TBD

--------------------------7zDUQOAIAE9hEWoV
Content-Disposition: form-data; name="file"; filename="data.csv"
Content-Type: text/csv

ИД,Имя,Почта,Возраст
11,Иван И.,example@example.com,40
42,Михаил Л.,somebody@example.com,24
--------------------------7zDUQOAIAE9hEWoV--
```

{% endcut %}


## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-post);margin-bottom: 12px">

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
https://api-metrika.yandex.net/cdp/api/v1/counter/{counterId}/data/contacts/csv
```

</div>

</div>

</div>

### Path parameters

#|
|| **Name** | **Description** ||
||

_counterId_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer

Идентификатор счетчика, для которого вы хотите загрузить данные о клиентах.
{.table-cell}
||
|#{.json-schema-properties}

### Query parameters

#|
|| **Name** | **Description** ||
||

_columns_mapping_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Соответствие названий столбцов названиям атрибутов.

_Pattern:_{.json-schema-reset .json-schema-assertion} `"([^"]+)":"([^"]+)"`

_Example:_{.json-schema-reset .json-schema-example} `"uniq_id":"ИД","name":"Имя","birth_date":"Дата рождения"`
{.table-cell}
||
||

_merge_mode_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Режим сохранения данных. При любом из значений передавайте все [обязательные поля](https://yandex.com.tr/dev/metrika/ru/data-import/contacts-data.md) — даже те, которые не меняются.

- `SAVE` — вся ранее переданная информация полностью заменяется новой. [Подробно](https://yandex.com.tr/dev/metrika/ru/data-import/modes.md).
- `UPDATE` – обновляется только та информация, которую вы загружаете в данный момент. [Подробно](https://yandex.com.tr/dev/metrika/ru/data-import/modes.md).
- `APPEND` — новая информация добавляется к ранее загруженной. [Подробно](https://yandex.com.tr/dev/metrika/ru/data-import/modes.md).


_Example:_{.json-schema-reset .json-schema-example} `SAVE`
{.table-cell}
||
||

_delimiter_type_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Вид разделителя столбцов в файле:
- `COMMA` — разделитель "запятая".
- `SEMICOLON` — разделитель "точка с запятой".


_Default:_{.json-schema-reset .json-schema-value} `COMMA`

_Example:_{.json-schema-reset .json-schema-example} ``
{.table-cell}
||
|#{.json-schema-properties}

<div class="openapi-entity">

### Body

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

```json translate=no
{
  "file": "example"
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_file_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string&lt;binary&gt;

Ограничение на размер файла — 1 Гб.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

OK

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "uploading": {
    "uploading_id": "example",
    "datetime": "2020-04-21 11:59:21",
    "api_validation_status": "example",
    "elements_count": 0,
    "entity_type": "example",
    "uploading_format": "example",
    "uploading_source": "example"
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_uploading_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [UploadingMetaExternal](#entity-UploadingMetaExternal)

Информация о загрузке

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "uploading_id": "example",
  "datetime": "2020-04-21 11:59:21",
  "api_validation_status": "example",
  "elements_count": 0,
  "entity_type": "example",
  "uploading_format": "example",
  "uploading_source": "example"
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### UploadingMetaExternal {#entity-UploadingMetaExternal}

Информация о загрузке

#|
|| **Name** | **Description** ||
||

_api_validation_status_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Статус валидации загрузки:
- `PASSED` — валидация прошла успешно.
- `FAILED` — валидация прошла не успешно.


_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_datetime_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Время загрузки.

_Example:_{.json-schema-reset .json-schema-example} `2020-04-21 11:59:21`
{.table-cell}
||
||

_elements_count_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Количество элементов в загрузке.
{.table-cell}
||
||

_entity_type_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Тип сущности:
- `SYSTEM` — системная сущность, например, контакты или заказы.
- `CUSTOM_LIST` — пользовательский список.
- `SYSTEM_LIST` — системный список, например товары.


_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_uploading_format_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Формат загрузки. Возможные значения:
- `JSON`.
- `CSV`.


_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_uploading_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Идентификатор загрузки.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_uploading_source_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Источник загрузки. Возможные значения: `API`.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "uploading_id": "example",
  "datetime": "2020-04-21 11:59:21",
  "api_validation_status": "example",
  "elements_count": 0,
  "entity_type": "example",
  "uploading_format": "example",
  "uploading_source": "example"
}
```

{% endcut %}

</div>

</div>

</div>
<!-- endsource: ru/management-src/Upravlenie-dannymi-o-klientah-i-zakazah-iz-CRM/uploadContacts.md -->

[*Deprecated]: No longer supported, please use an alternative and newer version.