/v1/workspaces/{workspace_id}/segments/{segment_id}AuthUpdate a segment
Rename it, or change a rule segment's rule. A segment's type (static or rule) is fixed.
Path parameters
workspace_id*string · uuidId of the workspace.
segment_id*string · uuidId of the segment.
Headers
Idempotency-KeystringOpaque client-generated string (1–256 chars, `[A-Za-z0-9._:-]`) used to deduplicate retries within a 24h window. A retry with the same key and body returns the original response with `Idempotent-Replay: true`.
Request body
namestringNew name of the segment.
descriptionstringNew description; null clears it.
ruleobjectA new rule (rule segments only; a static segment cannot take one).
Response · 200
id*string · uuidThe segment id.
name*stringName of the segment.
Example: "Pro customers"
description*stringOptional description of who is in the segment.
type*object`static`: an explicit member list. `rule`: the contacts matching `rule`.
rule*objectNull for a static segment.
created_at*string · date-timeWhen the segment was created.
updated_at*string · date-timeWhen the segment was last changed.
Example
Request
PATCH https://api.mail.productcraft.co/v1/workspaces/{workspace_id}/segments/{segment_id}
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json
{
"name": "string",
"description": "string",
"rule": {}
}Response
{
"id": "00000000-0000-0000-0000-000000000000",
"name": "Pro customers",
"description": "string",
"type": {},
"rule": {},
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}