Deleting expense data using a request

Deletes data on expenses uploaded to Yandex Metrica. Use this method to pass data to be removed right in the request.

Note

Yandex Direct data can't be deleted.

Note

The values of UTM tags are case-sensitive. Use the same case as in the uploaded data.

Request

POST

https://api-metrica.yandex.net/management/v1/counter/{counterId}/expense/delete_single

Path parameters

Name

Description

counterId*

Type: integer<int32>

ID of the counter for which you want to delete data.
Example: 2215573

Query parameters

Name

Description

date*

Type: string

Date in YYYY-MM-DD format or a date range in YYYY-MM-DD/YYYY-MM-DD format.

UTMCampaign

Type: string

String, utm_campaign label value.

UTMContent

Type: string

String, utm_content label value.

UTMMedium

Type: string

String, utm_medium label value.

UTMSource

Type: string

String, utm_source label value.

UTMTerm

Type: string

String, utm_term label value.

comment

Type: string

Comment.

provider

Type: string

Name of the data provider that could have been passed when uploading expenses via the API. If the parameter value is not specified, data for all providers will be removed according to the conditions given in the uploaded file.

trafficSource

Type: string

First-level traffic source. Acceptable values are given in the table.

trafficSourceDetail

Type: string

Second-level traffic source. Acceptable values are given in the table.

Responses

200 OK

OK

Body

application/json
{
    "uploading": {
        "id": 0,
        "create_time": "2022-12-29T18:02:01Z",
        "source_quantity": 0,
        "provider": "string",
        "comment": "string",
        "type": "string",
        "status": "string"
    }
}

Name

Description

uploading*

Type: ExpenseUploading

Information about expense uploads.

ExpenseUploading

Information about expense uploads.

Name

Description

comment

Type: string

Comment.

create_time

Type: string<date-time>

Upload time.

id

Type: integer<int64>

Upload ID.

provider

Type: string

Data provider name.

source_quantity

Type: integer<int32>

Number of rows in the source file.

status

Type: string

Upload status:

  • UPLOADED: Upload complete.
  • IN_PROGRESS: Upload in progress.
  • PROCESSED: Upload processed successfully.

type

Type: string

Upload type:

  • EXPENSES: Expenses.
  • REMOVES: Deleting expenses.