Creating a segment with the "lookalike" type

Creates a lookalike segment with the specified parameters.

Request

POST

https://api-audience.yandex.ru/v1/management/segments/create_lookalike

Body

application/json
{
    "segment": {
        "name": "string",
        "lookalike_link": 0,
        "lookalike_value": 0,
        "maintain_device_distribution": false,
        "maintain_geo_distribution": false
    }
}

Name

Description

segment*

Type: SegmentRequestLookalike

The segment with the specified parameters.

SegmentRequestLookalike

The segment with the specified parameters.

Name

Description

lookalike_link*

Type: integer<int32>

ID of the segment that the created segment should be similar to.

lookalike_value*

Type: integer<int32>

The degree of similarity. Accepts the values 1, 2, 3, 4, and 5.

Min value: 1

Max value: 5

name*

Type: string

Segment name.

maintain_device_distribution

Type: boolean

Distribute users by device type. Acceptable values:

  • true: The distribution of users by device type is maintained, if possible.
  • false: The distribution of users by device type is ignored.

Default value: true.

maintain_geo_distribution

Type: boolean

Distribute users by city. Acceptable values:

  • true: The distribution of users by city is maintained, if possible.
  • false: The distribution of users by city is ignored.

Default value: true.

Responses

200 OK

OK

Body

application/json
{
    "segment": {
        "type": "string",
        "id": 0,
        "name": "string",
        "status": "string",
        "create_time": "2022-12-29T18:02:01Z",
        "owner": "string",
        "lookalike_link": 0,
        "lookalike_value": 0,
        "maintain_device_distribution": false,
        "maintain_geo_distribution": false
    }
}

Name

Description

segment

Type: LookalikeSegment

A segment of users who are similar to one of the client's other segments (look-alike technology).
The segment description by type.

LookalikeSegment

A segment of users who are similar to one of the client's other segments (look-alike technology).

Name

Description

name*

Type: string

Segment name.

create_time

Type: string<date-time>

The time of segment creation.

id

Type: integer<int32>

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

lookalike_link

Type: integer<int32>

ID of the segment that the created segment should be similar to.

lookalike_value

Type: integer<int32>

The degree of similarity. Accepts the values 1, 2, 3, 4, and 5.

maintain_device_distribution

Type: boolean

Distribute users by device type. Acceptable values:

  • true: The distribution of users by device type is maintained, if possible.
  • false: The distribution of users by device type is ignored.

Default value: true.

maintain_geo_distribution

Type: boolean

Distribute users by city. Acceptable values:

  • true: The distribution of users by city is maintained, if possible.
  • false: The distribution of users by city is ignored.

Default value: true.

owner

Type: string

The username of the segment owner.

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.

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.

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