> ## 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.

# Accept Call

> Formally accepts an inbound WhatsApp call. Transitions the call status to `CONNECTED` and records the `startTimestamp`.



## OpenAPI

````yaml POST /api/pub/wa/call/accept
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/accept:
    post:
      tags:
        - Call
      summary: Accept Call
      description: >-
        Formally accepts an inbound WhatsApp call. Transitions the call status
        to `CONNECTED` and records the `startTimestamp`.
      requestBody:
        description: Accept call payload
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CallActionRequest'
      responses:
        '200':
          description: Call accepted. Status is now `CONNECTED`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CallActionResponse'
              example:
                status: 200
                success: true
                error: null
                msg: Call accepted.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - AppIdAuth: []
          AppSecretAuth: []
components:
  schemas:
    CallActionRequest:
      type: object
      description: Payload for pre-accepting or accepting a call (requires SDP).
      properties:
        id:
          type: string
          description: The `_id` of the WaCall record (returned by the connect endpoint).
          example: 64f1a2b3c4d5e6f7a8b9c0d1
        sdp:
          type: string
          description: WebRTC SDP answer string from the receiving client.
          example: "v=0\r\no=- 46117317 2 IN IP4 127.0.0.1\r\n..."
      required:
        - id
        - sdp
    CallActionResponse:
      type: object
      description: Generic success response for call action endpoints.
      properties:
        status:
          type: integer
          example: 200
        success:
          type: boolean
          example: true
        error:
          type: 'null'
          example: null
        msg:
          type: string
          example: Call accepted.
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          example: 500
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Internal Server Error!
  responses:
    BadRequest:
      description: >-
        Bad Request. A required field is missing or an item is in an invalid
        state.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            MissingTemplate:
              value:
                status: 400
                success: false
                error: Template id not provided!
            TemplateNotApproved:
              value:
                status: 400
                success: false
                error: Template is not approved!
            WabaNotConnected:
              value:
                status: 400
                success: false
                error: WhatsApp Account Not Connected or Exist!
    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.'
    NotFound:
      description: >-
        Not Found. The requested resource (template, contact) could not be
        found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 404
            success: false
            error: Template not found!
    InternalServerError:
      description: Internal Server Error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  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.

````