---
title: "PATCH /api/v4/customers/segments/{id}"
method: PATCH
path: "/api/v4/customers/segments/{id}"
---

# PATCH /api/v4/customers/segments/{id}

`PATCH /api/v4/customers/segments/{id}`

Update a segment by id.

## Path parameters

- `id` integer, required

## Request body

- CustomerSegmentUpdateById
  - `name` string
  - `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
  - 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)
