---
metadata:
  - name: generator
    content: Diplodoc Platform v5.19.4
alternate:
  - https://yandex.ru/dev/audience/en/ref/openapi/segments/createGeoPolygon.md
  - https://yandex.ru/dev/audience/ru/ref/openapi/segments/createGeoPolygon.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/audience/ru/llms.txt

<div class="openapi">

# Создание сегмента с типом "геолокация-полигоны"

<!-- markdownlint-disable-file -->

Создает сегмент на основании данных о геолокации с типом `полигоны`.

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-post);margin-bottom: 12px">

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
https://api-audience.yandex.ru/v1/management/segments/create_geo_polygon
```

</div>

</div>

</div>

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "segment": {
    "name": "example",
    "polygons": [
      {
        "points": [
          {},
          {},
          {},
          {}
        ],
        "description": "example"
      }
    ],
    "period_length": 0,
    "times_quantity": 0,
    "geo_segment_type": "example",
    "device_matching_type": "example"
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_segment_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [SegmentRequestGeoPolygon](#entity-SegmentRequestGeoPolygon)

Сегмент с заданными параметрами.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "name": "example",
  "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"
    }
  ],
  "period_length": 0,
  "times_quantity": 0,
  "geo_segment_type": "example",
  "device_matching_type": "example"
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### GeoPoint {#entity-GeoPoint}

Координаты точек.

#|
|| **Name** | **Description** ||
||

_description_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Произвольный комментарий, длина которого не превышает 200.

_Min length:_{.json-schema-reset .json-schema-assertion} `0`

_Max length:_{.json-schema-reset .json-schema-assertion} `200`

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_latitude_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: number

Широта.
{.table-cell}
||
||

_longitude_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: number

Долгота.
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "latitude": 0.5,
  "longitude": 0.5,
  "description": "example"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### GeoPolygon {#entity-GeoPolygon}

Список полигонов. Всего в сегмент можно добавить не более 10 полигонов.

#|
|| **Name** | **Description** ||
||

_points_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [GeoPoint](#entity-GeoPoint)[]

_Min items:_{.json-schema-reset .json-schema-assertion} `4`

_Max items:_{.json-schema-reset .json-schema-assertion} `2147483647`

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "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"
  }
]
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "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"
    }
  ]
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### SegmentRequestGeoPolygon {#entity-SegmentRequestGeoPolygon}

Сегмент с заданными параметрами.

#|
|| **Name** | **Description** ||
||

_name_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Название сегмента.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_polygons_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: [GeoPolygon](#entity-GeoPolygon)[]

_Min items:_{.json-schema-reset .json-schema-assertion} `1`

_Max items:_{.json-schema-reset .json-schema-assertion} `10`

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "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"
  }
]
```

{% endcut %}
{.table-cell}
||
||

_geo_segment_type_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Тип координат. Допустимые значения:

- `last` — актуальные координаты. В сегмент попадут пользователи, которые находятся на выбранной территории прямо сейчас, или находились там не более часа назад.
- `regular` — регулярные координаты. В сегмент попадут пользователи, которые регулярно бывают на выбранной территории. Например, живут или работают рядом. При подборе учитываются данные за последние 45 дней.
- `home` — координаты дома. В сегмент попадут пользователи, которые живут на выбранной территории.
- `work` — координаты работы. В сегмент попадут пользователи, которые работают на выбранной территории.
- `condition` — условие "Пользователь посетил указанные места N раз за период". В сегмент попадут пользователи, которые выполнили заданное условие.


_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_period_length_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Период посещений указанных мест. Параметр необходим для создания условия "Пользователь посетил указанные места N раз за период". Допустимые значения периода (в сутках): от 1 до 90 (включительно).
{.table-cell}
||
||

_times_quantity_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Частота посещений указанных мест. Параметр необходим для создания условия "Пользователь посетил указанные места N раз за период".

{% note info %}

Учитывается только одно посещение в сутки.

{% endnote %}

