PATCH /api/v1/sequences/{sequenceId}
Renames the sequence, sets its editorial topic, activates it or pauses it. Send one field, or
several.
| Condition | Answer |
|---|---|
| body carries none of the three fields | 400 — nothing to change |
status is anything else | 400 — active and paused are the only two |
active with no published version | 400 — publish first, an "active" sequence with nothing published would enrol nobody |
topicId: null while a published step carries {{topicOptOutUrl}} | 400 — removing the topic would leave a dead link; the message names the steps |
Authorization
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused — 403 |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | 1 to 100 characters |
status | string | no | active or paused |
topicId | string | no | Editorial topic the sequence carries, or null to clear. Resolve it with GET /api/v1/topics |
Example
bash
curl -X PATCH -H "x-api-key: $AGENTMAIL_API_KEY" -H "content-type: application/json" \
-d '{"status":"active"}' \
"https://www.agentsmail.io/api/v1/sequences/$SEQUENCE_ID"Response
200 OK— the call succeeded.401 Unauthorized— missing or invalid key, or its owner left the organization.403 Forbidden— the key's owner is amemberof the organization, not anadmin.404 Not Found— no such resource, or it belongs to another organization. The API never confirms that an id exists to a caller who has no right to it.429 Too Many Requests— over 120 requests in a minute for this key.
Response fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the operation was successful |
data.id | string | Unique identifier for the sequence |
data.name | string | Its name |
data.status | string | active or paused |
data.publishedVersionId | string | null |
data.topicId | string | null |
data.createdAt | string | ISO creation date |
data.updatedAt | string | ISO date of the last change |
Example response
json
{
"success": true,
"data": {
"id": "4d19c0a2",
"name": "Newsletter",
"status": "subscribed",
"publishedVersionId": "c41a7e55",
"topicId": null,
"createdAt": "2026-08-23T10:22:05.000Z",
"updatedAt": "2026-08-23T10:22:05.000Z"
}
}Notes
- A sequence gets its topic here, never at creation.
POST /api/v1/sequencesdoes not taketopicId— you set it afterwards, as the screens do.