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

# Create Cadence

> Create a new automated cadence

## Endpoint

<Card>
  <strong>POST</strong> `/backend/cadences`
</Card>

## Body Parameters

<ParamField body="name" type="string" required>
  Cadence name
</ParamField>

<ParamField body="description" type="string">
  Description
</ParamField>

<ParamField body="active" type="boolean" default="true">
  Whether cadence is active
</ParamField>

<ParamField body="steps" type="array" required>
  Cadence steps
</ParamField>

### Step Structure

<ParamField body="steps[].order" type="integer" required>
  Step order (1, 2, 3...)
</ParamField>

<ParamField body="steps[].delay" type="string" required>
  Delay in ISO 8601 format (PT30M, P1D, etc.)
</ParamField>

<ParamField body="steps[].message" type="object" required>
  Message to send
</ParamField>

## Request Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.leavo.ai/backend/cadences" \
    -H "Authorization: Bearer your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "New Lead Welcome",
      "description": "Welcome sequence for new leads",
      "active": true,
      "steps": [
        {
          "order": 1,
          "delay": "PT0S",
          "message": {
            "type": "text",
            "content": "Hello {{LEAD_FIRSTNAME}}! Welcome to our platform. How can I help you?"
          }
        },
        {
          "order": 2,
          "delay": "P1D",
          "message": {
            "type": "text",
            "content": "Hi {{LEAD_FIRSTNAME}}, I noticed you haven'\''t replied yet. Do you have any questions?"
          }
        },
        {
          "order": 3,
          "delay": "P3D",
          "message": {
            "type": "text",
            "content": "{{LEAD_FIRSTNAME}}, I'\''m here if you need anything. Just reply to this message!"
          }
        }
      ]
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.leavo.ai/backend/cadences', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer your_api_key_here',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      name: 'New Lead Welcome',
      description: 'Welcome sequence for new leads',
      active: true,
      steps: [
        {
          order: 1,
          delay: 'PT0S',
          message: {
            type: 'text',
            content: 'Hello {{LEAD_FIRSTNAME}}! Welcome to our platform.'
          }
        },
        {
          order: 2,
          delay: 'P1D',
          message: {
            type: 'text',
            content: 'Hi {{LEAD_FIRSTNAME}}, any questions?'
          }
        }
      ]
    })
  });
  ```
</CodeGroup>

## Response

```json theme={null}
{
  "success": true,
  "data": {
    "id": "cadence-uuid",
    "name": "New Lead Welcome",
    "description": "Welcome sequence for new leads",
    "active": true,
    "steps": [...],
    "created_at": "2024-01-15T10:30:00Z"
  }
}
```
