---
title: "Create Auto ReQL Segmentation"
method: PUT
path: "/{databaseId}/segmentations/auto-reql/{segmentationId}"
tags: ["Segmentations Definition"]
---

# Create Auto ReQL Segmentation

`PUT /{databaseId}/segmentations/auto-reql/{segmentationId}`

Segment the items using a [ReQL](https://docs.recombee.com/reql) expression.

For each item, the expression should return a set that contains IDs of segments to which the item belongs to.

## Path parameters

- `databaseId` string, required
- `segmentationId` string, required

## Request body

- CreateAutoReQLSegmentationParameters
  - `sourceType` string, required — What type of data should be segmented. Currently only `items` are supported.
  - `expression` string, required — ReQL expression that returns for each item a set with IDs of segments to which the item belongs
  - `title` string — Human-readable name that is shown in the Recombee Admin UI.
  - `description` string — Description that is shown in the Recombee Admin UI.

## Response `201`

successful operation

## Other responses

- `400` — segmentationId does not match ^[a-zA-Z0-9_\-:@\.]+$, ReQL expression is invalid.

---

[API](https://skmtc.dev/recombee/apis/recombee-api.md) · [All operations](https://skmtc.dev/recombee/apis/recombee-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/recombee/recombee-api/revisions/a9c9c33eb2e8/schema)
