---
title: "Update a Customer Segment"
method: PATCH
path: "/v2/customer-segments/{segment_id}"
tags: ["customer-segments"]
---

# Update a Customer Segment

`PATCH /v2/customer-segments/{segment_id}`

## Request

- Base URL: `https://api.stuut.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.stuut.ai/v2/customer-segments/{segment_id}`
- Auth: HTTP bearer

Updates a customer segment's name, description, priority, or conditions.

## Path parameters

- `segment_id` string, required

## Request body

- UpdateCustomerSegmentInput
  - `name` string, nullable: The name of the segment (case-insensitive unique per org).
  - `description` string, nullable: Optional description of what this segment represents.
  - `priority` integer, nullable: Lower number = higher priority for conflict resolution when partner matches multiple segments.
  - `conditions` SegmentConditionsInput: Segment filter conditions. Use and_/or_ to combine conditions.
    - `address` AddressConditionInput
      - `country` CountryOperators
        - `in` string[], nullable: Include countries
        - `nin` string[], nullable: Exclude countries
    - `businessUnit` BusinessUnitConditionInput
      - `name` BusinessUnitNameOperators
        - `in` string[], nullable: Include business units
        - `nin` string[], nullable: Exclude business units
    - `customFields` object, nullable
    - `stats` StatsConditionInput: Filter by partner_stats values (forex-converted to org base currency).
      - `total_invoice_balance` StatsNumericOperators: Numeric comparison operators for partner_stats fields (values in org base currency).
        - `eq` integer, nullable
        - `ne` integer, nullable
        - `gt` integer, nullable
        - `gte` integer, nullable
        - `lt` integer, nullable
        - `lte` integer, nullable
      - `overdue_invoice_balance` StatsNumericOperators: Numeric comparison operators for partner_stats fields (values in org base currency).
        - `eq` integer, nullable
        - `ne` integer, nullable
        - `gt` integer, nullable
        - `gte` integer, nullable
        - `lt` integer, nullable
        - `lte` integer, nullable
    - `and` SegmentConditionsInput[], nullable
    - `or` SegmentConditionsInput[], nullable

## Response `200`

Successful Response

- CustomerSegment
  - `created_at` string, date-time, required
  - `modified_at` string, date-time, nullable, required
  - `id` string, required
  - `name` string, required: The name of the segment (case-insensitive unique per org).
  - `description` string, nullable, required: Optional description of what this segment represents.
  - `priority` integer, required: Lower number = higher priority for conflict resolution when partner matches multiple segments.
  - `conditions` object, nullable, required: Rules that determine which partners belong to this segment.
  - `partner_count` integer, nullable, required: Cached number of partners matching this segment.
  - `partner_count_refreshed_at` string, date-time, required
  - `object` string, required: String representing the object's type. Objects of the same type share the same value.

## Other responses

- `409`: Conflict
- `422`: Validation Error

---

[API](https://skmtc.dev/stuut/apis/stuut-api.md) - [All operations](https://skmtc.dev/stuut/apis/stuut-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stuut/apis/stuut-api/revisions/3b5ab941f918?raw)
