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

# Update Campaign

> Partially updates an existing campaign by campaignId. Only fields provided in the request body are updated — omitted fields remain unchanged. Returns the updated campaign record.



## OpenAPI

````yaml patch /v1/campaigns/{campaignId}
openapi: 3.0.1
info:
  title: SigmaMind APIs
  description: OpenAPI documentation SigmaMind Agent Builder APIs
  version: '1.0'
servers:
  - url: https://api.sigmamind.ai
    description: SigmaMind AI Agent Builder APIs
security:
  - apiKeyAuth: []
tags:
  - name: Chats
    description: >-
      Endpoints for creating and managing text-based chat sessions with an
      agent. A session is started by specifying an agent and an opening message.
      Returns a chatId used in all subsequent get, update, completion, and
      end-session calls.
  - name: Calls
    description: >-
      Endpoints for creating and managing outbound phone calls. A call is
      initiated by specifying an agent, caller number, and destination number —
      dynamic variables can be included to personalise the agent's behaviour.
      Returns a callId used in all subsequent get and delete operations.
  - name: Phone Numbers
    description: >-
      Endpoints for managing phone numbers used in outbound and inbound calls.
      Supports purchasing a new number through SigmaMind or importing an
      existing number via SIP trunking (BYO). Each number can be assigned
      separate inbound and outbound agents.
  - name: Campaigns
    description: >-
      Endpoints for creating and managing outbound call campaigns. A campaign
      dials a CSV-uploaded contact list using a selected agent and caller
      number, with support for immediate or scheduled launch. Returns a
      campaignId used in all subsequent get, update, and delete operations.
  - name: Agents
    description: >-
      Endpoints for creating and managing single prompt agents. An agent is
      configured with a system prompt, voice settings, and optional tools.
      Returns an agentId used in all subsequent update, call, and simulation
      operations.
  - name: Integrations
    description: >-
      Endpoints for creating and managing third-party integrations (e.g.
      Shopify, Cal.com). An integration links your account to an external
      service and acts as the parent resource for auth credentials and API
      tools. Returns an integrationId used in all subsequent auth and tool
      operations.
  - name: Integration Auth
    description: >-
      Endpoints for managing authentication credentials for a third-party
      integration. Supports API Key, Basic, and Bearer token credential types —
      scoped to an integration and injected automatically by tools when
      executing. Returns an authId used in all subsequent get, update, and
      delete operations.
  - name: Integration Tools
    description: >-
      Endpoints for creating and managing API tools backed by a third-party
      integration. Each tool defines an HTTP endpoint, method, and parameter
      schema — scoped to an integration and using its stored auth credentials
      when executing. Returns a toolId used in all subsequent get, update,
      delete, and execute operations.
  - name: Webhooks
    description: >-
      Endpoints for registering and managing webhooks. A webhook delivers
      real-time event notifications via HTTP POST when selected events occur on
      a specific agent — each webhook is scoped to one agent and one or more
      event types. Payloads are signed with an HMAC secret — verify the
      signature on your server to confirm authenticity.
  - name: Test Cases
    description: >-
      Endpoints for creating and managing simulation test cases for an agent. A
      test case defines a conversation scenario — including user persona, goals,
      and expected behaviour — used to generate a synthetic conversation with
      the agent. Returns a testCaseId used in all subsequent get, update,
      delete, and batch-run operations.
  - name: Batch Runs
    description: >-
      Endpoints for creating and managing batch runs of simulation test cases. A
      batch run executes multiple test cases in parallel against a selected
      agent and aggregates the results for review. Returns a batchId used in all
      subsequent get and list test-run operations.
  - name: Test Runs
    description: >-
      Endpoints for retrieving test run results within a batch. Each test run
      represents a single test case execution within a batch run, identified by
      a jobId. Use batchId and agentId to scope results to the correct batch.
  - name: API Keys
    description: >-
      Endpoints for creating and managing API keys used to authenticate public
      API requests. Each key must be included in the X-API-Key request header.
      Returns a keyId used in all subsequent get, revoke, and delete operations.
  - name: QA Rules
    description: >-
      Endpoints for creating and managing quality assurance rules applied to
      agent conversations. A QA rule defines evaluation criteria used to
      automatically assess conversation quality. Returns a qaRuleId used in all
      subsequent get, update,  and delete operations.
  - name: QA Issues
    description: >-
      Endpoints for retrieving and managing quality assurance issues flagged
      across agent conversations. A QA issue is created with status 'Fail' when
      a conversation violates one or more QA rules — capturing the offending
      rule reference. It is created with status 'Success' when the conversation
      passes the evaluation criteria of QA rule(s). Returns a qaIssueId used in
      all subsequent get operations.
