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

# Instantly Campaign Management: Inputs, Cost & CLI Example

> Updating an Instantly campaign with a flexible patch payload. Includes inputs, outputs, pricing notes, Deepline CLI examples, and GTM automation guidance.

## Run in Enrichment Spreadsheet

<Info>
  Use this function as a column step in `deepline enrich`.
</Info>

```bash theme={null}
deepline enrich --input leads.csv --output leads.enriched.csv --with 'result=instantly_patch_campaign:{}' --json
```

<Tip>
  Map payload values to spreadsheet columns with `{{column_name}}` placeholders.
</Tip>

## Input Schema

| Name                                        | Type      | Required | Default | Description |
| ------------------------------------------- | --------- | -------- | ------- | ----------- |
| `payload.id`                                | `string`  | No       |         |             |
| `payload.campaign_id`                       | `string`  | No       |         |             |
| `payload.updates`                           | `object`  | No       |         |             |
| `payload.name`                              | `string`  | No       |         |             |
| `payload.pl_value`                          | `number`  | No       |         |             |
| `payload.is_evergreen`                      | `boolean` | No       |         |             |
| `payload.campaign_schedule`                 | `object`  | No       |         |             |
| `payload.sequences`                         | `array`   | No       |         |             |
| `payload.email_list`                        | `array`   | No       |         |             |
| `payload.email_gap`                         | `number`  | No       |         |             |
| `payload.random_wait_max`                   | `number`  | No       |         |             |
| `payload.text_only`                         | `boolean` | No       |         |             |
| `payload.first_email_text_only`             | `boolean` | No       |         |             |
| `payload.stop_on_reply`                     | `boolean` | No       |         |             |
| `payload.stop_on_auto_reply`                | `boolean` | No       |         |             |
| `payload.daily_limit`                       | `integer` | No       |         |             |
| `payload.daily_max_leads`                   | `integer` | No       |         |             |
| `payload.email_tag_list`                    | `array`   | No       |         |             |
| `payload.cc_list`                           | `array`   | No       |         |             |
| `payload.bcc_list`                          | `array`   | No       |         |             |
| `payload.link_tracking`                     | `boolean` | No       |         |             |
| `payload.open_tracking`                     | `boolean` | No       |         |             |
| `payload.prioritize_new_leads`              | `boolean` | No       |         |             |
| `payload.match_lead_esp`                    | `boolean` | No       |         |             |
| `payload.stop_for_company`                  | `boolean` | No       |         |             |
| `payload.owned_by`                          | `string`  | No       |         |             |
| `payload.insert_unsubscribe_header`         | `boolean` | No       |         |             |
| `payload.allow_risky_contacts`              | `boolean` | No       |         |             |
| `payload.disable_bounce_protect`            | `boolean` | No       |         |             |
| `payload.auto_variant_select`               | `object`  | No       |         |             |
| `payload.limit_emails_per_company_override` | `object`  | No       |         |             |
| `payload.provider_routing_rules`            | `array`   | No       |         |             |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Patch an Instantly campaign by id.",
    "properties": {
      "id": {
        "type": "string",
        "minLength": 1
      },
      "campaign_id": {
        "type": "string",
        "minLength": 1
      },
      "updates": {
        "type": "object",
        "minProperties": 1,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "pl_value": {
            "type": [
              "number",
              "null"
            ]
          },
          "is_evergreen": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "campaign_schedule": {
            "type": "object",
            "minProperties": 1,
            "properties": {
              "start_date": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "end_date": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "schedules": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1
                    },
                    "timing": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string",
                          "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                        },
                        "to": {
                          "type": "string",
                          "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                        }
                      },
                      "required": [
                        "from",
                        "to"
                      ],
                      "additionalProperties": false
                    },
                    "days": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "boolean"
                      }
                    },
                    "timezone": {
                      "type": "string",
                      "description": "Instantly-supported timezone value. Use instantly_get_campaign/list_campaigns payloads to mirror accepted values (e.g. Pacific/Auckland)."
                    }
                  },
                  "required": [
                    "name",
                    "timing",
                    "days",
                    "timezone"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "additionalProperties": false
          },
          "sequences": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "steps": {
                  "type": "array",
                  "minItems": 1,
                  "maxItems": 50,
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string",
                        "const": "email"
                      },
                      "delay": {
                        "type": "integer",
                        "default": 0,
                        "minimum": 0
                      },
                      "variants": {
                        "type": "array",
                        "minItems": 1,
                        "items": {
                          "type": "object",
                          "properties": {
                            "subject": {
                              "type": "string",
                              "minLength": 1,
                              "allowsTemplatePlaceholders": true
                            },
                            "body": {
                              "type": "string",
                              "minLength": 1,
                              "allowsTemplatePlaceholders": true
                            }
                          },
                          "required": [
                            "subject",
                            "body"
                          ],
                          "additionalProperties": false
                        }
                      }
                    },
                    "required": [
                      "type",
                      "delay",
                      "variants"
                    ],
                    "additionalProperties": false
                  }
                }
              },
              "required": [
                "steps"
              ],
              "additionalProperties": false
            }
          },
          "email_list": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
            }
          },
          "email_gap": {
            "type": [
              "number",
              "null"
            ]
          },
          "random_wait_max": {
            "type": [
              "number",
              "null"
            ]
          },
          "text_only": {
            "type": "boolean"
          },
          "first_email_text_only": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "stop_on_reply": {
            "type": "boolean"
          },
          "stop_on_auto_reply": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "daily_limit": {
            "type": "integer",
            "minimum": 1
          },
          "daily_max_leads": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "email_tag_list": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "cc_list": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
            }
          },
          "bcc_list": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
            }
          },
          "link_tracking": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "open_tracking": {
            "type": "boolean"
          },
          "prioritize_new_leads": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "match_lead_esp": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "stop_for_company": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "owned_by": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1
          },
          "insert_unsubscribe_header": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "allow_risky_contacts": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "disable_bounce_protect": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "auto_variant_select": {
            "type": [
              "object",
              "null"
            ],
            "minProperties": 1,
            "properties": {
              "trigger": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "trigger"
            ],
            "additionalProperties": true
          },
          "limit_emails_per_company_override": {
            "type": [
              "object",
              "null"
            ],
            "properties": {},
            "additionalProperties": true
          },
          "provider_routing_rules": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true
            }
          }
        },
        "additionalProperties": false
      },
      "name": {
        "type": "string",
        "minLength": 1
      },
      "pl_value": {
        "type": [
          "number",
          "null"
        ]
      },
      "is_evergreen": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "campaign_schedule": {
        "type": "object",
        "minProperties": 1,
        "properties": {
          "start_date": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "end_date": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "schedules": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "timing": {
                  "type": "object",
                  "properties": {
                    "from": {
                      "type": "string",
                      "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                    },
                    "to": {
                      "type": "string",
                      "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
                    }
                  },
                  "required": [
                    "from",
                    "to"
                  ],
                  "additionalProperties": false
                },
                "days": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  }
                },
                "timezone": {
                  "type": "string",
                  "description": "Instantly-supported timezone value. Use instantly_get_campaign/list_campaigns payloads to mirror accepted values (e.g. Pacific/Auckland)."
                }
              },
              "required": [
                "name",
                "timing",
                "days",
                "timezone"
              ],
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      },
      "sequences": {
        "type": "array",
        "minItems": 1,
        "items": {
          "type": "object",
          "properties": {
            "steps": {
              "type": "array",
              "minItems": 1,
              "maxItems": 50,
              "items": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "email"
                  },
                  "delay": {
                    "type": "integer",
                    "default": 0,
                    "minimum": 0
                  },
                  "variants": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "object",
                      "properties": {
                        "subject": {
                          "type": "string",
                          "minLength": 1,
                          "allowsTemplatePlaceholders": true
                        },
                        "body": {
                          "type": "string",
                          "minLength": 1,
                          "allowsTemplatePlaceholders": true
                        }
                      },
                      "required": [
                        "subject",
                        "body"
                      ],
                      "additionalProperties": false
                    }
                  }
                },
                "required": [
                  "type",
                  "delay",
                  "variants"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "steps"
          ],
          "additionalProperties": false
        }
      },
      "email_list": {
        "type": "array",
        "minItems": 1,
        "items": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
        }
      },
      "email_gap": {
        "type": [
          "number",
          "null"
        ]
      },
      "random_wait_max": {
        "type": [
          "number",
          "null"
        ]
      },
      "text_only": {
        "type": "boolean"
      },
      "first_email_text_only": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "stop_on_reply": {
        "type": "boolean"
      },
      "stop_on_auto_reply": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "daily_limit": {
        "type": "integer",
        "minimum": 1
      },
      "daily_max_leads": {
        "type": [
          "integer",
          "null"
        ],
        "minimum": 1
      },
      "email_tag_list": {
        "type": "array",
        "minItems": 1,
        "items": {
          "type": "string",
          "minLength": 1
        }
      },
      "cc_list": {
        "type": "array",
        "minItems": 1,
        "items": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
        }
      },
      "bcc_list": {
        "type": "array",
        "minItems": 1,
        "items": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
        }
      },
      "link_tracking": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "open_tracking": {
        "type": "boolean"
      },
      "prioritize_new_leads": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "match_lead_esp": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "stop_for_company": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "owned_by": {
        "type": [
          "string",
          "null"
        ],
        "minLength": 1
      },
      "insert_unsubscribe_header": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "allow_risky_contacts": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "disable_bounce_protect": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "auto_variant_select": {
        "type": [
          "object",
          "null"
        ],
        "minProperties": 1,
        "properties": {
          "trigger": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "trigger"
        ],
        "additionalProperties": true
      },
      "limit_emails_per_company_override": {
        "type": [
          "object",
          "null"
        ],
        "properties": {},
        "additionalProperties": true
      },
      "provider_routing_rules": {
        "type": "array",
        "minItems": 1,
        "items": {
          "type": "object",
          "properties": {},
          "additionalProperties": true
        }
      }
    },
    "additionalProperties": false
  }
  ```
</details>

## Output Schema

Output schema is not available yet.

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "description": "Raw Instantly patch campaign response."
  }
  ```
</details>

## Advanced: Direct CLI

<Info>
  Use direct execution for single payload debugging.
</Info>

```bash theme={null}
deepline tools execute instantly_patch_campaign --payload '{}' --json
```

### CLI flags

| Flag                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `--json`                    | Print machine-readable output.                      |
| `--wait`                    | Wait for terminal provider status when supported.   |
| `--debug`                   | Enable wait mode with additional status/log output. |
| `--wait-timeout SECONDS`    | Max seconds to wait in wait mode.                   |
| `--poll-interval SECONDS`   | Polling interval in seconds during wait mode.       |
| `--timeout SECONDS`         | Request timeout in seconds.                         |
| `--connect-timeout SECONDS` | Connection timeout in seconds.                      |

## Provider API Context

<details>
  <summary>Show provider reference (optional)</summary>

  ```md theme={null}
  > Requires one of the following scopes: `campaigns:update`, `campaigns:all`, `all:update`, `all:all`

  ## 48. Search campaigns by lead email

  Source: https://developer.instantly.ai/api-reference/campaign/search-campaigns-by-lead-email.md
  ```
</details>

## Cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.
* Billing mode: `no_bill`.
