# Autocalls

> Manage Autocalls assistants, campaigns and leads, place calls, send SMS and read call and conversation results.

App · 25 actions. Web page: https://docs.lodol.com/docs/integrations/autocalls

## Actions

### Create campaign

Create campaign. Returns one response page; the connected account determines access.

**Inputs**

- Name (`name`, text, required): Campaign name. Maximum 255 characters.
- Channel (`channel`, text): `call`, `whatsapp`, or `sms`. One of: `call`, `whatsapp`, `sms`.
- Timezone (`timezone`, text): IANA timezone for the send/call window (e.g. `America/New_York`). Defaults to the assistant timezone for call campaigns, otherwise your account timezone.
- Schedule windows (`schedule_windows`, list): Preferred schedule: 1 to 6 daily windows as objects with `start` and `end` in `HH:MM`. Overnight windows are supported when `end` is earlier than `start` (e.g. `16:00` → `02:00`). Defaults to one window from `09:00` to `18:00`.
- Allowed hours start time (`allowed_hours_start_time`, time): Legacy single-window start (`HH:MM`). Used if `schedule_windows` is omitted.
- Allowed hours end time (`allowed_hours_end_time`, time): Legacy single-window end (`HH:MM`). Overnight when end \< start.
- Scheduled start at (`scheduled_start_at`, date and time): ISO 8601 date and time. Without an offset it is read in the campaign timezone. The date cannot be before today. When set, the campaign is created as `scheduled` and starts by itself at that time; otherwise it is `draft`.
- Allowed days (`allowed_days`, list): Weekdays: `monday` … `sunday`. One or more of: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
- Max retries (`max_retries`, number): Max retry attempts per lead. Range: 1 to 5.
- Retry interval (`retry_interval`, number): Minutes between retries. Range: 10 to 4320.
- Mark complete when no leads (`mark_complete_when_no_leads`, true/false): `false` keeps the campaign waiting for new leads, which campaigns fed by an automation or the API need. `true` completes it once every lead has been processed; leads added after that are not contacted until it is started again. #### Call campaigns
- Assistant (`assistant_id`, number): Required for `channel=call`. Must be an OUTBOUND assistant you own.
- Max calls in parallel (`max_calls_in_parallel`, number): Concurrent calls, up to your plan's limit (max 10). Defaults to 3, or to your plan's limit when it is lower.
- Phone number IDS (`phone_number_ids`, list): Outbound from-number IDs available to your account. Call campaigns only: sending it for a WhatsApp or SMS campaign returns 422.
- Retry on voicemail (`retry_on_voicemail`, true/false): Retry when a call hits voicemail.
- Retry on goal incomplete (`retry_on_goal_incomplete`, true/false): Keep retrying until a boolean post-call goal variable is true.
- Goal completion variable (`goal_completion_variable`, text): Boolean post-call schema variable name used with `retry_on_goal_incomplete`.
- Fallback channel (`fallback_channel`, text): Optional call→text follow-up after max call retries: `whatsapp` or `sms`.
- Fallback whatsapp sender ID (`fallback_whatsapp_sender_id`, number): Required when `fallback_channel=whatsapp`.
- Fallback whatsapp template ID (`fallback_whatsapp_template_id`, number): Required when `fallback_channel=whatsapp`. Must be an approved template on that sender.
- Fallback SMS from phone number ID (`fallback_sms_from_phone_number_id`, number): Required when `fallback_channel=sms`.
- Fallback SMS body (`fallback_sms_body`, text): Required when `fallback_channel=sms`. Supports `{{variable}}` placeholders.
- Fallback variable mapping (`fallback_variable_mapping`, object): Maps WhatsApp template placeholders (e.g. `"1"`) to lead variable keys for the fallback send. Must map every placeholder of the template to a lead variable, and nothing else. #### WhatsApp campaigns
- Whatsapp sender ID (`whatsapp_sender_id`, number): Required for `channel=whatsapp`. Sender you own.
- Whatsapp template ID (`whatsapp_template_id`, number): Required for `channel=whatsapp`. Approved template on that sender.
- Text variable mapping (`text_variable_mapping`, object): Maps template placeholders (e.g. `"1"`) to lead variable keys. Must map every placeholder of the template to a lead variable, and nothing else.
- Messages per minute (`messages_per_minute`, number): Per-campaign send rate (1 to 10). WhatsApp campaigns also share a **user-wide pool of 10** in-flight sends across all your active WhatsApp campaigns. #### SMS campaigns
- SMS from phone number ID (`sms_from_phone_number_id`, number): Required for `channel=sms`. Must be SMS-capable and available to you.
- SMS body (`sms_body`, text): Required for `channel=sms`. Max 1600 characters. Supports `{{variable}}` placeholders.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "data": {
      "allowed_days": [],
      "allowed_hours_end_time": "example",
      "allowed_hours_start_time": "example",
      "assistant_id": 1,
      "channel": "example",
      "created_at": "example",
      "fallback_channel": "example",
      "fallback_sms_body": "example",
      "fallback_sms_from_phone_number_id": "example",
      "fallback_variable_mapping": {
        "1": "example"
      },
      "fallback_whatsapp_sender_id": 1,
      "fallback_whatsapp_template_id": 1,
      "goal_completion_variable": "example",
      "id": 1,
      "mark_complete_when_no_leads": false,
      "max_calls_in_parallel": 1,
      "max_retries": 1,
      "messages_per_minute": 1,
      "name": "example",
      "phone_number_ids": [],
      "retry_interval": 1,
      "retry_on_goal_incomplete": false,
      "retry_on_voicemail": false,
      "schedule_windows": [],
      "scheduled_start_at": "example",
      "sms_body": "example",
      "sms_from_phone_number_id": "example",
      "status": "example",
      "text_variable_mapping": "example",
      "timezone": "example",
      "updated_at": "example",
      "whatsapp_sender_id": "example",
      "whatsapp_template_id": "example"
    },
    "message": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Create lead

