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

# Replace campaign configuration

> Replaces the complete writable campaign configuration using the same relaxed, defaulted schema as campaign creation. No phone number or voice is inferred from the organization. Omitted fields return to their schema defaults, supplied arrays replace existing arrays, empty arrays clear them, and null clears nullable fields. Use PATCH instead when changing only name, phoneNumbers, or webhooks. Lifecycle state is preserved unless the campaign is changed to a trigger campaign, which activates immediately. Ownership, audit, generated credentials, and provider-managed fields are preserved by the server.



## OpenAPI

````yaml https://api.callers.ai/openapi-json put /campaigns/{campaignId}
openapi: 3.0.0
info:
  title: Callers API
  description: API documentation for Callers, providing endpoints for seamless integration.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.callers.ai
security: []
tags: []
paths:
  /campaigns/{campaignId}:
    put:
      tags:
        - Campaigns
      summary: Replace campaign configuration
      description: >-
        Replaces the complete writable campaign configuration using the same
        relaxed, defaulted schema as campaign creation. No phone number or voice
        is inferred from the organization. Omitted fields return to their schema
        defaults, supplied arrays replace existing arrays, empty arrays clear
        them, and null clears nullable fields. Use PATCH instead when changing
        only name, phoneNumbers, or webhooks. Lifecycle state is preserved
        unless the campaign is changed to a trigger campaign, which activates
        immediately. Ownership, audit, generated credentials, and
        provider-managed fields are preserved by the server.
      operationId: CampaignPublicController_replaceCampaign
      parameters:
        - name: campaignId
          required: true
          in: path
          description: ID of the campaign to replace
          schema:
            type: string
            pattern: ^[0-9a-fA-F]{24}$
        - name: x-sub-organization-id
          in: header
          schema:
            type: string
          description: >-
            Optional sub organization ID. Must belong to your main organization
            API key.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CampaignReplacePublicDto'
            examples:
              callCampaign:
                summary: Call campaign with a custom script
                value:
                  name: Customer follow-up calls
                  type: CALL
                  isIncoming: false
                  callParams:
                    voice: 507f1f77bcf86cd799439011
                    phonesFrom:
                      - '+14155552671'
                    language: en-US
                    timezone: America/New_York
                  steps:
                    - id: greeting
                      type: OTHER
                      template: Hello {{name}}, how can I help?
                      meeting: null
                      description: null
      responses:
        '200':
          description: Campaign configuration replaced successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                  data:
                    $ref: '#/components/schemas/CampaignPublicDto'
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
                  data:
                    type: array
                    items:
                      type: object
        '403':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
        '503':
          description: Service Unavailable - feature is currently disabled
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - error
                  message:
                    type: string
      security:
        - Authorization: []
