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

# Perform call action

> Perform various call actions via the WhatsApp Calling API.

**Proxy endpoint**: Proxies directly to Meta Graph API.

Supports the following actions:
- **connect**: Initiate an outbound call to a WhatsApp user
- **pre_accept**: Pre-establish WebRTC connection before accepting call
- **accept**: Accept an inbound call from a WhatsApp user
- **reject**: Reject an inbound call
- **terminate**: End an active call




## OpenAPI

````yaml /api/meta/whatsapp/openapi-whatsapp.yaml post /{phone_number_id}/calls
openapi: 3.1.0
info:
  title: Kapso Meta Proxy API
  version: 1.0.0
  description: >
    Kapso's Meta Proxy API provides a unified interface to WhatsApp Business
    Platform with enhanced features and Kapso-specific extensions.


    This API acts as a proxy layer between your application and WhatsApp,
    adding:

    - Simplified authentication with project-level API keys

    - Enhanced message metadata and tracking

    - Conversation management capabilities

    - Voice call integration

    - Extended contact and template management


    ## Base URL


    All API requests are made to: `https://api.kapso.ai/meta/whatsapp/v24.0`


    ## Authentication


    The API supports authentication via **X-API-Key header** (recommended):


    ```

    X-API-Key: your_project_api_key

    ```


    Alternative: Bearer token authentication is also supported for backward
    compatibility:


    ```

    Authorization: Bearer your_access_token

    ```


    Note: X-API-Key is the recommended authentication method for the Meta Proxy
    API.
  contact:
    name: Kapso Support
    url: https://kapso.ai
    email: dev@kap.so
servers:
  - url: https://api.kapso.ai/meta/whatsapp/v24.0
    description: Production server
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Messages
    description: Send and retrieve WhatsApp messages
  - name: Conversations
    description: Manage WhatsApp conversations
  - name: Contacts
    description: Manage WhatsApp contacts
  - name: Templates
    description: Manage message templates
  - name: Media
    description: Upload and retrieve media files
  - name: Calls
    description: Manage voice calls
  - name: Settings
    description: Account settings and configuration
  - name: Business Profile
    description: Business profile management
  - name: Phone Numbers
    description: Phone number management
  - name: Flows
    description: WhatsApp Flow management (Beta)
  - name: Block Users
    description: Block and unblock WhatsApp users
  - name: Usernames
    description: Reserve and manage WhatsApp business usernames
