---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com.tr/dev/metrika/en/management/openapi/operation/addOperation.md
  - https://yandex.com.tr/dev/metrika/ru/management/openapi/operation/addOperation.md
  - href: ru/management/openapi/operation/addOperation.md
    type: text/markdown
    title: Markdown version
  - href: ../../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/dev/metrika/ru/llms.txt

<!-- source: ru/management-src/Upravlenie-operaciyami/addOperation.md -->
<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-metrika.yandex.net/management/v1/counter/{counterId}/operations
```

</div>

</div>

</div>

### Path parameters

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

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

идентификатор счетчика, для которого необходимо создать операцию.
{.table-cell}
||
|#{.json-schema-properties}

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "operation": {
    "id": 0,
    "action": "example",
    "attr": "example",
    "value": "example",
    "status": "example"
  }
}
```

{% endcut %}

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

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

Список структур с информацией об операциях счетчика.

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

```json translate=no
{
  "id": 0,
  "action": "example",
  "attr": "example",
  "value": "example",
  "status": "example"
}
```

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

</div>

<div class="openapi-entity">

### OperationE {#entity-OperationE}

Список структур с информацией об операциях счетчика.

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

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

Тип операции:
- `cut_fragment` — вырезать якорь из URL.
- `cut_parameter` — вырезать определенный параметр из URL.
- `cut_all_parameters` — вырезать все параметры из URL.
- `merge_https_and_http` — заменить https:// на http://.
- `to_lower` — привести к нижнему регистру.
- `replace_domain` — заменить домен.


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

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

Поле для фильтрации:
- `referer` — реферер.
- `url` — URL страницы.


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

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

Статус операции:
- `active` — операция используется.
- `disabled` — операция отключена (без удаления).


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

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

Идентификатор операции (требуется указывать при изменении операции счетчика).
{.table-cell}
||
||

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

Значение для замены.

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

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

```json translate=no
{
  "id": 0,
  "action": "example",
  "attr": "example",
  "value": "example",
  "status": "example"
}
```

{% endcut %}

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

OK

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "operation": {
    "id": 0,
    "action": "example",
    "attr": "example",
    "value": "example",
    "status": "example"
  }
}
```

{% endcut %}

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

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

Список структур с информацией об операциях счетчика.

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

```json translate=no
{
  "id": 0,
  "action": "example",
  "attr": "example",
  "value": "example",
  "status": "example"
}
```

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

</div>

</div>

</div>
<!-- endsource: ru/management-src/Upravlenie-operaciyami/addOperation.md -->

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