Changing a filter

Changes the settings for a specified tag filter.

Request

PUT

https://api-metrika.yandex.net/management/v1/counter/{counterId}/filter/{filterId}

Path parameters

Name

Description

counterId

Type: integer

ID of the tag whose filter you want to change.

filterId

Type: integer

ID of the filter whose settings you want to change.

Body

application/json
{
  "filter": {
    "id": 0,
    "attr": "example",
    "type": "example",
    "value": "example",
    "action": "example",
    "status": "example",
    "start_ip": "example",
    "end_ip": "example",
    "with_subdomains": true
  }
}

Name

Description

filter

Type: FilterE

List of structures with information on tag filters.

Example
{
  "id": 0,
  "attr": "example",
  "type": "example",
  "value": "example",
  "action": "example",
  "status": "example",
  "start_ip": "example",
  "end_ip": "example",
  "with_subdomains": true
}

FilterE

List of structures with information on tag filters.

Name

Description

action

Type: string

Filter type:

  • exclude: Exclude traffic.
  • include: Leave only traffic.

Example: example

attr

Type: string

Data type the filter is applied to:

  • title: Page title.
  • client_ip: IP address.
  • url: Page URL.
  • referer: Referrer.
  • uniq_id: Special attribute for the Don't count my sessions filter.

Example: example

status

Type: string

Filter status:

  • active: Filter is used.
  • disabled: Filter disabled (but not deleted).

Example: example

type

Type: string

Filter type or action for filter:

  • equal: Equal to.
  • start: Starts with.
  • contain: Contains.
  • interval: In the interval, only used with the "IP address" data type (attr = client_ip).
  • me: My visits, only used with the attr = uniq_id data type.
  • only_mirrors: Only the site and its mirrors, used only for the Page URL data type (attr = url) and the Leave only traffic filter type (action = include), and provided that mirrors are specified for the tag.
  • regexp: Regular expression.

Example: example

end_ip

Type: string

The last IP address in the range.

Example: example

id

Type: integer

Filter ID. Specify this parameter when changing a tag filter.

start_ip

Type: string

The first IP address in the range.

Example: example

value

Type: string

Filter value.

Example: example

with_subdomains

Type: boolean

Filter by subdomain.

Example
{
  "id": 0,
  "attr": "example",
  "type": "example",
  "value": "example",
  "action": "example",
  "status": "example",
  "start_ip": "example",
  "end_ip": "example",
  "with_subdomains": true
}

Responses

200 OK

OK

Body

application/json
{
  "filter": {
    "id": 0,
    "attr": "example",
    "type": "example",
    "value": "example",
    "action": "example",
    "status": "example",
    "start_ip": "example",
    "end_ip": "example",
    "with_subdomains": true
  }
}

Name

Description

filter

Type: FilterE

List of structures with information on tag filters.

Example
{
  "id": 0,
  "attr": "example",
  "type": "example",
  "value": "example",
  "action": "example",
  "status": "example",
  "start_ip": "example",
  "end_ip": "example",
  "with_subdomains": true
}