Uploading customer data (JSON)
Uploads customer data. The data is submitted within the POST request body in JSON format.
Sample request body
--data '{
"contacts": [
{
"uniq_id": "J3QQ4-H7H2V-2HCH4-M3HK8-6M8VW",
"name": "John Smith",
"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": "Jane Smith",
"create_date_time": "2020-05-17 16:13:21",
"update_date_time": "2020-05-17 16:14:21",
"client_ids": [
"11223344556"
]
}
]
}'
Request
POST
https://api-metrika.yandex.net/cdp/api/v1/counter/{counterId}/data/contacts/json
Path parameters
|
Name |
Description |
|
counterId |
Type: integer ID of the counter that you want to upload contact data for. |
Query parameters
|
Name |
Description |
|
merge_mode |
Type: string Data saving mode. For any value, pass all required fields, even ones that aren't modified.
Example: |
Body
application/json
{
"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
],
"user_ids": [
"example"
],
"emails": [
"example"
],
"phones": [
"example"
],
"emails_md5": [
"example"
],
"phones_md5": [
"example"
],
"company_uniq_id": "example",
"user_comment": "example"
}
]
}
|
Name |
Description |
|
contacts |
Type: ContactRow[] Min items: Example
|
ContactRow
List of customers.
|
Name |
Description |
||
|
uniq_id |
Type: string Customer ID. Min length: Example: |
||
|
attribute_values |
Type: object[]
Custom attributes. Example
|
||
|
birth_date |
Type: string<date> Customer's date of birth. Example: |
||
|
client_ids |
Type: integer[] Min items: Max items: Unique items: Example
|
||
|
create_date_time |
Type: string<date-time> Date and time of contact creation in the counter's time zone. Learn more. Example: |
||
|
emails |
Type: string[] Min items: Max items: Unique items: Example
|
||
|
emails_md5 |
Type: string[] Min items: Max items: Unique items: Example
|
||
|
name |
Type: string Customer name. When you send the full name, the string will be truncated to Example: |
||
|
phones |
Type: string[] Min items: Max items: Unique items: Example
|
||
|
phones_md5 |
Type: string[] Min items: Max items: Unique items: Example
|
||
|
update_date_time |
Type: string<date-time> Date and time of contact update in the counter's time zone. Learn more. Example: |
||
|
user_comment |
Type: string Comment on the customer. Min length: Max length: Example: |
Example
{
"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": [
"example"
],
"phones": [
"example"
],
"emails_md5": [
"example"
],
"phones_md5": [
"example"
],
"user_comment": "example"
}
Responses
200 OK
OK
Body
application/json
{
"uploading": {
"uploading_id": "example",
"datetime": "2025-01-01T00:00:00Z",
"api_validation_status": "example",
"elements_count": 0,
"entity_type": "example",
"entity_subtype": "example",
"uploading_format": "example",
"uploading_source": "example",
"api_validation_errors": [
"example"
],
"uploading_title": "example"
}
}
|
Name |
Description |
|
uploading |
Type: UploadingMetaExternal Upload information Example
|
UploadingMetaExternal
Upload information
|
Name |
Description |
|
api_validation_status |
Type: string Upload validation status:
Example: |
|
datetime |
Type: string<date-time> Upload time. Example: |
|
elements_count |
Type: integer Number of elements within the upload. |
|
entity_type |
Type: string Entity type:
Example: |
|
uploading_format |
Type: string Upload format. Possible values:
Example: |
|
uploading_id |
Type: string Upload ID. Example: |
|
uploading_source |
Type: string Upload source. Possible values: Example: |
Example
{
"uploading_id": "example",
"datetime": "2025-01-01T00:00:00Z",
"api_validation_status": "example",
"elements_count": 0,
"entity_type": "example",
"uploading_format": "example",
"uploading_source": "example"
}
No longer supported, please use an alternative and newer version.