Modifying the data for a segment created from a file

Changes the data for the specified segment. When updating segments, you need to use the file structure that was used when the segment was loaded the first time.

  1. Request syntax
  2. In the request body
  3. Response format

Request syntax

segmentId — ID of the segment that you want to change the data for.

https://api-audience.yandex.ru/v1/management/segment/{segmentId}/modify_data
 ? modification_type=<uploading_segment_modification_type>
 & [check_size=<boolean>]
modification_type *Type of data change: adding or deleting data, overwriting the entire file. Added data must match the original format (hashed or unhashed information).

Acceptable values:

  • subtraction — Removing data from the file.
  • addition — Adding data to the file.
  • replace — Overwriting the entire file.
check_sizeThis parameter enables you to create segments of less than 100 entries. Such segments cannot be used for ads in Yandex Direct until their size exceeds 100 entries.

Default value: true.

modification_type *Type of data change: adding or deleting data, overwriting the entire file. Added data must match the original format (hashed or unhashed information).

Acceptable values:

  • subtraction — Removing data from the file.
  • addition — Adding data to the file.
  • replace — Overwriting the entire file.
check_sizeThis parameter enables you to create segments of less than 100 entries. Such segments cannot be used for ads in Yandex Direct until their size exceeds 100 entries.

Default value: true.

* Required

In the request body


POST http://api-audience.yandex.ru/v1/management/segment/111/modify_data?modification_type=addition
Content-Type: multipart/form-data; boundary=--------------------------5b2a52c5c90f668a
Context-Length: 331

--------------------------5b2a52c5c90f668a
Content-Disposition: form-data; name="file"; filename="data.tsv"
Content-Type: application/octet-stream

aaaaaaaa-bbbb-cccc-1111-222222222200
aaaaaaaa-bbbb-cccc-1111-222222222201
--------------------------5b2a52c5c90f668a--

Sample request

POST https://api-audience.yandex.ru/v1/management/segment/{segmentId}/modify_data?modification_type=addition, subtraction, replace

Response format


{
    "segment" :  < _uploading_segment > 
}
Parameters Description
segment The segment with the specified parameters.
Parameters Description
segment The segment with the specified parameters.