---
title: "[BETA] accept call"
method: POST
path: "/instances/{id}/client/action/accept-call"
tags: ["call"]
---

# \[BETA\] accept call

`POST /instances/{id}/client/action/accept-call`

## Request

- Base URL: `https://waapi.app/api/v1`
- URL: `https://waapi.app/api/v1/instances/{id}/client/action/accept-call`
- Auth: HTTP bearer

Accepts the ringing incoming call. Media starts after the call connected; audioUrl plays once, imageUrl is shown, videoUrl loops as the camera. hangupAfterSeconds, if given, ends the call that many seconds after it connects. Every media URL is fetched before the call is accepted, so an unusable URL fails the request instead of answering a call that then plays nothing. Errors come back as `data.status: error` with `message` and `explanation`. Note: This endpoint is currently in beta and may change without notice.

## Path parameters

- `id` integer, required

## Request body

- object
  - `callId` string: The call to act on. Omit to use the instance's only active call.
  - `video` boolean: Accept as a video call and send a camera track
  - `audioUrl` string, uri: wav, mp3 or ogg played once into the call, max 25 MB
  - `imageUrl` string, uri: jpeg or png shown as the outgoing camera, max 25 MB
  - `videoUrl` string, uri: mp4 (H.264) looped as the outgoing camera, max 25 MB
  - `hangupAfterSeconds` integer: Hang up at the latest this many seconds after the call connects; omitted means the call stays up until someone ends it

## Response `200`

Request reached the instance. `data.status` reports whether the action was carried out; on error `data` carries `message` and `explanation`. Payload: the accepted call.

- object
  - `status` 'success' | 'error': Whether the request reached the instance. `success` here does **not** mean the action was carried out — that is reported by `data.status`, which is the authoritative one. A malformed input arrives as `status: success` with `data.status: error`.
  - `data` union: The action's outcome. `status: success` carries the payload; `status: error` is an `actionError`.
    - object
      - `status` 'success', required: Whether the instance carried the action out — the authoritative field. In this branch it is always `success`; when the instance refused the action the whole `data` object is an `actionError` with `status: error`, `message` and `explanation`.
      - `instanceId` union
        - integer
        - string
      - `data` object
        - `call` Call
          - `id` string
          - `from` string: The peer — the caller for an incoming call, the callee for an outgoing one
          - `timestamp` integer
          - `isVideo` boolean
          - `isGroup` boolean
          - `fromMe` boolean: true for calls placed by this instance
          - `state` integer: The call's state, as the platform's own CallState enum — all fifteen members: 0 None, 1 Calling, 2 PreacceptReceived, 3 ReceivedCall (an incoming call is ringing), 4 AcceptSent, 5 AcceptReceived, 6 CallActive (connected), 7 CallActiveElseWhere (answered on another linked device), 8 ReceivedCallWithoutOffer, 9 Rejoining, 10 Link, 11 ConnectedLonely, 12 PreCalling (an outgoing call that is not registered yet), 13 CallStateEnding, 14 CallBCallStarting. In practice you will see 3, 6, 12 and 13; start-call with waitForAnswer false can report 12, and 7 reaches the call webhook. Treat any other value as one of the states above rather than as an error.
          - `answered` boolean: start-call only
          - `timedOut` boolean: start-call only: answerTimeout elapsed and the call was hung up
    - ActionError: Shape of `data` when the instance refused the action. HTTP status is still 200 and the outer `status` is still `success`.
      - `status` 'error', required
      - `message` string
      - `explanation` string
      - `instanceId` union
        - integer
        - string

## Other responses

- `401`: Unauthorized — invalid or missing bearer token
- `403`: Forbidden — insufficient permissions or account blocked
- `404`: Not found — instance does not exist or does not belong to you
- `409`: Conflict — instance is not ready
- `422`: Validation error — invalid or missing request parameters
- `429`: Too many requests — rate limit exceeded

---

[API](https://skmtc.dev/waapi/apis/waapi-api-2.md) · [All operations](https://skmtc.dev/waapi/apis/waapi-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/waapi/apis/waapi-api-2/revisions/490302f75576?raw)
