Skip to main content

Update Segment

Change a segment's name, description or rules. Send only the fields you want to change.

Sending filter replaces the whole rule tree. The members are then recomputed in the background: the segment returns to status: "processing", and contact_count is null until it is "ready" again. Changing only the name or description leaves the members as they are.

Endpoint​

PATCH /segments/:id

Returns: 200 OK

Headers​

HeaderValueRequired
AuthorizationBearer <your-api-key>Yes
Content-Typeapplication/jsonYes

Path Parameters​

ParameterTypeDescription
idstringThe segment ID

Body Parameters​

ParameterTypeRequiredDescription
namestringNoSegment name. Max 100 characters.
descriptionstringNoDescription. Max 500 characters.
filterobjectNoThe new rules, replacing the current ones. See Segment Filters.

Response​

The updated segment. See List Segments for the field reference.

{
"id": "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a",
"name": "VIP customers (email)",
"description": "Opened 3+ emails in the last 90 days",
"status": "processing",
"filter": {
"type": "group",
"operator": "and",
"conditions": [
{
"type": "engagement_count",
"channel": "email",
"action": "opened",
"operator": "greater_than_or_equal",
"value": 3,
"time_window": { "value": 90, "unit": "days" }
},
{ "type": "channel_status", "channel": "email", "consent": "subscribed" }
]
},
"contact_count": null,
"counted_at": null,
"created_at": "2026-03-08T12:00:00.000Z",
"updated_at": "2026-03-08T12:00:00.000Z"
}

Examples​

Rename only — members and count are untouched:

curl -X PATCH "https://api.arsel.sa/v1/segments/01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a" \
-H "Authorization: Bearer $ARSEL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "VIP customers (email)"
}'

Error Responses​

{
"status_code": 422,
"name": "validation_error",
"message": "Invalid filter: conditions.0.operator: \"created_at\" does not accept the operator \"contains\""
}