Changing a segment
Changes the specified segment. The segment updated via the API won't appear in the Yandex Metrica web interface
Request
PUT
https://api-metrika.yandex.net/management/v1/counter/{counterId}/apisegment/segment/{segmentId}
Path parameters
|
Name |
Description |
|
counterId |
Type: integer Tag ID. |
|
segmentId |
Type: integer ID of the segment that you want to update. |
Body
application/json
{
"segment": {
"segment_id": 0,
"counter_id": 0,
"name": "example",
"expression": "example",
"status": "example",
"segment_source": "example",
"create_time": "2025-01-01T00:00:00Z"
}
}
|
Name |
Description |
|
segment |
Type: Segment Segment. Example
|
Segment
Segment.
|
Name |
Description |
|
counter_id |
Type: integer Tag ID. |
|
create_time |
Type: string<date-time> Segment creation time. Example: |
|
expression |
Type: string An expression that matches the value of the Min length: Max length: Example: |
|
name |
Type: string Segment name. Min length: Max length: Example: |
|
segment_id |
Type: integer Segment ID. |
|
segment_source |
Type: string Segment source. Shows how this segment was created. Accepts the value Example: |
|
status |
Type: string Segment status. Possible values:
Example: |
Example
{
"segment_id": 0,
"counter_id": 0,
"name": "example",
"expression": "example",
"status": "example",
"segment_source": "example",
"create_time": "2025-01-01T00:00:00Z"
}
Responses
200 OK
OK
Body
application/json
{
"segment": {
"segment_id": 0,
"counter_id": 0,
"name": "example",
"expression": "example",
"status": "example",
"segment_source": "example",
"create_time": "2025-01-01T00:00:00Z"
}
}
|
Name |
Description |
|
segment |
Type: Segment Segment. Example
|