List of segments for counter

Attention.

Access tokens will not be accepted in URL parameters starting February 13, 2019. To continue working with the Yandex.Metrica API, set up authorization by passing the token in the HTTP header.

The outdated authorization method will be temporarily disabled on January 23, January 30, and February 6 for maintenance. Authorization using URL parameters will be unavailable on these dates.

Returns a list of segments created via the API and pertaining to the specified counter.

  1. Request syntax
  2. Response format

Request syntax

counterId — counter id.

https://api-metrica.yandex.net/management/v1/counter/{counterId}/apisegment/segments
 ? 

Response format


{
    "segments" : [ {
        "segment_id" :  < integer > ,
        "counter_id" :  < integer > ,
        "name" :  < string > ,
        "expression" :  < string > ,
        "segment_source" :  < segment_source > 
    }, ... ]
}
ParametersDescription
segmentsSegment.
segments
segment_idSegment ID.
counter_idCounter ID.
nameSegment name.
expressionВыражение, которое соответствует значению параметра filters.
segment_sourceSegment source. Indicates the means of its creation. Accepts the value api — uses segments created through the API.