Create lead. Returns one response page; the connected account determines access.

**Inputs**

- Phone number (`phone_number`, text, required): The phone number of the lead in E.164 format (e.g. +1234567890)
- Campaign (`campaign_id`, number, required): The ID of the campaign to create the lead for
- Variables (`variables`, object): Custom variables for the lead. For **call** campaigns, use variables defined on your assistant (see [Call variables](/ai-assistants/settings/prompt-and-tools#call-variables)). For **WhatsApp/SMS** campaigns, use the keys referenced by your template mapping or SMS body placeholders. **Example variables (add your own)**
- Allow dupplicate (`allow_dupplicate`, true/false): Whether to allow duplicate leads in a campaign.
- Secondary contacts (`secondary_contacts`, list): Call campaigns only. Extra phone numbers for the same lead. Rejected for WhatsApp/SMS campaigns. **secondary\_contacts properties**

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "data": {
      "campaign": {
        "id": 1,
        "name": "example"
      },
      "campaign_id": 1,
      "created_at": "example",
      "id": 1,
      "phone_number": "example",
      "secondary_contacts": [],
      "status": "example",
      "updated_at": "example",
      "variables": {
        "customer_name": "example",
        "email": "example"
      }
    },
    "message": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Delete campaign

Delete campaign. Returns one response page; the connected account determines access.

**Inputs**

- ID (`id`, text, required): Id.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "message": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Delete lead

Delete lead. Returns one response page; the connected account determines access.

**Inputs**

- ID (`id`, text, required): Id.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {},
  "has_more": false,
  "next_cursor": null
}
```

### Get automation

Get automation. Returns one response page; the connected account determines access.

**Inputs**

- ID (`id`, text, required): Id.
- Include secrets (`include_secrets`, true/false): By default, credential-bearing values inside the definition (API keys, tokens, `Authorization` headers) are masked as `••• hidden`. Pass `true` to return them unmasked.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "data": {
      "binding": "example",
      "definition": {
        "displayName": "example",
        "name": "example",
        "nextAction": {
          "displayName": "example",
          "name": "example",
          "settings": {
            "actionName": "example",
            "input": {
              "headers": {
                "Authorization": "example"
              },
              "method": "example",
              "url": "example"
            },
            "pieceName": "example"
          },
          "type": "example"
        },
        "settings": {
          "pieceName": "example",
          "triggerName": "example"
        },
        "type": "example"
      },
      "id": "example",
      "name": "example",
      "status": "example",
      "updated_at": "example"
    }
  },
  "has_more": false,
  "next_cursor": null
}
```

### Get call

Get call. Returns one response page; the connected account determines access.

**Inputs**

- ID (`id`, text, required): Id.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "answered_by": "example",
    "assistant_name": "example",
    "assistant_phone_number": "example",
    "campaign_name": "example",
    "carrier_cost": 1.0,
    "client_phone_number": "example",
    "created_at": "example",
    "duration": 1,
    "ended_by": "example",
    "evaluation": {
      "outcome": "example",
      "score": 1.0,
      "sentiment": "example"
    },
    "id": 1,
    "recording_url": "example",
    "status": "example",
    "total_cost": 1.0,
    "transcript": "example",
    "type": "example",
    "updated_at": "example",
    "variables": {
      "customer_name": "example",
      "follow_up_date": "example",
      "interest_level": "example"
    },
    "webhook_response": {
      "data": {
        "crm_contact_id": "example"
      },
      "status": "example"
    }
  },
  "has_more": false,
  "next_cursor": null
}
```

### Get campaign

Get campaign. Returns one response page; the connected account determines access.

**Inputs**

- ID (`id`, text, required): Id.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "data": {
      "allowed_days": [],
      "allowed_hours_end_time": "example",
      "allowed_hours_start_time": "example",
      "assistant_id": "example",
      "channel": "example",
      "created_at": "example",
      "fallback_channel": "example",
      "fallback_sms_body": "example",
      "fallback_sms_from_phone_number_id": "example",
      "fallback_variable_mapping": "example",
      "fallback_whatsapp_sender_id": "example",
      "fallback_whatsapp_template_id": "example",
      "goal_completion_variable": "example",
      "id": 1,
      "mark_complete_when_no_leads": false,
      "max_calls_in_parallel": 1,
      "max_retries": 1,
      "messages_per_minute": 1,
      "name": "example",
      "phone_number_ids": [],
      "retry_interval": 1,
      "retry_on_goal_incomplete": false,
      "retry_on_voicemail": false,
      "schedule_windows": [],
      "scheduled_start_at": "example",
      "sms_body": "example",
      "sms_from_phone_number_id": "example",
      "status": "example",
      "text_variable_mapping": {
        "1": "example"
      },
      "timezone": "example",
      "updated_at": "example",
      "whatsapp_sender_id": 1,
      "whatsapp_template_id": 1
    }
  },
  "has_more": false,
  "next_cursor": null
}
```

