---
title: "Update CustomerSegment"
method: PUT
path: "/shop/customers/customer-segments/{customerSegmentId}"
tags: ["CustomerSegments"]
---

# Update CustomerSegment

`PUT /shop/customers/customer-segments/{customerSegmentId}`

Updates the given `CustomerSegment`.

## Request body

- object
  - `name` string — The display name of the segment.
  - `filters` object, nullable — Filters that define automatic membership criteria for the segment.
    - `all_customers` boolean — When `true`, all customers in the site are included in the segment regardless of other filters.
    - `label_ids` string[], nullable — Include customers that have all of the given label IDs.
    - `membership_type_ids` union — Include customers that hold a membership matching one of the given IDs. Use `true` to include customers with any active membership.
      - string[]
      - true

## Response `200`

The customer segment was successfully retrieved.

- object
  - `data` CustomerSegment, required — A named group of customers within a site that can be targeted for marketing campaigns. Segments can be defined manually or filtered automatically by label and membership criteria.
    - `id` string, uuid, required — The unique identifier of the customer segment.
    - `name` string, required — The display name of the segment.
    - `site_id` string, uuid, required — The ID of the site this segment belongs to.
    - `filters` object, nullable, required — Optional filters that define automatic membership criteria for this segment. `null` indicates no filters are applied.
      - `all_customers` boolean — When `true`, all customers in the site are included in the segment regardless of other filters.
      - `label_ids` string[], nullable — Customers that have all of the given label IDs are included in the segment.
      - `membership_type_ids` union — Customers that hold a membership matching one of the given IDs are included in the segment. Use `true` to include customers with any active membership.
        - string[], nullable
        - true

## Other responses

- `401` — The user is unauthenticated
- `403` — The authenticated user does not have permission.
- `404` — The resource couldn't be found
- `422` — The request didn't pass validation

---

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