Editing a segment

Modifies the specified segment.

Request

PUT

https://api-audience.yandex.ru/v1/management/segment/{segmentId}

Path parameters

Name

Description

segmentId*

Type: integer<int32>

ID of the segment that you want to edit.

Body

application/json
{
    "segment": {
        "name": "string"
    }
}

Name

Description

segment

Type: SegmentName

The segment with the specified parameters.

SegmentName

The segment with the specified parameters.

Name

Description

name*

Type: string

Segment name.

Responses

200 OK

OK

Body

application/json
{
    "segment": {
        "type": "string",
        "id": 0,
        "name": "string",
        "status": "string",
        "create_time": "2022-12-29T18:02:01Z",
        "owner": "string",
        "app_metrica_segment_type": "string",
        "app_metrica_segment_id": 0
    }
}

Name

Description

segment

Type: AppMetricaSegment or GeoSegment or LookalikeSegment or MetrikaSegment or PixelSegment or PolygonGeoSegment or UploadingSegment

AppMetricaSegment

A segment imported from AppMetrica.

Name

Description

name*

Type: string

Segment name.

app_metrica_segment_id

Type: integer<int32>

ID of the object from AppMetrica.

app_metrica_segment_type

Type: string

Object type in AppMetrica. Acceptable values:

  • api_key: Application.
  • segment_id: Segment.

create_time

Type: string<date-time>

The time of segment creation.

id

Type: integer<int32>

ID of the segment. Specify this parameter when updating a segment.

owner

Type: string

The username of the segment owner.

status

Type: string

Status of processing the segment. Acceptable values:

  • uploaded: The segment with the user's data has been uploaded.
  • is_processed: The segment with the specified parameters is being processed.
  • processed: The segment has been uploaded and processed. The segment is ready to use.
  • processing_failed: Segment processing has failed.
  • is_updated: The segment is updating.
  • few_data: The segment has insufficient data.

type

Type: string

Segment type. Acceptable values:

  • uploading: A segment created from a file with user data.
  • metrika: A segment imported from Yandex Metrica.
  • appmetrica: A segment imported from AppMetrica.
  • lookalike: A segment of users who "look like" one of the client's other segments (uses the "lookalike" technology).
  • geo: A segment based on location data for polygons and circles.
  • pixel: A segment created using a tracking pixel.

GeoSegment

Segment based on location data for circles.

Name

Description

name*

Type: string

Segment name.

create_time

Type: string<date-time>

The time of segment creation.

geo_segment_type

Type: string

Coordinate type. Acceptable values:

  • last: Current location. The segment includes users who are currently in the selected area or who were in the area less than an hour ago.
  • regular: Frequent location. The segment includes users who frequently visit the selected area. For example, they may be people who live or work nearby. Targeting is based on the data from the past 45 days.
  • home: Home location. The segment includes users who live in the selected area.
  • work: Work location. The segment includes users who work in the selected area.
  • condition: The condition "The user visited the specified places X times during the period". The segment will include users who meet this criteria.

id

Type: integer<int32>

ID of the segment. Specify this parameter when updating a segment.

owner

Type: string

The username of the segment owner.

period_length

Type: integer<int32>

The period for visits to the specified places. This parameter is required if you are creating the condition "User visited the specified places N time(s) during the period". Acceptable values for the time period (in days): from 1 to 90 (inclusive).

status

Type: string

Status of processing the segment. Acceptable values:

  • uploaded: The segment with the user's data has been uploaded.
  • is_processed: The segment with the specified parameters is being processed.
  • processed: The segment has been uploaded and processed. The segment is ready to use.
  • processing_failed: Segment processing has failed.
  • is_updated: The segment is updating.
  • few_data: The segment has insufficient data.

times_quantity

Type: integer<int32>

Frequency of visits to the specified places. This parameter is required if you are creating the condition "User visited the specified places N time(s) during the period".

Note

Only one visit per day is counted.

type

Type: string

Segment type. Acceptable values:

  • uploading: A segment created from a file with user data.
  • metrika: A segment imported from Yandex Metrica.
  • appmetrica: A segment imported from AppMetrica.
  • lookalike: A segment of users who "look like" one of the client's other segments (uses the "lookalike" technology).
  • geo: A segment based on location data for polygons and circles.
  • pixel: A segment created using a tracking pixel.

LookalikeSegment

A segment of users who are similar to one of the client's other segments (look-alike technology).

Name

Description

name*

Type: string

Segment name.

create_time

Type: string<date-time>

The time of segment creation.

id

Type: integer<int32>

ID of the segment. Specify this parameter when updating a segment.

lookalike_link

Type: integer<int32>

ID of the segment that the created segment should be similar to.

lookalike_value

Type: integer<int32>