### Get knowledgebase

Get knowledgebase. Returns one response page; the connected account determines access.

**Inputs**

- ID (`id`, text, required): Id.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "data": {
      "assistants_count": 1,
      "created_at": "example",
      "description": "example",
      "documents_count": 1,
      "id": 1,
      "name": "example",
      "status": "example",
      "status_label": "example",
      "updated_at": "example"
    }
  },
  "has_more": false,
  "next_cursor": null
}
```

### List assistants

List assistants. Returns one response page; the connected account determines access.

**Inputs**

- Per page (`per_page`, number): Number of assistants per page (1-100, default: 10). From 1 to 100.
- Page (`page`, number): Page number (default: 1). At least 1.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "current_page": 1,
    "data": [],
    "first_page_url": "example",
    "from": 1,
    "last_page": 1,
    "last_page_url": "example",
    "links": [],
    "next_page_url": "example",
    "path": "example",
    "per_page": 1,
    "prev_page_url": "example",
    "to": 1,
    "total": 1
  },
  "has_more": false,
  "next_cursor": null
}
```

### List automation runs

List automation runs. Returns one response page; the connected account determines access.

**Inputs**

- ID (`id`, text, required): Id.
- Run ID (`run_id`, text): A run ID from the list : returns that run's step-by-step detail instead of the list
- Limit (`limit`, number): How many recent runs to list (1 to 20, default 10)

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "runs": []
  },
  "has_more": false,
  "next_cursor": null
}
```

### List automations

List automations. Returns one response page; the connected account determines access.

**Inputs**

- Per page (`per_page`, number): Number of automations per page (1-100, default: 100). From 1 to 100.
- Cursor (`cursor`, text): Cursor for pagination. Use `next_cursor` from a previous response.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "data": [],
    "next_cursor": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### List calls

List calls. Returns one response page; the connected account determines access.

**Inputs**

- Status (`status`, text): Filter calls by status. Possible values: `initiated`, `ringing`, `busy`, `in-progress`, `ended`, `completed`, `ended_by_customer`, `ended_by_assistant`, `no-answer`, `failed`. One of: `initiated`, `ringing`, `busy`, `in-progress`, `ended`, `completed`, `ended_by_customer`, `ended_by_assistant`, `no-answer`, `failed`.
- Type (`type`, text): Filter calls by type. Possible values: `inbound`, `outbound`, `web`. One of: `inbound`, `outbound`, `web`.
- Phone number (`phone_number`, text): Filter calls by client phone number
- Assistant (`assistant_id`, number): Filter calls by assistant ID
- Campaign (`campaign_id`, number): Filter calls by campaign ID
- Date from (`date_from`, date): Filter calls from this date (YYYY-MM-DD format)
- Date to (`date_to`, date): Filter calls until this date (YYYY-MM-DD format)
- Per page (`per_page`, number): Number of calls per page (1-100, default: 15). From 1 to 100.
- Page (`page`, number): Page number (default: 1). At least 1.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "current_page": 1,
    "data": [],
    "first_page_url": "example",
    "from": 1,
    "last_page": 1,
    "last_page_url": "example",
    "links": [],
    "next_page_url": "example",
    "path": "example",
    "per_page": 1,
    "prev_page_url": "example",
    "to": 1,
    "total": 1
  },
  "has_more": false,
  "next_cursor": null
}
```

