POST /api/v1/sequences/{sequenceId}/versions/{versionId}/rollback
Goes back to an earlier version by copying it forward: a new version is created, published
immediately. Answers 201, and the version number you get back is a new one — never the old one.
Nothing is ever rewritten in place, so a contact pinned to an old version still finds it unchanged
when it wakes up. A draft left open blocks a rollback: 400, discard it first.
Authorization
| Role in the organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused — 403 |
Path parameters
| Parameter | Type | Description |
|---|---|---|
sequenceId | string | Required. The sequence |
versionId | string | Required. The version whose content is republished |
Example
bash
curl -X POST -H "x-api-key: $AGENTMAIL_API_KEY" \
"https://www.agentsmail.io/api/v1/sequences/$SEQUENCE_ID/versions/$VERSION_ID/rollback"Response
201 Created— the created resource.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
201 with the new version — rolling back never resurrects the old one, it republishes its content under a new rank.
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the operation was successful |
data.id | string | Identifier of the version |
data.sequenceId | string | The sequence it belongs to |
data.version | number | Its rank, starting at 1 |
data.status | string | draft or published |
data.publishedAt | string \ | null |
data.triggerType | string | list_joined or tag_added |
data.triggerTargetId | string | The list or tag that enrols contacts |
data.createdAt / updatedAt | string | ISO dates |
Example response
json
{
"success": true,
"data": {
"id": "4d19c0a2",
"sequenceId": "9b3f2d10",
"version": 1,
"status": "subscribed",
"publishedAt": "2026-08-23T10:22:05.000Z",
"triggerType": "list_joined",
"triggerTargetId": "0b7c51e8",
"createdAt` / `updatedAt": "value"
}
}