API Reference

Calls

Get the active callbeta

This feature is in private beta. Contact technical support to request access for your workspace.

Currently, only WhatsApp one-to-one voice and video calls are supported. Returns the current call managed by UnifyPort, or data: {} when none exists. This does not determine whether the account or recipient is busy in the WhatsApp mobile app.

GEThttps://api.unifyport.ai/v1/calls/active

Supported channels

WhatsApp

Before you call

Use a server-side X-Api-Key for the workspace that owns the resource. Replace every placeholder before running a sample.

Confirm that the workspace has private-beta access. Before creating a call, complete WhatsApp authorization and check runtime_status=running. Use the conversation_id of a private conversation under this account.

Prepare your parameters
account_id
Use data.id from account creation or an account query. Account identifiers belong to the workspace selected by X-Api-Key. Get account

Request parameters

Headers

X-Api-Key
stringrequired

Workspace API key. The workspace is resolved from this header.

Query parameters

account_id
stringrequired

Account ID in this workspace.

pattern: ^acc_[A-Za-z0-9][A-Za-z0-9_-]*$

Request body

This endpoint does not require a JSON request body.

Understand the result

Read the current call managed by UnifyPort and its call_id/state. data={} means no such call was found; it does not establish whether either party is busy or idle in the WhatsApp mobile app.

Response 200 · active

{
  "request_id": "req_example",
  "data": {
    "call_id": "call_example",
    "state": "active",
    "direction": "inbound",
    "media_type": "voice"
  }
}

Response 200 · idle

{
  "request_id": "req_example",
  "data": {}
}

Response body

call_id
string

Call identifier, also used to hang up.

maxLength: 128

state
string

Current call state.

enum: preparing, dialing, ringing, connecting, active

direction
string

Call direction.

enum: inbound, outbound

media_type
string

voice for audio; video for a video-capable call.

enum: voice, video

Responses

200

200 · active

Request succeeded. See the example response body.

400

Bad Request

The request body, path, or parameters are invalid.

401

Unauthorized

The X-Api-Key header is missing or invalid.

403

Forbidden

The request is authenticated but is not allowed.

404

Not Found

The requested resource was not found. Check error.code and the current operation.

409

Conflict

The requested operation conflicts with an existing provider account or resource.

500

Internal Server Error

The service encountered an unexpected error.

501

Not Implemented

The selected provider does not implement this operation.

502

Bad Gateway

The provider adapter or upstream provider could not complete the operation.

503

Service Unavailable

A required backend service is temporarily unavailable.

If the request fails

Inspect HTTP status and error.code/numeric_code; keep request_id. Check private-beta access, the account and call_id. On a creation conflict, query the active call first. Check the current call before retrying creation or hangup. Error reference

invalid_request · 10000 · 400
Check required fields, formats and channel conditions, then correct the request.
missing_api_key · 11000 · 401
Check X-Api-Key and whether the workspace is active.
invalid_api_key · 11001 · 401
Check X-Api-Key and whether the workspace is active.
account_not_found · 20020 · 404
Check account_id and use an X-Api-Key for the workspace that owns the account. An account not found in this workspace cannot be accessed with this key.
unsupported_by_provider · 30003 · 501
Check the channel capability guide and choose a supported channel or action. Repeating the request does not add support.
beta_feature_not_enabled · 41002 · 403
Contact technical support to request private-beta access for the workspace. Repeating the request or changing is_beta in a request does not grant access.