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.
| Condition | Answer |
|---|---|
| everything valid | 201 |
missing name, unknown triggerType, malformed id | 400 — details names the field |
| trigger target of another organization | 404 — like a list that does not exist |
| your plan's sequence limit is reached | 400 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 organization | This endpoint |
|---|---|
OWNER | Allowed |
ADMIN | Allowed |
MEMBER | Refused — 403 |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | 1 to 100 characters |
triggerType | string | yes | list_joined or tag_added |
triggerTargetId | string | yes | The 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 amemberof the organization, not anadmin.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.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",
"createdAt": "2026-08-23T10:22:05.000Z",
"updatedAt": "2026-08-23T10:22:05.000Z"
}
}