Update a segment
const url = 'https://api.tryletterhead.com/api/v3/contacts/segments/1?api=true';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Engaged opens - last 60 days","description":"Updated window","criteria":{"matchMode":"all","conditions":[{"type":"tag","value":"engaged"}],"suppressionSegmentIds":[]},"channelSlugs":[]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url 'https://api.tryletterhead.com/api/v3/contacts/segments/1?api=true' \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Engaged opens - last 60 days", "description": "Updated window", "criteria": { "matchMode": "all", "conditions": [ { "type": "tag", "value": "engaged" } ], "suppressionSegmentIds": [] }, "channelSlugs": [] }'Updates a company-level contact segment. This is a partial update — every field is optional; only the fields you send are changed, and omitted fields keep their existing values.
This is a company-level (v3) write. Authenticate with a company API key as a Bearer token.
Response
The updated segment is returned under items. An unknown ID returns 404; a duplicate name returns 409.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The segment’s identifier. This is the numeric id returned by List segments — not a UUID.
Query Parameters
Section titled “Query Parameters ”Required. Set to true.
Request Body required
Section titled “Request Body required ”object
Segment name. Max 255 chars. Unique within the company.
Free-text description. Max 500 chars.
The saved query — same shape as Create a segment.
object
object
object
Channels to scope the segment to. An empty array means available on every channel.
object
Example
{ "name": "Engaged opens - last 60 days", "description": "Updated window", "criteria": { "matchMode": "all", "conditions": [ { "type": "tag", "value": "engaged" } ], "suppressionSegmentIds": [] }, "channelSlugs": []}Responses
Section titled “ Responses ”Successful response
Still can’t find what you need? Contact support.