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
{
  "name": "example"
}

SegmentName

The segment with the specified parameters.

Name

Description

name

Type: string

Segment name.

Example: 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
  • Type: AppMetricaSegment

    A segment imported from AppMetrica.

    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,
      "pattern": "example"
    }
    
  • Type: GeoSegment

    Segment based on location data for circles.

    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,
      "form": "example",
      "pattern": "example",
      "too_much_data": true
    }
    
  • Type: LookalikeSegment

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

    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
    }
    
  • Type: MetrikaSegment

    A segment imported from Yandex Metrica.

    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,
      "pattern": "example"
    }
    
  • Type: PixelSegment

    A segment created using a tracking pixel.

    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",
      "pattern": "example"
    }
    
  • Type: PolygonGeoSegment

    Segment based on location data for polygons.

    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,
      "form": "example",
      "polygons": [
        {
          "points": [
            {},
            {},
            {},
            {}
          ],
          "description": "example"
        }
      ],
      "pattern": "example",
      "too_much_data": true
    }
    
  • Type: UploadingSegment

    A segment created from a file with user data.

    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",
      "source_id": 0,
      "source_name": "example",
      "item_quantity": 0,
      "valid_unique_quantity": 0,
      "valid_unique_percentage": "example",
      "matched_quantity": 0,
      "matched_percentage": "example",
      "counter_id": 0,
      "uploading_last_modify_time": "2025-01-01T00:00:00Z",
      "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,
  "app_metrica_segment_type": "example",
  "app_metrica_segment_id": 0,
  "pattern": "example"
}

BaseSegment

The segment description by type.

Name

Description

name

Type: string

Segment name.

Example: example

create_time

Type: string<date-time>

The time of segment creation.

Example: 2025-01-01T00:00:00Z

id

Type: integer

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

owner

Type: string

The username of the segment owner.

Example: example

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.

Example: example

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.

Example: 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: example

    Example
    {
      "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: example

    period_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: example

    Example
    {
      "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: example

    utm_campaign

    Type: string

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

    Example: example

    utm_content

    Type: string

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

    Example: example

    utm_medium

    Type: string

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

    Example: example

    utm_source

    Type: string

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

    Example: example

    utm_term

    Type: string

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

    Example: example

    Example
    {
      "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: 0

Max length: 200

Example: 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: 4

Max items: 2147483647

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"
  },
  {
    "latitude": 0.5,
    "longitude": 0.5,
    "description": "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: example

    period_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: example

    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.

    Example: example

    hashed

    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: example

    Example
    {
      "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.