Open a draft version

POST /api/v1/sequences/{sequenceId}/versions Opens a draft as a copy of the published version — nodes, contents, wires and trigger included. Answers 201. The trigger is copied as it is: a draft opened this way runs on the trigger of the version it copies, until you change it with Change a draft's trigger.
ConditionAnswer
no draft open201 — you get a new draft to edit
a draft is already open400 — one draft at a time; publish it or discard it

Authorization

Role in the organizationThis endpoint
OWNERAllowed
ADMINAllowed
MEMBERRefused — 403
A key carries the role its creator holds in this organization — never a role on AgentsMail itself. See API keys.

Path parameters

ParameterTypeDescription
sequenceIdstringRequired. The sequence to open a draft on

Example

bash
curl -X POST -H "x-api-key: $AGENTMAIL_API_KEY" \
  "https://www.agentsmail.io/api/v1/sequences/$SEQUENCE_ID/versions"

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 a member of the organization, not an admin.
  • 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 draft — a copy of the published version, trigger included.
FieldTypeDescription
successbooleanIndicates if the operation was successful
data.idstringIdentifier of the version
data.sequenceIdstringThe sequence it belongs to
data.versionnumberIts rank, starting at 1
data.statusstringdraft or published
data.publishedAtstring \null
data.triggerTypestringlist_joined or tag_added
data.triggerTargetIdstringThe list or tag that enrols contacts
data.createdAt / updatedAtstringISO 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"
  }
}