PATCH/lists/{id}

PATCH /lists/{id}

Rename a list, describe it, or change its rules or type.

View as Markdown

Request

curl -X PATCH 'https://api.sendheron.com/api/v1/lists/{id}' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json'

Required scopes

The key must carry these:

  • contacts:write

Path parameters

NameTypeRequiredDescription
iduuidYesList UUID.

Body parameters

NameTypeRequiredDescription
namestringNoNew name, unique within the workspace.
descriptionstringNoWhat the list is for. Shown in the dashboard only.
typestatic | dynamicNostatic: members are added and removed explicitly, and adding one fires the list_added sequence trigger. dynamic: a segment whose members are whoever matches rules when it is read; nothing is ever added to it, so list_added never fires for it. Switching a dynamic list to static drops its rules and starts it empty; switching a static list to dynamic needs rules in the same request.
rulesobjectNoReplaces the rules of a dynamic list. Who a dynamic list contains, evaluated every time it is read. Required when type is dynamic, cleared when it is static. A group is {"type": "group", "logic": "and" | "or", "rules": [...]} whose rules are atomic rules {"type": "rule", "field": ..., "operator": ..., "value": ...} or nested groups, at most three levels deep. A bare array of atomic rules is read as an AND group. field is a contact column (email, firstName, lastName, status, source, createdAt or updatedAt), tags, or properties.<key> for a custom property; any other field is refused (400 lists.invalidRuleField). operator is one of equals, not_equals, contains, not_contains, starts_with, ends_with, greater_than, less_than, greater_than_or_equal, less_than_or_equal, is_set, is_not_set, in or not_in. contains, not_contains, starts_with and ends_with are case-insensitive; a contact column compares as its own type and a custom property as text. is_set and is_not_set take no value; in and not_in take an array. On tags only in and not_in (tag names) and is_set and is_not_set (any tag at all) are accepted. Example: {"type": "group", "logic": "and", "rules": [{"type": "rule", "field": "status", "operator": "equals", "value": "subscribed"}, {"type": "rule", "field": "tags", "operator": "in", "value": ["customer"]}, {"type": "rule", "field": "properties.plan", "operator": "equals", "value": "pro"}]}.

Responses

Returns 200 on success.

400
The payload failed validation, or the request is not valid for the current state. The body's description names the field and says what was wrong with it in words, e.g. "domain: domain must be a bare hostname such as acme.com, with no scheme, path, or port". The error code is stable and safe to branch on; description is for the human reading the log.
401
Missing or invalid API key.
403
Valid key, but it does not carry the required scope. The error code is apiKeys.insufficientScopes and the description names both halves of the problem: "Missing required scope(s): X. This key holds: Y." Neither is a secret, since the required scopes are on this page and the held ones are your own credential, and a bare "Forbidden" costs a debugging pass to work out which of the two it was.
404
No such record in this workspace. An id belonging to a different workspace returns this too, never a 403, because the API will not confirm that a record exists outside the workspace your key was issued in. Read it as "not yours or not there" rather than as "definitely gone".
409
A duplicate, or an idempotency key reused with a different payload.
429
Either rate-limit ceiling was exceeded.
400
lists.rulesRequiredForDynamic: a switch to dynamic without rules in the same request.
400
lists.invalidRuleField, lists.invalidRuleOperator, lists.invalidRuleLogic, lists.invalidRuleFormat or lists.rulesTooDeeplyNested: a rule the segment query cannot apply, refused rather than stored.
409
A list with this name already exists in the workspace.

Rate limits

100/min per key, counted against the organization's WRITE ceiling (400/min). Both windows are one minute.