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

# Update a segment

`PATCH /v1/segments/{id}`

## Request

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

Partially updates a segment. Passing `condition` re-validates it and re-snapshots memberCount.

## Path parameters

- `id` string, required

## Request body

- object
  - `name` string
  - `description` string
  - `condition` unknown
  - `trackMembership` boolean

## Response `200`

- object
  - `id` string, required
  - `name` string, required
  - `description` string, required
  - `condition` unknown, required
  - `memberCount` number, required
  - `trackMembership` boolean, required
  - `lastComputedAt` string, required
  - `createdAt` string, required
  - `updatedAt` string, required

## Other responses

- `400`
- `401`: Missing, malformed, or revoked credentials. Send `Authorization: Bearer <api key>`.
- `403`: Authenticated, but the resource belongs to another organization.
- `404`
- `422`: The request parsed but failed schema validation.
- `429`: Rate limit exceeded. Wait for the window named by the RateLimit headers.
- `500`: Unexpected server failure. Safe to retry with backoff; quote `requestId` if it persists.

---

[API](https://skmtc.dev/wraps/apis/wraps-platform-api.md) · [All operations](https://skmtc.dev/wraps/apis/wraps-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/wraps/apis/wraps-platform-api/revisions/12116fb21af7?raw)
