# Replace the step list atomically

**`PATCH https://myagentmail.com/cadences/{id}/steps`**

Group: Cadences
Operation ID: `replaceCadenceSteps`

Sends the full ordered list of steps in one call — wipes the
previous steps and reinserts. Steps are tiny; diffing is more
trouble than it's worth.

Step kinds:
  • `linkedin_connect` — POST a connection request (with note)
  • `linkedin_message` — DM a 1st-degree connection
  • `email` — (v1.1) send via configured inbox
  • `wait` — no-op delay before the next step

Conditions (optional, NULL = always run):
  • `after_accept` — only run if the previous linkedin_connect step's
    invite has been accepted (signal.connection_accepted with
    outbound attribution)
  • `no_reply_to_prev` — only run if the lead hasn't replied since
    the previous step
  • `never_replied` — only run if the lead has never replied during
    this enrollment


## Path parameters

- `id` (string, required) —

## Request body

Content-Type: `application/json`

```json
{
  "steps": [
    {
      "kind": "linkedin_connect",
      "delayDays": 0,
      "condition": "after_accept",
      "draftStrategy": "ai",
      "staticSubject": "string",
      "staticBody": "string",
      "promptHint": "string",
      "notes": "string"
    }
  ]
}
```

## Responses

### 200 — Steps replaced.

## Code samples

### TypeScript

```typescript
import { MyAgentMail } from "myagentmail";

const client = new MyAgentMail({ apiKey: process.env.MYAGENTMAIL_API_KEY! });

// PATCH /cadences/{id}/steps
const result = await client.request("patch", "/cadences/{id}/steps", { params: { id: "00000000-0000-0000-0000-000000000000" } }, { body: {
  "steps": [
    {
      "kind": "linkedin_connect",
      "delayDays": 0,
      "condition": "after_accept",
      "draftStrategy": "ai",
      "staticSubject": "string",
      "staticBody": "string",
      "promptHint": "string",
      "notes": "string"
    }
  ]
} });
```

### curl

```bash
curl -X PATCH 'https://myagentmail.com/cadences/00000000-0000-0000-0000-000000000000/steps' \
  -H 'X-API-Key: $MYAGENTMAIL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "steps": [
    {
      "kind": "linkedin_connect",
      "delayDays": 0,
      "condition": "after_accept",
      "draftStrategy": "ai",
      "staticSubject": "string",
      "staticBody": "string",
      "promptHint": "string",
      "notes": "string"
    }
  ]
}'
```

### Python

```python
import os, requests

r = requests.patch(
    "https://myagentmail.com/cadences/00000000-0000-0000-0000-000000000000/steps",
    headers={"X-API-Key": os.environ["MYAGENTMAIL_API_KEY"]},
    json={
        "steps": [
            {
                "kind": "linkedin_connect",
                "delayDays": 0,
                "condition": "after_accept",
                "draftStrategy": "ai",
                "staticSubject": "string",
                "staticBody": "string",
                "promptHint": "string",
                "notes": "string"
            }
        ]
    },
)
r.raise_for_status()
print(r.json())
```
