Creating a pixel

Creates a pixel with the specified parameters.

Request

POST

https://api-audience.yandex.ru/v1/management/pixels

Body

application/json
{
  "pixel": {
    "name": "example"
  }
}

Name

Description

pixel

Type: PixelRequest

Pixel.

Example
{
  "name": "example"
}

PixelRequest

Pixel.

Name

Description

name

Type: string

The pixel name.

Example: example

Example
{
  "name": "example"
}

Responses

200 OK

OK

Body

application/json
{
  "pixel": {
    "id": 0,
    "name": "example",
    "create_time": "2025-01-01T00:00:00Z",
    "segments": [
      {
        "type": "example",
        "id": 0,
        "name": "example",
        "status": "example",
        "create_time": "2025-01-01T00:00:00Z",
        "owner": "example",
        "has_guests": true,
        "guest_quantity": 0,
        "can_create_dependent": true,
        "has_derivatives": true,
        "derivatives": [
          null
        ],
        "cookies_matched_quantity": 0,
        "pixel_id": 0,
        "period_length": 0,
        "times_quantity": 0,
        "times_quantity_operation": "example",
        "utm_source": "example",
        "utm_content": "example",
        "utm_campaign": "example",
        "utm_term": "example",
        "utm_medium": "example",
        "pattern": "example"
      }
    ],
    "url": "example",
    "user_quantity_7": 0,
    "user_quantity_30": 0,
    "user_quantity_90": 0
  }
}

Name

Description

pixel

Type: Pixel

Pixel.

Example
{
  "id": 0,
  "name": "example",
  "create_time": "2025-01-01T00:00:00Z",
  "segments": [
    {
      "type": "example",
      "id": 0,
      "name": "example",
      "status": "example",
      "create_time": "2025-01-01T00:00:00Z",
      "owner": "example",
      "has_guests": true,
      "guest_quantity": 0,
      "can_create_dependent": true,
      "has_derivatives": true,
      "derivatives": [
        0
      ],
      "cookies_matched_quantity": 0,
      "pixel_id": 0,
      "period_length": 0,
      "times_quantity": 0,
      "times_quantity_operation": "example",
      "utm_source": "example",
      "utm_content": "example",
      "utm_campaign": "example",
      "utm_term": "example",
      "utm_medium": "example",
      "pattern": "example"
    }
  ],
  "url": "example",
  "user_quantity_7": 0,
  "user_quantity_30": 0,
  "user_quantity_90": 0
}

BaseSegment

The segment description by type.

Name

Description

name

Type: string

Segment name.

Example: example

create_time

Type: string<date-time>

The time of segment creation.

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

id

Type: integer

ID of the segment. Specify this parameter when updating a segment.

owner

Type: string

The username of the segment owner.

Example: example

status

Type: string

Status of processing the segment. Acceptable values:

  • uploaded: The segment with the user's data has been uploaded.
  • is_processed: The segment with the specified parameters is being processed.
  • processed: The segment has been uploaded and processed. The segment is ready to use.
  • processing_failed: Segment processing has failed.
  • is_updated: The segment is updating.
  • few_data: The segment has insufficient data.

Example: example

type

Type: string

Segment type. Acceptable values:

  • uploading: A segment created from a file with user data.
  • metrika: A segment imported from Yandex Metrica.
  • appmetrica: A segment imported from AppMetrica.
  • lookalike: A segment of users who "look like" one of the client's other segments (uses the "lookalike" technology).
  • geo: A segment based on location data for polygons and circles.
  • pixel: A segment created using a tracking pixel.

Example: example

Example
{
  "type": "example",
  "id": 0,
  "name": "example",
  "status": "example",
  "create_time": "2025-01-01T00:00:00Z",
  "owner": "example"
}

PixelSegment

A segment created using a tracking pixel.

