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

# Update Campaign Settings

> Updates campaign configuration including: tracking settings (enable/disable opens and clicks - array format with DONT_EM

<Note>
  Updates campaign configuration including: tracking settings (enable/disable opens and clicks - array format with DONT\_EMAIL\_OPEN/DONT\_LINK\_CLICK values), sending limits (max\_leads\_per\_day, min\_time\_between\_emails), stop conditions (when to stop emailing leads - REPLY\_TO\_AN\_EMAIL/OPENED\_EMAIL/CLIC...
</Note>

## Overview

Updates campaign configuration including: tracking settings (enable/disable opens and clicks - array format with DONT\_EMAIL\_OPEN/DONT\_LINK\_CLICK values), sending limits (max\_leads\_per\_day, min\_time\_between\_emails), stop conditions (when to stop emailing leads - REPLY\_TO\_AN\_EMAIL/OPENED\_EMAIL/CLICKED\_LINK), AI ESP matching (intelligently pair leads with optimal email accounts), plain text mode (send\_as\_plain\_text for better deliverability with technical audiences), follow-up percentage, and unsubscribe text

**Key Features**:

* Validates settings before applying

## Path Parameters

<ParamField path="campaign_id" type="number" required>
  The ID of the campaign to update
</ParamField>

## Query Parameters

<ParamField query="api_key" type="string" required>
  Your SmartLead API key
</ParamField>

## Request Body

<ParamField body="name" type="string">
  Campaign name
</ParamField>

<ParamField body="track_settings" type="array">
  Email tracking configuration. Pass an array of string values to disable specific tracking. Allowed values: `DONT_TRACK_EMAIL_OPEN`, `DONT_TRACK_LINK_CLICK`, `DONT_TRACK_REPLY_TO_AN_EMAIL`. Pass an empty array `[]` to enable all tracking.
</ParamField>

<ParamField body="stop_lead_settings" type="string">
  When to stop emailing a lead. Allowed values: `CLICK_ON_A_LINK`, `OPEN_AN_EMAIL`
</ParamField>

<ParamField body="unsubscribe_text" type="string">
  Unsubscribe text to append to emails
</ParamField>

<ParamField body="send_as_plain_text" type="boolean">
  Send emails as plain text (no HTML)
</ParamField>

<ParamField body="force_plain_text" type="boolean">
  Force convert all emails to plain text
</ParamField>

<ParamField body="follow_up_percentage" type="integer">
  Follow-up percentage (0-100)
</ParamField>

<ParamField body="client_id" type="integer">
  Client ID. Leave as null if not needed
</ParamField>

<ParamField body="enable_ai_esp_matching" type="boolean">
  Use AI to match leads with best email accounts
</ParamField>

<ParamField body="auto_pause_domain_leads_on_reply" type="boolean">
  Pause leads from same domain after reply
</ParamField>

<ParamField body="ignore_ss_mailbox_sending_limit" type="boolean">
  Ignore SmartSenders mailbox sending limit
</ParamField>

<ParamField body="bounce_autopause_threshold" type="string">
  Bounce auto-pause threshold
</ParamField>

<ParamField body="domain_level_rate_limit" type="boolean">
  Enable domain-level rate limiting
</ParamField>

<ParamField body="out_of_office_detection_settings" type="object">
  Out of office detection configuration

  <Expandable title="out_of_office_detection_settings properties">
    <ParamField body="ignoreOOOasReply" type="boolean">
      When true, out-of-office responses are not counted as replies and will not stop the sequence
    </ParamField>

    <ParamField body="autoReactivateOOO" type="boolean">
      Automatically reactivate leads after their out-of-office period ends
    </ParamField>

    <ParamField body="reactivateOOOwithDelay" type="number">
      Number of days to wait before reactivating a lead after an out-of-office response
    </ParamField>

    <ParamField body="autoCategorizeOOO" type="boolean">
      Automatically categorize out-of-office replies using AI
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="add_unsubscribe_tag" type="boolean">
  Add an unsubscribe tag to outgoing emails
</ParamField>

<ParamField body="ai_categorisation_options" type="array">
  AI categorisation options
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/settings?api_key=YOUR_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "My Campaign",
      "track_settings": ["DONT_TRACK_EMAIL_OPEN"],
      "stop_lead_settings": "CLICK_ON_A_LINK",
      "send_as_plain_text": false,
      "follow_up_percentage": 100,
      "enable_ai_esp_matching": true
    }'
  ```

  ```python Python theme={null}
  import requests

  API_KEY = "YOUR_API_KEY"

  response = requests.post(
      "https://server.smartlead.ai/api/v1/campaigns/{campaign_id}/settings",
      params={"api_key": API_KEY},
      json={
          "name": "My Campaign",
          "track_settings": ["DONT_TRACK_EMAIL_OPEN"],
          "stop_lead_settings": "CLICK_ON_A_LINK",
          "send_as_plain_text": False,
          "follow_up_percentage": 100,
          "enable_ai_esp_matching": True
      }
  )

  result = response.json()
  print(result)
  ```

  ```javascript JavaScript theme={null}
  const API_KEY = 'YOUR_API_KEY';

  const response = await fetch(
    `https://server.smartlead.ai/api/v1/campaigns/${campaignId}/settings?api_key=${API_KEY}`,
    {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        name: 'My Campaign',
        track_settings: ['DONT_TRACK_EMAIL_OPEN'],
        stop_lead_settings: 'CLICK_ON_A_LINK',
        send_as_plain_text: false,
        follow_up_percentage: 100,
        enable_ai_esp_matching: true
      })
    }
  );

  const result = await response.json();
  console.log(result);
  ```
</RequestExample>

## Response Codes

<ResponseField name="200" type="Success">
  Request successful
</ResponseField>

<ResponseField name="400" type="Bad Request">
  Invalid request parameters or malformed request body
</ResponseField>

<ResponseField name="401" type="Unauthorized">
  Invalid or missing API key. Check your authentication.
</ResponseField>

<ResponseField name="404" type="Not Found">
  The requested resource (campaign, lead, email account, etc.) does not exist or you don't have access to it
</ResponseField>

<ResponseField name="422" type="Validation Error">
  Request validation failed. Check parameter types, required fields, and value constraints.
</ResponseField>

<ResponseField name="429" type="Rate Limit Exceeded">
  Too many requests. Please slow down and retry after the rate limit resets.
</ResponseField>

<ResponseField name="500" type="Internal Server Error">
  Server error occurred. Please try again or contact support if the issue persists.
</ResponseField>

<ResponseField name="503" type="Service Unavailable">
  API is temporarily unavailable or under maintenance. Please try again later.
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "success": true,
    "data": {
      "message": "Settings updated successfully"
    }
  }
  ```

  ```json 401 - Unauthorized theme={null}
  {
    "message": "Invalid API Key"
  }
  ```

  ```json 404 - Not Found theme={null}
  {
    "error": "Resource not found"
  }
  ```

  ```json 422 - Validation Error theme={null}
  {
    "error": "Invalid parameters provided"
  }
  ```
</ResponseExample>

## Settings Explained

### Track Settings

Control what gets tracked in your emails:

* **track\_open**: Adds tracking pixel to detect opens
* **track\_click**: Wraps links to track clicks

<Tip>
  Disable tracking for privacy-focused outreach or when targeting technical audiences who may block tracking.
</Tip>

### Sending Limits

* **sending\_limit**: Daily cap across all email accounts
* **min\_time\_btwn\_emails**: Prevents rapid-fire sending (appears more natural)

### Stop Lead Settings

* **REPLY\_TO\_AN\_EMAIL**: Most common - stop when they engage
* **OPENED\_EMAIL**: Conservative - stop after they show interest
* **CLICKED\_LINK**: Stop when they click a link

### AI ESP Matching

When enabled, SmartLead's AI:

* Matches leads with appropriate sender accounts
* Considers lead's email provider
* Optimizes for deliverability
* Balances account usage

## Implementation Details

Settings changes affect only future sends. In-progress leads continue with old settings.

**Response Format**: object

## Related Endpoints

* [Update Campaign Schedule](/api-reference/campaigns/update-schedule)
* [Get Campaign by ID](/api-reference/campaigns/get-by-id)
* [Update Campaign Status](/api-reference/campaigns/update-status)
