---
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/en/llms.txt

<!-- source: en/management-src/Managing-customer-and-order-data-from-the-CRM/uploadContacts.md -->
<div class="openapi">

# Uploading customer data (CSV)

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

Uploads customer data.

The data is transmitted as multipart/form-data in CSV format. In the first line of the request, pass the names of the columns. [Learn more about the format of transmitted data](https://yandex.com.tr/dev/metrika/en/data-import/contacts-data.md).

{% note info %}

File size limit: 1 GB.

{% endnote %}

[Example of an uploaded file](https://download.cdn.yandex.net/from/yandex.ru/support/ru/metrica/files/crm-clients.csv).

{% cut "Sample request" %}

```json translate=no
POST https://api-metrika.yandex.net/cdp/api/v1/counter/2215573/data/contacts/csv?
    merge_mode=SAVE&
    columns_mapping=
        "uniq_id":"ID",
        "name":"Name",
        "emails":"Email",
        "age":"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

ID,Name,Email,Age
11,John J.,example@example.com,40
42,Michael L.,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

ID of the tag that you want to upload customer data for.
{.table-cell}
||
|#{.json-schema-properties}

### Query parameters

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

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

Correspondence between column names and attribute names.

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

_Example:_{.json-schema-reset .json-schema-example} `"uniq_id":"ID","name":"Name","birth_date":"Date of birth"`
{.table-cell}
||
||

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

Data saving mode. For any value, pass all [required fields](https://yandex.com.tr/dev/metrika/en/data-import/contacts-data.md), even ones that aren't modified.

- `SAVE`: All previously transmitted data is completely replaced with new data. [Details](https://yandex.com.tr/dev/metrika/en/data-import/modes.md).
- `UPDATE`: Only the data that you're currently uploading is updated. [Details](https://yandex.com.tr/dev/metrika/en/data-import/modes.md).
- `APPEND`: New data is added to previously uploaded data. [Details](https://yandex.com.tr/dev/metrika/en/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

Type of column separator used in the file:
- `COMMA`: Comma separator.
- `SEMICOLON`: Semicolon separator.


_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;

The file size limit is 1 GB.

_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-21T11:59:21.000Z",
    "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)

Upload information

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

```json translate=no
{
  "uploading_id": "example",
  "datetime": "2020-04-21T11:59:21.000Z",
  "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}

Upload information

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

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

Upload validation status:
- `PASSED`: Validation passed.
- `FAILED`: Validation failed.


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

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

Upload time.

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

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

Number of elements within the upload.
{.table-cell}
||
||

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

Entity type:
- `SYSTEM`: System entity, such as contacts or orders.
- `CUSTOM_LIST`: Custom list.
- `SYSTEM_LIST`: System list, such as products.


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

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

Upload format. Possible values:
- `JSON`
- `CSV`


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

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

Upload ID.

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

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

Upload source. Possible values: `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-21T11:59:21.000Z",
  "api_validation_status": "example",
  "elements_count": 0,
  "entity_type": "example",
  "uploading_format": "example",
  "uploading_source": "example"
}
```

{% endcut %}

</div>

</div>

</div>
<!-- endsource: en/management-src/Managing-customer-and-order-data-from-the-CRM/uploadContacts.md -->

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