paths:
  /v1/campaigns/{campaignId}:
    patch:
      tags:
        - Campaigns
      summary: Update Campaign
      description: >-
        Partially updates an existing campaign by campaignId. Only fields
        provided in the request body are updated — omitted fields remain
        unchanged. Returns the updated campaign record.
      operationId: updateCampaign
      parameters:
        - name: campaignId
          in: path
          description: Unique identifier of the campaign to update.
          required: true
          schema:
            type: string
          example: camp_XiQEBcj9cc5TFRB4
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCampaignRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                default:
                  value:
                    error: Bad Request
                    message: Invalid request parameters
                    path: /v1/campaigns
                    status: 400
                    timestamp: '2026-05-05T10:06:45.996Z'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                default:
                  value:
                    error: Unauthorized
                    message: X-API-Key is missing or invalid
                    path: /v1/campaigns
                    status: 401
                    timestamp: '2026-05-05T10:06:45.996Z'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                default:
                  value:
                    error: Forbidden
                    message: Access denied for this resource
                    path: /v1/campaigns
                    status: 403
                    timestamp: '2026-05-05T10:06:45.996Z'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                default:
                  value:
                    error: Not Found
                    message: The requested resource was not found
                    path: /v1/campaigns
                    status: 404
                    timestamp: '2026-05-05T10:06:45.996Z'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                default:
                  value:
                    error: Conflict
                    message: Conflict with the current state of the resource
                    path: /v1/campaigns
                    status: 409
                    timestamp: '2026-05-05T10:06:45.996Z'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                default:
                  value:
                    error: Internal Server Error
                    message: Unexpected server error
                    path: /v1/campaigns
                    status: 500
                    timestamp: '2026-05-05T10:06:45.996Z'
