Skip to content
Letterhead Letterhead Letterhead Help Center
Admin Tools

Update a segment

PUT
/api/v3/contacts/segments/{segmentId}
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", "operator": "has", "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.

segmentId
required
integer

The segment’s identifier. This is the numeric id returned by List segments — not a UUID.

api
required
boolean

Required. Set to true.

Media type application/json
object
name

Segment name. Max 255 chars. Unique within the company.

string
description

Free-text description. Max 500 chars.

string
criteria

The saved query — same shape as Create a segment.

object
matchMode
string
conditions

At least one condition. The shape of each depends on its type — see the schemas below.

Array
One of:
customField
object
type
required
string
Allowed values: customField
customFieldKey
required

The custom field’s key (see List custom field definitions).

string
operator
required

=, >, <, >=, <=, inLastDays, notInLastDays, or isEmpty.

string
value

Comparison value. Omitted for the isEmpty operator, which carries no value. For inLastDays/notInLastDays, an integer number of days as a string.

string
suppressionSegmentIds

IDs of other segments (same company) whose members are excluded from this segment’s audience.

Array<integer>
channelSlugs

Channels to scope the segment to. An empty array means available on every channel.

Array<string>
Example
{
"name": "Engaged opens - last 60 days",
"description": "Updated window",
"criteria": {
"matchMode": "all",
"conditions": [
{
"type": "tag",
"operator": "has",
"value": "engaged"
}
],
"suppressionSegmentIds": []
},
"channelSlugs": []
}

200 OK

Media type application/json
object
items
object
id

The segment’s identifier.

integer
name

The segment’s name (unique per company).

string
description

The segment’s description.

string
criteria
object
matchMode
string
conditions

At least one condition. The shape of each depends on its type — see the schemas below.

Array
One of:
customField
object
type
required
string
Allowed values: customField
customFieldKey
required

The custom field’s key (see List custom field definitions).

string
operator
required

=, >, <, >=, <=, inLastDays, notInLastDays, or isEmpty.

string
value

Comparison value. Omitted for the isEmpty operator, which carries no value. For inLastDays/notInLastDays, an integer number of days as a string.

string
suppressionSegmentIds

IDs of other segments (same company) whose members are excluded from this segment’s audience.

Array<integer>
channelSlugs

Channels the segment is scoped to. An empty array means it is available on every channel.

Array<string>
createdAt

Creation timestamp.

string
updatedAt

Last-updated timestamp.

string
message
string
total
integer
Example
{
"items": {
"id": 5,
"name": "Engaged opens - last 60 days",
"description": "Updated window",
"criteria": {
"matchMode": "all",
"conditions": [
{
"type": "tag",
"operator": "has",
"value": "engaged"
}
],
"suppressionSegmentIds": []
},
"channelSlugs": [],
"createdAt": "2026-05-20 17:48:15",
"updatedAt": "2026-06-20 12:05:00"
},
"message": "Segment updated.",
"total": 1
}

Still can’t find what you need? Contact support.