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

# Accept incoming call

> Answers an incoming WhatsApp call in live stream mode and returns a media WebSocket (wsUrl + token), in the same format as POST /calls/stream. Connect to the WS to stream microphone audio, hear the caller and receive the call lifecycle events. Use the `callId` from the call.offer event while the call is still ringing. Unavailable on cloud_api (Official API) connections.



## OpenAPI

````yaml /api-reference/openapi.en.json post /api/v1/calls/accept
openapi: 3.1.0
info:
  title: D-API - Complete WhatsApp Infrastructure
  description: >-
    A scalable, robust solution for automation managers, SaaS products and end
    users who need a reliable WhatsApp integration. It offers multiple
    simultaneous instances, real-time webhooks, an intuitive dashboard and a
    documented REST API with 99.9% uptime and latency under 30ms.
  version: 1.2.1
  contact:
    name: Suporte D-API
    email: suporte@d-api.cloud
    url: https://d-api.cloud
servers:
  - url: https://api.d-api.cloud
    description: Production
security:
  - ApiKeyAuth: []
tags:
  - name: Home
    description: Base endpoints
  - name: Sessions
    description: Endpoints for managing sessions
  - name: Messages
    description: Endpoints for sending messages
  - name: Cloud API
    description: >-
      WhatsApp Official API (Meta Cloud API): manual connection, template
      management (list/create/delete) and template sending.
  - name: IVR Calls
    description: 'Voice call dispatch (IVR): single or bulk, with audio or an IVR flow.'
  - name: SMS
    description: 'SMS sending: single or bulk.'
  - name: Commands
    description: >-
      Look up asynchronous commands (async: true) by the commandId returned when
      enqueued.
paths:
  /api/v1/calls/accept:
    post:
      tags:
        - Calls
      summary: Accept incoming call
      description: >-
        Answers an incoming WhatsApp call in live stream mode and returns a
        media WebSocket (wsUrl + token), in the same format as POST
        /calls/stream. Connect to the WS to stream microphone audio, hear the
        caller and receive the call lifecycle events. Use the `callId` from the
        call.offer event while the call is still ringing. Unavailable on
        cloud_api (Official API) connections.
      operationId: postApiV1CallsAccept
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                sessionId:
                  minLength: 1
                  type: string
                callId:
                  minLength: 1
                  type: string
                from:
                  type: string
              required:
                - sessionId
                - callId
              additionalProperties: false
          multipart/form-data:
            schema:
              type: object
              properties:
                sessionId:
                  minLength: 1
                  type: string
                callId:
                  minLength: 1
                  type: string
                from:
                  type: string
              required:
                - sessionId
                - callId
              additionalProperties: false
          text/plain:
            schema:
              type: object
              properties:
                sessionId:
                  minLength: 1
                  type: string
                callId:
                  minLength: 1
                  type: string
                from:
                  type: string
              required:
                - sessionId
                - callId
              additionalProperties: false
      responses:
        '200':
          description: Call accepted
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  sessionId:
                    type: string
                  callId:
                    type: string
                    description: Id of the call actually answered by the pod
                  wsUrl:
                    type: string
                    description: Media WebSocket ready to use (token embedded)
                  token:
                    type: string
                    description: API Key used to authenticate the WebSocket
                  data:
                    type: object
                required:
                  - success
                  - sessionId
                  - callId
                  - wsUrl
                  - token
              example:
                success: true
                sessionId: session123
                callId: 3EB0C767D26B8F2A1B11
                wsUrl: >-
                  wss://api.d-api.cloud/voip/stream?callId=3EB0C767D26B8F2A1B11&token=TOKEN_DA_CHAMADA
                token: TOKEN_DA_CHAMADA
                data:
                  callId: 3EB0C767D26B8F2A1B11
        '400':
          description: Failed to accept the call, or cloud_api connection
          content:
            application/json:
              example:
                success: false
                error: Failed to accept call
                sessionId: session123
        '404':
          description: Session not found
          content:
            application/json:
              example:
                success: false
                error: Session not found
                sessionId: session123
        '503':
          description: Live stream unavailable (Redis disabled)
          content:
            application/json:
              example:
                success: false
                error: Live call streaming is not available (Redis disabled)
                sessionId: session123
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: 'API Key for authentication. Format: <API_KEY>'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.