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

<div class="openapi">

# Создание сегмента из объекта AppMetrica

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

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

## 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_appmetrica
```

</div>

</div>

</div>

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "segment": {
    "name": "example",
    "app_metrica_segment_type": "example",
    "app_metrica_segment_id": 0,
    "device_matching_type": "example"
  }
}
```

{% endcut %}

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

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

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

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

```json translate=no
{
  "name": "example",
  "app_metrica_segment_type": "example",
  "app_metrica_segment_id": 0,
  "device_matching_type": "example"
}
```

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

</div>

<div class="openapi-entity">

### SegmentRequestAppMetrika {#entity-SegmentRequestAppMetrika}

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

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

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

Вид объекта в AppMetrica. Допустимые значения:

- `api_key` — приложение.
- `segment_id` — сегмент.


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

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

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

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

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

Идентификатор объекта из AppMetrica.
{.table-cell}
||
|#{.json-schema-properties}

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

```json translate=no
{
  "name": "example",
  "app_metrica_segment_type": "example",
  "app_metrica_segment_id": 0
}
```

{% 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,
    "app_metrica_segment_type": "example",
    "app_metrica_segment_id": 0,
    "pattern": "example"
  }
}
```

{% endcut %}

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

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

Сегмент, импортируемый из AppMetrica.

{% 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,
  "app_metrica_segment_type": "example",
  "app_metrica_segment_id": 0,
  "pattern": "example"
}
```

{% 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">

### AppMetricaSegment {#entity-AppMetricaSegment}

Сегмент, импортируемый из AppMetrica.

{% 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" %}

  #|
  ||

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

  Идентификатор объекта из AppMetrica.
  {.table-cell}
  ||
  ||

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

  Вид объекта в AppMetrica. Допустимые значения:

  - `api_key` — приложение.
  - `segment_id` — сегмент.


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

  {% endcut %}

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

  ```json translate=no
  {
    "app_metrica_segment_type": "example",
    "app_metrica_segment_id": 0
  }
  ```

  {% 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,
  "app_metrica_segment_type": "example",
  "app_metrica_segment_id": 0
}
```

{% endcut %}

</div>

</div>

</div>

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