Deleting expense data as multipart/form-data

Deletes data on expenses uploaded to Yandex Metrica.

Note

Yandex Direct data cannot be deleted.

Data is passed as multipart/form-data within the file parameter in CSV format. Specify which data should be deleted.

Required columns:

  • Date: String, a date in YYYY-MM-DD format or a range of dates in YYYY-MM-DD/YYYY-MM-DD format.

Optional columns:

  • UTMSource: String, utm_source label value.
  • UTMMedium: String, utm_medium label value.
  • UTMCampaign: String, utm_campaign label value.
  • UTMTerm: String, utm_term label value.
  • UTMContent: String, utm_content label value.
  • TrafficSource: First-level traffic source. Acceptable values are given in the table.
  • TrafficSourceDetail: Second-level traffic source. Acceptable values are given in the table.

Note

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

Request

POST

https://api-metrika.yandex.net/management/v1/counter/{counterId}/expense/delete

Path parameters

Name

Description

counterId

Type: integer

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

Query parameters

Name

Description

comment

Type: string

Comment.

Example: ``

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.

Example: ``

Body

multipart/form-data
{
  "file": "example"
}

Name

Description

file

Type: string<binary>

Example: example

Responses

200 OK

OK

Body

application/json
{
  "uploading": {
    "id": 0,
    "create_time": "2025-01-01T00:00:00Z",
    "source_quantity": 0,
    "provider": "example",
    "comment": "example",
    "type": "example",
    "status": "example"
  }
}

Name

Description

uploading

Type: ExpenseUploading

Information about expense uploads.

Example
{
  "id": 0,
  "create_time": "2025-01-01T00:00:00Z",
  "source_quantity": 0,
  "provider": "example",
  "comment": "example",
  "type": "example",
  "status": "example"
}

ExpenseUploading

Information about expense uploads.

Name

Description

comment

Type: string

Comment.

Example: example

create_time

Type: string<date-time>

Upload time.

Example: 2025-01-01T00:00:00Z

id

Type: integer

Upload ID.

provider

Type: string

Data provider name.

Example: example

source_quantity

Type: integer

Number of rows in the source file.

status

Type: string

Upload status:

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

Example: example

type

Type: string

Upload type:

  • EXPENSES: Expenses.
  • REMOVES: Deleting expenses.

Example: example

Example
{
  "id": 0,
  "create_time": "2025-01-01T00:00:00Z",
  "source_quantity": 0,
  "provider": "example",
  "comment": "example",
  "type": "example",
  "status": "example"
}