> ## 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 agent WhatsApp configuration

> Associates a WhatsApp configuration with the agent



## OpenAPI

````yaml api/legacy/openapi-agents.yaml post /agents/{agent_id}/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:
  /agents/{agent_id}/agent_whatsapp_configs:
    post:
      tags:
        - Agent WhatsApp Configs
      summary: Create agent WhatsApp configuration
      description: Associates a WhatsApp configuration with the agent
      operationId: createAgentWhatsappConfig
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - agent_whatsapp_config
              properties:
                agent_whatsapp_config:
                  type: object
                  required:
                    - whatsapp_config_id
                  properties:
                    whatsapp_config_id:
                      type: string
                      format: uuid
                      example: config-123abc
                    is_primary:
                      type: boolean
                      example: true
      responses:
        '201':
          description: Agent WhatsApp configuration created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AgentWhatsappConfig'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Agent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AgentWhatsappConfig:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: awc-123abc
        is_primary:
          type: boolean
          example: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        whatsapp_config:
          $ref: '#/components/schemas/WhatsappConfig'
    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

````