---
title: "Update segment"
method: PUT
path: "/segments/{segmentID}"
tags: ["Segments"]
---

# Update segment

`PUT /segments/{segmentID}`

## Request

- Base URL: `https://api.omnisend.com/api`
- URL: `https://api.omnisend.com/api/segments/{segmentID}`
- Auth: one of:
  - OAuth 2
    - Client credentials
    - Token URL: `https://app.omnisend.com/oauth2/token` scopes: `segments.write`
  - API key in header `Authorization`

Updates an existing segment by ID.
The segment must not be in a building state to be updated.
If the segment is currently being built, a `409 Conflict` error is returned.

**Scopes:**
`segments.write`

**Rate Limiting:**
This endpoint is rate limited to 15 requests per minute.

The request body structure (`name` and `conditionGroups`) is identical to [Create segment](post_segments).
See the Create segment endpoint for detailed examples of condition groups, filters, and advanced segmentation patterns.

## Path parameters

- `segmentID` string, required

## Headers

- `Omnisend-Version` string, required

## Request body

- UpdateSegmentRequest: Request body for updating an existing segment.
  - `conditionGroups` SegmentConditionGroup[], required: Condition groups defining the segment rules
    - `conditions` SegmentCondition[]: List of conditions in this group
      - `entity` string: Entity type this condition applies to
      - `filters` unknown[], required: List of filter criteria. Must contain at least one item.
        - unknown
      - `junction` string: Logical operator combining the filters within this condition
  - `name` string, required: Name of the segment

## Response `200`

OK

- GetSegmentResponse: Segment resource representation.
  - `archivedAt` string, nullable: Segment archival timestamp, null if not archived (read-only)
  - `conditionGroups` SegmentConditionGroup[]: Condition groups defining the segment rules
    - `conditions` SegmentCondition[]: List of conditions in this group
      - `entity` string: Entity type this condition applies to
      - `filters` unknown[], required: List of filter criteria. Must contain at least one item.
        - unknown
      - `junction` string: Logical operator combining the filters within this condition
  - `createdAt` string: Segment creation timestamp (read-only)
  - `isStarred` boolean: Whether the segment is marked as a favourite
  - `name` string: Segment name
  - `segmentID` string: Segment unique identifier (read-only)
  - `status` 'ready' | 'building' | 'archived': Segment processing status (read-only)
  - `updatedAt` string: Segment last update timestamp (read-only)

## Other responses

- `400`: Invalid request body or validation failed
- `401`: Authentication is missing or invalid
- `403`: Insufficient permissions for this operation
- `404`: Segment with the given ID was not found
- `409`: Segment is currently being built and cannot be updated
- `410`: API version has been retired
- `429`: Rate limit exceeded
- `500`: Unexpected error occurred

---

[API](https://skmtc.dev/omnisend/apis/segments-api.md) - [All operations](https://skmtc.dev/omnisend/apis/segments-api/llms.txt) - [OpenAPI document](https://skmtc.dev/omnisend/apis/segments-api/revisions/5d5cfb339623?raw)