components:
  schemas:
    CampaignReplacePublicDto:
      type: object
      properties:
        name:
          description: Human-readable campaign name. Minimum 3 characters.
          type: string
          minLength: 3
        steps:
          description: >-
            Legacy flat script steps. Use this or nestedSteps; omitted scripts
            receive the standard starter step.
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                nullable: true
              type:
                type: string
                enum:
                  - OTHER
                  - FORWARD
                  - QUESTION
                  - SMS
                  - EMAIL
                  - MEETING
                  - NEXT_STEP
                  - SYSTEM
                  - FUNCTION_CALL
                  - WHATSAPP_TEMPLATE
                  - WIDGET
                x-enumNames:
                  - OTHER
                  - FORWARD
                  - QUESTION
                  - SMS
                  - EMAIL
                  - MEETING
                  - NEXT_STEP
                  - SYSTEM
                  - FUNCTION_CALL
                  - WHATSAPP_TEMPLATE
                  - WIDGET
              template:
                type: string
                default: ''
              title:
                type: string
                nullable: true
              meeting:
                type: object
                properties:
                  eventTypeId:
                    type: string
                    nullable: true
                  daysAhead:
                    type: number
                    minimum: 1
                    exclusiveMinimum: false
                    maximum: 60
                    exclusiveMaximum: false
                    nullable: true
                  noSlotsStrategy:
                    type: string
                    nullable: true
                  noSlotsFallbackText:
                    type: string
                    nullable: true
                required:
                  - daysAhead
                nullable: true
              description:
                type: string
                nullable: true
              data:
                type: object
                properties:
                  template:
                    type: string
                    minLength: 1
                    nullable: true
                  incomingTemplate:
                    type: string
                    minLength: 1
                    nullable: true
                    default: Hi {{ name }}! How are you doing today?
                  phoneNumberType:
                    type: string
                    enum:
                      - Phone Number
                      - Contact Field
                      - SIP URI
                      - Human Agent Queue
                    x-enumNames:
                      - PHONE_NUMBER
                      - CONTACT_FIELD
                      - SIP_URI
                      - HUMAN_AGENT_QUEUE
                    default: Phone Number
                    nullable: true
                  phoneNumber:
                    type: string
                    nullable: true
                  humanAgentQueueId:
                    type: string
                    minLength: 1
                    nullable: true
                  contactAsCallerId:
                    type: boolean
                    default: false
                    nullable: true
                  warmTransfer:
                    type: boolean
                    default: false
                    nullable: true
                  warmTransferPrompt:
                    type: string
                    nullable: true
                  warmTransferAgentOnly:
                    type: boolean
                    default: true
                    nullable: true
                  warmTransferPlayOnDTMF:
                    type: boolean
                    default: false
                    nullable: true
                  whatsappTemplateStatus:
                    type: string
                    nullable: true
                  whatsappTemplateName:
                    type: string
                    nullable: true
                  sendingStrategy:
                    type: string
                    enum:
                      - NODE_REACHED
                      - AFTER_CALL
                    x-enumNames:
                      - NODE_REACHED
                      - AFTER_CALL
                    nullable: true
                    default: NODE_REACHED
                  functionName:
                    type: string
                    minLength: 1
                    nullable: true
                  systemScenario:
                    type: string
                    enum:
                      - GOODBYE
                      - HOLD_ON
                      - USER_WANTS_HANGUP
                      - WRONG_NUMBER
                      - VOICEMAIL_FALLBACK
                      - SCREENING_FALLBACK
                      - SCREENING_FALLBACK_HOLD_ON
                      - SCREENING_HANG_UP
                    x-enumNames:
                      - GOODBYE
                      - HOLD_ON
                      - USER_WANTS_HANGUP
                      - WRONG_NUMBER
                      - VOICEMAIL_FALLBACK
                      - SCREENING_FALLBACK
                      - SCREENING_FALLBACK_HOLD_ON
                      - SCREENING_HANG_UP
                    nullable: true
                  isBackgroundActionRun:
                    type: boolean
                    default: false
                    nullable: true
                  skipAssistantMessage:
                    type: boolean
                    default: false
                    nullable: true
                  type:
                    type: string
                    enum:
                      - FORM
                      - STEPPED
                      - JSON
                    x-enumNames:
                      - FORM
                      - STEPPED
                      - JSON
                    nullable: true
                  formElements:
                    nullable: true
                  formName:
                    type: string
                    nullable: true
                nullable: true
              summary:
                type: array
                items:
                  type: object
                  properties:
                    name:
                      type: string
                      minLength: 1
                    description:
                      type: string
                      nullable: true
                    type:
                      type: string
                      enum:
                        - OPEN_QUESTION
                        - SINGLE_CHOICE
                        - MULTIPLE_CHOICE
                        - YES_NO
                        - NUMBER
                        - DATE
                        - TIME
                        - LINEAR_SCALE
                      x-enumNames:
                        - OPEN_QUESTION
                        - SINGLE_CHOICE
                        - MULTIPLE_CHOICE
                        - YES_NO
                        - NUMBER
                        - DATE
                        - TIME
                        - LINEAR_SCALE
                      nullable: true
                      default: OPEN_QUESTION
                    options:
                      type: array
                      items:
                        type: string
                      nullable: true
                      default: []
                  required:
                    - name
                    - options
              callParams:
                type: object
                properties:
                  minSilenceMsBeforeResponse:
                    type: integer
                    minimum: 0
                    exclusiveMinimum: false
                    nullable: true
                  detectInterruption:
                    type: boolean
                    default: true
                  noInterruptionOnce:
                    type: boolean
                    default: false
                  enableKeypadInput:
                    type: boolean
                    default: false
                required:
                  - minSilenceMsBeforeResponse
                nullable: true
              scriptUpdateRules:
                type: array
                items:
                  type: object
                  properties:
                    event:
                      type: object
                      properties:
                        type:
                          type: string
                      required:
                        - type
                    action:
                      type: object
                      properties:
                        type:
                          type: string
                        target:
                          type: object
                          properties:
                            id:
                              type: string
                            type:
                              type: string
                          required:
                            - id
                            - type
                          nullable: true
                      required:
                        - type
                  required:
                    - event
                    - action
                nullable: true
              emailData:
                type: object
                properties:
                  subject:
                    type: string
                    nullable: true
                  body:
                    type: string
                    default: ''
                  attachments:
                    nullable: true
                  prompt:
                    type: string
                    nullable: true
                  tone:
                    type: string
                    enum:
                      - default
                      - direct
                      - formal
                      - casual
                      - creative
                      - based_on_contact
                    x-enumNames:
                      - DEFAULT
                      - DIRECT
                      - FORMAL
                      - CASUAL
                      - CREATIVE
                      - BASED_ON_CONTACT
                    nullable: true
                  contentMode:
                    type: string
                    enum:
                      - HUMAN_TEMPLATE
                      - AI_TEMPLATE
                    x-enumNames:
                      - HUMAN_TEMPLATE
                      - AI_TEMPLATE
                    nullable: true
                  includeSignature:
                    type: boolean
                    nullable: true
                  signatureId:
                    type: string
                    nullable: true
                  isSubjectOverridden:
                    type: boolean
                    nullable: true
                required:
                  - prompt
                  - tone
                  - contentMode
                  - includeSignature
                  - signatureId
                  - isSubjectOverridden
                nullable: true
            required:
              - type
              - meeting
              - description
              - callParams
              - emailData
          default:
            - id: VroLPP3
              type: OTHER
              template: Hello, is this {{ name }} ?
              meeting: null
              description: null
              data: null
              summary: []
        nestedSteps:
          description: >-
            Hierarchical script nodes containing prompts, actions, transfers,
            forms, and meetings.
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                minLength: 1
              title:
                type: string
                minLength: 1
              steps:
                type: array
                minItems: 1
                items:
                  type: object
                  properties:
                    id:
                      type: string
                      nullable: true
                    type:
                      type: string
                      enum:
                        - OTHER
                        - FORWARD
                        - QUESTION
                        - SMS
                        - EMAIL
                        - MEETING
                        - NEXT_STEP
                        - SYSTEM
                        - FUNCTION_CALL
                        - WHATSAPP_TEMPLATE
                        - WIDGET
                      x-enumNames:
                        - OTHER
                        - FORWARD
                        - QUESTION
                        - SMS
                        - EMAIL
                        - MEETING
                        - NEXT_STEP
                        - SYSTEM
                        - FUNCTION_CALL
                        - WHATSAPP_TEMPLATE
                        - WIDGET
                    template:
                      type: string
                      default: ''
                    title:
                      type: string
                      nullable: true
                    meeting:
                      type: object
                      properties:
                        eventTypeId:
                          type: string
                          nullable: true
                        daysAhead:
                          type: number
                          minimum: 1
                          exclusiveMinimum: false
                          maximum: 60
                          exclusiveMaximum: false
                          nullable: true
                        noSlotsStrategy:
                          type: string
                          nullable: true
                        noSlotsFallbackText:
                          type: string
                          nullable: true
                      required:
                        - daysAhead
                      nullable: true
                    description:
                      type: string
                      nullable: true
                    data:
                      type: object
                      properties:
                        template:
                          type: string
                          minLength: 1
                          nullable: true
                        incomingTemplate:
                          type: string
                          minLength: 1
                          nullable: true
                          default: Hi {{ name }}! How are you doing today?
                        phoneNumberType:
                          type: string
                          enum:
                            - Phone Number
                            - Contact Field
                            - SIP URI
                            - Human Agent Queue
                          x-enumNames:
                            - PHONE_NUMBER
                            - CONTACT_FIELD
                            - SIP_URI
                            - HUMAN_AGENT_QUEUE
                          default: Phone Number
                          nullable: true
                        phoneNumber:
                          type: string
                          nullable: true
                        humanAgentQueueId:
                          type: string
                          minLength: 1
                          nullable: true
                        contactAsCallerId:
                          type: boolean
                          default: false
                          nullable: true
                        warmTransfer:
                          type: boolean
                          default: false
                          nullable: true
                        warmTransferPrompt:
                          type: string
                          nullable: true
                        warmTransferAgentOnly:
                          type: boolean
                          default: true
                          nullable: true
                        warmTransferPlayOnDTMF:
                          type: boolean
                          default: false
                          nullable: true
                        whatsappTemplateStatus:
                          type: string
                          nullable: true
                        whatsappTemplateName:
                          type: string
                          nullable: true
                        sendingStrategy:
                          type: string
                          enum:
                            - NODE_REACHED
                            - AFTER_CALL
                          x-enumNames:
                            - NODE_REACHED
                            - AFTER_CALL
                          nullable: true
                          default: NODE_REACHED
                        functionName:
                          type: string
                          minLength: 1
                          nullable: true
                        systemScenario:
                          type: string
                          enum:
                            - GOODBYE
                            - HOLD_ON
                            - USER_WANTS_HANGUP
                            - WRONG_NUMBER
                            - VOICEMAIL_FALLBACK
                            - SCREENING_FALLBACK
                            - SCREENING_FALLBACK_HOLD_ON
                            - SCREENING_HANG_UP
                          x-enumNames:
                            - GOODBYE
                            - HOLD_ON
                            - USER_WANTS_HANGUP
                            - WRONG_NUMBER
                            - VOICEMAIL_FALLBACK
                            - SCREENING_FALLBACK
                            - SCREENING_FALLBACK_HOLD_ON
                            - SCREENING_HANG_UP
                          nullable: true
                        isBackgroundActionRun:
                          type: boolean
                          default: false
                          nullable: true
                        skipAssistantMessage:
                          type: boolean
                          default: false
                          nullable: true
                        type:
                          type: string
                          enum:
                            - FORM
                            - STEPPED
                            - JSON
                          x-enumNames:
                            - FORM
                            - STEPPED
                            - JSON
                          nullable: true
                        formElements:
                          nullable: true
                        formName:
                          type: string
                          nullable: true
                      nullable: true
                    summary:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                            minLength: 1
                          description:
                            type: string
                            nullable: true
                          type:
                            type: string
                            enum:
                              - OPEN_QUESTION
                              - SINGLE_CHOICE
                              - MULTIPLE_CHOICE
                              - YES_NO
                              - NUMBER
                              - DATE
                              - TIME
                              - LINEAR_SCALE
                            x-enumNames:
                              - OPEN_QUESTION
                              - SINGLE_CHOICE
                              - MULTIPLE_CHOICE
                              - YES_NO
                              - NUMBER
                              - DATE
                              - TIME
                              - LINEAR_SCALE
                            nullable: true
                            default: OPEN_QUESTION
                          options:
                            type: array
                            items:
                              type: string
                            nullable: true
                            default: []
                        required:
                          - name
                          - options
                    callParams:
                      type: object
                      properties:
                        minSilenceMsBeforeResponse:
                          type: integer
                          minimum: 0
                          exclusiveMinimum: false
                          nullable: true
                        detectInterruption:
                          type: boolean
                          default: true
                        noInterruptionOnce:
                          type: boolean
                          default: false
                        enableKeypadInput:
                          type: boolean
                          default: false
                      required:
                        - minSilenceMsBeforeResponse
                      nullable: true
                    scriptUpdateRules:
                      type: array
                      items:
                        type: object
                        properties:
                          event:
                            type: object
                            properties:
                              type:
                                type: string
                            required:
                              - type
                          action:
                            type: object
                            properties:
                              type:
                                type: string
                              target:
                                type: object
                                properties:
                                  id:
                                    type: string
                                  type:
                                    type: string
                                required:
                                  - id
                                  - type
                                nullable: true
                            required:
                              - type
                        required:
                          - event
                          - action
                      nullable: true
                    emailData:
                      type: object
                      properties:
                        subject:
                          type: string
                          nullable: true
                        body:
                          type: string
                          default: ''
                        attachments:
                          nullable: true
                        prompt:
                          type: string
                          nullable: true
                        tone:
                          type: string
                          enum:
                            - default
                            - direct
                            - formal
                            - casual
                            - creative
                            - based_on_contact
                          x-enumNames:
                            - DEFAULT
                            - DIRECT
                            - FORMAL
                            - CASUAL
                            - CREATIVE
                            - BASED_ON_CONTACT
                          nullable: true
                        contentMode:
                          type: string
                          enum:
                            - HUMAN_TEMPLATE
                            - AI_TEMPLATE
                          x-enumNames:
                            - HUMAN_TEMPLATE
                            - AI_TEMPLATE
                          nullable: true
                        includeSignature:
                          type: boolean
                          nullable: true
                        signatureId:
                          type: string
                          nullable: true
                        isSubjectOverridden:
                          type: boolean
                          nullable: true
                      required:
                        - prompt
                        - tone
                        - contentMode
                        - includeSignature
                        - signatureId
                        - isSubjectOverridden
                      nullable: true
                  required:
                    - type
                    - meeting
                    - description
                    - callParams
                    - emailData
              scriptUpdateRules:
                type: array
                items:
                  type: object
                  properties:
                    event:
                      type: object
                      properties:
                        type:
                          type: string
                      required:
                        - type
                    action:
                      type: object
                      properties:
                        type:
                          type: string
                        target:
                          type: object
                          properties:
                            id:
                              type: string
                            type:
                              type: string
                          required:
                            - id
                            - type
                          nullable: true
                      required:
                        - type
                  required:
                    - event
                    - action
                nullable: true
              nestedScriptHead:
                description: >-
                  Marks this node as a nested script (collapsible sub-tree in
                  the UI). If true in the current campaign, you MUST include it
                  as true. Omit this property entirely when it is not true — do
                  not set it to false.
                type: boolean
                nullable: true
            required:
              - id
              - title
              - steps
          default: []
        edges:
          description: Directed graph edges connecting script and nested-script nodes.
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                minLength: 1
              source:
                type: string
                minLength: 1
              target:
                type: string
                minLength: 1
              goTo:
                type: boolean
                default: false
                nullable: true
              additionalInstructions:
                type: string
                default: ''
                nullable: true
            required:
              - id
              - source
              - target
              - additionalInstructions
          default: []
        fallbacks:
          description: Fallback behavior for silence, errors, retries, and unhandled input.
          type: array
          items:
            type: object
            properties:
              input:
                type: string
                minLength: 1
              output:
                oneOf:
                  - type: string
                    minLength: 1
                  - type: array
                    minItems: 1
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          nullable: true
                        type:
                          type: string
                          enum:
                            - OTHER
                            - FORWARD
                            - QUESTION
                            - SMS
                            - EMAIL
                            - MEETING
                            - NEXT_STEP
                            - SYSTEM
                            - FUNCTION_CALL
                            - WHATSAPP_TEMPLATE
                            - WIDGET
                          x-enumNames:
                            - OTHER
                            - FORWARD
                            - QUESTION
                            - SMS
                            - EMAIL
                            - MEETING
                            - NEXT_STEP
                            - SYSTEM
                            - FUNCTION_CALL
                            - WHATSAPP_TEMPLATE
                            - WIDGET
                        template:
                          type: string
                          default: ''
                        title:
                          type: string
                          nullable: true
                        meeting:
                          type: object
                          properties:
                            eventTypeId:
                              type: string
                              nullable: true
                            daysAhead:
                              type: number
                              minimum: 1
                              exclusiveMinimum: false
                              maximum: 60
                              exclusiveMaximum: false
                              nullable: true
                            noSlotsStrategy:
                              type: string
                              nullable: true
                            noSlotsFallbackText:
                              type: string
                              nullable: true
                          required:
                            - daysAhead
                          nullable: true
                        description:
                          type: string
                          nullable: true
                        data:
                          type: object
                          properties:
                            template:
                              type: string
                              minLength: 1
                              nullable: true
                            incomingTemplate:
                              type: string
                              minLength: 1
                              nullable: true
                              default: Hi {{ name }}! How are you doing today?
                            phoneNumberType:
                              type: string
                              enum:
                                - Phone Number
                                - Contact Field
                                - SIP URI
                                - Human Agent Queue
                              x-enumNames:
                                - PHONE_NUMBER
                                - CONTACT_FIELD
                                - SIP_URI
                                - HUMAN_AGENT_QUEUE
                              default: Phone Number
                              nullable: true
                            phoneNumber:
                              type: string
                              nullable: true
                            humanAgentQueueId:
                              type: string
                              minLength: 1
                              nullable: true
                            contactAsCallerId:
                              type: boolean
                              default: false
                              nullable: true
                            warmTransfer:
                              type: boolean
                              default: false
                              nullable: true
                            warmTransferPrompt:
                              type: string
                              nullable: true
                            warmTransferAgentOnly:
                              type: boolean
                              default: true
                              nullable: true
                            warmTransferPlayOnDTMF:
                              type: boolean
                              default: false
                              nullable: true
                            whatsappTemplateStatus:
                              type: string
                              nullable: true
                            whatsappTemplateName:
                              type: string
                              nullable: true
                            sendingStrategy:
                              type: string
                              enum:
                                - NODE_REACHED
                                - AFTER_CALL
                              x-enumNames:
                                - NODE_REACHED
                                - AFTER_CALL
                              nullable: true
                              default: NODE_REACHED
                            functionName:
                              type: string
                              minLength: 1
                              nullable: true
                            systemScenario:
                              type: string
                              enum:
                                - GOODBYE
                                - HOLD_ON
                                - USER_WANTS_HANGUP
                                - WRONG_NUMBER
                                - VOICEMAIL_FALLBACK
                                - SCREENING_FALLBACK
                                - SCREENING_FALLBACK_HOLD_ON
                                - SCREENING_HANG_UP
                              x-enumNames:
                                - GOODBYE
                                - HOLD_ON
                                - USER_WANTS_HANGUP
                                - WRONG_NUMBER
                                - VOICEMAIL_FALLBACK
                                - SCREENING_FALLBACK
                                - SCREENING_FALLBACK_HOLD_ON
                                - SCREENING_HANG_UP
                              nullable: true
                            isBackgroundActionRun:
                              type: boolean
                              default: false
                              nullable: true
                            skipAssistantMessage:
                              type: boolean
                              default: false
                              nullable: true
                            type:
                              type: string
                              enum:
                                - FORM
                                - STEPPED
                                - JSON
                              x-enumNames:
                                - FORM
                                - STEPPED
                                - JSON
                              nullable: true
                            formElements:
                              nullable: true
                            formName:
                              type: string
                              nullable: true
                          nullable: true
                        summary:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                                minLength: 1
                              description:
                                type: string
                                nullable: true
                              type:
                                type: string
                                enum:
                                  - OPEN_QUESTION
                                  - SINGLE_CHOICE
                                  - MULTIPLE_CHOICE
                                  - YES_NO
                                  - NUMBER
                                  - DATE
                                  - TIME
                                  - LINEAR_SCALE
                                x-enumNames:
                                  - OPEN_QUESTION
                                  - SINGLE_CHOICE
                                  - MULTIPLE_CHOICE
                                  - YES_NO
                                  - NUMBER
                                  - DATE
                                  - TIME
                                  - LINEAR_SCALE
                                nullable: true
                                default: OPEN_QUESTION
                              options:
                                type: array
                                items:
                                  type: string
                                nullable: true
                                default: []
                            required:
                              - name
                              - options
                        callParams:
                          type: object
                          properties:
                            minSilenceMsBeforeResponse:
                              type: integer
                              minimum: 0
                              exclusiveMinimum: false
                              nullable: true
                            detectInterruption:
                              type: boolean
                              default: true
                            noInterruptionOnce:
                              type: boolean
                              default: false
                            enableKeypadInput:
                              type: boolean
                              default: false
                          required:
                            - minSilenceMsBeforeResponse
                          nullable: true
                        scriptUpdateRules:
                          type: array
                          items:
                            type: object
                            properties:
                              event:
                                type: object
                                properties:
                                  type:
                                    type: string
                                required:
                                  - type
                              action:
                                type: object
                                properties:
                                  type:
                                    type: string
                                  target:
                                    type: object
                                    properties:
                                      id:
                                        type: string
                                      type:
                                        type: string
                                    required:
                                      - id
                                      - type
                                    nullable: true
                                required:
                                  - type
                            required:
                              - event
                              - action
                          nullable: true
                        emailData:
                          type: object
                          properties:
                            subject:
                              type: string
                              nullable: true
                            body:
                              type: string
                              default: ''
                            attachments:
                              nullable: true
                            prompt:
                              type: string
                              nullable: true
                            tone:
                              type: string
                              enum:
                                - default
                                - direct
                                - formal
                                - casual
                                - creative
                                - based_on_contact
                              x-enumNames:
                                - DEFAULT
                                - DIRECT
                                - FORMAL
                                - CASUAL
                                - CREATIVE
                                - BASED_ON_CONTACT
                              nullable: true
                            contentMode:
                              type: string
                              enum:
                                - HUMAN_TEMPLATE
                                - AI_TEMPLATE
                              x-enumNames:
                                - HUMAN_TEMPLATE
                                - AI_TEMPLATE
                              nullable: true
                            includeSignature:
                              type: boolean
                              nullable: true
                            signatureId:
                              type: string
                              nullable: true
                            isSubjectOverridden:
                              type: boolean
                              nullable: true
                          required:
                            - prompt
                            - tone
                            - contentMode
                            - includeSignature
                            - signatureId
                            - isSubjectOverridden
                          nullable: true
                      required:
                        - type
                        - meeting
                        - description
                        - callParams
                        - emailData
              scriptUpdateRules:
                type: array
                items:
                  type: object
                  properties:
                    event:
                      type: object
                      properties:
                        type:
                          type: string
                      required:
                        - type
                    action:
                      type: object
                      properties:
                        type:
                          type: string
                        target:
                          type: object
                          properties:
                            id:
                              type: string
                            type:
                              type: string
                          required:
                            - id
                            - type
                          nullable: true
                      required:
                        - type
                  required:
                    - event
                    - action
                nullable: true
            required:
              - input
              - output
          default: []
        interestCriteria:
          type: string
          nullable: true
          default: null
        interestCriteriaV2:
          description: >-
            Interest classification criteria. Include a non-empty value when
            defining a custom criterion.
          type: object
          properties:
            value:
              type: string
              nullable: true
            successCriteria:
              type: object
              properties:
                interested:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                      type:
                        type: string
                        enum:
                          - INTERESTED
                          - NOT_INTERESTED
                        x-enumNames:
                          - INTERESTED
                          - NOT_INTERESTED
                      order:
                        type: number
                      default:
                        type: boolean
                        nullable: true
                    required:
                      - name
                      - description
                      - type
                      - order
                      - default
                  default: []
                notInterested:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      description:
                        type: string
                      type:
                        type: string
                        enum:
                          - INTERESTED
                          - NOT_INTERESTED
                        x-enumNames:
                          - INTERESTED
                          - NOT_INTERESTED
                      order:
                        type: number
                      default:
                        type: boolean
                        nullable: true
                    required:
                      - name
                      - description
                      - type
                      - order
                      - default
                  default: []
              nullable: true
            updatedAt:
              oneOf:
                - type: string
                - {}
              nullable: true
            isReviewed:
              type: boolean
          nullable: true
        webhookUrl:
          type: string
          nullable: true
        slackUrl:
          type: string
          nullable: true
        webhookStatuses:
          type: array
          items:
            type: string
          default:
            - INTERESTED
            - NOT_INTERESTED
            - CALL_ME_LATER
            - WRONG_NUMBER
            - DO_NOT_CALL
            - COMPLETED
        webhookEvents:
          type: array
          items:
            type: string
          default:
            - POST_PROCESSING_FINISHED:INTERESTED
            - POST_PROCESSING_FINISHED:NOT_INTERESTED
            - POST_PROCESSING_FINISHED:CALL_ME_LATER
            - POST_PROCESSING_FINISHED:WRONG_NUMBER
            - POST_PROCESSING_FINISHED:DO_NOT_CALL
        webhooks:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                maxLength: 30
                nullable: true
              url:
                type: string
                nullable: true
              events:
                type: array
                items:
                  type: string
                default:
                  - POST_PROCESSING_FINISHED:INTERESTED
                  - POST_PROCESSING_FINISHED:NOT_INTERESTED
                  - POST_PROCESSING_FINISHED:CALL_ME_LATER
                  - POST_PROCESSING_FINISHED:WRONG_NUMBER
                  - POST_PROCESSING_FINISHED:DO_NOT_CALL
              isAdvanced:
                type: boolean
                default: false
                nullable: true
              advancedWebhook:
                type: object
                properties:
                  url:
                    type: string
                    format: uri
                    nullable: true
                  method:
                    type: string
                    enum:
                      - GET
                      - POST
                      - PUT
                      - DELETE
                      - PATCH
                    x-enumNames:
                      - GET
                      - POST
                      - PUT
                      - DELETE
                      - PATCH
                    nullable: true
                  headers:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        value:
                          type: string
                        enabled:
                          type: boolean
                      required:
                        - name
                        - value
                    nullable: true
                  parameters:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        value:
                          type: string
                        enabled:
                          type: boolean
                      required:
                        - name
                        - value
                    nullable: true
                  body:
                    type: string
                    nullable: true
                  payload:
                    type: object
                    additionalProperties: {}
                  isBranded:
                    type: boolean
                  apiData:
                    type: object
                    properties:
                      method:
                        type: string
                        enum:
                          - GET
                          - POST
                          - PUT
                          - DELETE
                          - PATCH
                        x-enumNames:
                          - GET
                          - POST
                          - PUT
                          - DELETE
                          - PATCH
                        default: GET
                      url:
                        type: string
                        default: ''
                      headers:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            value:
                              type: string
                          required:
                            - name
                            - value
                        default: []
                      parameters:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            value:
                              type: string
                          required:
                            - name
                            - value
                        default: []
                      body:
                        type: string
                      outputParamsSchema:
                        type: string
                      ignoreResponse:
                        type: boolean
                        default: false
                      useRSASignature:
                        type: boolean
                    nullable: true
                  apiType:
                    type: string
                    enum:
                      - EXTERNAL
                      - ACTIVE_PIECE
                      - SYNTHETIC_SYSTEM_API_CALL
                    x-enumNames:
                      - EXTERNAL
                      - ACTIVE_PIECE
                      - SYNTHETIC_SYSTEM_API_CALL
                    default: EXTERNAL
                  activePieceData:
                    type: object
                    properties:
                      id:
                        type: string
                        minLength: 1
                      connectionId:
                        type: string
                        nullable: true
                      requestData:
                        default: {}
                      pieceVersion:
                        type: string
                        nullable: true
                      signRequest:
                        oneOf:
                          - type: boolean
                          - type: string
                        nullable: true
                      actionId:
                        type: string
                        minLength: 1
                    required:
                      - id
                      - actionId
                    nullable: true
                  outputParamsSchema:
                    type: string
                  ignoreResponse:
                    type: boolean
                  testResponse:
                    nullable: true
                  contactMapper:
                    type: object
                    additionalProperties:
                      type: string
                    nullable: true
                  functionDefinition:
                    type: object
                    properties:
                      parameters:
                        type: object
                        properties:
                          type:
                            type: string
                            default: object
                          properties:
                            type: object
                            additionalProperties:
                              type: object
                              properties:
                                type:
                                  type: string
                                description:
                                  type: string
                              required:
                                - type
                                - description
                          required:
                            type: array
                            items:
                              type: string
                              pattern: ^[a-z][a-zA-Z0-9_]*$
                            default: []
                          additionalProperties:
                            type: boolean
                            default: false
                        required:
                          - properties
                    required:
                      - parameters
                    nullable: true
                nullable: true
          default: []
        slackStatuses:
          type: array
          items:
            type: string
          default:
            - INTERESTED
            - NOT_INTERESTED
            - CALL_ME_LATER
            - WRONG_NUMBER
            - DO_NOT_CALL
            - COMPLETED
        slackEvents:
          type: array
          items:
            type: string
          default: []
        isIncoming:
          description: >-
            Whether interactions are initiated by the customer. Defaults to
            false.
          type: boolean
          nullable: true
          default: false
        scriptVariables:
          type: array
          items:
            type: string
          default: []
        scriptVariablesV2:
          description: Typed script variables. Omit to receive direction-aware defaults.
          type: array
          items:
            type: object
            properties:
              variableName:
                type: string
                minLength: 1
              required:
                type: boolean
              source:
                type: string
                nullable: true
            required:
              - variableName
              - required
        maxIncomingSlots:
          type: number
          minimum: 1
          exclusiveMinimum: false
          maximum: 20
          exclusiveMaximum: false
          default: 2
        callParams:
          description: >-
            Call, speech, scheduling, retry, recording, voicemail, web-call, and
            model settings. Nested fields use the same defaults as the UI.
          type: object
          properties:
            timezone:
              type: string
              nullable: true
              default: UTC
            allowIncomingCalls:
              type: boolean
              default: false
            acceptWebCalls:
              type: boolean
              default: false
            webCallWorkingHoursOnly:
              type: boolean
              default: false
            webCallTheme:
              type: object
              properties:
                base:
                  type: string
                  enum:
                    - light
                    - dark
              required:
                - base
              nullable: true
            webCallThemeId:
              type: string
              pattern: ^[0-9a-fA-F]{24}$
              nullable: true
            closeWidgetFormOnNextTranscriptMessage:
              type: boolean
              default: false
            detectInterruption:
              type: boolean
              default: true
            enableKeypadInput:
              type: boolean
              default: false
            smartInterruptionDelayEnabled:
              type: boolean
              default: true
            afterInterruptionDelay:
              type: number
              minimum: 0
              exclusiveMinimum: false
              default: 0.5
            detectSilence:
              type: boolean
              default: true
            detectHangup:
              type: boolean
              default: true
            retryDailyAttempts:
              type: number
              nullable: true
              default: 3
            retryDailyAttemptsSchedule:
              type: array
              items:
                type: object
                properties:
                  from:
                    type: number
                  to:
                    type: number
                  value:
                    type: number
                required:
                  - from
                  - value
              default: []
            detectShortSilenceSeconds:
              type: integer
              minimum: 0
              exclusiveMinimum: false
              default: 8
            detectHangupSilenceSeconds:
              type: integer
              minimum: 0
              exclusiveMinimum: false
              default: 13
            detectHangupUserRequestCount:
              type: integer
              minimum: 0.01
              exclusiveMinimum: false
              default: 20
            goodbyeUserRequestCount:
              type: integer
              minimum: 0
              exclusiveMinimum: false
              default: 4
            minSilenceMsBeforeResponse:
              type: integer
              minimum: 0
              exclusiveMinimum: false
              default: 1000
            voiceActivationDetection:
              type: integer
              minimum: 0
              exclusiveMinimum: false
              default: 10
            recognizedEventHandlingDelay:
              type: integer
              minimum: 0
              exclusiveMinimum: false
              default: 0
            retryAttempts:
              type: number
              default: 5
            recognizedEventConfidenceThreshold:
              type: number
              minimum: 0
              exclusiveMinimum: false
              maximum: 1
              exclusiveMaximum: false
              default: 0.6
            recognizingEventConfidenceThreshold:
              type: number
              minimum: 0
              exclusiveMinimum: false
              maximum: 1
              exclusiveMaximum: false
              default: 0.5
            lowConfidenceDurationThreshold:
              type: number
              minimum: 0
              exclusiveMinimum: false
              default: 250
            retryIntervalMinutes:
              type: number
              default: 90
            temperature:
              type: number
              minimum: 0
              exclusiveMinimum: false
              maximum: 1
              exclusiveMaximum: false
              default: 0.25
            voice:
              type: string
              nullable: true
            phonesFrom:
              type: array
              items:
                type: string
              default: []
            endTime:
              type: string
              nullable: true
              default: '17:00'
            startTime:
              type: string
              nullable: true
              default: '09:00'
            daysOfWeek:
              type: array
              items:
                oneOf:
                  - type: string
                    enum:
                      - Sunday
                  - type: string
                    enum:
                      - Monday
                  - type: string
                    enum:
                      - Tuesday
                  - type: string
                    enum:
                      - Wednesday
                  - type: string
                    enum:
                      - Thursday
                  - type: string
                    enum:
                      - Friday
                  - type: string
                    enum:
                      - Saturday
              default:
                - Monday
                - Tuesday
                - Wednesday
                - Thursday
                - Friday
            availabilitySchedule:
              type: array
              items:
                type: object
                properties:
                  dayOfWeek:
                    oneOf:
                      - type: string
                        enum:
                          - Sunday
                      - type: string
                        enum:
                          - Monday
                      - type: string
                        enum:
                          - Tuesday
                      - type: string
                        enum:
                          - Wednesday
                      - type: string
                        enum:
                          - Thursday
                      - type: string
                        enum:
                          - Friday
                      - type: string
                        enum:
                          - Saturday
                  timeSlots:
                    type: array
                    items:
                      type: object
                      properties:
                        startTime:
                          type: string
                          default: '09:00'
                        endTime:
                          type: string
                          default: '17:00'
                required:
                  - dayOfWeek
                  - timeSlots
              default:
                - dayOfWeek: Monday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
                - dayOfWeek: Tuesday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
                - dayOfWeek: Wednesday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
                - dayOfWeek: Thursday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
                - dayOfWeek: Friday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
            recordIncomingCall:
              type: boolean
              default: true
            recordOutgoingCall:
              type: boolean
              default: true
            stopRecordingOnTransfer:
              type: boolean
              default: false
            models:
              type: object
              properties:
                outgoingConversationModelIds:
                  type: array
                  items:
                    type: string
                  default: []
                stageModelIds:
                  type: array
                  items:
                    type: string
                  default: []
                voicemailModelIds:
                  type: array
                  items:
                    type: string
                  default: []
                postProcessingVoicemailModelIds:
                  type: array
                  items:
                    type: string
                  nullable: true
                  default: []
                prePostProcessingModelIds:
                  type: array
                  items:
                    type: string
                  default: []
                pronunciationModelIds:
                  type: array
                  items:
                    type: string
                  default: []
                incomingConversationModelIds:
                  type: array
                  items:
                    type: string
                  default: []
                embeddingsModelIds:
                  type: array
                  items:
                    type: string
                  default: []
                kbContentSplittingModelIds:
                  type: array
                  items:
                    type: string
                  default: []
                warmTransferModelIds:
                  type: array
                  items:
                    type: string
                  default: []
                phoneNumberPredictionsModelIds:
                  type: array
                  items:
                    type: string
                  default: []
              default:
                outgoingConversationModelIds: []
                stageModelIds: []
                voicemailModelIds: []
                postProcessingVoicemailModelIds: []
                prePostProcessingModelIds: []
                pronunciationModelIds: []
                incomingConversationModelIds: []
                embeddingsModelIds: []
                kbContentSplittingModelIds: []
                warmTransferModelIds: []
                phoneNumberPredictionsModelIds: []
            modelContainersSettings:
              type: object
              properties:
                outgoingConversationModel:
                  type: object
                  properties:
                    loops:
                      type: number
                      nullable: true
                  nullable: true
                incomingConversationModel:
                  type: object
                  properties:
                    loops:
                      type: number
                      nullable: true
                  nullable: true
                stageModel:
                  type: object
                  properties:
                    loops:
                      type: number
                      nullable: true
                  nullable: true
                voicemailModel:
                  type: object
                  properties:
                    loops:
                      type: number
                      nullable: true
                  nullable: true
                postProcessingVoicemailModel:
                  type: object
                  properties:
                    loops:
                      type: number
                      nullable: true
                  nullable: true
                prePostProcessingModel:
                  type: object
                  properties:
                    loops:
                      type: number
                      nullable: true
                  nullable: true
                pronunciationModel:
                  type: object
                  properties:
                    loops:
                      type: number
                      nullable: true
                  nullable: true
                embeddingsModel:
                  type: object
                  properties:
                    loops:
                      type: number
                      nullable: true
                  nullable: true
                kbContentSplittingModel:
                  type: object
                  properties:
                    loops:
                      type: number
                      nullable: true
                  nullable: true
                generateScriptModel:
                  type: object
                  properties:
                    loops:
                      type: number
                      nullable: true
                  nullable: true
                scriptProcessingModel:
                  type: object
                  properties:
                    loops:
                      type: number
                      nullable: true
                  nullable: true
                warmTransferModel:
                  type: object
                  properties:
                    loops:
                      type: number
                      nullable: true
                  nullable: true
              nullable: true
            notifyRecording:
              type: boolean
              default: false
            notifyRecordingFile:
              type: string
              nullable: true
            preloadGreetingEnabled:
              type: boolean
              default: true
            preloadGreetingUninterruptible:
              type: boolean
              default: false
            ignoreUserSpeechBeforeGreeting:
              type: boolean
              default: false
            beforeGreetingTimeout:
              type: number
              minimum: 1
              exclusiveMinimum: false
              nullable: true
            checkDoNotCall:
              type: boolean
              default: false
            checkStateDoNotCall:
              type: boolean
              default: false
            twilioVoiceMailDetection:
              type: boolean
              default: true
            voxiaVoiceMailDetection:
              type: boolean
              default: true
            voiceMailFallbackEnabled:
              type: boolean
              default: false
            delayBeforeVoiceMailCheckSeconds:
              type: integer
              minimum: 5
              exclusiveMinimum: false
              default: 10
            detectAiScreening:
              type: boolean
              default: false
              nullable: true
            aiScreeningResponseTimeout:
              type: integer
              minimum: 1
              exclusiveMinimum: false
              nullable: true
              default: 30
            screeningFallbackTTL:
              type: integer
              minimum: 1
              exclusiveMinimum: false
              nullable: true
              default: 30
            screeningTopics:
              type: string
              default: ''
              nullable: true
            retryCallMeLater:
              type: boolean
              default: true
            language:
              type: string
              default: en
            locale:
              type: string
              default: en-US
            smsConsentRequirement:
              type: boolean
              default: false
            openaiRealtime:
              type: boolean
              default: false
            geminiRealtime:
              type: boolean
              default: false
            sttCodeSwitching:
              type: boolean
              nullable: true
            sttKeywords:
              type: array
              items:
                type: string
              nullable: true
              default: []
            sttVocabulary:
              type: array
              items:
                type: object
                properties:
                  content:
                    type: string
                  soundsLike:
                    type: array
                    items:
                      type: string
                    nullable: true
                    default: []
                required:
                  - content
              nullable: true
              default: []
            ragEnabled:
              type: boolean
              default: false
            nodeReachedHandlingDelayed:
              type: boolean
              default: true
            flushUserInputBufferAfterUninterruptible:
              type: boolean
              default: true
            collapseInactiveNestedSteps:
              type: boolean
              default: false
            additionalPrompt:
              type: string
              nullable: true
            restrictionsPrompt:
              type: string
              nullable: true
            useAdditionalRulesOnly:
              type: boolean
              default: false
              nullable: true
            useForcedToolCallsOnly:
              type: boolean
              default: true
            useConversationMeetingFunction:
              type: boolean
              default: false
            voiceMailEnabled:
              type: boolean
              default: false
            voiceMailMessage:
              type: string
              nullable: true
            voiceMailWhenToLeave:
              oneOf:
                - type: string
                  enum:
                    - EVERY_TIME
                - type: string
                  enum:
                    - ONCE_PER_CONTACT
                - type: string
                  enum:
                    - LAST_ATTEMPT
              default: EVERY_TIME
            voiceMailRephraseWithAI:
              type: boolean
              default: false
            voiceMailBeepTimeout:
              type: integer
              default: 5000
            noiseReduction:
              type: number
              minimum: 0
              exclusiveMinimum: false
              maximum: 30
              exclusiveMaximum: false
              nullable: true
            maxDuration:
              type: integer
              minimum: 1
              exclusiveMinimum: false
              maximum: 60
              exclusiveMaximum: false
              nullable: true
              default: 30
            channel:
              type: string
              enum:
                - TWILIO
                - WHATSAPP
                - TELNYX
                - LINE
                - EMAIL
              x-enumNames:
                - TWILIO
                - WHATSAPP
                - TELNYX
                - LINE
                - EMAIL
              nullable: true
              default: TWILIO
            pronunciationDictionary:
              type: array
              items:
                type: object
                properties:
                  word:
                    type: string
                    minLength: 1
                  ipa:
                    type: string
                    minLength: 1
                  phonetic:
                    type: string
                    minLength: 1
                  native:
                    type: string
                    nullable: true
                  selectedPlaybackType:
                    type: string
                    enum:
                      - NATIVE
                      - IPA
                      - PHONETIC
                    x-enumNames:
                      - NATIVE
                      - IPA
                      - PHONETIC
                    nullable: true
                required:
                  - word
                  - ipa
                  - phonetic
              default: []
            pronunciationDictionaryIds:
              type: array
              items:
                type: string
              nullable: true
              default: []
            aiCousticsNoiseReductionEnabled:
              type: boolean
              default: true
            useContactCustomCallerId:
              type: boolean
              default: false
            isTimezoneBasedOnContact:
              type: boolean
              default: false
            sendSipHeaders:
              type: boolean
              default: true
            backgroundNoiseVolumePercent:
              type: integer
              minimum: 0
              exclusiveMinimum: false
              maximum: 100
              exclusiveMaximum: false
              nullable: true
            enableEmotions:
              type: boolean
              default: false
            emotionMergeSentences:
              type: boolean
              default: false
            emotionMergeMaxSentences:
              type: integer
              minimum: 2
              exclusiveMinimum: false
              maximum: 5
              exclusiveMaximum: false
              nullable: true
              default: 2
            emotionBreakTimeMs:
              type: integer
              minimum: 50
              exclusiveMinimum: false
              maximum: 2000
              exclusiveMaximum: false
              nullable: true
              default: 500
            nestedScriptMaxDepth:
              type: integer
              minimum: 1
              exclusiveMinimum: false
              maximum: 10
              exclusiveMaximum: false
              nullable: true
              default: 1
          required:
            - retryDailyAttemptsSchedule
            - beforeGreetingTimeout
            - detectAiScreening
            - aiScreeningResponseTimeout
            - screeningFallbackTTL
            - screeningTopics
            - maxDuration
          default: {}
        chatParams:
          description: Chat channel, sender numbers, cadence, and drop-off configuration.
          type: object
          properties:
            channel:
              type: string
              enum:
                - TWILIO
                - WHATSAPP
                - TELNYX
                - LINE
                - EMAIL
              x-enumNames:
                - TWILIO
                - WHATSAPP
                - TELNYX
                - LINE
                - EMAIL
              nullable: true
            phonesFrom:
              type: array
              items:
                type: string
              default: []
            phoneSelectionStrategy:
              type: string
              enum:
                - ROTATE_NUMBERS
                - PREFER_LOCAL_NUMBERS
                - AUTO_OPTIMIZE
              x-enumNames:
                - ROTATE_NUMBERS
                - PREFER_LOCAL_NUMBERS
                - AUTO_OPTIMIZE
              default: ROTATE_NUMBERS
            windowMinutes:
              type: number
              default: 5
            additionalPrompt:
              type: string
              nullable: true
            restrictionsPrompt:
              type: string
              nullable: true
            useAdditionalRulesOnly:
              type: boolean
              default: false
              nullable: true
            followUpPrompt:
              type: string
              nullable: true
            followUpAttempts:
              type: number
              minimum: 0
              exclusiveMinimum: false
              default: 1
            followUpDailyAttempts:
              type: number
              minimum: 1
              exclusiveMinimum: false
              maximum: 50
              exclusiveMaximum: false
              default: 1
            followUpIntervalMinutes:
              type: number
              minimum: 0
              exclusiveMinimum: false
              default: 90
            followUpSchedule:
              type: array
              items:
                type: object
                properties:
                  from:
                    type: number
                  to:
                    type: number
                  value:
                    type: number
                required:
                  - from
                  - value
              default: []
            minDelaySec:
              type: number
              default: 3
            maxDelaySec:
              type: number
              default: 10
            timezone:
              type: string
              nullable: true
              default: UTC
            availabilitySchedule:
              type: array
              items:
                type: object
                properties:
                  dayOfWeek:
                    oneOf:
                      - type: string
                        enum:
                          - Sunday
                      - type: string
                        enum:
                          - Monday
                      - type: string
                        enum:
                          - Tuesday
                      - type: string
                        enum:
                          - Wednesday
                      - type: string
                        enum:
                          - Thursday
                      - type: string
                        enum:
                          - Friday
                      - type: string
                        enum:
                          - Saturday
                  timeSlots:
                    type: array
                    items:
                      type: object
                      properties:
                        startTime:
                          type: string
                          default: '09:00'
                        endTime:
                          type: string
                          default: '17:00'
                required:
                  - dayOfWeek
                  - timeSlots
              default:
                - dayOfWeek: Monday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
                - dayOfWeek: Tuesday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
                - dayOfWeek: Wednesday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
                - dayOfWeek: Thursday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
                - dayOfWeek: Friday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
            retryFollowUp:
              type: boolean
              default: false
            followUpDelayMinutes:
              type: number
              minimum: 60
              exclusiveMinimum: false
              maximum: 43200
              exclusiveMaximum: false
              default: 1440
            dropOffFollowUp:
              type: boolean
              default: false
            dropOffAttempts:
              type: number
              minimum: 0
              exclusiveMinimum: false
              default: 1
            dropOffDailyAttempts:
              type: number
              minimum: 1
              exclusiveMinimum: false
              maximum: 50
              exclusiveMaximum: false
              default: 1
            dropOffIntervalMinutes:
              type: number
              minimum: 0
              exclusiveMinimum: false
              default: 1440
            dropOffSchedule:
              type: array
              items:
                type: object
                properties:
                  from:
                    type: number
                  to:
                    type: number
                  value:
                    type: number
                required:
                  - from
                  - value
              default: []
            splitMessagesIntoSentences:
              type: boolean
              default: false
              nullable: true
          required:
            - followUpDailyAttempts
            - followUpSchedule
            - followUpDelayMinutes
            - dropOffDailyAttempts
            - dropOffSchedule
          nullable: true
        emailParams:
          description: >-
            Email connections, sender behavior, follow-up cadence, content, and
            signature configuration.
          type: object
          properties:
            outboundConnectionIds:
              type: array
              items:
                type: string
              default: []
            inboundConnectionIds:
              type: array
              items:
                type: string
              default: []
            emailSelectionStrategy:
              type: string
              enum:
                - ROTATE
                - RANDOM
                - FIXED
              x-enumNames:
                - ROTATE
                - RANDOM
                - FIXED
              default: ROTATE
            signature:
              type: string
              nullable: true
            signatureId:
              type: string
              nullable: true
            signatureName:
              type: string
              nullable: true
            defaultSubject:
              type: string
              nullable: true
            followUpSteps:
              type: array
              maxItems: 10
              items:
                type: object
                properties:
                  delayValue:
                    type: number
                    minimum: 1
                    exclusiveMinimum: false
                  delayUnit:
                    type: string
                    enum:
                      - min
                      - hour
                      - day
                    x-enumNames:
                      - MINUTES
                      - HOURS
                      - DAYS
                    default: min
                  contentMode:
                    type: string
                    enum:
                      - HUMAN_TEMPLATE
                      - AI_TEMPLATE
                    x-enumNames:
                      - HUMAN_TEMPLATE
                      - AI_TEMPLATE
                    default: HUMAN_TEMPLATE
                  body:
                    type: string
                    nullable: true
                  prompt:
                    type: string
                    nullable: true
                required:
                  - delayValue
              default: []
            followUpRespectSchedule:
              type: boolean
              default: true
            followUpOnlyIfNoReply:
              type: boolean
              default: true
            fallbackEnabled:
              type: boolean
              default: false
            fallbackPrompt:
              type: string
              nullable: true
            additionalPrompt:
              type: string
              nullable: true
            restrictionsPrompt:
              type: string
              nullable: true
            useAdditionalRulesOnly:
              type: boolean
              default: false
              nullable: true
            timezone:
              type: string
              nullable: true
              default: UTC
            availabilitySchedule:
              type: array
              items:
                type: object
                properties:
                  dayOfWeek:
                    oneOf:
                      - type: string
                        enum:
                          - Sunday
                      - type: string
                        enum:
                          - Monday
                      - type: string
                        enum:
                          - Tuesday
                      - type: string
                        enum:
                          - Wednesday
                      - type: string
                        enum:
                          - Thursday
                      - type: string
                        enum:
                          - Friday
                      - type: string
                        enum:
                          - Saturday
                  timeSlots:
                    type: array
                    items:
                      type: object
                      properties:
                        startTime:
                          type: string
                          default: '09:00'
                        endTime:
                          type: string
                          default: '17:00'
                required:
                  - dayOfWeek
                  - timeSlots
              default:
                - dayOfWeek: Monday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
                - dayOfWeek: Tuesday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
                - dayOfWeek: Wednesday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
                - dayOfWeek: Thursday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
                - dayOfWeek: Friday
                  timeSlots:
                    - startTime: '09:00'
                      endTime: '17:00'
            retryFollowUp:
              type: boolean
              default: false
            approvalConditions:
              type: array
              items:
                type: string
              nullable: true
          required:
            - approvalConditions
          nullable: true
        maxOutgoingConcurrency:
          type: number
          default: 10
        maxOutgoingCallsBatchSize:
          type: number
          default: 2
        limitOutgoingConcurrency:
          type: boolean
          default: true
        summaryQuestions:
          description: >-
            Post-interaction summary questions. Each question requires a
            non-empty name; description and options are optional.
          type: array
          items:
            type: object
            properties:
              name:
                type: string
                minLength: 1
              description:
                type: string
                nullable: true
              type:
                type: string
                enum:
                  - OPEN_QUESTION
                  - SINGLE_CHOICE
                  - MULTIPLE_CHOICE
                  - YES_NO
                  - NUMBER
                  - DATE
                  - TIME
                  - LINEAR_SCALE
                x-enumNames:
                  - OPEN_QUESTION
                  - SINGLE_CHOICE
                  - MULTIPLE_CHOICE
                  - YES_NO
                  - NUMBER
                  - DATE
                  - TIME
                  - LINEAR_SCALE
                nullable: true
                default: OPEN_QUESTION
              options:
                type: array
                items:
                  type: string
                nullable: true
                default: []
            required:
              - name
              - options
          default: []
        toolFunctions:
          description: >-
            Callable HTTP or integration actions available during an
            interaction. Every function definition and every parameter property
            must include a non-empty description. External tools require
            apiData; ActivePieces tools require activePieceData.
          type: array
          items:
            type: object
            properties:
              functionDefinition:
                type: object
                properties:
                  name:
                    type: string
                    pattern: ^[a-z0-9_-]+$
                    maxLength: 64
                  description:
                    type: string
                  parameters:
                    type: object
                    properties:
                      type:
                        type: string
                        default: object
                      properties:
                        type: object
                        additionalProperties:
                          type: object
                          properties:
                            type:
                              type: string
                            description:
                              type: string
                          required:
                            - type
                            - description
                      required:
                        type: array
                        items:
                          type: string
                          pattern: ^[a-z][a-zA-Z0-9_]*$
                        default: []
                      additionalProperties:
                        type: boolean
                        default: false
                    required:
                      - properties
                  strict:
                    type: boolean
                    default: true
                required:
                  - name
                  - description
                  - parameters
              apiData:
                type: object
                properties:
                  method:
                    type: string
                    enum:
                      - GET
                      - POST
                      - PUT
                      - DELETE
                      - PATCH
                    x-enumNames:
                      - GET
                      - POST
                      - PUT
                      - DELETE
                      - PATCH
                    default: GET
                  url:
                    type: string
                    default: ''
                  headers:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        value:
                          type: string
                      required:
                        - name
                        - value
                    default: []
                  parameters:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                        value:
                          type: string
                      required:
                        - name
                        - value
                    default: []
                  body:
                    type: string
                  outputParamsSchema:
                    type: string
                  ignoreResponse:
                    type: boolean
                    default: false
                  useRSASignature:
                    type: boolean
              name:
                type: string
              apiType:
                type: string
                enum:
                  - EXTERNAL
                  - ACTIVE_PIECE
                  - SYNTHETIC_SYSTEM_API_CALL
                x-enumNames:
                  - EXTERNAL
                  - ACTIVE_PIECE
                  - SYNTHETIC_SYSTEM_API_CALL
                default: EXTERNAL
              activePieceData:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  connectionId:
                    type: string
                    nullable: true
                  requestData:
                    default: {}
                  pieceVersion:
                    type: string
                    nullable: true
                  signRequest:
                    oneOf:
                      - type: boolean
                      - type: string
                    nullable: true
                  actionId:
                    type: string
                    minLength: 1
                required:
                  - id
                  - actionId
              outputParamsSchema:
                type: string
              ignoreResponse:
                type: boolean
            required:
              - functionDefinition
              - name
          default: []
        triggers:
          description: Trigger definitions used by trigger and event-driven campaigns.
          type: array
          items:
            type: object
            properties:
              activePieceTrigger:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  connectionId:
                    type: string
                    nullable: true
                  requestData:
                    default: {}
                  pieceVersion:
                    type: string
                    nullable: true
                  signRequest:
                    oneOf:
                      - type: boolean
                      - type: string
                    nullable: true
                  triggerId:
                    type: string
                    minLength: 1
                  triggerStrategy:
                    type: string
                    enum:
                      - POLLING
                      - WEBHOOK
                      - APP_WEBHOOK
                    x-enumNames:
                      - POLLING
                      - WEBHOOK
                      - APP_WEBHOOK
                    default: POLLING
                required:
                  - id
                  - triggerId
              contactMapper:
                default: {}
              type:
                type: string
                enum:
                  - add_contact
                  - archive_contact
                  - inbound_email
                x-enumNames:
                  - ADD_CONTACT
                  - ARCHIVE_CONTACT
                  - INBOUND_EMAIL
                nullable: true
                default: add_contact
            required:
              - activePieceTrigger
          default: []
        preCallActions:
          description: >-
            Actions run before an outbound call. ActivePieces actions require
            their activePieceAction configuration.
          type: array
          items:
            type: object
            properties:
              activePieceAction:
                description: >-
                  The integration action to execute before the call. Contains
                  the piece ID, action ID, connection ID, request data (input
                  payload with {{contact.phoneNumber}},
                  {{contact.data.fieldName}} interpolation for dynamic values),
                  and piece version.
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                  connectionId:
                    type: string
                    nullable: true
                  requestData:
                    default: {}
                  pieceVersion:
                    type: string
                    nullable: true
                  signRequest:
                    oneOf:
                      - type: boolean
                      - type: string
                    nullable: true
                  actionId:
                    type: string
                    minLength: 1
                required:
                  - id
                  - actionId
              contactMapper:
                description: >-
                  Maps API response fields to contact variables. Keys are
                  camelCase variable names (become {{ variableName }} in
                  scripts), values are dot-notation paths into the API response
                  (e.g., 'data.leadScore').
                type: object
                additionalProperties:
                  type: string
                default: {}
              timeout:
                description: 'Timeout in milliseconds for the API call. Default: 5000.'
                type: integer
                minimum: 0
                exclusiveMinimum: true
                default: 5000
              executionScope:
                description: >-
                  EVERY_ATTEMPT (default): run before every call attempt.
                  ONCE_PER_CONTACT: run only on first attempt, cache results for
                  retries. When ONCE_PER_CONTACT, storeInfo is automatically
                  true.
                type: string
                enum:
                  - EVERY_ATTEMPT
                  - ONCE_PER_CONTACT
                x-enumNames:
                  - EVERY_ATTEMPT
                  - ONCE_PER_CONTACT
                default: EVERY_ATTEMPT
              storeInfo:
                description: >-
                  Whether to persist mapped response data on the contact record.
                  Automatically true when executionScope is ONCE_PER_CONTACT.
                  Default: true.
                type: boolean
                default: true
            required:
              - activePieceAction
          default: []
        allowContactDuplicates:
          type: boolean
          default: false
        backgroundNoiseId:
          type: string
          nullable: true
          default: null
        knowledgeBaseIds:
          description: >-
            Knowledge bases available to the campaign. IDs must belong to the
            authenticated organization.
          type: array
          items:
            type: string
          default: []
        campaignGroupId:
          description: Optional campaign group ID from the authenticated organization.
          type: string
          nullable: true
          default: null
        dialingStrategy:
          type: string
          enum:
            - ROTATE_NUMBERS
            - PREFER_LOCAL_NUMBERS
            - AUTO_OPTIMIZE
          x-enumNames:
            - ROTATE_NUMBERS
            - PREFER_LOCAL_NUMBERS
            - AUTO_OPTIMIZE
          default: ROTATE_NUMBERS
        type:
          description: 'Campaign channel: CALL, CHAT, EMAIL, or TRIGGER. Defaults to CALL.'
          type: string
          enum:
            - CALL
            - CHAT
            - TRIGGER
            - EMAIL
          default: CALL
        preCallChat:
          type: object
          properties:
            content:
              type: string
            allowCallingOutsideWorkingHours:
              type: boolean
            responseTimeout:
              type: number
              minimum: 1
              exclusiveMinimum: false
              default: 300
            nudge:
              type: boolean
              default: false
            noResponseAction:
              type: string
              enum:
                - PROCEED_VOICE
                - DO_NOT_CALL
              x-enumNames:
                - PROCEED_VOICE
                - DO_NOT_CALL
              default: PROCEED_VOICE
            refusedCallAction:
              type: string
              enum:
                - CONTINUE_IN_CHAT
                - DO_NOT_CALL
              x-enumNames:
                - CONTINUE_IN_CHAT
                - DO_NOT_CALL
              default: DO_NOT_CALL
          required:
            - content
            - allowCallingOutsideWorkingHours
          nullable: true
        useCase:
          type: string
          nullable: true
        useLocalDnc:
          type: boolean
          nullable: true
        useLocalDialing:
          type: boolean
          nullable: true
        shouldAddToLocalDnc:
          type: boolean
          nullable: true
        sensitiveContentRestricted:
          type: boolean
          default: false
        deleteTranscriptsWithSensitiveData:
          type: boolean
          default: false
        deleteRecordingsWithSensitiveData:
          type: boolean
          default: false
        maskSensitiveMessages:
          type: boolean
          default: false
        turnOffContactMemories:
          type: boolean
          default: false
        turnOffContactMemoryContribution:
          type: boolean
          default: false
        turnOffGlobalContactMemories:
          type: boolean
          default: false
        scriptUpdateRules:
          type: array
          items:
            type: object
            properties:
              event:
                type: object
                properties:
                  type:
                    type: string
                required:
                  - type
              action:
                type: object
                properties:
                  type:
                    type: string
                  target:
                    type: object
                    properties:
                      id:
                        type: string
                      type:
                        type: string
                    required:
                      - id
                      - type
                    nullable: true
                required:
                  - type
            required:
              - event
              - action
          nullable: true
        ignoredContactVariables:
          type: array
          items:
            type: string
          default: []
        guardrailSettings:
          type: object
          properties:
            enabled:
              type: boolean
              default: false
            useOrganizationGuardrails:
              type: boolean
              default: true
            guardrails:
              type: array
              items:
                type: object
                properties:
                  enabled:
                    type: boolean
                    default: true
                  name:
                    type: string
                  prompt:
                    type: string
                    nullable: true
                required:
                  - name
              default: []
            validateByChunk:
              type: boolean
              default: false
            onFailAction:
              oneOf:
                - type: string
                  enum:
                    - HANGUP
                    - TRANSFER
                    - REGENERATE
                  x-enumNames:
                    - HANGUP
                    - TRANSFER
                    - REGENERATE
                - type: string
                  enum:
                    - ''
              default: HANGUP
          nullable: true
        voiceId:
          description: >-
            Convenience alias for callParams.voice. When supplied, this value
            takes precedence.
          type: string
          pattern: ^[0-9a-fA-F]{24}$
        phoneNumbers:
          description: >-
            Convenience alias for callParams.phonesFrom. When supplied, this
            list takes precedence; an empty list clears assigned call numbers.
          type: array
          items:
            type: string
        webCallCredentials:
          type: object
          properties:
            allowedOrigins:
              type: array
              items:
                type: string
              default: []
            captchaEnabled:
              type: boolean
              nullable: true
            captchaProvider:
              type: string
              nullable: true
            captchaSiteKey:
              type: string
              nullable: true
            captchaSecret:
              type: string
              nullable: true
          nullable: true
      required:
        - name
        - useLocalDialing
    CampaignPublicDto:
      type: object
      properties:
        id:
          type: string
          description: The id of the campaign. string representation of a ObjectId.
        name:
          type: string
          description: The name of the campaign.
        active:
          type: boolean
          description: >-
            Whether the campaign is active (running). Derived from the campaign
            active field.
        pauseNewChats:
          type: boolean
          description: >-
            Whether new chats are paused. When true, stops initiating new chats
            while allowing ongoing chats to complete.
        firstInteractionAt:
          type: string
          description: >-
            The date and time of the first interaction (call or chat) in the
            campaign in ISO string format.
        completedAt:
          type: string
          description: >-
            The date and time when the campaign was completed in ISO string
            format.
        callParams:
          description: The call parameters of the campaign.
          allOf:
            - $ref: '#/components/schemas/CampaignCallParamsPublicDto'
        emailParams:
          description: The email parameters of the campaign.
          allOf:
            - $ref: '#/components/schemas/CampaignEmailParamsPublicDto'
        organizationId:
          type: string
          description: The id of the organization. string representation of a ObjectId.
        incomingPhoneNumber:
          type: string
          description: The incoming phone number of the campaign.
        webhooks:
          description: The webhook url of the campaign.
          type: array
          items:
            type: string
        slackUrl:
          type: string
          description: The Slack notifications URL of the campaign.
        isIncoming:
          type: boolean
          description: >-
            Boolean value defines if the campaign is incoming or outgoing. True
            if the campaign is incoming, false if the campaign is outgoing.
        variables:
          description: List of variable used in the campaign.
          type: array
          items:
            type: string
        campaignGroupId:
          type: string
          description: >-
            The id of the campaign group this campaign belongs to. Null if the
            campaign is not part of any group.
          nullable: true
        campaignGroupName:
          type: string
          description: >-
            The name of the campaign group this campaign belongs to. Null if the
            campaign is not part of any group or the group could not be
            resolved.
          nullable: true
      required:
        - id
        - name
        - active
        - firstInteractionAt
        - completedAt
        - callParams
        - organizationId
        - webhooks
        - slackUrl
        - isIncoming
        - variables
    CampaignCallParamsPublicDto:
      type: object
      properties:
        phonesFrom:
          description: The array of the available phone numbers.
          type: array
          items:
            type: string
        timezone:
          type: string
          description: The timezone of the campaign.
        daysOfWeek:
          description: Days of the week the campaign is active.
          type: array
          items:
            type: string
        language:
          type: string
          description: The language of the calls.
        approvedCountries:
          description: The array of the approved countries to call.
          type: array
          items:
            type: string
      required:
        - phonesFrom
        - timezone
        - daysOfWeek
        - language
        - approvedCountries
    CampaignEmailParamsPublicDto:
      type: object
      properties:
        outboundConnectionIds:
          description: IDs of outbound email connections used for sending.
          type: array
          items:
            type: string
        inboundConnectionIds:
          description: IDs of inbound email connections used for receiving replies.
          type: array
          items:
            type: string
        emailSelectionStrategy:
          type: string
          description: >-
            The strategy for selecting outbound email connections when more than
            one is configured.
          enum:
            - ROTATE
            - RANDOM
            - FIXED
        signature:
          type: string
          description: The email signature HTML content.
        signatureName:
          type: string
          description: The display name for the email signature.
        defaultSubject:
          type: string
          description: The default subject line for emails.
        timezone:
          type: string
          description: The timezone of the email campaign.
        followUpSteps:
          description: The ordered list of follow-up steps to send when there is no reply.
          type: array
          items:
            $ref: '#/components/schemas/CampaignEmailFollowUpStepPublicDto'
        followUpRespectSchedule:
          type: boolean
          description: Whether follow-up sends respect the campaign availability schedule.
        followUpOnlyIfNoReply:
          type: boolean
          description: >-
            Whether follow-ups stop once the contact has ever replied, rather
            than continuing on cadence regardless.
        fallbackEnabled:
          type: boolean
          description: Whether fallback behavior is enabled.
        retryFollowUp:
          type: boolean
          description: Whether to retry follow-up emails.
      required:
        - outboundConnectionIds
        - inboundConnectionIds
        - emailSelectionStrategy
        - followUpSteps
        - followUpRespectSchedule
        - followUpOnlyIfNoReply
        - fallbackEnabled
        - retryFollowUp
    CampaignEmailFollowUpStepPublicDto:
      type: object
      properties:
        delayValue:
          type: number
          description: >-
            The wait time before this follow-up fires, counted from the previous
            send.
        delayUnit:
          type: string
          description: The unit for delayValue.
          enum:
            - min
            - hour
            - day
        contentMode:
          type: string
          description: >-
            Whether this follow-up sends a fixed template or an AI-drafted
            message.
          enum:
            - HUMAN_TEMPLATE
            - AI_TEMPLATE
        body:
          type: string
          description: The template body, used when contentMode is HUMAN_TEMPLATE.
        prompt:
          type: string
          description: The AI prompt, used when contentMode is AI_TEMPLATE.
      required:
        - delayValue
        - delayUnit
        - contentMode
  securitySchemes:
    Authorization:
      type: apiKey
      in: header
      name: Authorization

````