---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://www.yandex.com/dev/metrika/en/management/openapi/schema/uploadContactJson_1.md
  - https://www.yandex.com/dev/metrika/ru/management/openapi/schema/uploadContactJson_1.md
  - href: en/management/openapi/schema/uploadContactJson_1.md
    type: text/markdown
    title: Markdown version
  - href: ../../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://www.yandex.com/dev/metrika/en/llms.txt

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

# Uploading customer data (JSON)

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

Uploads customer data. The data is submitted within the POST request body in JSON format.

{% cut "Sample request body" %}

```json translate=no
--data '{
        "contacts": [
            {
                "uniq_id": "J3QQ4-H7H2V-2HCH4-M3HK8-6M8VW",
                "name": "Иванов И.",
                "create_date_time": "2020-04-17 16:12:21",
                "update_date_time": "2020-04-17 16:12:21",
                "client_ids": [
                    "12345678910",
                    "10987654321"
                ],
                "emails": [
                    "exampl1@example.com",
                    "example2@example.com"
                ],
                "phones": [
                    "78005553535",
                    "73449932378"
                ]
            },
            {
                "uniq_id": "ZYX4-H7H2V-2HCH4-M3HK8-6M8VW",
                "name": "Петрова М.",
                "create_date_time": "2020-05-17 16:13:21",
                "update_date_time": "2020-05-17 16:14:21",
                "client_ids": [
                    "11223344556"
                ]
            }
        ]
    }'
```

{% 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/json
```

</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 contact data for.
{.table-cell}
||
|#{.json-schema-properties}

### Query parameters

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

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


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

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "contacts": [
    {
      "attribute_values": [
        {}
      ],
      "uniq_id": "example",
      "name": "example",
      "birth_date": "2025-01-01",
      "create_date_time": "2025-01-01T00:00:00Z",
      "update_date_time": "2025-01-01T00:00:00Z",
      "client_ids": [
        0
      ],
      "emails": [
        "user@example.com"
      ],
      "phones": [
        "example"
      ],
      "emails_md5": [
        "example"
      ],
      "phones_md5": [
        "example"
      ],
      "user_comment": "example"
    }
  ]
}
```

{% endcut %}

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

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

_Min items:_{.json-schema-reset .json-schema-assertion} `1`

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

```json translate=no
[
  {
    "attribute_values": [
      {}
    ],
    "uniq_id": "example",
    "name": "example",
    "birth_date": "2025-01-01",
    "create_date_time": "2025-01-01T00:00:00Z",
    "update_date_time": "2025-01-01T00:00:00Z",
    "client_ids": [
      0
    ],
    "emails": [
      "user@example.com"
    ],
    "phones": [
      "example"
    ],
    "emails_md5": [
      "example"
    ],
    "phones_md5": [
      "example"
    ],
    "user_comment": "example"
  }
]
```

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

</div>

<div class="openapi-entity">

### ContactRow {#entity-ContactRow}

List of customers.

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

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

Customer ID.

_Min length:_{.json-schema-reset .json-schema-assertion} `1`

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

_attribute_values_{.json-schema-reset .json-schema-property}
{.table-cell}|
{% cut "**Type**: object[]" %}

#|
||

_[additional]_{.json-schema-reset .json-schema-additional-property}
{.table-cell}|
**Type**: string[]

_Unique items:_{.json-schema-reset .json-schema-assertion} `true`

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

```json translate=no
[
  "example"
]
```

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

{% endcut %}

Custom attributes.

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

```json translate=no
[
  {}
]
```

{% endcut %}
{.table-cell}
||
||

_birth_date_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date&gt;

Customer's date of birth.

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

_client_ids_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer[]

_Min items:_{.json-schema-reset .json-schema-assertion} `0`

_Max items:_{.json-schema-reset .json-schema-assertion} `500`

_Unique items:_{.json-schema-reset .json-schema-assertion} `true`

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

```json translate=no
[
  0
]
```

{% endcut %}
{.table-cell}
||
||

_create_date_time_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

Date and time of contact creation in the tag's time zone. [Learn more](https://www.yandex.com/dev/metrika/en/data-import/date.md#orders).

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_emails_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;email&gt;[]

_Min items:_{.json-schema-reset .json-schema-assertion} `0`

_Max items:_{.json-schema-reset .json-schema-assertion} `50`

_Unique items:_{.json-schema-reset .json-schema-assertion} `true`

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

```json translate=no
[
  "user@example.com"
]
```

{% endcut %}
{.table-cell}
||
||

_emails_md5_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

_Min items:_{.json-schema-reset .json-schema-assertion} `0`

_Max items:_{.json-schema-reset .json-schema-assertion} `50`

_Unique items:_{.json-schema-reset .json-schema-assertion} `true`

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

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
||

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

Customer name. When you send the full name, the string will be truncated to `Doe J.` format.

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

_phones_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

_Min items:_{.json-schema-reset .json-schema-assertion} `0`

_Max items:_{.json-schema-reset .json-schema-assertion} `50`

_Unique items:_{.json-schema-reset .json-schema-assertion} `true`

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

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
||

_phones_md5_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[]

_Min items:_{.json-schema-reset .json-schema-assertion} `0`

_Max items:_{.json-schema-reset .json-schema-assertion} `50`

_Unique items:_{.json-schema-reset .json-schema-assertion} `true`

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

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
||

_update_date_time_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

Date and time of contact update in the tag's time zone. [Learn more](https://www.yandex.com/dev/metrika/en/data-import/date.md#orders).

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

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

Comment on the customer.

_Min length:_{.json-schema-reset .json-schema-assertion} `0`

_Max length:_{.json-schema-reset .json-schema-assertion} `1000`

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

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

```json translate=no
{
  "attribute_values": [
    {}
  ],
  "uniq_id": "example",
  "name": "example",
  "birth_date": "2025-01-01",
  "create_date_time": "2025-01-01T00:00:00Z",
  "update_date_time": "2025-01-01T00:00:00Z",
  "client_ids": [
    0
  ],
  "emails": [
    "user@example.com"
  ],
  "phones": [
    "example"
  ],
  "emails_md5": [
    "example"
  ],
  "phones_md5": [
    "example"
  ],
  "user_comment": "example"
}
```

{% endcut %}

</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/uploadContactJson.md -->

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