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

# Update campaign

> **Update campaign configuration**

Modify campaign settings, leads, inboxes, email content, or sequences.
All validations are handled automatically - no need to track internal steps.

## What Can Be Updated

- Basic settings (name, schedule, limits)
- Lead mapping configuration
- Sender inbox selection
- Email variants for A/B testing
- Follow-up sequences

## Launching a Campaign

Set `launch: true` when the campaign is ready to activate. The response includes
`is_launch_ready` and `missing_requirements` to help you understand what's needed.

## Example Usage

```python
import requests

campaign_id = "550e8400-e29b-41d4-a716-446655440000"

# Update campaign with email content
response = requests.put(
    f"https://api.coldsend.io/api/public/v1/campaigns/{campaign_id}",
    headers={"X-API-Key": "your-api-key"},
    json={
        "variants": [{
            "variant_name": "A",
            "subject_template": "Quick question, {{first_name}}",
            "email_content": "Hi {{first_name}},...",
            "distribution_percent": 100
        }]
    }
)

# Response shows what's still needed
# {"is_launch_ready": false, "missing_requirements": ["leads", "inboxes"]}

# Launch when ready
response = requests.put(
    f"https://api.coldsend.io/api/public/v1/campaigns/{campaign_id}",
    headers={"X-API-Key": "your-api-key"},
    json={"launch": true}
)
# {"status": "ACTIVE", "is_launch_ready": true, "missing_requirements": []}
```



## OpenAPI

````yaml /public_openapi.json put /api/public/v1/campaigns/{campaign_id}
openapi: 3.0.3
info:
  title: ColdSend Public API
  description: >-
    Programmatic access to ColdSend for managing cold email campaigns and sender
    accounts.
  version: 1.0.0
  contact:
    name: ColdSend Support
    email: support@coldsend.pro
    url: https://coldsend.pro
servers:
  - url: https://api.coldsend.pro
    description: Production
security:
  - ApiKeyAuth: []