### List campaigns

List campaigns. Returns one response page; the connected account determines access.

**Inputs**: None.

**Outputs**: API response.

- `data` (list): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

### List conversations

List conversations. Returns one response page; the connected account determines access.

**Inputs**

- Type (`type`, text): Filter conversations by type. Possible values: `test`, `widget`, `whatsapp`, `api`. One of: `test`, `widget`, `whatsapp`, `api`.
- Assistant (`assistant_id`, number): Filter conversations by assistant ID (must belong to the authenticated user)
- Customer phone (`customer_phone`, text): Filter conversations by customer phone number (exact match). Useful for finding all conversations with a specific customer.
- Whatsapp sender phone (`whatsapp_sender_phone`, text): Filter conversations by WhatsApp sender phone number (exact match). Useful for finding all conversations from a specific WhatsApp business number.
- External identifier (`external_identifier`, text): Filter conversations by external identifier. Useful for finding conversations linked to your external system records.
- Per page (`per_page`, number): Number of conversations per page (1-100, default: 15). From 1 to 100.
- Cursor (`cursor`, text): Cursor for pagination. Use `next_cursor` or `prev_cursor` from a previous response.

**Outputs**: API response.

- `data` (object): A conversation page.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "data": [],
    "next_cursor": null
  },
  "has_more": false,
  "next_cursor": null
}
```

### List knowledgebases

List knowledgebases. Returns one response page; the connected account determines access.

**Inputs**: None.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "data": []
  },
  "has_more": false,
  "next_cursor": null
}
```

