# PATCH /lead-gen/initiatives/:id/steps/:stepId

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

Update a step's delay, config (subject/body templates), or reorder its step_number. Updating step_number re-sequences other steps automatically.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | uuid | yes | Initiative UUID |
| `stepId` | path | uuid | yes | Step UUID |
| `delay_days` | body | integer | no | Updated delay in days |
| `config` | body | object | no | Updated action config |
| `step_number` | body | integer | no | New step position (triggers re-sequence) |

## Request example

```bash
curl -X PATCH \
  "https://api.trustpager.com/functions/v1/api/v1/lead-gen/initiatives/a1b2c3d4-.../steps/s1b2c3d4-..." \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"delay_days":2}'
```

## Response example

```json
{
  "id": "s1b2c3d4-...",
  "step_number": 1,
  "delay_days": 2,
  "updated_at": "2026-05-02T09:00:00Z"
}
```

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