Create a sequence

POST /api/v1/sequences Creates the sequence and its version 1 draft, in one transaction. Answers 201. The sequence is born paused, with publishedVersionId: null — nothing enrols anyone yet. List ids come from GET /api/v1/lists, tag ids from GET /api/v1/tags, both on the Audience API.
ConditionAnswer
everything valid201
missing name, unknown triggerType, malformed id400details names the field
trigger target of another organization404 — like a list that does not exist
your plan's sequence limit is reached400 naming the limit and how many you already have
The plan's sequence cap applies here exactly as it does in the app. It is not a property of the interface: the same guard refuses the API. Delete a sequence you no longer need, or upgrade — retrying will not help.

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.

Request body

FieldTypeRequiredDescription
namestringyes1 to 100 characters
triggerTypestringyeslist_joined or tag_added
triggerTargetIdstringyesThe list id for list_joined, the tag id for tag_added

Example

bash
curl -X POST -H "x-api-key: $AGENTMAIL_API_KEY" -H "content-type: application/json" \
  -d '{"name":"Onboarding","triggerType":"list_joined","triggerTargetId":"'$LIST_ID'"}' \
  "https://www.agentsmail.io/api/v1/sequences"

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.
  • 429 Too Many Requests — over 120 requests in a minute for this key.

Response fields

FieldTypeDescription
successbooleanIndicates if the operation was successful
data.idstringUnique identifier for the sequence
data.namestringIts name
data.statusstringactive or paused
data.publishedVersionIdstringnull
data.createdAtstringISO creation date
data.updatedAtstringISO date of the last change

Example response

json
{
  "success": true,
  "data": {
    "id": "4d19c0a2",
    "name": "Newsletter",
    "status": "subscribed",
    "publishedVersionId": "c41a7e55",
    "createdAt": "2026-08-23T10:22:05.000Z",
    "updatedAt": "2026-08-23T10:22:05.000Z"
  }
}