# enroll_subscriber_in_sequence

Enroll a confirmed reader in a sequence

`POST /v1/sequences/{sequence_id}/enrollments`

| | |
| --- | --- |
| 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:

```bash
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"
}'
```

Response: `200`:

```json
{
  "status": "enrolled",
  "subscriber_id": "sub_0123456789abcdefghjkmnpq",
  "sequence_id": "aut_0123456789abcdefghjkmnpq",
  "run_id": "arn_1"
}
```

## Errors

| Status | Codes |
| --- | --- |
| 400 | [`validation_failed`](/developers/md/errors/validation_failed) |
| 401 | [`unauthenticated`](/developers/md/errors/unauthenticated), [`credential_revoked`](/developers/md/errors/credential_revoked), [`credential_expired`](/developers/md/errors/credential_expired) |
| 403 | [`insufficient_scope`](/developers/md/errors/insufficient_scope), [`plan_does_not_include`](/developers/md/errors/plan_does_not_include), [`workspace_paused`](/developers/md/errors/workspace_paused), [`api_suspended`](/developers/md/errors/api_suspended), [`consent_required`](/developers/md/errors/consent_required) |
| 404 | [`not_found`](/developers/md/errors/not_found) |
| 409 | [`conflict`](/developers/md/errors/conflict) |
| 413 | [`payload_too_large`](/developers/md/errors/payload_too_large) |
| 415 | [`unsupported_media_type`](/developers/md/errors/unsupported_media_type) |
| 429 | [`rate_limited`](/developers/md/errors/rate_limited), [`quota_exceeded`](/developers/md/errors/quota_exceeded) |
| 503 | [`service_unavailable`](/developers/md/errors/service_unavailable) |

Every error is an `application/problem+json` body with a `code`, a `fix` sentence and `next_actions`. See [reading a problem response](/developers/md/guides/agents#reading-a-problem-response).

## Typical next steps

- [`get_sequence`](/developers/md/operations/get_sequence)
- [`get_subscriber`](/developers/md/operations/get_subscriber)

## Related

- [OpenAPI document](https://api.seemly.com/v1/openapi.json)
- [Agent guide](/developers/md/guides/agents)