### List languages

List languages. Returns one response page; the connected account determines access.

**Inputs**: None.

**Outputs**: API response.

- `data` (list): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

### List leads

List leads. Returns one response page; the connected account determines access.

**Inputs**

- Status (`status`, text): Filter leads by status. Possible values: `created`, `scheduled`, `processing`, `completed`, `rescheduled`, `reached-max-retries`, `blacklisted`. One of: `created`, `scheduled`, `processing`, `completed`, `rescheduled`, `reached-max-retries`, `blacklisted`.
- Campaign (`campaign_id`, number): Filter leads by campaign ID
- Phone number (`phone_number`, text): Filter leads by phone number (partial match supported)
- Date from (`date_from`, date): Filter leads created from this date (YYYY-MM-DD format)
- Date to (`date_to`, date): Filter leads created until this date (YYYY-MM-DD format)
- Per page (`per_page`, number): Number of leads per page (1-100, default: 15). From 1 to 100.
- Page (`page`, number): Page number (default: 1). At least 1.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "current_page": 1,
    "data": [],
    "first_page_url": "example",
    "from": 1,
    "last_page": 1,
    "last_page_url": "example",
    "links": [],
    "next_page_url": "example",
    "path": "example",
    "per_page": 1,
    "prev_page_url": "example",
    "to": 1,
    "total": 1
  },
  "has_more": false,
  "next_cursor": null
}
```

### List models

List models. Returns one response page; the connected account determines access.

**Inputs**

- Type (`type`, text): The type of models to retrieve based on engine mode: * `llm` - LLM models for **pipeline** mode (default) * `multimodal` - Multimodal models for **multimodal** mode * `dualplex` - Multimodal models for **dualplex** mode

**Outputs**: API response.

- `data` (list): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

### List outbound assistants

List outbound assistants. Returns one response page; the connected account determines access.

**Inputs**: None.

**Outputs**: API response.

- `data` (list): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

### List phone numbers

List phone numbers. Returns one response page; the connected account determines access.

**Inputs**

- Type (`type`, text): Filter phone numbers by assistant type. Options: `inbound`, `outbound`

**Outputs**: API response.

- `data` (list): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

### List voices

List voices. Returns one response page; the connected account determines access.

**Inputs**

- Mode (`mode`, text): Filter voices by assistant mode. Options: `pipeline`, `multimodal`, `dualplex`
- Language ID (`language_id`, number): Filter voices by language ID. Use the [Get Languages](/api-reference/assistants/get-languages) endpoint to get available language IDs.
- Synthesizer provider ID (`synthesizer_provider_id`, number): Filter voices by TTS provider ID (e.g. ElevenLabs, Cartesia, Azure). Use the [Get Synthesizer Providers](/api-reference/assistants/get-synthesizer-providers) endpoint to get available provider IDs.
- Gender (`gender`, text): Filter voices by gender (e.g., `male`, `female`).
- Age (`age`, text): Filter voices by age category (e.g., `Young`, `Middle aged`).
- Accent (`accent`, text): Filter voices by accent (e.g., `American`, `British`).
- Search (`search`, text): Free-text search across voice name, accent, age, and gender.

**Outputs**: API response.

- `data` (list): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": null
}
```

### Make phone call

Make phone call. Returns one response page; the connected account determines access.

**Inputs**

