---
title: "Update a segment"
method: PATCH
path: "/v1/segments/{id}"
tags: ["Segments"]
---

# Update a segment

`PATCH /v1/segments/{id}`

## Request

- Base URL: `https://api.volanea.com`
- URL: `https://api.volanea.com/v1/segments/{id}`
- Auth: HTTP bearer

Changing `conditions` recomputes membership immediately. Static segments reject `conditions`.

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string
  - `description` string, nullable
  - `conditions` SegmentConditions: Nested condition tree evaluated against contacts, their custom `data`, and their activity.
    - `logic` 'and' | 'or', required
    - `groups` object[], required
      - `filters` object[], required
        - `field` string, required: `email`, `subscribed`, `locale`, `createdAt`, `data.<key>`, `event.<name>`, `email.opened`, …
        - `operator` string, required: `equals`, `notEquals`, `contains`, `notContains`, `greaterThan`, `lessThan`, `exists`, `notExists`, `within`, `notWithin`, `triggered`, `notTriggered`, …
        - `value` union
          - string
          - number
          - boolean
        - `days` integer: Time window (days) for activity operators.

## Response `200`

The updated segment.

- Segment
  - `segmentId` string, required
  - `projectId` string
  - `name` string, required
  - `description` string, nullable
  - `type` 'dynamic' | 'static', required: Dynamic segments are computed from `conditions`; static segments are managed via the members endpoints.
  - `conditions` SegmentConditions: Nested condition tree evaluated against contacts, their custom `data`, and their activity.
    - `logic` 'and' | 'or', required
    - `groups` object[], required
      - `filters` object[], required
        - `field` string, required: `email`, `subscribed`, `locale`, `createdAt`, `data.<key>`, `event.<name>`, `email.opened`, …
        - `operator` string, required: `equals`, `notEquals`, `contains`, `notContains`, `greaterThan`, `lessThan`, `exists`, `notExists`, `within`, `notWithin`, `triggered`, `notTriggered`, …
        - `value` union
          - string
          - number
          - boolean
        - `days` integer: Time window (days) for activity operators.
  - `memberCount` integer, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `401`: Missing or invalid API key.
- `404`: Not found.
- `422`: Request validation failed (code `validation_error`, 422).

---

[API](https://skmtc.dev/volanea/apis/volanea-api.md) · [All operations](https://skmtc.dev/volanea/apis/volanea-api/llms.txt) · [OpenAPI document](https://skmtc.dev/volanea/apis/volanea-api/revisions/9e187ae84fda?raw)
