Upload customer data (CSV)

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.

Note

The file size limit is 1 GB.

Example of an uploaded file.

Sample request
POST https://api-metrica.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--

Request

POST

https://api-metrica.yandex.net/cdp/api/v1/counter/{counterId}/data/contacts/csv

Path parameters

Name

Description

counterId*

Type: integer<int32>

ID of the counter that you want to upload customer data for.
Example: 2215573

Query parameters

Name

Description

columns_mapping*

Type: string

Correspondence between column names and attribute names.

Example: "uniq_id":"ИД","name":"Имя","birth_date":"Дата рождения"

Pattern: "([^"]+)":"([^"]+)"

merge_mode*

Type: string

Data saving mode. For any value, pass all required fields, even ones that aren't modified.

  • SAVE: All previously transmitted data is completely replaced with new data. Details.
  • UPDATE: Only the information that you're currently uploading is updated. Details.
  • APPEND: New information is added to the previously uploaded information. Details.
    Example: SAVE

delimiter_type

Type: string

Type of column separator used in the file.

  • COMMA: Comma separator.
  • SEMICOLON: Semicolon separator.

Default: COMMA

Body

multipart/form-data
{
    "file": null
}

Name

Description

file*

Type: string<binary>

The file size limit is 1 GB.

Responses

200 OK

OK

Body

application/json
{
    "uploading": {
        "uploading_id": "string",
        "datetime": "2022-12-29T18:02:01Z",
        "api_validation_status": "string",
        "elements_count": 0,
        "entity_type": "string",
        "uploading_format": "string",
        "uploading_source": "string"
    }
}

Name

Description

uploading

Type: UploadingMetaExternal

Description of the UploadingMetaExternal object.

UploadingMetaExternal

Description of the UploadingMetaExternal object.

Name

Description

api_validation_status

Type: string

Upload validation status:

  • PASSED: Validation passed.
  • FAILED: Validation failed.

datetime

Type: string<date-time>

Upload time.

elements_count

Type: integer<int32>

Number of elements in the upload.

entity_type

Type: string

Entity type:

  • SYSTEM: System entity, such as contacts or orders.
  • CUSTOM_LIST: Custom list.
  • SYSTEM_LIST: System list, such as products.

uploading_format

Type: string

Upload format. Possible values:

  • JSON.
  • CSV.

uploading_id

Type: string

Upload ID.

uploading_source

Type: string

Upload source. Possible values: API