---
title: "Update Segment"
description: "How to call Update Segment (PATCH /api/segments/{id}) in the Klaviyo REST API: authentication, parameters, request and response bodies, and an example request."
url: "https://developers.klaviyo.com/en/v2025-01-15/reference/update_segment"
revision: "2025-01-15"
latestUrl: "https://developers.klaviyo.com/en/reference/update_segment"
operationId: "update_segment"
method: "PATCH"
endpoint: "https://a.klaviyo.com/api/segments/{id}"
authentication: "privateKey"
scopes: ["segments:write"]
rateLimits: {"burst":"1/s","steady":"15/m","daily":"100/d"}
revisionHeader: {"name":"revision","required":true}
deprecated: false
related: ["https://developers.klaviyo.com/en/v2025-01-15/reference/segments/llms.txt","https://developers.klaviyo.com/en/v2025-01-15/reference/get_segments.md","https://developers.klaviyo.com/en/v2025-01-15/reference/get_segment.md","https://developers.klaviyo.com/en/v2025-01-15/reference/create_segment.md","https://developers.klaviyo.com/en/v2025-01-15/reference/delete_segment.md","https://developers.klaviyo.com/en/v2025-01-15/reference/get_tags_for_segment.md","https://developers.klaviyo.com/en/v2025-01-15/reference/get_tag_ids_for_segment.md","https://developers.klaviyo.com/en/v2025-01-15/reference/get_profiles_for_segment.md","https://developers.klaviyo.com/en/v2025-01-15/reference/get_profile_ids_for_segment.md","https://developers.klaviyo.com/en/v2025-01-15/reference/get_flows_triggered_by_segment.md","https://developers.klaviyo.com/en/v2025-01-15/reference/get_ids_for_flows_triggered_by_segment.md"]
---

# Update Segment

> This is the Markdown version of https://developers.klaviyo.com/en/v2025-01-15/reference/update_segment

```http
PATCH https://a.klaviyo.com/api/segments/{id}
```

Update a segment with the given segment ID.

- Revision header: `revision: 2025-01-15` (required)
- Scopes: `segments:write`
- Rate limits: Burst: `1/s`, Steady: `15/m`, Daily: `100/d`

## Example request

```bash
curl --request PATCH \
     --url 'https://a.klaviyo.com/api/segments/id' \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/vnd.api+json' \
     --header 'revision: 2025-01-15' \
     --header 'content-type: application/vnd.api+json' \
     --data '{
  "data": {
    "type": "segment",
    "id": "string",
    "attributes": {}
  }
}'
```

## Path parameters

- `id` (string, required)

## Headers

- `revision` (string, required): API endpoint revision (format: YYYY-MM-DD[.suffix]) Default: `2025-01-15`

## Request body

Content type: `application/vnd.api+json` (required)

- `data` (object, required)
  - `type` (string, required): Allowed values: `segment`
  - `id` (string, required)
  - `attributes` (object, required)
    - `definition` (object)
      - `condition_groups` (object[], required): Fields nested this deep aren't listed here; they're in the endpoint's OpenAPI document.
    - `name` (string, nullable)
    - `is_starred` (boolean, nullable)

### Example request body

```json
{
  "data": {
    "type": "segment",
    "id": "string",
    "attributes": {}
  }
}
```

## Responses

### 200: Success

Content type: `application/vnd.api+json`

- `data` (object, required)
  - `type` (string, required): Allowed values: `segment`
  - `id` (string, required)
  - `attributes` (object, required)
    - `name` (string, nullable): A helpful name to label the segment Example: `Repeat Purchasers`
    - `definition` (object): Same fields as SegmentDefinition in the request body above.
    - `created` (string<date-time>, nullable): Date and time when the segment was created, in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm) Example: `2022-11-08T00:00:00+00:00`
    - `updated` (string<date-time>, nullable): Date and time when the segment was last updated, in ISO 8601 format (YYYY-MM-DDTHH:MM:SS.mmmmmm) Example: `2022-11-08T00:00:00+00:00`
    - `is_active` (boolean, required)
    - `is_processing` (boolean, required)
    - `is_starred` (boolean, required)
  - `relationships` (object)
    - `profiles` (object)
      - `data` (object[]): Fields nested this deep aren't listed here; they're in the endpoint's OpenAPI document.
      - `links` (object): Fields nested this deep aren't listed here; they're in the endpoint's OpenAPI document.
    - `tags` (object)
      - `data` (object[]): Fields nested this deep aren't listed here; they're in the endpoint's OpenAPI document.
      - `links` (RelationshipLinks): Fields nested this deep aren't listed here; they're in the endpoint's OpenAPI document.
    - `flow-triggers` (object)
      - `data` (object[]): Fields nested this deep aren't listed here; they're in the endpoint's OpenAPI document.
      - `links` (RelationshipLinks): Fields nested this deep aren't listed here; they're in the endpoint's OpenAPI document.
  - `links` (object, required)
    - `self` (string<uri>, required)

#### Example response body

```json
{
  "data": {
    "type": "segment",
    "id": "string",
    "attributes": {
      "name": "Repeat Purchasers",
      "definition": {
        "condition_groups": [
          {
            "conditions": [
              {
                "type": "profile-group-membership",
                "is_member": true,
                "group_ids": [
                  "string"
                ],
                "timeframe_filter": {
                  "type": "date",
                  "operator": "after",
                  "date": "2022-11-08T00:00:00+00:00"
                }
              }
            ]
          }
        ]
      },
      "created": "2022-11-08T00:00:00+00:00",
      "updated": "2022-11-08T00:00:00+00:00",
      "is_active": true,
      "is_processing": true,
      "is_starred": true
    },
    "relationships": {
      "profiles": {
        "data": [
          {
            "type": "profile",
            "id": "string"
          }
        ],
        "links": {
          "self": "https://www.example.com",
          "related": "https://www.example.com"
        }
      },
      "tags": {
        "data": [
          {
            "type": "tag",
            "id": "string"
          }
        ],
        "links": {
          "self": "https://www.example.com",
          "related": "https://www.example.com"
        }
      },
      "flow-triggers": {
        "data": [
          {
            "type": "flow",
            "id": "string"
          }
        ],
        "links": {
          "self": "https://www.example.com",
          "related": "https://www.example.com"
        }
      }
    },
    "links": {
      "self": "https://www.example.com"
    }
  }
}
```

### 4XX: Client Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```

### 5XX: Server Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```