All of 2 types
  • Type: BaseSegment

    The segment description by type.

    Example
    {
      "type": "example",
      "id": 0,
      "name": "example",
      "status": "example",
      "create_time": "2025-01-01T00:00:00Z",
      "owner": "example",
      "has_guests": true,
      "guest_quantity": 0,
      "can_create_dependent": true,
      "has_derivatives": true,
      "derivatives": [
        0
      ],
      "cookies_matched_quantity": 0
    }
    
  • Type: object

    period_length

    Type: integer

    The time period for tracking the user with the pixel. Acceptable values (in days): from 1 to 90 (inclusive).

    pixel_id

    Type: integer

    The pixel ID.

    times_quantity

    Type: integer

    Threshold value (M). This is the base number for comparing how many times the user was detected by the pixel during the period.

    times_quantity_operation

    Type: string

    Condition for users to be included in the pixel segment. Acceptable values:

    • lt: Less than. The user was detected by the pixel less than M times during the period.
    • eq: Equal to. The user was detected by the pixel M times during the period.
    • gt: Greater than. The user was detected by the pixel more than M times during the period.

    Example: example

    utm_campaign

    Type: string

    utm_campaign tag. Can be used as a condition for including users in a pixel segment.

    Example: example

    utm_content

    Type: string

    utm_content tag. Can be used as a condition for including users in a pixel segment.

    Example: example

    utm_medium

    Type: string

    utm_medium tag. Can be used as a condition for including users in a pixel segment.

    Example: example

    utm_source

    Type: string

    utm_source tag. Can be used as a condition for including users in a pixel segment.

    Example: example

    utm_term

    Type: string

    utm_term tag. Can be used as a condition for including users in a pixel segment.

    Example: example

    Example
    {
      "pixel_id": 0,
      "period_length": 0,
      "times_quantity": 0,
      "times_quantity_operation": "example",
      "utm_source": "example",
      "utm_content": "example",
      "utm_campaign": "example",
      "utm_term": "example",
      "utm_medium": "example"
    }
    
Example
{
  "type": "example",
  "id": 0,
  "name": "example",
  "status": "example",
  "create_time": "2025-01-01T00:00:00Z",
  "owner": "example",
  "has_guests": true,
  "guest_quantity": 0,
  "can_create_dependent": true,
  "has_derivatives": true,
  "derivatives": [
    0
  ],
  "cookies_matched_quantity": 0,
  "pixel_id": 0,
  "period_length": 0,
  "times_quantity": 0,
  "times_quantity_operation": "example",
  "utm_source": "example",
  "utm_content": "example",
  "utm_campaign": "example",
  "utm_term": "example",
  "utm_medium": "example"
}

Pixel

Pixel.

Name

Description

name

Type: string

The pixel name.

Example: example

create_time

Type: string<date-time>

The time of pixel creation.

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

id

Type: integer

The pixel ID. Specify this parameter when updating a pixel.

segments

Type: PixelSegment[]

Example
[
  {
    "type": "example",
    "id": 0,
    "name": "example",
    "status": "example",
    "create_time": "2025-01-01T00:00:00Z",
    "owner": "example",
    "has_guests": true,
    "guest_quantity": 0,
    "can_create_dependent": true,
    "has_derivatives": true,
    "derivatives": [
      0
    ],
    "cookies_matched_quantity": 0,
    "pixel_id": 0,
    "period_length": 0,
    "times_quantity": 0,
    "times_quantity_operation": "example",
    "utm_source": "example",
    "utm_content": "example",
    "utm_campaign": "example",
    "utm_term": "example",
    "utm_medium": "example",
    "pattern": "example"
  }
]

user_quantity_30

Type: integer

Coverage over one month.

user_quantity_7

Type: integer

Coverage over one week.

user_quantity_90

Type: integer

Coverage over 90 days.

Example
{
  "id": 0,
  "name": "example",
  "create_time": "2025-01-01T00:00:00Z",
  "segments": [
    {
      "type": "example",
      "id": 0,
      "name": "example",
      "status": "example",
      "create_time": "2025-01-01T00:00:00Z",
      "owner": "example",
      "has_guests": true,
      "guest_quantity": 0,
      "can_create_dependent": true,
      "has_derivatives": true,
      "derivatives": [
        0
      ],
      "cookies_matched_quantity": 0,
      "pixel_id": 0,
      "period_length": 0,
      "times_quantity": 0,
      "times_quantity_operation": "example",
      "utm_source": "example",
      "utm_content": "example",
      "utm_campaign": "example",
      "utm_term": "example",
      "utm_medium": "example",
      "pattern": "example"
    }
  ],
  "user_quantity_7": 0,
  "user_quantity_30": 0,
  "user_quantity_90": 0
}

No longer supported, please use an alternative and newer version.