- Phone number (`phone_number`, text, required): The phone number of the customer in E.164 format (e.g. +1234567890)
- Assistant (`assistant_id`, number, required): The ID of the assistant to make the call with
- Variables (`variables`, object): Custom variables to pass to the call. You can include **any variables that are defined on your assistant** (see [Call variables](/ai-assistants/settings/prompt-and-tools#call-variables)). The examples below are just for illustration : use your own variable names as configured in the assistant settings. **Example variables (add your own)**

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "data": {},
    "message": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Send sms

Send sms. Returns one response page; the connected account determines access.

**Inputs**

- Sender ID (`sender_id`, number, required): The ID of your phone number to send the SMS from (must be SMS-capable)
- To (`to`, text, required): The recipient's phone number in international format (e.g., "+1234567890")
- Message (`message`, text, required): The SMS message content (max 300 characters)

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "data": {
      "body": "example",
      "created_at": "example",
      "id": 1,
      "phone_number_id": 1,
      "segment_price": 1.0,
      "segments": 1,
      "sms_sid": "example",
      "status": "example",
      "to": "example",
      "total_cost": 1.0,
      "updated_at": "example",
      "user_id": 1
    },
    "message": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Update campaign

Update campaign. Returns one response page; the connected account determines access.

**Inputs**

- ID (`id`, text, required): Id.
- Name (`name`, text): Campaign name. Maximum 255 characters.
- Timezone (`timezone`, text): IANA timezone for the send/call windows (e.g. `America/New_York`).
- Schedule windows (`schedule_windows`, list): 1 to 6 daily windows as objects with `start` and `end` in `HH:MM`. A window runs overnight when `end` is earlier than `start` (e.g. `16:00` → `02:00`). Replaces the current windows.
- Allowed hours start time (`allowed_hours_start_time`, time): Legacy single-window start (`HH:MM`). Sets the start of the first window when `schedule_windows` is not sent.
- Allowed hours end time (`allowed_hours_end_time`, time): Legacy single-window end (`HH:MM`). Sets the end of the first window when `schedule_windows` is not sent. Overnight when end \< start.
- Allowed days (`allowed_days`, list): Weekdays when calls or messages can go out: `monday` … `sunday`. At least one. Replaces the current days. One or more of: `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`.
- Scheduled start at (`scheduled_start_at`, date and time): ISO 8601 date and time to start the campaign automatically. Without an offset it is read in the campaign timezone. The date cannot be before today. A campaign that isn't running (for example `draft`, `paused` or `completed`) becomes `scheduled` and starts by itself at that time. A running campaign keeps running. Set to `null` to clear it: a `scheduled` campaign goes back to `draft`.
- Max retries (`max_retries`, number): Max retry attempts per lead. Range: 1 to 5.
- Retry interval (`retry_interval`, number): Minutes between retries. Range: 10 to 4320.
- Mark complete when no leads (`mark_complete_when_no_leads`, true/false): `true` completes the campaign once every lead has been processed. `false` keeps it waiting for new leads, which campaigns fed by an automation or the API need. Turning it off doesn't reopen a campaign that has already completed: start it again with [Update campaign status](/api-reference/campaigns/update-status). #### Call campaigns
- Assistant (`assistant_id`, number): An OUTBOUND assistant you own. Changing it also moves the campaign to that assistant's timezone, unless you send `timezone` in the same request. The goal variable is cleared if the new assistant doesn't have it as a True/False post-call variable.
- Max calls in parallel (`max_calls_in_parallel`, number): Concurrent calls, up to your plan's limit (max 10).
- Phone number IDS (`phone_number_ids`, list): The numbers to call from. **Replaces the whole pool.** Send `[]` to remove all numbers; calls then use the assistant's own number. Numbers you add must be available to your account.
- Retry on voicemail (`retry_on_voicemail`, true/false): Retry when a call hits voicemail.
- Retry on goal incomplete (`retry_on_goal_incomplete`, true/false): Keep retrying until the goal variable is true. Turning it off clears `goal_completion_variable`.
- Goal completion variable (`goal_completion_variable`, text): A True/False (`bool`) post-call variable of the campaign's assistant, used with `retry_on_goal_incomplete`. It is cleared while `retry_on_goal_incomplete` is off.
- Fallback channel (`fallback_channel`, text): Text follow-up after the last call retry: `whatsapp` or `sms`. Set to `null` to turn the follow-up off, which also clears its settings. Switching between `whatsapp` and `sms` clears the settings of the other one.
- Fallback whatsapp sender ID (`fallback_whatsapp_sender_id`, number): WhatsApp sender for the follow-up. A new sender also needs `fallback_whatsapp_template_id`.
- Fallback whatsapp template ID (`fallback_whatsapp_template_id`, number): An approved template on that sender. Placeholders it shares with the current follow-up template keep their mapping; if it has other placeholders, send the full `fallback_variable_mapping` in the same request.
- Fallback variable mapping (`fallback_variable_mapping`, object): Maps every placeholder of the follow-up template (e.g. `"1"`) to a lead variable key, and nothing else.
- Fallback SMS from phone number ID (`fallback_sms_from_phone_number_id`, number): SMS-capable number for the follow-up, available to your account.
- Fallback SMS body (`fallback_sms_body`, text): Follow-up SMS text. Max 1600 characters. Supports `{{variable}}` placeholders. #### WhatsApp campaigns
- Whatsapp sender ID (`whatsapp_sender_id`, number): A sender you own. A new sender also needs `whatsapp_template_id`.
- Whatsapp template ID (`whatsapp_template_id`, number): An approved template on that sender. Placeholders it shares with the current template keep their mapping; if it has other placeholders, send the full `text_variable_mapping` in the same request.
- Text variable mapping (`text_variable_mapping`, object): Maps every template placeholder (e.g. `"1"`) to a lead variable key, and nothing else. Replaces the current mapping.
- Messages per minute (`messages_per_minute`, number): Per-campaign send rate. Range: 1 to 10. #### SMS campaigns
- SMS from phone number ID (`sms_from_phone_number_id`, number): An SMS-capable number available to your account.
- SMS body (`sms_body`, text): Message text. Max 1600 characters. Supports `{{variable}}` placeholders.

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "data": {
      "allowed_days": [],
      "allowed_hours_end_time": "example",
      "allowed_hours_start_time": "example",
      "assistant_id": 1,
      "channel": "example",
      "created_at": "example",
      "fallback_channel": "example",
      "fallback_sms_body": "example",
      "fallback_sms_from_phone_number_id": "example",
      "fallback_variable_mapping": "example",
      "fallback_whatsapp_sender_id": "example",
      "fallback_whatsapp_template_id": "example",
      "goal_completion_variable": "example",
      "id": 1,
      "mark_complete_when_no_leads": false,
      "max_calls_in_parallel": 1,
      "max_retries": 1,
      "messages_per_minute": 1,
      "name": "example",
      "phone_number_ids": [],
      "retry_interval": 1,
      "retry_on_goal_incomplete": false,
      "retry_on_voicemail": false,
      "schedule_windows": [],
      "scheduled_start_at": "example",
      "sms_body": "example",
      "sms_from_phone_number_id": "example",
      "status": "example",
      "text_variable_mapping": "example",
      "timezone": "example",
      "updated_at": "example",
      "whatsapp_sender_id": "example",
      "whatsapp_template_id": "example"
    },
    "message": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```

### Update lead

Update lead. Returns one response page; the connected account determines access.

**Inputs**

- ID (`id`, text, required): Id.
- Campaign (`campaign_id`, number): The ID of the campaign to assign the lead to
- Phone number (`phone_number`, text): The phone number of the lead (will be formatted to E164)
- Status (`status`, text): The status of the lead. Must be one of: `created`, `completed`, `reached-max-retries`
- Variables (`variables`, object): Custom variables to merge with existing lead variables

**Outputs**: API response.

- `data` (object): Data.
- `has_more` (true/false): Whether a continuation page is available.
- `next_cursor` (text): Continuation value, when supplied by the service.

**Example output**

```json
{
  "data": {
    "message": "example"
  },
  "has_more": false,
  "next_cursor": null
}
```
