# POST /lead-gen/initiatives/:id/steps

**Resource:** [Lead Generation](./lead-gen.md)  
**Scopes:** `lead-gen:write`  
**Write operation:** yes

Add a new step to an outreach initiative. Steps are executed in step_number order. Supported action types: send_gmail_email (requires gmail_connection_id and subject/body templates with {{lead.*}} tokens), send_sms (requires sms body with {{lead.*}} tokens), notify_assigned_staff (sends an internal alert email to the enrolling user).

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | uuid | yes | Initiative UUID |
| `step_number` | body | integer | yes | Execution order (1-based). Existing steps with >= this number are shifted down. |
| `action_type` | body | string | yes | Action to perform: send_gmail_email, send_sms, notify_assigned_staff |
| `delay_days` | body | integer | no | Days to wait after the previous step before executing this one (default: 0) |
| `config` | body | object | yes | Action-specific config. For send_gmail_email: {gmail_connection_id, subject, body}. For send_sms: {body}. For notify_assigned_staff: {subject, body}. |

## Request example

```bash
curl -X POST \
  "https://api.trustpager.com/functions/v1/api/v1/lead-gen/initiatives/a1b2c3d4-.../steps" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"step_number":1,"action_type":"send_gmail_email","delay_days":0,"config":{"gmail_connection_id":"conn-id","subject":"Hi {{lead.name}}","body":"Hi {{lead.name}}, I saw your business {{lead.business_name}}..."}}'
```

## Response example

```json
{
  "id": "s1b2c3d4-...",
  "initiative_id": "a1b2c3d4-...",
  "step_number": 1,
  "action_type": "send_gmail_email",
  "delay_days": 0,
  "config": { "gmail_connection_id": "conn-id", "subject": "Hi {{lead.name}}", "body": "..." },
  "created_at": "2026-05-01T10:00:00Z"
}
```

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