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 ID of the segment that you want to edit. |
Body
application/json
{
"segment": {
"name": "example"
}
}
|
Name |
Description |
|
segment |
Type: SegmentName The segment with the specified parameters. Example
|
SegmentName
The segment with the specified parameters.
|
Name |
Description |
|
name |
Type: string Segment name. Example: |
Example
{
"name": "example"
}
Responses
200 OK
OK
Body
application/json
{
"segment": {
"type": "example",
"id": 0,
"name": "example",
"status": "example",
"create_time": "2025-01-01T00:00:00Z",
"owner": "example",
"has_guests": true,
"guest_quantity": 0,
"can_create_dependent": true,
"has_derivatives": true,
"derivatives": [
0
],
"cookies_matched_quantity": 0,
"app_metrica_segment_type": "example",
"app_metrica_segment_id": 0,
"pattern": "example"
}
}
|
Name |
Description |
|
segment |
One of 7 types
Example
|
BaseSegment
The segment description by type.
|
Name |
Description |
|
name |
Type: string Segment name. Example: |
|
create_time |
Type: string<date-time> The time of segment creation. Example: |
|
id |
Type: integer ID of the segment. Specify this parameter when updating a segment. |
|
owner |
Type: string The username of the segment owner. Example: |
|
status |
Type: string Status of processing the segment. Acceptable values:
Example: |
|
type |
Type: string Segment type. Acceptable values:
Example: |
Example
{
"type": "example",
"id": 0,
"name": "example",
"status": "example",
"create_time": "2025-01-01T00:00:00Z",
"owner": "example"
}
AppMetricaSegment
A segment imported from AppMetrica.
All of 2 types
-
Type: BaseSegment
The segment description by type.
Example
{ "type": "example", "id": 0, "name": "example", "status": "example", "create_time": "2025-01-01T00:00:00Z", "owner": "example", "has_guests": true, "guest_quantity": 0, "can_create_dependent": true, "has_derivatives": true, "derivatives": [ 0 ], "cookies_matched_quantity": 0 } -
Type: object
app_metrica_segment_id
Type: integer
ID of the object from AppMetrica.
app_metrica_segment_type
Type: string
Object type in AppMetrica. Acceptable values:
api_key: Application.segment_id: Segment.
Example:
exampleExample
{ "app_metrica_segment_type": "example", "app_metrica_segment_id": 0 }
Example
{
"type": "example",
"id": 0,
"name": "example",
"status": "example",
"create_time": "2025-01-01T00:00:00Z",
"owner": "example",
"has_guests": true,
"guest_quantity": 0,
"can_create_dependent": true,
"has_derivatives": true,
"derivatives": [
0
],
"cookies_matched_quantity": 0,
"app_metrica_segment_type": "example",
"app_metrica_segment_id": 0
}
GeoSegment
Segment based on location data for circles.
All of 2 types
-
Type: BaseSegment
The segment description by type.
Example
{ "type": "example", "id": 0, "name": "example", "status": "example", "create_time": "2025-01-01T00:00:00Z", "owner": "example", "has_guests": true, "guest_quantity": 0, "can_create_dependent": true, "has_derivatives": true, "derivatives": [ 0 ], "cookies_matched_quantity": 0 } -
Type: object
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.
Example:
exampleperiod_length
Type: integer
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).
times_quantity
Type: integer
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.
Example
{ "geo_segment_type": "example", "times_quantity": 0, "period_length": 0 }
Example
{
"type": "example",
"id": 0,
"name": "example",
"status": "example",
"create_time": "2025-01-01T00:00:00Z",
"owner": "example",
"has_guests": true,
"guest_quantity": 0,
"can_create_dependent": true,
"has_derivatives": true,
"derivatives": [
0
],
"cookies_matched_quantity": 0,
"geo_segment_type": "example",
"times_quantity": 0,
"period_length": 0
}
LookalikeSegment
A segment of users who are similar to one of the client's other segments (look-alike technology).
All of 2 types
-
Type: BaseSegment
The segment description by type.
Example
{ "type": "example", "id": 0, "name": "example", "status": "example", "create_time": "2025-01-01T00:00:00Z", "owner": "example", "has_guests": true, "guest_quantity": 0, "can_create_dependent": true, "has_derivatives": true, "derivatives": [ 0 ], "cookies_matched_quantity": 0 } -
Type: object
lookalike_link
Type: integer
ID of the segment that the created segment should be similar to.
lookalike_value
Type: integer
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.Example
{ "lookalike_link": 0, "lookalike_value": 0, "maintain_device_distribution": true, "maintain_geo_distribution": true }
Example
{
"type": "example",
"id": 0,
"name": "example",
"status": "example",
"create_time": "2025-01-01T00:00:00Z",
"owner": "example",
"has_guests": true,
"guest_quantity": 0,
"can_create_dependent": true,
"has_derivatives": true,
"derivatives": [
0
],
"cookies_matched_quantity": 0,
"lookalike_link": 0,
"lookalike_value": 0,
"maintain_device_distribution": true,
"maintain_geo_distribution": true
}
MetrikaSegment
A segment imported from Yandex Metrica.
All of 2 types
-
Type: BaseSegment
The segment description by type.
Example
{ "type": "example", "id": 0, "name": "example", "status": "example", "create_time": "2025-01-01T00:00:00Z", "owner": "example", "has_guests": true, "guest_quantity": 0, "can_create_dependent": true, "has_derivatives": true, "derivatives": [ 0 ], "cookies_matched_quantity": 0 } -
Type: object
metrika_segment_id
Type: integer
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.
Example:
exampleExample
{ "metrika_segment_type": "example", "metrika_segment_id": 0 }
Example
{
"type": "example",
"id": 0,
"name": "example",
"status": "example",
"create_time": "2025-01-01T00:00:00Z",
"owner": "example",
"has_guests": true,
"guest_quantity": 0,
"can_create_dependent": true,
"has_derivatives": true,
"derivatives": [
0
],
"cookies_matched_quantity": 0,
"metrika_segment_type": "example",
"metrika_segment_id": 0
}
PixelSegment
A segment created using a tracking pixel.
All of 2 types
-
Type: BaseSegment
The segment description by type.
Example
{ "type": "example", "id": 0, "name": "example", "status": "example", "create_time": "2025-01-01T00:00:00Z", "owner": "example", "has_guests": true, "guest_quantity": 0, "can_create_dependent": true, "has_derivatives": true, "derivatives": [ 0 ], "cookies_matched_quantity": 0 } -
Type: object
period_length
Type: integer
The time period for tracking the user with the pixel. Acceptable values (in days): from 1 to 90 (inclusive).
pixel_id
Type: integer
The pixel ID.
times_quantity
Type: integer
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.
Example:
exampleutm_campaign
Type: string
utm_campaigntag. Can be used as a condition for including users in a pixel segment.Example:
exampleutm_content
Type: string
utm_contenttag. Can be used as a condition for including users in a pixel segment.Example:
exampleutm_medium
Type: string
utm_mediumtag. Can be used as a condition for including users in a pixel segment.Example:
exampleutm_source
Type: string
utm_sourcetag. Can be used as a condition for including users in a pixel segment.Example:
exampleutm_term
Type: string
utm_termtag. Can be used as a condition for including users in a pixel segment.Example:
exampleExample
{ "pixel_id": 0, "period_length": 0, "times_quantity": 0, "times_quantity_operation": "example", "utm_source": "example", "utm_content": "example", "utm_campaign": "example", "utm_term": "example", "utm_medium": "example" }
Example
{
"type": "example",
"id": 0,
"name": "example",
"status": "example",
"create_time": "2025-01-01T00:00:00Z",
"owner": "example",
"has_guests": true,
"guest_quantity": 0,
"can_create_dependent": true,
"has_derivatives": true,
"derivatives": [
0
],
"cookies_matched_quantity": 0,
"pixel_id": 0,
"period_length": 0,
"times_quantity": 0,
"times_quantity_operation": "example",
"utm_source": "example",
"utm_content": "example",
"utm_campaign": "example",
"utm_term": "example",
"utm_medium": "example"
}
GeoPoint
The coordinates of the points.
|
Name |
Description |
|
description |
Type: string Any comment up to 200 characters. Min length: Max length: Example: |
|
latitude |
Type: number Latitude. |
|
longitude |
Type: number Longitude. |
Example
{
"latitude": 0.5,
"longitude": 0.5,
"description": "example"
}
GeoPolygon
List of polygons. You cannot add more than 10 polygons to a segment.
|
Name |
Description |
|
points |
Type: GeoPoint[] Min items: Max items: Example
|
Example
{
"points": [
{
"latitude": 0.5,
"longitude": 0.5,
"description": "example"
},
{
"latitude": 0.5,
"longitude": 0.5,
"description": "example"
},
{
"latitude": 0.5,
"longitude": 0.5,
"description": "example"
},
{
"latitude": 0.5,
"longitude": 0.5,
"description": "example"
}
]
}
PolygonGeoSegment
Segment based on location data for polygons.
All of 2 types
-
Type: BaseSegment
The segment description by type.
Example
{ "type": "example", "id": 0, "name": "example", "status": "example", "create_time": "2025-01-01T00:00:00Z", "owner": "example", "has_guests": true, "guest_quantity": 0, "can_create_dependent": true, "has_derivatives": true, "derivatives": [ 0 ], "cookies_matched_quantity": 0 } -
Type: object
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.
Example:
exampleperiod_length
Type: integer
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[]
Example
[ { "points": [ { "latitude": 0.5, "longitude": 0.5, "description": "example" }, { "latitude": 0.5, "longitude": 0.5, "description": "example" }, { "latitude": 0.5, "longitude": 0.5, "description": "example" }, { "latitude": 0.5, "longitude": 0.5, "description": "example" } ], "description": "example" } ]times_quantity
Type: integer
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.
Example
{ "geo_segment_type": "example", "times_quantity": 0, "period_length": 0, "polygons": [ { "points": [ { "latitude": 0.5, "longitude": 0.5, "description": "example" }, { "latitude": 0.5, "longitude": 0.5, "description": "example" }, { "latitude": 0.5, "longitude": 0.5, "description": "example" }, { "latitude": 0.5, "longitude": 0.5, "description": "example" } ], "description": "example" } ] }
Example
{
"type": "example",
"id": 0,
"name": "example",
"status": "example",
"create_time": "2025-01-01T00:00:00Z",
"owner": "example",
"has_guests": true,
"guest_quantity": 0,
"can_create_dependent": true,
"has_derivatives": true,
"derivatives": [
0
],
"cookies_matched_quantity": 0,
"geo_segment_type": "example",
"times_quantity": 0,
"period_length": 0,
"polygons": [
{
"points": [
{},
{},
{},
{}
],
"description": "example"
}
]
}
UploadingSegment
A segment created from a file with user data.
All of 2 types
-
Type: BaseSegment
The segment description by type.
Example
{ "type": "example", "id": 0, "name": "example", "status": "example", "create_time": "2025-01-01T00:00:00Z", "owner": "example", "has_guests": true, "guest_quantity": 0, "can_create_dependent": true, "has_derivatives": true, "derivatives": [ 0 ], "cookies_matched_quantity": 0 } -
Type: object
content_type
Type: string
Type of file content. Acceptable values:
idfa_gaid: Device IDs.mac: MAC addresses.crm: CRM data.
Example:
exampledevice_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, theIN_DEVICEmode is available only foridfa_gaidsegments.
Example:
examplehashed
Type: boolean
Whether every string in the uploaded file is hashed. Acceptable values:
true: Hashed.false: Unhashed.
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.
Example:
exampleExample
{ "hashed": true, "used_hashing_alg": "example", "content_type": "example", "device_matching_type": "example" }
Example
{
"type": "example",
"id": 0,
"name": "example",
"status": "example",
"create_time": "2025-01-01T00:00:00Z",
"owner": "example",
"has_guests": true,
"guest_quantity": 0,
"can_create_dependent": true,
"has_derivatives": true,
"derivatives": [
0
],
"cookies_matched_quantity": 0,
"hashed": true,
"used_hashing_alg": "example",
"content_type": "example",
"device_matching_type": "example"
}
No longer supported, please use an alternative and newer version.