# Update Campaign

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /campaign/update/campaign:
    patch:
      summary: Update Campaign
      deprecated: false
      description: |-
        This is a PATCH endpoint to update an existing campaign.
        Only the fields explicitly provided in the request body will be updated.
        Any fields not included will retain their existing values.
        This allows for partial updates without affecting other campaign data.
      tags:
        - Campaign
        - Campaigns
      parameters:
        - name: x-api-key
          in: header
          description: Your PlusVibe.ai account's API Key
          required: true
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - workspace_id
                - campaign_id
              properties:
                workspace_id:
                  type: string
                  description: The Id of the workspace
                  pattern: ^[a-fA-F0-9]{24}$
                campaign_id:
                  type: string
                  description: The Id of the campaign to be updated
                  pattern: ^[a-fA-F0-9]{24}$
                camp_name:
                  type: string
                  description: New name for the campaign
                status:
                  type: string
                  description: >
                    New campaign status.   One of: `ACTIVE`, `PAUSED`,
                    `INACTIVE`.
                  enum:
                    - ACTIVE
                    - PAUSED
                    - INACTIVE
                schedules:
                  title: ScheduleItem
                  type: object
                  properties:
                    daily_limit:
                      type: integer
                      minimum: 0
                      description: Max total sends per day
                    daily_limit_new_lead:
                      type: integer
                      minimum: 0
                      description: Max new leads per day
                    start_date:
                      type: string
                      pattern: ^\d{4}-\d{2}-\d{2}$
                      description: Campaign start date in YYYY-MM-DD
                    end_date:
                      type: string
                      pattern: ^$|^\d{4}-\d{2}-\d{2}$
                      description: Campaign end date in YYYY-MM-DD or empty string
                    days:
                      type: object
                      minProperties: 1
                      patternProperties:
                        ^[1-7]$:
                          type: boolean
                      additionalProperties: false
                      description: 'Days of week to send: ''1'' = Monday … ''7'' = Sunday'
                      x-apidog-orders: []
                      properties: {}
                      x-apidog-ignore-properties: []
                    timezone:
                      type: string
                      pattern: ^[A-Za-z]+(?:/[A-Za-z_]+){1,2}$
                      description: IANA timezone, e.g. Asia/Hong_Kong
                    timing:
                      type: object
                      properties:
                        from:
                          type: string
                          pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                          description: Send window start time HH:MM (24h)
                        to:
                          type: string
                          pattern: ^(?:[01]\d|2[0-3]):[0-5]\d$
                          description: Send window end time HH:MM (24h)
                      required:
                        - from
                        - to
                      additionalProperties: false
                      x-apidog-orders:
                        - from
                        - to
                      x-apidog-ignore-properties: []
                  required:
                    - daily_limit
                    - days
                    - timezone
                    - timing
                  additionalProperties: false
                  x-apidog-orders:
                    - daily_limit
                    - daily_limit_new_lead
                    - start_date
                    - end_date
                    - days
                    - timezone
                    - timing
                  x-apidog-ignore-properties: []
                sequences:
                  type: array
                  description: >
                    Array of sequence steps.   If non‑empty, `first_wait_time`
                    becomes required.
                  items:
                    type: object
                    properties:
                      step:
                        type: integer
                        description: Sequential step number.
                        minimum: 1
                      wait_time:
                        type: integer
                        description: Day to wait AFTER this step
                        minimum: 0
                      variations:
                        type: array
                        description: One or more email variations for this step.
                        items:
                          type: object
                          x-apidog-refs:
                            01K978BZZAQG101HAXBSK7M0ED:
                              $ref: '#/components/schemas/Variation'
                              x-apidog-overrides:
                                subject: &ref_0
                                  type: string
                                  description: Email subject line. Required for step 1
                          x-apidog-orders:
                            - 01K978BZZAQG101HAXBSK7M0ED
                          properties:
                            variation:
                              type: string
                              description: Variation identifier, e.g. "A" or "B".
                            subject: *ref_0
                            name:
                              type: string
                              description: Optional display name or identifier.
                            body:
                              type: string
                              description: HTML body of the email.
                          required:
                            - variation
                            - name
                            - body
                          x-apidog-ignore-properties:
                            - variation
                            - subject
                            - name
                            - body
                    x-apidog-refs: {}
                    x-apidog-orders:
                      - step
                      - wait_time
                      - variations
                    required:
                      - step
                      - wait_time
                      - variations
                    x-apidog-ignore-properties: []
                first_wait_time:
                  type: integer
                  description: >
                    **Only for subsequence** Initial wait time in days before
                    first sequence step.   
                  minimum: 0
                first_wait_time_unit:
                  type: string
                  enum:
                    - days
                    - minutes
                  x-apidog-enum:
                    - value: days
                      name: ''
                      description: ''
                    - value: minutes
                      name: ''
                      description: ''
                email_accounts:
                  type: array
                  description: >-
                    List of email account IDs or Tags IDs to be added to the
                    campaign
                  items:
                    type: string
                    pattern: ^[a-fA-F0-9]{24}$
                send_priority:
                  type: integer
                  description: >-
                    Send priority (0 = 100% new lead, 1 = 100% follow-ups. 0.5 =
                    equally prioritize between new lead and follow-ups).
                  enum:
                    - 0
                    - 1
                ignore_mailbox_limit:
                  type: integer
                  description: |-
                    **Only for subsequence**
                     Bypass mailbox daily sending limits (0 = no, 1 = yes).
                  enum:
                    - 0
                    - 1
                opportunity_val:
                  type: number
                  description: Opportunity value associated with campaign.
                template_id:
                  type: string
                  description: The email template Id associated to the campaign
                  pattern: ^[a-fA-F0-9]{24}$
                unlink_template:
                  type: string
                  description: Whether to remove the linked template (`yes`/`no`).
                  enum:
                    - 'yes'
                    - 'no'
                stop_on_lead_replied:
                  type: string
                  description: Stop sending emails on reply (`yes`/`no`).
                  enum:
                    - 'yes'
                    - 'no'
                is_emailopened_tracking:
                  type: string
                  description: Open Rate Tracking (`yes`/`no`).
                  enum:
                    - 'yes'
                    - 'no'
                is_unsubscribed_link:
                  type: string
                  description: Unsubscribe link (`yes`/`no`).
                  enum:
                    - 'yes'
                    - 'no'
                send_as_txt:
                  type: string
                  description: Send as Plain Text (`yes`/`no`).
                  enum:
                    - 'yes'
                    - 'no'
                exclude_ooo:
                  type: string
                  description: Continue sending for Out of Office replies (`yes`/`no`).
                  enum:
                    - 'yes'
                    - 'no'
                ooo_nr_opt:
                  type: string
                  description: >-
                    When continue sending for OOO is enabled, next reply option:
                    AI or MAN 
                  enum:
                    - AI
                    - MAN
                  x-apidog-enum:
                    - value: AI
                      name: ''
                      description: AI detects return date
                    - value: MAN
                      name: ''
                      description: Add fixed number of days
                ooo_nr_ai_d:
                  type: string
                  description: >-
                    When AI fails to detect OOO return date, number of fixed day
                    to add
                ooo_nr_d:
                  type: string
                  description: When ooo_nr_opt = "MAN", number of fixed day to add
                is_acc_based_sending:
                  type: string
                  description: Stop sending to same Domain on reply (`yes`/`no`).
                  enum:
                    - 'yes'
                    - 'no'
                is_pause_on_bouncerate:
                  type: string
                  description: Auto-Pause Campaign on High Bounce Rate (`yes`/`no`).
                  enum:
                    - 'yes'
                    - 'no'
                bounce_rate_limit:
                  type: number
                  description: Pause campaign when higher than
                send_risky_email:
                  type: string
                  description: Send to Risky Emails (`yes`/`no`).
                  enum:
                    - 'yes'
                    - 'no'
                unsub_blocklist:
                  type: string
                  description: >-
                    Add Unsubscribed Lead to Workspace's Block List
                    (`yes`/`no`).
                  enum:
                    - 'yes'
                    - 'no'
                other_email_acc:
                  type: string
                  description: Fallback Sending (`yes`/`no`).
                  enum:
                    - 'yes'
                    - 'no'
                is_esp_match:
                  type: string
                  description: ESP matching (`yes`/`no`).
                  enum:
                    - 'yes'
                    - 'no'
                var_sel_type:
                  type: string
                  description: 'Follow-up Variation Selection Mode: R_ROBIN or INIT_STEP_VAR'
                  enum:
                    - R_ROBIN
                    - INIT_STEP_VAR
                  x-apidog-enum:
                    - value: R_ROBIN
                      name: ''
                      description: ''
                    - value: INIT_STEP_VAR
                      name: ''
                      description: ''
                disable_variations:
                  type: string
              x-apidog-orders:
                - workspace_id
                - campaign_id
                - camp_name
                - status
                - schedules
                - sequences
                - first_wait_time
                - first_wait_time_unit
                - email_accounts
                - send_priority
                - ignore_mailbox_limit
                - opportunity_val
                - template_id
                - unlink_template
                - stop_on_lead_replied
                - is_emailopened_tracking
                - is_unsubscribed_link
                - send_as_txt
                - exclude_ooo
                - ooo_nr_opt
                - ooo_nr_ai_d
                - ooo_nr_d
                - is_acc_based_sending
                - is_pause_on_bouncerate
                - bounce_rate_limit
                - send_risky_email
                - unsub_blocklist
                - other_email_acc
                - is_esp_match
                - var_sel_type
                - disable_variations
              x-apidog-ignore-properties: []
            examples:
              full-update:
                value:
                  workspace_id: 68626ec969bf94f59f8c5c9d
                  campaign_id: 68626ec969bf94f59f8c5c9e
                  camp_name: New Campaign Name
                  status: PAUSED
                  schedules:
                    - daily_limit: 1000
                      daily_limit_new_lead: 500
                      start_date: '2025-08-10'
                      end_date: ''
                      days:
                        '1': true
                        '2': true
                        '3': true
                        '4': true
                        '5': true
                      timezone: Asia/Hong_Kong
                      timing:
                        from: '09:00'
                        to: '18:00'
                  sequences:
                    - step: 1
                      wait_time: 1
                      variations:
                        - variation: A
                          subject: this is step 1A Subject
                          name: ''
                          body: <div>this is step 1A body</div>
                        - variation: B
                          subject: this is step 1B Subject
                          name: ''
                          body: <div>this is step 1B body</div>
                    - step: 2
                      wait_time: 1
                      variations:
                        - variation: A
                          subject: ''
                          name: ''
                          body: <div>this is step 2A body</div>
                  first_wait_time: 60
                  email_accounts:
                    - 68626ec969bf94f59f8c5c5e
                    - 68626ec969bf94f59f8c5c2e
                  send_priority: 1
                  ignore_mailbox_limit: 0
                  bounce_rate_limit: 5
                  opportunity_val: 1000
                  template_id: 68626ec969bf94f59f8c5c3e
                  unlink_template: 'no'
                  stop_on_lead_replied: 'yes'
                  is_emailopened_tracking: 'yes'
                  is_unsubscribed_link: 'no'
                  send_as_txt: 'no'
                  exclude_ooo: 'yes'
                  is_acc_based_sending: 'no'
                  is_pause_on_bouncerate: 'yes'
                  send_risky_email: 'no'
                  unsub_blocklist: 'no'
                  other_email_acc: 'no'
                  is_esp_match: 'yes'
                  var_sel_type: R_ROBIN
                  disable_variations:
                    step: 1
                    variation: A
                    is_active: 'no'
                summary: Full update payload with schedule & sequences
      responses:
        '200':
          description: Campaign updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
          headers: {}
          x-apidog-name: OK
        '400':
          description: Invalid request parameters
          headers: {}
          x-apidog-name: Bad Request
        '401':
          description: Unauthorized (invalid/missing API key)
          headers: {}
          x-apidog-name: Unauthorized
        '404':
          description: Campaign or workspace not found
          headers: {}
          x-apidog-name: Record Not Found
        '500':
          description: Internal server error
          headers: {}
          x-apidog-name: Server Error
      security:
        - ApiKeyAuth: []
          x-apidog:
            schemeGroups:
              - id: uS5KiuC4wfZHK42AzOfA_
                schemeIds:
                  - ApiKeyAuth
            required: true
            use:
              id: uS5KiuC4wfZHK42AzOfA_
            scopes:
              uS5KiuC4wfZHK42AzOfA_:
                ApiKeyAuth: []
      x-apidog-folder: Campaign
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/929054/apis/api-19620373-run
components:
  schemas:
    Variation:
      type: object
      description: One variant of an email step.
      required:
        - variation
        - subject
        - name
        - body
      properties:
        variation:
          type: string
          description: Variation identifier, e.g. "A" or "B".
        subject:
          type: string
          description: Email subject line.
        name:
          type: string
          description: Optional display name or identifier.
        body:
          type: string
          description: HTML body of the email.
      x-apidog-orders:
        - variation
        - subject
        - name
        - body
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Campaign:
      type: object
      description: Representation of a campaign.
      properties:
        id:
          type: string
        workspace_id:
          type: string
        camp_name:
          type: string
        status:
          type: string
        updated_at:
          type: string
          format: date-time
      x-apidog-orders:
        - id
        - workspace_id
        - camp_name
        - status
        - updated_at
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    ApiKeyAuth:
      type: apikey
      in: header
      name: x-api-key
      description: |
        API key issued in the PlusVibe dashboard. The server reads it
        from the `x-api-key` header and injects it into the request as
        the `api_key` query parameter, which is why you will see
        `api_key` referenced in validation errors.
    apiKey:
      type: apikey
      in: body
      name: api_key
      description: API key passed in request body
servers:
  - url: https://api.plusvibe.ai/api/v1
    description: Prod Env
security:
  - ApiKeyAuth: []
    x-apidog:
      schemeGroups:
        - id: uS5KiuC4wfZHK42AzOfA_
          schemeIds:
            - ApiKeyAuth
      required: true
      use:
        id: uS5KiuC4wfZHK42AzOfA_
      scopes:
        uS5KiuC4wfZHK42AzOfA_:
          ApiKeyAuth: []

```
