---
title: "Agent Patch Segment"
method: PATCH
path: "/api/agent/v1/segments/{segment_id}"
tags: ["agent-audiences"]
---

# Agent Patch Segment

`PATCH /api/agent/v1/segments/{segment_id}`

## Request

- Base URL: `https://app.sentientmail.com` (the document declares no server; this is the origin it was published from)
- URL: `https://app.sentientmail.com/api/agent/v1/segments/{segment_id}`
- Auth: none declared

Edit a segment. Passing a definition re-evaluates it, so the same
address-predicate guard applies as on preview.

Rewriting the definition of a segment a published journey or a scheduled
send already reads is a way to widen who gets mailed, so that case asks
for a confirmation.

## Path parameters

- `segment_id` string, uuid, required

## Headers

- `X-Confirmation-Id` string, nullable
- `authorization` string, nullable
- `X-API-Key` string, nullable
- `X-Business-Unit` string, nullable

## Request body

- AgentSegmentPatch
  - `name` string, nullable
  - `description` string, nullable
  - `external_key` string, nullable
  - `definition` object, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/sentientmail/apis/sentientmail.md) · [All operations](https://skmtc.dev/sentientmail/apis/sentientmail/llms.txt) · [OpenAPI document](https://skmtc.dev/sentientmail/apis/sentientmail/revisions/4c87ece26935?raw)
