Enroll a confirmed reader in a sequence
On this page
POST
/v1/sequences/{sequence_id}/enrollmentsenroll_subscriber_in_sequence| Risk | write |
| Authentication | API key or OAuth access token |
| Scopes | sequences:enroll |
| Idempotency | natural: repeating the call gives the same result |
| Dry run | yes: add dry_run=true to the query |
| Success status | 200 |
| Response type | application/json |
What it does#
- Use when: A confirmed reader should start a published sequence, for example after a purchase.
- Do not use when: the reader is pending, unsubscribed or suppressed (refused), or the sequence is a draft.
- Side effects: Starts the sequence's emails for this reader.
- Reversible: No.
- Required scope: sequences:enroll.
- Idempotency: safe to repeat (same result).
- Typical next step: call get_sequence to watch run counts.
Scopes#
sequences:enroll: Enroll subscribers in sequences and pause or resume them.
Side effects#
- Starts the sequence's emails for this reader
Request#
Path parameters#
| Field | Type | Description |
|---|---|---|
sequence_id | string |
Query parameters#
None.
Every mutation also accepts dry_run=true: it runs every check and returns {"dry_run": true, "would": {...}} without writing anything.
Body (application/json)#
| Field | Type | Required | Description |
|---|---|---|---|
subscriber_id | string | yes |
Response#
| Field | Type | Required | Description |
|---|---|---|---|
status | one of "enrolled", "already_enrolled", "refused" | yes | |
subscriber_id | string | yes | |
sequence_id | string | yes | |
run_id | string | no | |
reason | string | no | Stable reason code when refused |
message | string | no | Author sentence when refused |
Examples#
enrolled#
Request:
curl -X POST 'https://api.seemly.com/v1/sequences/aut_0123456789abcdefghjkmnpq/enrollments' \
-H "Authorization: Bearer $SEEMLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subscriber_id": "sub_0123456789abcdefghjkmnpq"
}'const response = await fetch("https://api.seemly.com/v1/sequences/aut_0123456789abcdefghjkmnpq/enrollments", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SEEMLY_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"subscriber_id": "sub_0123456789abcdefghjkmnpq"
}),
});
const result = await response.json();
console.log(response.status, result);import os
import requests
response = requests.post(
"https://api.seemly.com/v1/sequences/aut_0123456789abcdefghjkmnpq/enrollments",
headers={
"Authorization": f"Bearer {os.environ['SEEMLY_API_KEY']}",
},
json={
"subscriber_id": "sub_0123456789abcdefghjkmnpq",
},
)
print(response.status_code, response.json())Response: 200:
{
"status": "enrolled",
"subscriber_id": "sub_0123456789abcdefghjkmnpq",
"sequence_id": "aut_0123456789abcdefghjkmnpq",
"run_id": "arn_1"
}Errors#
Every error is an application/problem+json body with a code, a fix sentence and next_actions. See reading a problem response.