---
metadata:
  - name: generator
    content: Diplodoc Platform v5.48.2
alternate:
  - https://yandex.com.tr/dev/metrika/en/management/openapi/expense/uploadRemoveBody_1.md
  - https://yandex.com.tr/dev/metrika/ru/management/openapi/expense/uploadRemoveBody_1.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/dev/metrika/ru/llms.txt

<!-- source: ru/management-src/Upravlenie-zagruzkami-rashodov-na-reklamu/uploadRemoveBody.md -->
<div class="openapi">

# Удаление данных о расходах как multipart/form-data

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

Удаляет загруженные в Метрику данные о расходах.

{% note info %}

Данные Директа удалить невозможно.

{% endnote %}

Данные передаются как multipart/form-data в параметре `file`, в формате CSV — укажите, какую именно информацию нужно удалить.

Обязательные колонки:
- `Date` — строка, дата в формате YYYY-MM-DD или диапазон дат в формате YYYY-MM-DD/YYYY-MM-DD.

Необязательные колонки:
- `UTMSource` — строка, значение метки `utm_source`.
- `UTMMedium` — строка, значение метки `utm_medium`.
- `UTMCampaign` — строка, значение метки `utm_campaign`.
- `UTMTerm` — строка, значение метки `utm_term`.
- `UTMContent` — строка, значение метки `utm_content`.
- `TrafficSource` — источник трафика первого уровня. Доступные значения описаны в [таблице](https://yandex.com.tr/dev/metrika/ru/management/table-source.md).
- `TrafficSourceDetail` — источник трафика второго уровня. Доступные значения описаны в [таблице](https://yandex.com.tr/dev/metrika/ru/management/table-source.md).

{% note info %}

Значения UTM-меток регистрозависимые. Регистр должен совпадать с тем, в котором значение было указано при загрузке данных.

{% endnote %}


## 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}/expense/delete
```

</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}

### Query parameters

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

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

Комментарий.

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

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

Название провайдера данных, которое могло быть передано при загрузке расходов по API. Если значение параметра не указано, будут удалены данные для всех провайдеров по заданным в загруженном файле условиям.

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

<div class="openapi-entity">

### Body

{% cut "multipart/form-data" %}

```json translate=no
{
  "file": "example"
}
```

{% endcut %}

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

_file_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string&lt;binary&gt;

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

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

OK

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "uploading": {
    "id": 0,
    "create_time": "2025-01-01T00:00:00Z",
    "source_quantity": 0,
    "provider": "example",
    "comment": "example",
    "type": "example",
    "status": "example"
  }
}
```

{% endcut %}

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

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

Информация о загрузке расходов.

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

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

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

</div>

<div class="openapi-entity">

### ExpenseUploading {#entity-ExpenseUploading}

Информация о загрузке расходов.

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

_comment_{.json-schema-reset .json-schema-property}
{.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}
||
||

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

Имя провайдера данных.

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

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

Количество строк в исходном файле.
{.table-cell}
||
||

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

Статус загрузки:
- `UPLOADED` — загрузка завершена.
- `IN_PROGRESS` — загрузка находится в процессе обработки.
- `PROCESSED` — загрузка успешно обработана.


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

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

Тип загрузки:
- `EXPENSES` — расходы.
- `REMOVES` — удаление расходов.


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

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

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

{% endcut %}

</div>

</div>

</div>
<!-- endsource: ru/management-src/Upravlenie-zagruzkami-rashodov-na-reklamu/uploadRemoveBody.md -->


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