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

# Initiate Outbound Call

> Initiates a new outbound WhatsApp voice call to a contact. Creates a `WaCall` record and a linked `WhatsAppMsg` of type `call` in the conversation thread. The `callId` returned should be used for all subsequent call operations.



## OpenAPI

````yaml POST /api/pub/wa/call/connect/{whatsapp}
openapi: 3.1.0
info:
  title: AdsEra REST API
  description: >-
    Welcome to the AdsEra REST API. Use our API to integrate powerful,
    multi-channel communication (Email and WhatsApp) directly into your
    applications. Automate transactional messages, trigger marketing campaigns,
    manage your audience, and track performance programmatically.
  contact:
    name: Shubham
    email: shubham@adsera.in
  version: 1.0.0
servers:
  - url: https://app.adsera.in
    description: Production Server
security:
  - AppIdAuth: []
    AppSecretAuth: []
paths:
  /api/pub/wa/call/connect/{whatsapp}:
    post:
      tags:
        - Call
      summary: Initiate Outbound Call
      description: >-
        Initiates a new outbound WhatsApp voice call to a contact. Creates a
        `WaCall` record and a linked `WhatsAppMsg` of type `call` in the
        conversation thread. The `callId` returned should be used for all
        subsequent call operations.
      parameters:
        - name: whatsapp
          in: path
          required: true
          description: The `_id` of the WhatsApp Business Account (WABA) to call from.
          schema:
            type: string
            example: 60c72b2f9b1d8e001f8a1b2c
      requestBody:
        description: Outbound call payload
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectCallRequest'
      responses:
        '200':
          description: >-
            Call initiated successfully. Use the returned `callId` for
            accept/end operations.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectCallResponse'
        '400':
          description: >-
            Bad Request. A required field is missing or the phone number is
            invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                MissingSdp:
                  value:
                    status: 400
                    success: false
                    error: sdp not provided.
                MissingPhone:
                  value:
                    status: 400
                    success: false
                    error: phone not provided.
                InvalidPhone:
                  value:
                    status: 400
                    success: false
                    error: Invalid phone number.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Not Found. The contact or WhatsApp account does not exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                ContactNotFound:
                  value:
                    status: 404
                    success: false
                    error: Contact not found.
                WhatsAppNotFound:
                  value:
                    status: 404
                    success: false
                    error: WhatsApp account not found.
        '500':
          description: Internal Server Error or Meta API failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                status: 500
                success: false
                error: {}
                msg: Unable to establish connection with Meta.
      security:
        - AppIdAuth: []
          AppSecretAuth: []
components:
  schemas:
    ConnectCallRequest:
      type: object
      description: Payload for initiating an outbound WhatsApp call.
      properties:
        phone:
          type: string
          description: The recipient's phone number in E.164 format.
          example: '911234567890'
        sdp:
          type: string
          description: WebRTC SDP offer string from the calling client.
          example: "v=0\r\no=- 46117317 2 IN IP4 127.0.0.1\r\n..."
      required:
        - phone
        - sdp
    ConnectCallResponse:
      type: object
      description: Response returned after successfully initiating an outbound call.
      properties:
        status:
          type: integer
          example: 200
        success:
          type: boolean
          example: true
        error:
          type: 'null'
          example: null
        callId:
          type: string
          description: >-
            The MongoDB `_id` of the created WaCall record. Use this as `id` in
            subsequent requests.
          example: 64f1a2b3c4d5e6f7a8b9c0d1
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          example: 500
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Internal Server Error!
  responses:
    Unauthorized:
      description: Unauthorized. The API keys are missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 401
            success: false
            error: 'Unauthorized: Please provide valid API credentials.'
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your application's unique ID.
    AppSecretAuth:
      type: apiKey
      in: header
      name: x-api-secret
      description: Your application's secret key.

````