> ## Documentation Index
> Fetch the complete documentation index at: https://docs.foxreach.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Sequence Step

> Add a new sequence step to a campaign. Campaign must be in draft or paused status.

## Path Parameters

<ParamField path="campaign_id" type="string" required>
  The unique identifier of the campaign.
</ParamField>

## Body Parameters

<ParamField body="subject" type="string" required>
  Email subject line. Supports [template variables](/template-variables) and spin syntax.
</ParamField>

<ParamField body="body" type="string" required>
  Email body content. Supports [template variables](/template-variables) and spin syntax.
</ParamField>

<ParamField body="name" type="string">
  Optional name for the sequence step (e.g., "Initial outreach", "Follow-up").
</ParamField>

<ParamField body="delayDays" type="integer" default="0">
  Number of days to wait after the previous step before sending.
</ParamField>

<ParamField body="delayHours" type="integer" default="0">
  Additional hours to wait (combined with `delayDays`).
</ParamField>

<ParamField body="sendOnlyIfNoReply" type="boolean" default="true">
  If true, skip this step if the lead has already replied to a previous step.
</ParamField>

## Response

Returns the created sequence step object.

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.foxreach.io/api/v1/campaigns/cmp_abc123/sequences" \
    -H "X-API-Key: otr_your_key" \
    -H "Content-Type: application/json" \
    -d '{
      "subject": "Quick question, {{firstName}}",
      "body": "Hi {{firstName}},\n\nI noticed {{company}} recently expanded...",
      "name": "Initial outreach",
      "delayDays": 0,
      "delayHours": 0,
      "sendOnlyIfNoReply": false
    }'
  ```

  ```python Python SDK theme={null}
  from foxreach import FoxReach
  from foxreach.types import SequenceCreate

  client = FoxReach(api_key="otr_your_key")
  sequence = client.campaigns.sequences.create(
      "cmp_xyz789",
      SequenceCreate(
          subject="Quick question about {{company}}",
          body="Hi {{firstName}},...",
          delay_days=0,
      ),
  )
  ```

  ```typescript TypeScript SDK theme={null}
  import { FoxReach } from "foxreach";

  const client = new FoxReach({ apiKey: "otr_your_key" });
  const sequence = await client.campaigns.sequences.create("cmp_xyz789", {
    subject: "Quick question about {{company}}",
    body: "Hi {{firstName}},...",
    delayDays: 0,
  });
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "data": {
      "id": "seq_001",
      "campaignId": "cmp_abc123",
      "stepNumber": 1,
      "name": "Initial outreach",
      "subject": "Quick question, {{firstName}}",
      "body": "Hi {{firstName}},\n\nI noticed {{company}} recently expanded...",
      "delayDays": 0,
      "delayHours": 0,
      "sendOnlyIfNoReply": false,
      "createdAt": "2025-01-10T08:00:00",
      "updatedAt": "2025-01-10T08:00:00"
    }
  }
  ```
</ResponseExample>

## Errors

| Status | Description                            |
| ------ | -------------------------------------- |
| `400`  | Campaign is active — pause it first    |
| `400`  | Invalid spin syntax in subject or body |
| `404`  | Campaign not found                     |

## Rate Limit

* **100 requests per minute, per API key.** Fixed 60-second window.
* Every response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and `X-RateLimit-Reset` (unix epoch seconds).
* A `429` response includes a `Retry-After` header (seconds until the bucket resets).

For client-side patterns (`Retry-After`, exponential backoff, monitoring `X-RateLimit-Remaining`), see [Rate Limiting](/rate-limiting).