paths:
  /{phone_number_id}/calls:
    parameters:
      - name: phone_number_id
        in: path
        required: true
        description: WhatsApp Business Phone Number ID
        schema:
          type: string
        example: '110987654321'
    post:
      tags:
        - Calls
      summary: Perform call action
      description: |
        Perform various call actions via the WhatsApp Calling API.

        **Proxy endpoint**: Proxies directly to Meta Graph API.

        Supports the following actions:
        - **connect**: Initiate an outbound call to a WhatsApp user
        - **pre_accept**: Pre-establish WebRTC connection before accepting call
        - **accept**: Accept an inbound call from a WhatsApp user
        - **reject**: Reject an inbound call
        - **terminate**: End an active call
      operationId: performCallAction
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - messaging_product
                - action
              properties:
                messaging_product:
                  type: string
                  enum:
                    - whatsapp
                  example: whatsapp
                to:
                  type: string
                  description: Recipient WhatsApp ID (required for connect action)
                  example: '15551234567'
                call_id:
                  type: string
                  description: Call ID (required for pre_accept, accept, reject, terminate)
                  example: wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh
                action:
                  type: string
                  enum:
                    - connect
                    - pre_accept
                    - accept
                    - reject
                    - terminate
                  description: The action to perform
                  example: accept
                session:
                  type: object
                  description: >-
                    WebRTC session description (required for connect,
                    pre_accept, accept)
                  properties:
                    sdp_type:
                      type: string
                      enum:
                        - offer
                        - answer
                      description: >-
                        SDP type - "offer" for connect, "answer" for
                        pre_accept/accept
                      example: answer
                    sdp:
                      type: string
                      description: >-
                        Session Description Protocol (SDP) compliant with RFC
                        8866
                      example: >-
                        v=0\r\no=- 7669997803033704573 2 IN IP4
                        127.0.0.1\r\ns=-\r\n...
                biz_opaque_callback_data:
                  type: string
                  description: >-
                    Arbitrary tracking string (max 512 chars, optional for
                    connect/accept)
                  maxLength: 512
                  example: tracking_id_12345
            examples:
              initiate_call:
                summary: Initiate outbound call (connect)
                value:
                  messaging_product: whatsapp
                  to: '15551234567'
                  action: connect
                  session:
                    sdp_type: offer
                    sdp: "v=0\r\no=- 6314352886888624490 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS ccd3f422-8d7d-49c9-936c-a152979ee4fa\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 110 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:/PSS\r\na=ice-pwd:buBIz+JlbmakiCT7JdJIq/j0\r\na=ice-options:trickle\r\na=fingerprint:sha-256 43:08:34:16:67:E3:D9:A2:F5:AA:6A:AE:03:97:C8:D5:B8:F2:4B:40:79:C8:1A:44:53:69:4B:9C:89:88:D7:22\r\na=setup:active\r\na=mid:0\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\n"
                  biz_opaque_callback_data: call_session_abc123
              pre_accept_call:
                summary: Pre-accept call (establish connection early)
                value:
                  messaging_product: whatsapp
                  call_id: wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh
                  action: pre_accept
                  session:
                    sdp_type: answer
                    sdp: "v=0\r\no=- 7669997803033704573 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS 3c28addc-03b7-4170-b5cd-535bfe767e75\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 110 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:6O0H\r\na=ice-pwd:TYCbtfOrBMPpfxFRgSbYnuTI\r\na=setup:active\r\na=mid:0\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\n"
              accept_call:
                summary: Accept inbound call
                value:
                  messaging_product: whatsapp
                  call_id: wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh
                  action: accept
                  session:
                    sdp_type: answer
                    sdp: "v=0\r\no=- 7669997803033704573 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE 0\r\na=extmap-allow-mixed\r\na=msid-semantic: WMS 3c28addc-03b7-4170-b5cd-535bfe767e75\r\nm=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 0 8 110 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:9 IN IP4 0.0.0.0\r\na=ice-ufrag:6O0H\r\na=ice-pwd:TYCbtfOrBMPpfxFRgSbYnuTI\r\na=setup:active\r\na=mid:0\r\na=sendrecv\r\na=rtcp-mux\r\na=rtpmap:111 opus/48000/2\r\n"
                  biz_opaque_callback_data: session_tracking_xyz
              reject_call:
                summary: Reject inbound call
                value:
                  messaging_product: whatsapp
                  call_id: wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh
                  action: reject
              terminate_call:
                summary: Terminate active call
                value:
                  messaging_product: whatsapp
                  call_id: wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh
                  action: terminate
      responses:
        '200':
          description: Action performed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  messaging_product:
                    type: string
                    enum:
                      - whatsapp
                    example: whatsapp
                  success:
                    type: boolean
                    example: true
                  calls:
                    type: array
                    description: Returned for connect action
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          example: wacid.ABGGFjFVU2AfAgo6V
              examples:
                connect_success:
                  summary: Initiate call success
                  value:
                    messaging_product: whatsapp
                    calls:
                      - id: wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh
                action_success:
                  summary: Other actions success
                  value:
                    messaging_product: whatsapp
                    success: true
        '400':
          description: Bad request (invalid action or parameters)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
            - code
          properties:
            message:
              type: string
              description: Human-readable error message
              example: Invalid phone number format
            type:
              type: string
              description: Error category
              example: OAuthException
            code:
              type: integer
              description: Error code
              example: 400
            error_subcode:
              type: integer
              description: More specific error code
              example: 1001
            fbtrace_id:
              type: string
              description: Facebook trace ID for debugging
              example: AXk7s_8dR4eVHp9Kq2MmNlO
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >
        Project API key for authentication. This is the recommended
        authentication method.


        Get your API key from the Kapso dashboard under Integrations > API keys.
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |
        Bearer token authentication (alternative method).

        Note: X-API-Key authentication is recommended for the Meta Proxy API.

````