{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "name": "example",
  "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"
    }
  ],
  "period_length": 0,
  "times_quantity": 0,
  "geo_segment_type": "example"
}
```

{% endcut %}

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

OK

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "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,
    "geo_segment_type": "example",
    "times_quantity": 0,
    "period_length": 0,
    "form": "example",
    "polygons": [
      {
        "points": [
          null,
          null,
          null,
          null
        ],
        "description": "example"
      }
    ],
    "pattern": "example",
    "too_much_data": true
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_segment_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [PolygonGeoSegment](#entity-PolygonGeoSegment)

Сегмент на основе данных о геолокации по полигонам.

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "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
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### BaseSegment {#entity-BaseSegment}

Тип для описания сегмента.

#|
|| **Name** | **Description** ||
||

_name_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

Название сегмента.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_create_time_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string&lt;date-time&gt;

Время создания сегмента.

_Example:_{.json-schema-reset .json-schema-example} `2025-01-01T00:00:00Z`
{.table-cell}
||
||

_id_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: integer

Идентификатор сегмента. Укажите данный параметр при обновлении сегмента.
{.table-cell}
||
||

_owner_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Логин владельца сегмента.

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_status_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Статус обработки сегмента. Допустимые значения:

- `uploaded` — сегмент с данными пользователя загружен.
- `is_processed` — сегмент с заданными параметрами обрабатывается.
- `processed` — загрузка и обработка сегмента завершена. Сегмент готов для работы.
- `processing_failed` — обработка сегмента завершилась с ошибкой.
- `is_updated` — сегмент обновляется.
- `few_data` — сегмент содержит мало данных для работы.


_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_type_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

Тип сегмента. Допустимые значения:

- `uploading` — сегмент, созданный из файла с пользовательскими данными.
- `metrika` — сегмент, импортируемый из Яндекс Метрики.
- `appmetrica` — сегмент, импортируемый из AppMetrica.
- `lookalike` — сегмент из пользователей, «похожих» на другой сегмент клиента (технология Look-alike).
- `geo` — сегмент на основе данных о геолокации по полигонам и по окружностям.
- `pixel` — сегмент, созданный по пикселю.


_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "type": "example",
  "id": 0,
  "name": "example",
  "status": "example",
  "create_time": "2025-01-01T00:00:00Z",
  "owner": "example"
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### PolygonGeoSegment {#entity-PolygonGeoSegment}

Сегмент на основе данных о геолокации по полигонам.

{% cut "**All of 2 types**" %}{.json-schema-combinators data-marker=and}

- **Type**: [BaseSegment](#entity-BaseSegment)

  Тип для описания сегмента.

  {% cut "**Example**" %}{.json-schema-example}

  ```json translate=no
  {
    "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
  }
  ```

  {% endcut %}

- {% cut "**Type**: object" %}

  #|
  ||

  _geo_segment_type_{.json-schema-reset .json-schema-property}
  {.table-cell}|
  **Type**: string

  Тип координат. Допустимые значения:

  - `last` — актуальные координаты. В сегмент попадут пользователи, которые находятся на выбранной территории прямо сейчас, или находились там не более часа назад.
  - `regular` — регулярные координаты. В сегмент попадут пользователи, которые регулярно бывают на выбранной территории. Например, живут или работают рядом. При подборе учитываются данные за последние 45 дней.
  - `home` — координаты дома. В сегмент попадут пользователи, которые живут на выбранной территории.
  - `work` — координаты работы. В сегмент попадут пользователи, которые работают на выбранной территории.
  - `condition` — условие "Пользователь посетил указанные места N раз за период". В сегмент попадут пользователи, которые выполнили заданное условие.


  _Example:_{.json-schema-reset .json-schema-example} `example`
  {.table-cell}
  ||
  ||

  _period_length_{.json-schema-reset .json-schema-property}
  {.table-cell}|
  **Type**: integer

  Период посещений указанных мест. Параметр необходим для создания условия "Пользователь посетил указанные места N раз за период". Допустимые значения периода (в сутках): от 1 до 90 (включительно).
  {.table-cell}
  ||
  ||

  _polygons_{.json-schema-reset .json-schema-property}
  {.table-cell}|
  **Type**: [GeoPolygon](#entity-GeoPolygon)[]

  {% cut "**Example**" %}{.json-schema-example}

  ```json translate=no
  [
    {
      "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"
    }
  ]
  ```

  {% endcut %}
  {.table-cell}
  ||
  ||

  _times_quantity_{.json-schema-reset .json-schema-property}
  {.table-cell}|
  **Type**: integer

  Частота посещений указанных мест. Параметр необходим для создания условия "Пользователь посетил указанные места N раз за период".

  {% note info %}

  Учитывается только одно посещение в сутки.

  {% endnote %}

  {.table-cell}
  ||
  |#{.json-schema-properties}

  {% endcut %}

  {% cut "**Example**" %}{.json-schema-example}

  ```json translate=no
  {
    "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"
      }
    ]
  }
  ```

  {% endcut %}

{% endcut %}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "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"
    }
  ]
}
```

{% endcut %}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.