paths:
  /api/public/v1/campaigns/{campaign_id}:
    put:
      tags:
        - Campaigns
      summary: Update campaign
      description: >-
        **Update campaign configuration**


        Modify campaign settings, leads, inboxes, email content, or sequences.

        All validations are handled automatically - no need to track internal
        steps.


        ## What Can Be Updated


        - Basic settings (name, schedule, limits)

        - Lead mapping configuration

        - Sender inbox selection

        - Email variants for A/B testing

        - Follow-up sequences


        ## Launching a Campaign


        Set `launch: true` when the campaign is ready to activate. The response
        includes

        `is_launch_ready` and `missing_requirements` to help you understand
        what's needed.


        ## Example Usage


        ```python

        import requests


        campaign_id = "550e8400-e29b-41d4-a716-446655440000"


        # Update campaign with email content

        response = requests.put(
            f"https://api.coldsend.io/api/public/v1/campaigns/{campaign_id}",
            headers={"X-API-Key": "your-api-key"},
            json={
                "variants": [{
                    "variant_name": "A",
                    "subject_template": "Quick question, {{first_name}}",
                    "email_content": "Hi {{first_name}},...",
                    "distribution_percent": 100
                }]
            }
        )


        # Response shows what's still needed

        # {"is_launch_ready": false, "missing_requirements": ["leads",
        "inboxes"]}


        # Launch when ready

        response = requests.put(
            f"https://api.coldsend.io/api/public/v1/campaigns/{campaign_id}",
            headers={"X-API-Key": "your-api-key"},
            json={"launch": true}
        )

        # {"status": "ACTIVE", "is_launch_ready": true, "missing_requirements":
        []}

        ```
      operationId: update_campaign_api_public_v1_campaigns__campaign_id__put
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Campaign Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublicCampaignUpdateRequest'
      responses:
        '200':
          description: Campaign updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicCampaignUpdateResponse'
        '400':
          description: Invalid request or business logic violation
        '401':
          description: Missing or invalid API key
        '403':
          description: Insufficient permissions - requires 'campaigns:update' scope
        '404':
          description: Campaign not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PublicCampaignUpdateRequest:
      properties:
        name:
          type: string
          maxLength: 255
          minLength: 8
          nullable: true
          title: Name
          description: Campaign name (minimum 8 characters)
        daily_limit_per_inbox:
          type: integer
          maximum: 100
          minimum: 1
          nullable: true
          title: Daily Limit Per Inbox
          description: Maximum emails per inbox per day (1-100)
        start_date:
          type: string
          format: date-time
          nullable: true
          title: Start Date
          description: Campaign start date (ISO 8601 format)
        timezone:
          type: string
          maxLength: 100
          nullable: true
          title: Timezone
          description: Timezone for scheduling (IANA format)
        sending_days:
          items:
            type: integer
          type: array
          maxItems: 7
          minItems: 1
          nullable: true
          title: Sending Days
          description: Days to send (1=Monday, 7=Sunday)
        sending_window_start:
          type: integer
          maximum: 23
          minimum: 0
          nullable: true
          title: Sending Window Start
          description: Sending window start hour (0-23)
        sending_window_start_minute:
          type: integer
          maximum: 59
          minimum: 0
          nullable: true
          title: Sending Window Start Minute
          description: Sending window start minute (0-59)
        sending_window_end:
          type: integer
          maximum: 24
          minimum: 1
          nullable: true
          title: Sending Window End
          description: Sending window end hour (1-24)
        sending_window_end_minute:
          type: integer
          maximum: 59
          minimum: 0
          nullable: true
          title: Sending Window End Minute
          description: >-
            Sending window end minute (0-59). Must be 0 when sending_window_end
            is 24
        enable_tracking:
          type: boolean
          nullable: true
          title: Enable Tracking
          description: Enable open tracking
        enable_unsubscribe:
          type: boolean
          nullable: true
          title: Enable Unsubscribe
          description: Enable unsubscribe link
        enable_click_tracking:
          type: boolean
          nullable: true
          title: Enable Click Tracking
          description: >-
            Enable link click-through-rate (CTR) tracking. Requires a verified
            tracking domain.
        ramp_up_enabled:
          type: boolean
          nullable: true
          title: Ramp Up Enabled
          description: >-
            Enable or disable gradual ramp-up of daily sending volume per inbox.
            Setting to true resets ramp-up progress for all assigned inboxes.
        ramp_up_increment:
          type: integer
          maximum: 100
          minimum: 1
          nullable: true
          title: Ramp Up Increment
          description: >-
            Additional emails per inbox per day added on each ramp-up day
            (1-100)
        ramp_up_max_limit:
          type: integer
          maximum: 1000
          minimum: 1
          nullable: true
          title: Ramp Up Max Limit
          description: Maximum daily emails per inbox once fully ramped (1-1000)
        lead_mapping:
          additionalProperties: true
          type: object
          nullable: true
          title: Lead Mapping
          description: Column mapping from CSV to lead fields
        inbox_ids:
          items:
            type: string
            format: uuid
          type: array
          minItems: 1
          nullable: true
          title: Inbox Ids
          description: Inbox IDs to use for sending
        variants:
          items:
            $ref: '#/components/schemas/PublicInlineVariantRequest'
          type: array
          nullable: true
          title: Variants
          description: >-
            Email variants for A/B testing. All variants must sum to 100%
            distribution.
        sequences:
          items:
            $ref: '#/components/schemas/PublicSequenceRequest'
          type: array
          nullable: true
          title: Sequences
          description: Follow-up email sequences (max 3)
        launch:
          type: boolean
          title: Launch
          description: >-
            Set to true when ready to activate the campaign. Campaign must have
            leads, inboxes, and email content.
          default: false
      type: object
      title: PublicCampaignUpdateRequest
      description: >-
        Request schema for updating a campaign via public API.


        This schema does NOT expose internal step mechanics. Simply provide

        the fields you want to update, and the system will handle validation

        automatically. Set 'launch=true' when you're ready to activate the
        campaign.
    PublicCampaignUpdateResponse:
      properties:
        success:
          type: boolean
          title: Success
        message:
          type: string
          title: Message
        campaign_id:
          type: string
          format: uuid
          title: Campaign Id
          description: Campaign ID
        name:
          type: string
          title: Name
          description: Campaign name
        status:
          type: string
          title: Status
          description: 'Campaign status: DRAFT, ACTIVE, PAUSED, COMPLETED, or FAILED'
        is_launch_ready:
          type: boolean
          title: Is Launch Ready
          description: Whether the campaign has all required components to launch
        missing_requirements:
          items:
            type: string
          type: array
          title: Missing Requirements
          description: List of missing requirements before launch (empty if launch-ready)
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Last update timestamp
      type: object
      required:
        - success
        - message
        - campaign_id
        - name
        - status
        - is_launch_ready
        - updated_at
      title: PublicCampaignUpdateResponse
      description: Response for public campaign update.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    PublicInlineVariantRequest:
      properties:
        variant_name:
          type: string
          maxLength: 10
          minLength: 1
          title: Variant Name
          description: Variant identifier (A, B, C, etc.)
          default: A
        variant_label:
          type: string
          maxLength: 100
          nullable: true
          title: Variant Label
          description: User-friendly label for this variant
        subject_template:
          type: string
          maxLength: 500
          minLength: 1
          title: Subject Template
          description: >-
            Email subject line. Supports Liquid templating: {{first_name}},
            {{company}}, etc.
        email_content:
          type: string
          maxLength: 100000
          title: Email Content
          description: >-
            Email body content (plain text or HTML). Supports Liquid templating
            for personalization. Must be at least 10 characters.
        content_type:
          type: string
          nullable: true
          title: Content Type
          description: >-
            Email content mode: 'plaintext', 'html', or 'raw_html'. If omitted,
            inferred from tracking setting.
        distribution_percent:
          type: integer
          maximum: 100
          minimum: 0
          title: Distribution Percent
          description: >-
            Percentage of leads that receive this variant (0-100). All variants
            must sum to 100%.
          default: 100
      type: object
      required:
        - subject_template
        - email_content
      title: PublicInlineVariantRequest
      description: Email variant for A/B testing in public API.
    PublicSequenceRequest:
      properties:
        step_number:
          type: integer
          maximum: 4
          minimum: 2
          title: Step Number
          description: Sequence step number (2-4 for follow-ups)
        trigger_type:
          type: string
          title: Trigger Type
          description: >-
            When to send: 'NOT_OPENED' (no open), 'NOT_REPLIED' (no reply), or
            'OPENED_BUT_NOT_REPLIED' (opened but no reply)
        wait_days:
          type: integer
          maximum: 30
          minimum: 1
          title: Wait Days
          description: Days to wait after previous email before sending this follow-up
        enable_unsubscribe:
          type: boolean
          nullable: true
          title: Enable Unsubscribe
          description: >-
            Enable unsubscribe for this sequence (inherits from campaign if not
            specified)
        variants:
          items:
            $ref: '#/components/schemas/PublicSequenceVariantRequest'
          type: array
          minItems: 1
          title: Variants
          description: Email variants for A/B testing this follow-up
      type: object
      required:
        - step_number
        - trigger_type
        - wait_days
        - variants
      title: PublicSequenceRequest
      description: Follow-up email sequence configuration.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    PublicSequenceVariantRequest:
      properties:
        variant_name:
          type: string
          maxLength: 10
          minLength: 1
          title: Variant Name
          description: Variant identifier
          default: A
        variant_label:
          type: string
          maxLength: 100
          nullable: true
          title: Variant Label
          description: User-friendly label
        subject_template:
          type: string
          maxLength: 500
          nullable: true
          title: Subject Template
          description: Subject line (if None, uses previous subject)
        email_content:
          type: string
          maxLength: 100000
          title: Email Content
          description: Email body content. Must be at least 10 characters.
        content_type:
          type: string
          nullable: true
          title: Content Type
          description: >-
            Email content mode: 'plaintext', 'html', or 'raw_html'. If omitted,
            inferred from tracking setting.
        distribution_percent:
          type: integer
          maximum: 100
          minimum: 0
          title: Distribution Percent
          description: Percentage distribution (0-100)
          default: 100
      type: object
      required:
        - email_content
      title: PublicSequenceVariantRequest
      description: Variant for follow-up sequence in public API.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key with format cs_live_xxx

````