Works with any language that speaks HTTPS

VideoRayan API

Three steps to a live visit: create the visit → mint a token per role → connect your UI. The full OpenAPI contract is served by the engine itself.

Authentication

Your platform receives an API key (rtck_...) and sends it in the header. Keep it server-side only — never distribute it inside client apps.

Authorization: Bearer rtck_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Public routes (/public/*, /guest/*) are keyless — they power the web panel.

The visit lifecycle

Create the visitPOST /v1/rooms with an Idempotency-Key — replaying the key returns the same visit, so duplicates are impossible.
Mint a token per rolePOST /v1/rooms/{id}/tokens with role doctor / patient / secretary — one seat per role per visit.
Connect to the roomHand token + wsUrl to any LiveKit SDK (web, Android, iOS) or redirect users to our web room.
End & eventsEnd with DELETE; a signed webhook also notifies your system when the visit finishes.

Endpoints

MethodPathPurpose
POST/v1/roomsCreate a visit (externalId, subject, expiresInSeconds)
GET/v1/rooms/{id}Visit status
POST/v1/rooms/{id}/tokensMint a token with role doctor / patient / secretary
GET/v1/rooms/{id}/participantsLive participant list
DELETE/v1/rooms/{id}/participants/{pid}Remove a participant
DELETE/v1/rooms/{id}End the visit (all tokens immediately invalidated)
POST/v1/public/roomsKeyless public visit (name = permanent link)
POST/v1/guest/rooms/{ref}/tokensGuest join with role
GET/v1/health · /v1/ready · /v1/whoamiLiveness, readiness, key check

Code samples

API=https://api.example.ir/v1
KEY=rtck_...

# 1) Create the visit
ROOM=$(curl -s -X POST $API/rooms \
  -H "Authorization: Bearer $KEY" \
  -H "Idempotency-Key: appt-4821" \
  -H "Content-Type: application/json" \
  -d '{"externalId":"appt-4821","subject":"Follow-up visit"}' | jq -r .roomId)

# 2) One token per role
for ROLE in doctor patient secretary; do
  curl -s -X POST $API/rooms/$ROOM/tokens \
    -H "Authorization: Bearer $KEY" \
    -H "Content-Type: application/json" \
    -d "{\"identity\":\"user-$ROLE\",\"role\":\"$ROLE\",\"ttlSeconds\":3600}"
done

# 3) End the visit
curl -s -X DELETE $API/rooms/$ROOM -H "Authorization: Bearer $KEY"

Error codes

CodeMeaningRecommended handling
400 invalid_inputInvalid fieldFix the payload
401 unauthorizedBad or missing keyCheck the key
404 room_not_foundVisit missing/expired (cross-platform existence is never revealed)Create the visit again
409 room_full3-seat capacity reachedReject the 4th participant
409 role_takenThat role seat is occupiedUse another role or the seat owner's identity
409 room_expiredVisit expired or endedCreate a new visit
429 rate_limited>120 requests/minRetry with backoff (Retry-After)
403 wrong_passwordWrong visit passwordAsk the visit owner

Rules of thumb: tokens are join-only, valid ≤1 hour, non-renewable (mint again for the same person — no new seat consumed). Max body size 64 KB.

End-of-visit webhook

When a visit ends (by command or automatically), your system is notified so it can update the appointment. Each event carries a verifiable JWT signature.

POST https://your-system.example.com/video/webhook
Content-Type: application/json
{
  "event": "room_finished",
  "roomId": "…",
  "externalId": "appt-4821",
  "endedAt": "2026-11-26T09:12:00Z"
}

Need an API key?

Get in touch to activate your sandbox environment.

Request an API key