The degree of similarity. Accepts the values 1, 2, 3, 4, and 5.

maintain_device_distribution

Type: boolean

Distribute users by device type. Acceptable values:

  • true: The distribution of users by device type is maintained, if possible.
  • false: The distribution of users by device type is ignored.

Default value: true.

maintain_geo_distribution

Type: boolean

Distribute users by city. Acceptable values:

  • true: The distribution of users by city is maintained, if possible.
  • false: The distribution of users by city is ignored.

Default value: true.

owner

Type: string

The username of the segment owner.

status

Type: string

Status of processing the segment. Acceptable values:

  • uploaded: The segment with the user's data has been uploaded.
  • is_processed: The segment with the specified parameters is being processed.
  • processed: The segment has been uploaded and processed. The segment is ready to use.
  • processing_failed: Segment processing has failed.
  • is_updated: The segment is updating.
  • few_data: The segment has insufficient data.

type

Type: string

Segment type. Acceptable values:

  • uploading: A segment created from a file with user data.
  • metrika: A segment imported from Yandex Metrica.
  • appmetrica: A segment imported from AppMetrica.
  • lookalike: A segment of users who "look like" one of the client's other segments (uses the "lookalike" technology).
  • geo: A segment based on location data for polygons and circles.
  • pixel: A segment created using a tracking pixel.

MetrikaSegment

A segment imported from Yandex Metrica.

Name

Description

name*

Type: string

Segment name.

create_time

Type: string<date-time>

The time of segment creation.

id

Type: integer<int32>

ID of the segment. Specify this parameter when updating a segment.

metrika_segment_id

Type: integer<int64>

ID of the object from Yandex Metrica.

metrika_segment_type

Type: string

Object type in Yandex Metrica. Acceptable values:

  • counter_id: Tag.
  • goal_id: Goal.
  • segment_id: Segment.

owner

Type: string

The username of the segment owner.

status

Type: string

Status of processing the segment. Acceptable values:

  • uploaded: The segment with the user's data has been uploaded.
  • is_processed: The segment with the specified parameters is being processed.
  • processed: The segment has been uploaded and processed. The segment is ready to use.
  • processing_failed: Segment processing has failed.
  • is_updated: The segment is updating.
  • few_data: The segment has insufficient data.

type

Type: string

Segment type. Acceptable values:

  • uploading: A segment created from a file with user data.
  • metrika: A segment imported from Yandex Metrica.
  • appmetrica: A segment imported from AppMetrica.
  • lookalike: A segment of users who "look like" one of the client's other segments (uses the "lookalike" technology).
  • geo: A segment based on location data for polygons and circles.
  • pixel: A segment created using a tracking pixel.

PixelSegment

A segment created using a tracking pixel.

Name

Description

name*

Type: string

Segment name.

create_time

Type: string<date-time>

The time of segment creation.

id

Type: integer<int32>

ID of the segment. Specify this parameter when updating a segment.

owner

Type: string

The username of the segment owner.

period_length

Type: integer<int32>

The time period for tracking the user with the pixel. Acceptable values (in days): from 1 to 90 (inclusive).

pixel_id

Type: integer<int32>

The pixel ID.

status

Type: string

Status of processing the segment. Acceptable values:

  • uploaded: The segment with the user's data has been uploaded.
  • is_processed: The segment with the specified parameters is being processed.
  • processed: The segment has been uploaded and processed. The segment is ready to use.
  • processing_failed: Segment processing has failed.
  • is_updated: The segment is updating.
  • few_data: The segment has insufficient data.

times_quantity

Type: integer<int32>

Threshold value (M). This is the base number for comparing how many times the user was detected by the pixel during the period.

times_quantity_operation

Type: string

Condition for users to be included in the pixel segment. Acceptable values:

  • lt: Less than. The user was detected by the pixel less than M times during the period.
  • eq: Equal to. The user was detected by the pixel M times during the period.
  • gt: Greater than. The user was detected by the pixel more than M times during the period.

type

Type: string

Segment type. Acceptable values:

  • uploading: A segment created from a file with user data.
  • metrika: A segment imported from Yandex Metrica.
  • appmetrica: A segment imported from AppMetrica.
  • lookalike: A segment of users who "look like" one of the client's other segments (uses the "lookalike" technology).
  • geo: A segment based on location data for polygons and circles.
  • pixel: A segment created using a tracking pixel.

utm_campaign

Type: string

utm_campaign tag. Can be used as a condition for including users in a pixel segment.

utm_content

Type: string

utm_content tag. Can be used as a condition for including users in a pixel segment.

utm_medium

Type: string

utm_medium tag. Can be used as a condition for including users in a pixel segment.

utm_source

Type: string