components:
  schemas:
    UpdateCampaignRequest:
      type: object
      properties:
        campaignName:
          maxLength: 128
          minLength: 1
          type: string
          description: >-
            Display name for this campaign. Used to identify the campaign in
            listings, dashboards, and reports. Must be unique within your
            account.
          example: Q4 Outreach Campaign
        sipPhoneNumber:
          pattern: ^\+[1-9][0-9]{6,14}$
          type: string
          description: >-
            Caller ID phone number used for all outbound calls in this campaign,
            in +E.164 format. Must be a number provisioned in SigmaMind or
            configured via SIP trunking that is enabled for outbound calls. This
            number appears on the recipient's device as the incoming caller.
          example: '+14155552671'
        agentId:
          maxLength: 64
          minLength: 1
          type: string
          description: >-
            Unique identifier of the agent that will handle every call in this
            campaign. The agent controls the conversation flow, scripts, and
            tools used during each call. All contacts in the uploaded CSV will
            be called using this agent.
          example: D5D0p7TUs66TTAEAx
        isScheduled:
          type: boolean
          description: >-
            Whether this campaign should be held and launched at a future date
            and time instead of starting immediately. When true, scheduledDate,
            scheduledTime, and scheduledTimezone are all required. When false or
            omitted, the campaign starts as soon as it is created.
          example: true
        scheduledDate:
          type: string
          description: >-
            Date on which the campaign should launch, in YYYY-MM-DD format.
            Required when isScheduled is true. Ignored when isScheduled is false
            or omitted. Must be a future date.
          format: date
          example: '2025-09-25T00:00:00.000Z'
        scheduledTime:
          type: string
          description: >-
            Time at which the campaign should launch on the scheduled date, in
            HH:mm:ss format. Required when isScheduled is true. Ignored when
            isScheduled is false or omitted. Interpreted in the timezone
            specified by scheduledTimezone.
          format: time
          example: '12:00:00'
        scheduledTimezone:
          type: string
          description: >-
            IANA timezone name used to interpret scheduledDate and
            scheduledTime. Required when isScheduled is true. Ignored when
            isScheduled is false or omitted. Use a valid IANA timezone
            identifier (e.g., 'America/Los_Angeles', 'Europe/London',
            'Asia/Kolkata').
          example: America/Los_Angeles
        concurrentCalls:
          type: integer
          description: >-
            Maximum number of calls the campaign is allowed to have active
            simultaneously. Controls the dialling throughput — a higher value
            dials more contacts in parallel. If omitted, the account default is
            used. Must be a positive integer.
          format: int32
          example: 5
        dynamicVariables:
          type: object
          description: >-
            Default dynamic variable values applied to every call in the
            campaign when the CSV does not supply a value for a given variable.
            Keys must match variable names defined in the agent's configuration.
            Per-contact values in the CSV take precedence over these defaults.
            Leave empty if the CSV provides all required variables.
          example:
            customer_name: Michael
          additionalProperties:
            oneOf:
              - type: string
              - type: number
              - type: boolean
              - type: object
              - type: array
      description: >-
        Request body to update a campaign. A campaign dials a list of phone
        numbers using a selected agent and caller number. The contact list and
        any per-contact dynamic variables are uploaded as a CSV file. Campaigns
        can start immediately or be scheduled for a future date and time.
    CampaignResponse:
      type: object
      properties:
        campaignId:
          type: string
          description: >-
            Unique identifier for this campaign. Use this value as campaignId
            when updating, deleting, or triggering this campaign via the API.
          example: camp_XiQEBcj9cc5TFRB4
        campaignName:
          type: string
          description: >-
            Display name of this campaign as set at creation time. Used to
            identify the campaign in listings and dashboards.
          example: Q4 Outreach Campaign
        campaignStatus:
          type: string
          description: >-
            Current lifecycle state of the campaign. 'live' means the campaign
            is actively dialling contacts. 'scheduled' means the campaign is
            configured to launch at a future date and time. 'paused' means
            dialling has been suspended and can be resumed. 'completed' means
            all contacts have been dialled and the campaign has finished.
          example: live
          enum:
            - live
            - scheduled
            - paused
            - completed
        scheduledDate:
          type: string
          description: >-
            The date and time when this campaign is scheduled to launch,
            including timezone. Present only when isScheduled is true. Null for
            campaigns that started immediately at creation.
          format: date-time
          example: '2025-09-25T19:00:00.000Z'
        concurrentCalls:
          type: integer
          description: >-
            Maximum number of calls allowed to be active simultaneously in this
            campaign. Determines dialling throughput — higher values dial more
            contacts in parallel. Reflects the value set at creation or last
            updated via the update endpoint.
          format: int32
          example: 5
        agent:
          $ref: '#/components/schemas/AgentResponse'
        phoneNumber:
          $ref: '#/components/schemas/PhoneNumberResponse'
        errors:
          type: array
          description: >-
            List of validation errors encountered when processing the campaign's
            contact CSV file. Present only when the upload contained rows with
            invalid phone numbers or missing required variables. Null or empty
            when the file was processed without errors.
          example:
            - 'Row 3: missing required variable ''customer_name'''
            - 'Row 7: invalid phone number ''+1234'''
          items:
            type: string
            description: >-
              List of validation errors encountered when processing the
              campaign's contact CSV file. Present only when the upload
              contained rows with invalid phone numbers or missing required
              variables. Null or empty when the file was processed without
              errors.
            example: >-
              ["Row 3: missing required variable 'customer_name'","Row 7:
              invalid phone number '+1234'"]
        scheduled:
          type: boolean
      description: >-
        Full details of a campaign record. Includes the campaign's identity,
        current status, schedule configuration, the agent handling calls, and
        the caller phone number used to dial contacts.
    Error:
      type: object
      properties:
        timestamp:
          type: string
          description: Error timestamp in ISO format
          format: date-time
        status:
          type: integer
          description: HTTP status code
          example: 400
        error:
          type: string
          description: Error type or HTTP status message
          example: Bad Request
        message:
          type: string
          description: Detailed error message
          example: Email is required
        path:
          type: string
          description: Request path where error occurred
          example: /v1/users
        validationErrors:
          type: object
          description: Field validation errors (if any)
          example: |-
            {
              "email": "Email is required",
              "name": "Name is too short"
            }
      description: Standard error response
    AgentResponse:
      type: object
      properties:
        name:
          type: string
          description: The display name of the assigned agent.
          example: New AI Agent
        agentId:
          type: string
          description: The unique identifier of the agent within the system.
          example: agent_D5D0p7TUs66TTAEAx
        status:
          type: string
          description: The current operational status of the agent.
          example: Live
          enum:
            - Live
            - Testing
            - Disabled
      description: >-
        Agent assigned to handle all calls in this campaign. Contains the
        agent's ID, name, and current status. All contacts in the campaign's
        contact list will be called using this agent.
    PhoneNumberResponse:
      type: object
      properties:
        sipPhoneNumber:
          type: string
          description: >-
            The caller’s phone number in +E.164 format. This number must be
            obtained from SigmaMind or configured using SIP trunking with
            SigmaMind.
          example: '+14155552671'
        provider:
          type: string
          description: The service provider associated with the phone number.
          example: twilio
          enum:
            - twilio
            - telnyx
            - byo
        inboundAgentId:
          type: string
          description: >-
            Default agent ID assigned to handle inbound calls for this phone
            number.
          example: agent_D5D0p7TUs66TTAEAx
        outboundAgentId:
          type: string
          description: >-
            Default agent ID assigned to handle outbound calls for this phone
            number.
          example: agent_D5D0p7TUs66TTAEAx
        outboundPhoneNumber:
          type: string
          description: >-
            The default outbound phone number of the callee, represented in
            +E.164 format
          example: '+14155552671'
        active:
          type: boolean
          description: >-
            Indicates whether the phone number is currently active and available
            for use.
          example: true
        terminationSipURI:
          type: string
          description: >-
            The SIP URI of the phone number, provided by the service provider
            for call termination.
          example: sip.telnyx.com
        friendlyName:
          type: string
          description: A user-friendly display name assigned to this phone number.
          example: Support Line - US
      description: >-
        Caller phone number used to dial contacts in this campaign. This number
        appears as the caller ID on recipients' devices.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      description: >-
        Authenticate every request by passing your API key in the `X-API-Key`
        header. To get your key, go to Dashboard → API Keys and create or copy
        your Production API key.
      name: X-API-Key
      in: header

````