# POST /auto-sequences

**Resource:** [Auto Sequences](./auto-sequences.md)  
**MCP tool:** `create_auto_sequence`  
**Scopes:** `automations:write`  
**Write operation:** yes

Create an auto sequence (formerly auto queue).

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `name` | body | string | yes |  |
| `description` | body | string | no |  |
| `respect_business_hours` | body | boolean | no | Respect business hours: when true, steps only send during the workspace business-hours window (held to the next window otherwise). Defaults to false. |
| `count_business_days` | body | boolean | no | Count step delays in business days: when true, the days in each step delay count only open days in the workspace business hours (closed weekdays and holidays are skipped), so Day 2 / 4 / 6 never lands on a weekend or two steps on the same Monday. Applies to new enrolments only; contacts already in the sequence keep their dates. Defaults to false (calendar days). |
| `is_active` | body | boolean | no | Whether the sequence is running. Set false to pause it: enrolled contacts stay enrolled and nothing sends until it is switched back on. |
| `repeat_every_days` | body | number | no | Repeat at the end: after a person's last step sends, run the steps again starting this many days later (1-365), round after round, until they are removed from the sequence (by a Remove from Auto Sequence automation, e.g. on booking_created or a won/paid stage, or remove_from_auto_sequence). null (the default) = no repeat: the sequence ends after its last step. Rounds count calendar days; Respect business hours still holds each send to the next open window. Turning it off stops new rounds; a round already booked still sends once. |
| `repeat_from_step_id` | body | string | no | Which step each repeat round starts from: a step id of this sequence (from get_auto_sequence). Its round runs that step through the last step, keeping their spacing. null (the default) = repeat only the last step. Needs repeat_every_days. Add the steps first, then set this with update_auto_sequence. |
| `allow_lost_opportunities` | body | boolean | no | Include lost opportunities: when true, the sequence enrols people whose opportunity is marked lost (for a reawakening sequence that starts when a card moves to Lost) and keeps sending to them. Removals still stop them (e.g. a Remove from Auto Sequence automation on booking_created or a won/paid stage). Defaults to false: enrolment skips lost opportunities. |
| `send_window` | body | object | no | This sequence's own sending hours, read in each contact's local time: { "mon": [[8, 20]], "tue": [[8, 20]], "sat": [["09:00", "12:00"]] }. A day left out is closed. When set, steps are held to these hours instead of the workspace business hours (respect_business_hours is not needed), so an email or text sequence is not squeezed into a narrow calling window. The contact's time zone comes from their timezone, then their state, then their phone number (area code for +1), then the workspace default. null (the default) = use the workspace business hours when respect_business_hours is true. |
| `min_send_gap` | body | object | no | This sequence's own minimum gap between automated messages to the same contact, overriding the workspace setting: { "minutes": 960, "channels": ["email"] }. A step is held until the gap has passed since the contact's last automated message, counting both sequence steps and emails or texts other automations sent the contact directly (for example an intake's welcome email). minutes: 0 to 1440, where 0 turns the gap off for this sequence. channels (optional): only messages on these channels count and only steps on them are held; one or more of email, sms, whatsapp, voice. Left out = every channel. null (the default) = use the workspace setting. |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X POST   "https://api.trustpager.com/functions/v1/api/v1/auto-sequences"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"name":"...","description":"...","respect_business_hours":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`