Developer docs

Everything you need to add calls to your app. Need a hand? Email support@videocallapi.com.

Quickstart

  1. Create a free account and verify your email.
  2. In the console, open API keys and create a key. Store the secret on your server.
  3. Install the SDK: npm i @videocallapi/react-sdk
  4. On your server, sign a token and create a room. In the browser, join it.

Authentication tokens

Every REST request and every call join uses a JWT signed with your API secret (HS256). Sign tokens on your server only; never ship the secret to browsers.

import jwt from "jsonwebtoken";

const token = jwt.sign(
  { apikey: process.env.VIDEOCALLAPI_KEY, permissions: ["allow_join"] },
  process.env.VIDEOCALLAPI_SECRET,
  { algorithm: "HS256", expiresIn: "2h" }
);

Permissions: allow_join joins directly; ask_join waits in the lobby; allow_mod can end the call and remove participants. To limit a token to one room, add roomId; to fix the participant's identity, add participantId.

Create a room

curl -X POST https://api.videocallapi.com/v2/rooms \
  -H "Authorization: $TOKEN" -H "Content-Type: application/json" \
  -d '{"customRoomId": "consult-1042"}'

# → { "roomId": "abcd-efgh-ijkl", "customRoomId": "consult-1042", ... }

Join from React

import { MeetingProvider, useMeeting, useParticipant, VideoPlayer } from "@videocallapi/react-sdk";

<MeetingProvider
  token={token}
  config={{ meetingId: roomId, name: "Asha", micEnabled: true, webcamEnabled: true }}
  joinWithoutUserInteraction
>
  <Room />
</MeetingProvider>

The SDK connects to https://api.videocallapi.com by default. If you need to change it, set VITE_VIDEOCALLAPI_URL, NEXT_PUBLIC_VIDEOCALLAPI_URL or REACT_APP_VIDEOCALLAPI_URL at build time.

REST API reference

Base URL https://api.videocallapi.com. Send the token in the Authorization header.

Method and pathPurpose
POST /v2/roomsCreate a room
GET /v2/rooms · GET /v2/rooms/:roomIdList rooms or fetch one
GET /v2/rooms/validate/:roomIdCheck that a room exists and is active
POST /v2/rooms/deactivate · /activateDisable or re-enable a room
GET /v2/sessions · GET /v2/sessions/:idCall history and participants
POST /v2/sessions/endEnd a call in progress
POST /v2/sessions/participants/removeRemove a participant
POST /v2/recordings/start · /endStart or stop recording
GET /v2/recordings · GET /v2/recordings/:idList recordings and get download links
GET /v2/public/rsa-public-keyPublic key for verifying webhooks

Recording

Recording is available on the Pay-as-you-go and Enterprise plans. Each account has a recording policy:

  • Every call (guaranteed): recording starts automatically. Participants don't receive media until it's running, and it restarts automatically if interrupted.
  • Client controlled: your app calls startRecording() and stopRecording().

Recordings are MP4 (H.264 video, 48 kHz stereo AAC audio) in SD, HD or Full HD. Download links from the API are signed and valid for 7 days.

Audio quality

ProfileSettingsUse for
High (default)Opus 48 kHz stereo, 128 kbps, RED, DTX off, echo cancellation onMost calls, including on speakers
StudioTrue stereo capture, 192 kbps, voice processing offMusic, tutoring, podcasts (headphones required)
SpeechMono speech optimised, low bandwidthPoor networks and very large calls

Webhooks

Set your endpoint in the console under Webhooks. We send a JSON POST for each event and retry failed deliveries with backoff. Events:

session-started session-ended participant-joined participant-left recording-starting recording-started recording-stopping recording-stopped recording-failed

Each request has an x-videocallapi-signature header: a base64 RSA-SHA256 signature of the JSON body.

import crypto from "node:crypto";

const { publicKey } = await (await fetch("https://api.videocallapi.com/v2/public/rsa-public-key")).json();

function verify(body, signature) {
  return crypto.createVerify("RSA-SHA256")
    .update(JSON.stringify(body))
    .verify(publicKey, signature, "base64");
}

Plan limits and errors

CodeMeaning
4026Your plan's concurrent-call limit is reached (2 on Free). Wait for a call to end, or upgrade.
4021The feature isn't on your plan (recording on Free), or this month's free minutes are used up.
4003The room ID doesn't exist. Create the room first.
3068The SDK feature isn't supported yet (for example HLS or transcription).

Questions? Email support@videocallapi.com.