---
title: "POST /api/v4/customers/segments"
method: POST
path: "/api/v4/customers/segments"
---

# POST /api/v4/customers/segments

`POST /api/v4/customers/segments`

Create segments.

## Request body

- CustomerSegmentCreate[]
  - `request_id` string
  - `name` string, required
  - `color` string
  - `custom_fields_values` CustomFieldValue[]
    - `field_id` integer — Use either field_id or field_code (e.g. PHONE/EMAIL)
    - `field_code` string — Field code (e.g. PHONE/EMAIL)
    - `values` CustomFieldValueItem[], required — Values for the field (multiple values allowed)
      - `value` union, required
        - string
        - integer
        - boolean
      - `enum_id` integer — Option id for list/select custom fields (one of predefined options)
      - `enum_code` string — Option code for list/select custom fields (if you use code instead of id)

## Response `200`

The request has succeeded.

- union
  - CustomerSegmentCreateResponse
    - `_links` object
    - `_embedded` object
      - `segments` CustomerSegmentCreateResult[]
        - `id` integer
        - `request_id` string
        - `_links` object
  - Problem
    - `title` string
    - `status` integer
    - `detail` string
    - `type` string

---

[API](https://skmtc.net/hexlet/apis/amocrm-api.md) · [All operations](https://skmtc.net/hexlet/apis/amocrm-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hexlet/amocrm-api/versions/800f4ed7083b/schema)
