Browse docs
Sequences API reference
Sync user details and trigger or cancel email sequences from your backend with the account secret API key.
The Sequences API lets your backend sync user details to Axoryn and start or stop email sequences. This page is for developers. Call it from your server only: the key is a secret and must never ship in browser or mobile code.
Base URL
https://api.axoryn.io/api/v1
All requests and responses are JSON. Send Content-Type: application/json.
Authentication
Every request needs your account secret API key as a Bearer token:
Authorization: Bearer imp_acc_...
To get the key:
- Open a project and select Sequences in the sidebar.
- Select API Key. The dialog Account API for sequences & user data shows the Account secret API key.
- Copy it into your backend’s secret store.
Owners and admins can see the key. Only owners can rotate it, with the rotate button next to the key. Rotating immediately invalidates the previous key, so update your backend right away.
A missing or wrong key returns:
{ "error": "unauthorized" }
with status 401.
Choose the project
The key works for your whole account. Each request runs against one project:
- Send
project_idin the request body to pick the project. It is the number in the dashboard URL, for example42inhttps://app.axoryn.io/dashboard/projects/42/sequences. - Without
project_id, the request uses the oldest project in your account.
Warning: If your account has more than one project, always send
project_id. Otherwise events go to your oldest project and enroll in its sequences, not the one you’re looking at.
A project_id that isn’t one of your account’s projects returns 404:
{ "error": "project_not_found" }
Contacts
Axoryn keeps one contact per email address per project. A request finds the contact by email first, then by external_id. If neither matches, a new contact is created, which needs a valid email.
traits are merged into the contact’s stored traits: keys you send are added or overwritten, keys you leave out are kept. Traits fill variables in sequence emails, so a trait first_name fills {{first_name}}.
Identify a user
POST /sequences/identify
Creates or updates a contact without starting anything.
| Field | Type | Required | Notes |
|---|---|---|---|
email | string | Yes, for a new contact | Stored in lowercase. |
external_id | string | No | Your own user ID. Lets you find the contact later without the email. |
traits | object | No | User details, such as first_name or plan. |
project_id | integer | No | See Choose the project. |
curl -X POST "https://api.axoryn.io/api/v1/sequences/identify" \
-H "Authorization: Bearer $AXORYN_SEQUENCES_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": 42,
"email": "user@example.com",
"external_id": "usr_123",
"traits": { "first_name": "Alex", "plan": "pro" }
}'
Response 200:
{
"contact": {
"id": 981,
"project_id": 42,
"email": "user@example.com",
"external_id": "usr_123",
"traits": { "first_name": "Alex", "plan": "pro" },
"last_seen_at": "2026-11-29T14:03:11Z"
}
}
Trigger an event
POST /sequences/events
Enrolls the contact in every active sequence of the project whose Event trigger key equals the event. POST /sequences/trigger is the same endpoint.
| Field | Type | Required | Notes |
|---|---|---|---|
event | string | Yes | The trigger key, such as user.signed_up. trigger is accepted as another name. |
email | string | Yes, for a new contact | Same rules as identify. |
external_id | string | No | Same rules as identify. |
traits | object | No | Saved on the contact and used for this enrollment’s variables. |
variables | object | No | Used for this enrollment’s variables. Also saved on the contact. |
idempotency_key | string | No | Enrolls the contact in each sequence at most once for this key. |
project_id | integer | No | See Choose the project. |
curl -X POST "https://api.axoryn.io/api/v1/sequences/events" \
-H "Authorization: Bearer $AXORYN_SEQUENCES_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": 42,
"event": "user.signed_up",
"email": "user@example.com",
"traits": { "first_name": "Alex" },
"idempotency_key": "signup_usr_123"
}'
Response 202 when at least one sequence enrolled the contact:
{
"enrolled": 1,
"sequence_ids": [7],
"contact_id": 981
}
Response 200 with "enrolled": 0 and an empty sequence_ids when nothing enrolled: no active sequence uses that key, or the contact was already enrolled with the same idempotency_key. The contact is still created or updated.
If the email address has unsubscribed from this project’s sequences, nothing is enrolled and the response is 200:
{ "enrolled": 0, "skipped": "unsubscribed" }
Tip: Always send an
idempotency_keybuilt from something stable, such as the user ID and event. Without one, every call enrolls the contact again, even if they are already in the sequence.
Cancel active sequences
POST /sequences/cancel
Stops the active enrollments for an email address in the project. No further emails are sent for them.
| Field | Type | Required | Notes |
|---|---|---|---|
email | string | Yes | Matched in lowercase. |
event | string | No | Only cancel sequences with this trigger key. trigger is accepted as another name. Without it, every active sequence for that email is canceled. |
project_id | integer | No | See Choose the project. |
curl -X POST "https://api.axoryn.io/api/v1/sequences/cancel" \
-H "Authorization: Bearer $AXORYN_SEQUENCES_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": 42,
"email": "user@example.com",
"event": "user.signed_up"
}'
Response 200:
{ "cancelled": 1 }
Errors
Errors return JSON with an error field.
| Status | Body | When |
|---|---|---|
401 | { "error": "unauthorized" } | The Bearer key is missing or wrong. |
404 | { "error": "project_not_found" } | project_id is not one of your account’s projects. |
422 | { "error": "valid email is required" } | No existing contact matched and email is missing or invalid (identify and events). |
422 | { "error": "event (or trigger) is required" } | event is missing (events). |
422 | { "error": "email is required" } | email is missing (cancel). |
429 | { "error": "Rate limit exceeded. Retry later." } | Too many requests. |
Rate limits
Requests are limited to 300 per 5 minutes per IP address. This limit is shared with all other Axoryn API requests from the same address. Past it, the API returns 429; wait and retry.
Unsubscribe links
Each sequence email carries its own signed unsubscribe link and one-click unsubscribe headers. You don’t call this endpoint yourself. When a recipient unsubscribes, their active enrollments in the project stop and later events for that address enroll nothing. See Unsubscribes.