---
search:
  tags:
    - Segments
    - PATCH
seo:
  description: >-
    Update a segment. Reference for the PATCH /segments/{id} endpoint in the
    BillionSend API.
sidebar:
  label: Update a segment
  badge: PATCH
title: Update a segment
type: openapi-operation
---
`PATCH /segments/{id}`

**Request body** (`application/json`)

- `name` (string)
- `domain_id` (string<uuid> | null) — BillionSend extension: id of one of your domains. A broadcast to this segment must then be sent from that domain (422 otherwise), so an audience is never mailed under another brand or against another brand's opt-outs. null or omitted: a segment of the whole team, sendable from any domain. On update, null makes the segment a team-wide one again.
- `filter` (SegmentFilter | null)

Request body example:

```json
{
  "name": "string",
  "domain_id": "b2f7354f-b74d-4332-ab10-1a5e3c56466c",
  "filter": {
    "match": "all",
    "conditions": [
      {
        "field": "string",
        "op": "string",
        "value": "string"
      }
    ]
  }
}
```

**Responses**

- `200` — Segment updated
- `401` — Missing, malformed, unknown or revoked API key
- `403` — A key held to one domain bound this to another domain, or unbound it
- `404` — Not found
- `422` — Validation error, or a domain\_id that is not one of your domains
- `429` — Over the rate limit (rate\_limit\_exceeded, with Retry-After)

Response example, 200:

```json
{
  "object": "segment",
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "name": "string",
  "domain_id": "b2f7354f-b74d-4332-ab10-1a5e3c56466c",
  "filter": {
    "match": "all",
    "conditions": [
      {
        "field": "string",
        "op": "string",
        "value": "string"
      }
    ]
  },
  "created_at": "string"
}
```
