> ## Documentation Index
> Fetch the complete documentation index at: https://kapso-1adbad2d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create voice agent WhatsApp config assignment

> Assigns a WhatsApp configuration to a voice agent



## OpenAPI

````yaml api/legacy/openapi-agents.yaml post /voice_agents/{voice_agent_id}/voice_agent_whatsapp_configs
openapi: 3.0.3
info:
  title: Kapso External API - Agents & Flows API
  description: >-
    API for programmatically interacting with Kapso agents, executions, and
    WhatsApp conversations. This specification includes only Agents & Flows API
    endpoints.
  version: 1.0.0
  contact:
    name: Kapso Support
servers:
  - url: https://app.kapso.ai/api/v1
    description: Production server
security:
  - ApiKeyAuth: []
paths:
  /voice_agents/{voice_agent_id}/voice_agent_whatsapp_configs:
    post:
      tags:
        - Voice Agent WhatsApp Configs
      summary: Create voice agent WhatsApp config assignment
      description: Assigns a WhatsApp configuration to a voice agent
      operationId: createVoiceAgentWhatsappConfig
      parameters:
        - name: voice_agent_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - voice_agent_whatsapp_config
              properties:
                voice_agent_whatsapp_config:
                  type: object
                  required:
                    - whatsapp_config_id
                  properties:
                    whatsapp_config_id:
                      type: string
                      format: uuid
                      example: config-123abc
                      description: WhatsApp config to assign
                    is_primary:
                      type: boolean
                      example: true
                      description: >-
                        Whether this should be the primary voice agent for this
                        WhatsApp config
                    enabled:
                      type: boolean
                      example: true
                      description: Whether voice calling is enabled for this assignment
      responses:
        '201':
          description: Voice agent WhatsApp config assignment created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/VoiceAgentWhatsappConfig'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Voice agent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Primary assignment already exists for this number
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: object
                    properties:
                      base:
                        type: array
                        items:
                          type: string
                        example:
                          - Primary assignment already exists for this number
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    VoiceAgentWhatsappConfig:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: vawc-123abc
        voice_agent_id:
          type: string
          format: uuid
          example: voice-agent-456def
        is_primary:
          type: boolean
          example: true
          description: Whether this is the primary voice agent for this WhatsApp config
        enabled:
          type: boolean
          example: true
          description: Whether voice calling is enabled for this assignment
        whatsapp_config:
          $ref: '#/components/schemas/WhatsappConfig'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
          example: Resource not found
        status:
          type: integer
          example: 404
        message:
          type: string
          example: The requested resource could not be found
    WhatsappConfig:
      type: object
      properties:
        id:
          type: string
          example: config-123abc
        name:
          type: string
          example: Client WhatsApp
        display_name:
          type: string
          example: Client WhatsApp (+1234567890)
        phone_number_id:
          type: string
          example: '1234567890'
        business_account_id:
          type: string
          example: '98765432109'
        webhook_verify_token:
          type: string
        webhook_destination_url:
          type: string
        customer_id:
          type: string
          format: uuid
          example: customer-456def
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key required for all endpoints

````