---
title: "Update a segment (full replace)"
method: PUT
path: "/segments/{segment_id}"
tags: ["Segments"]
---

# Update a segment (full replace)

`PUT /segments/{segment_id}`

Replaces all fields of a segment. All fields are required.

## Path parameters

- `segment_id` string, required

## Request body

- V4SegmentUpdate
  - `name` string, required — Segment name (max 256 characters).
  - `conditions` V4SegmentCondition[] — Targeting rules. PUT is a full replace: pass the complete set you want to keep, or an empty array to clear all conditions. Omit the field to leave existing conditions untouched.
    - `metric` string, required — Metric identifier. Corresponds to a configured `SegmentMetric` (`ref_table_field`). Common values: `environment`, `client_uid`, `custom_uid`, `client_advertiser_id`, `renewable`, `target_platform`.
    - `comparator` string, required — Comparison operator applied between the metric and `value`. `contains` / `not_contains` map to SQL LIKE semantics on string metrics; numeric comparators (`gt`/`gte`/`lt`/`lte`) require a numeric metric.
    - `value` string, required — String-encoded value to compare against. Cast to the metric's underlying type (e.g. int, string) on the server.
    - `negate` boolean — If `true`, the rule matches when the comparison is false (logical NOT applied to the individual rule). Defaults to `false`.

## Response `200`

Updated segment

- V4Segment
  - `object` string, required
  - `id` string, required — Segment identifier.
  - `url` string, required — Canonical API path.
  - `name` string, required — Display name.
  - `is_system` boolean, required — Whether this is a predefined system segment (read-only).
  - `conditions` V4SegmentCondition[], required — Targeting rules. Every rule must match for a user to fall into the segment (logical AND). Omit on update to leave existing conditions untouched; pass an empty array to clear.
    - `metric` string, required — Metric identifier. Corresponds to a configured `SegmentMetric` (`ref_table_field`). Common values: `environment`, `client_uid`, `custom_uid`, `client_advertiser_id`, `renewable`, `target_platform`.
    - `comparator` string, required — Comparison operator applied between the metric and `value`. `contains` / `not_contains` map to SQL LIKE semantics on string metrics; numeric comparators (`gt`/`gte`/`lt`/`lte`) require a numeric metric.
    - `value` string, required — String-encoded value to compare against. Cast to the metric's underlying type (e.g. int, string) on the server.
    - `negate` boolean — If `true`, the rule matches when the comparison is false (logical NOT applied to the individual rule). Defaults to `false`.
  - `created_at` string, date-time, required — ISO 8601 creation timestamp.
  - `updated_at` string, date-time, required — ISO 8601 last update timestamp.

## Other responses

- `400` — Invalid request
- `401` — Unauthorized
- `404` — Segment not found
- `415` — Unsupported Content-Type
- `422` — Unprocessable entity
- `500` — Internal error
- `504` — Upstream timeout

---

[API](https://skmtc.net/qonversion/apis/qonversion-rest-api-v4.md) · [All operations](https://skmtc.net/qonversion/apis/qonversion-rest-api-v4/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/qonversion/qonversion-rest-api-v4/versions/e3f72cf8951c/schema)
