Creating a segment with the "geo-polygon" type
Creates a segment based on location data with the polygon type.
Request
POST
https://api-audience.yandex.ru/v1/management/segments/create_geo_polygon
Body
application/json
{
    "segment": {
        "name": "string",
        "polygons": [
            {
                "points": [
                    {
                        "latitude": 0,
                        "longitude": 0,
                        "description": "string"
                    }
                ]
            }
        ],
        "period_length": 0,
        "times_quantity": 0,
        "geo_segment_type": "string"
    }
}
| Name | Description | 
| segment* | Type: SegmentRequestGeoPolygon The segment with the specified parameters. | 
SegmentRequestGeoPolygon
The segment with the specified parameters.
| Name | Description | 
| name* | Type: string Segment name. | 
| polygons* | Type: GeoPolygon[] List of polygons. You cannot add more than 10 polygons to a segment. Min items:  Max items:  | 
| geo_segment_type | Type: string Coordinate type. Acceptable values: 
 | 
| 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). | 
| 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. | 
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:  Max items:  | 
GeoPoint
The coordinates of the points.
| Name | Description | 
| description | Type: string Any comment up to 200 characters. Min length:  Max length:  | 
| latitude | Type: number Latitude. | 
| longitude | Type: number Longitude. | 
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",
        "geo_segment_type": "string",
        "times_quantity": 0,
        "period_length": 0,
        "polygons": [
            {
                "points": [
                    {
                        "latitude": 0,
                        "longitude": 0,
                        "description": "string"
                    }
                ]
            }
        ]
    }
}
| Name | Description | 
| segment | Type: PolygonGeoSegment Segment based on location data for polygons. | 
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: 
 | 
| 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: 
 | 
| 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: 
 | 
No longer supported, please use an alternative and newer version.