utm_source tag. Can be used as a condition for including users in a pixel segment.

utm_term

Type: string

utm_term tag. Can be used as a condition for including users in a pixel segment.

PolygonGeoSegment

Segment based on location data for polygons.

Name

Description

name*

Type: string

Segment name.

create_time

Type: string<date-time>

The time of segment creation.

geo_segment_type

Type: string

Coordinate type. Acceptable values:

  • last: Current location. The segment includes users who are currently in the selected area or who were in the area less than an hour ago.
  • regular: Frequent location. The segment includes users who frequently visit the selected area. For example, they may be people who live or work nearby. Targeting is based on the data from the past 45 days.
  • home: Home location. The segment includes users who live in the selected area.
  • work: Work location. The segment includes users who work in the selected area.
  • condition: The condition "The user visited the specified places X times during the period". The segment will include users who meet this criteria.

id

Type: integer<int32>

ID of the segment. Specify this parameter when updating a segment.

owner

Type: string

The username of the segment owner.

period_length

Type: integer<int32>

The period for visits to the specified places. This parameter is required if you are creating the condition "User visited the specified places N time(s) during the period". Acceptable values for the time period (in days): from 1 to 90 (inclusive).

polygons

Type: GeoPolygon[]

List of polygons. You cannot add more than 10 polygons to a segment.

status

Type: string

Status of processing the segment. Acceptable values:

  • uploaded: The segment with the user's data has been uploaded.
  • is_processed: The segment with the specified parameters is being processed.
  • processed: The segment has been uploaded and processed. The segment is ready to use.
  • processing_failed: Segment processing has failed.
  • is_updated: The segment is updating.
  • few_data: The segment has insufficient data.

times_quantity

Type: integer<int32>

Frequency of visits to the specified places. This parameter is required if you are creating the condition "User visited the specified places N time(s) during the period".

Note

Only one visit per day is counted.

type

Type: string

Segment type. Acceptable values:

  • uploading: A segment created from a file with user data.
  • metrika: A segment imported from Yandex Metrica.
  • appmetrica: A segment imported from AppMetrica.
  • lookalike: A segment of users who "look like" one of the client's other segments (uses the "lookalike" technology).
  • geo: A segment based on location data for polygons and circles.
  • pixel: A segment created using a tracking pixel.

UploadingSegment

A segment created from a file with user data.

Name

Description

name*

Type: string

Segment name.

used_hashing_alg*

Type: string

The hashing algorithm used for the data is sent for hashed: true. Acceptable value: SHA256.

Starting January 2025, uploading new MD5 hashes is no longer supported. To upload new data, use SHA‑256.

content_type

Type: string

Type of file content. Acceptable values:

  • idfa_gaid: Device IDs.
  • mac: MAC addresses.
  • crm: CRM data.

create_time

Type: string<date-time>

The time of segment creation.

device_matching_type

Type: string

Device search mode for the segment.

Acceptable values:

  • CROSS_DEVICE: The segment includes other devices associated with the uploaded ID and belonging to the same user. This is the default value if no search mode is selected.
  • IN_DEVICE: The segment includes only the uploaded devices, without expanding to other devices. Currently, the IN_DEVICE mode is available only for idfa_gaid segments.

hashed

Type: boolean

Whether every string in the uploaded file is hashed. Acceptable values:

  • true: Hashed.
  • false: Unhashed.

id

Type: integer<int32>

ID of the segment. Specify this parameter when updating a segment.

owner

Type: string

The username of the segment owner.

status

Type: string

Status of processing the segment. Acceptable values:

  • uploaded: The segment with the user's data has been uploaded.
  • is_processed: The segment with the specified parameters is being processed.
  • processed: The segment has been uploaded and processed. The segment is ready to use.
  • processing_failed: Segment processing has failed.
  • is_updated: The segment is updating.
  • few_data: The segment has insufficient data.

type

Type: string

Segment type. Acceptable values:

  • uploading: A segment created from a file with user data.
  • metrika: A segment imported from Yandex Metrica.
  • appmetrica: A segment imported from AppMetrica.
  • lookalike: A segment of users who "look like" one of the client's other segments (uses the "lookalike" technology).
  • geo: A segment based on location data for polygons and circles.
  • pixel: A segment created using a tracking pixel.

GeoPolygon

List of polygons. You cannot add more than 10 polygons to a segment.

Name

Description

points*

Type: GeoPoint[]

The coordinates of the points.

Min items: 4

Max items: 2147483647

GeoPoint

The coordinates of the points.

Name

Description

description

Type: string

Any comment up to 200 characters.

Min length: 0

Max length: 200

latitude

Type: number

Latitude.

longitude

Type: number

Longitude.

No longer supported, please use an alternative and newer version.