palbaseDocs

Palbase Calls · API

POST/calls

Call people

Rings one person (a direct call) or asks several into a group call, from the caller's device; either is a room on the media server, which the caller's device is in from the start (POST /calls/{call_id}/media). ring: false makes a group call that rings no one: the people asked join it when they like (a huddle). A call to someone who is calling the caller this moment is that call, answered (200). A call to someone in another call — or being rung by one — ends at once, busy, and they hear they missed it. Who may be called is the project's: no one who blocked the caller or whom they blocked, no deleted account, a conversation's members alone when it names one (conversation_id), and whom the project's hook allows (calls.can_call). A call from a conversation is kept in it, as a call message.

Called by a signed-in user of your app, with their token and the publishable key.

Request body

caller_image_urlstring · optionalThe caller's picture to show those rung
caller_namestring · optionalThe caller's name to show those rung (else their messaging profile's)
conversation_idstring (uuid) · optionalThe conversation it is made from: its members alone may be called, and it keeps the call
device_idstring · requiredThe device the call is made on
groupboolean · optionalA group call even with one person asked (others may be asked later): on the media server
metadataobject · optionalThe app's own words about the call (32 strings, 2 KiB at most)
placestring · optionalHolds the call at a place (a group call): letters, digits and . _ : -, 1 to 128 (channel:42; conversation:<id> for a conversation of Palbase's messaging, whose members it lets in). One call goes on at a place at a time. Who it lets in is the project's rule: a conversation's members, else the project's hook (calls.can_call, action place); with no hook, no one but those asked
ringboolean · optionalRing them (true, by default); false: a group call they join (a huddle)
user_idsstring[] · requiredWho to call: one person (a direct call), or several (a group); none for a call at a place, which its people join
videoboolean · optionalA video call (else voice)
curl
curl -X POST "https://<your-ref>.palbase.studio/calls" \
  -H "apikey: $PALBASE_PUBLISHABLE_KEY" \
  -H "authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "content-type: application/json" \
  -d '{"device_id":"string","user_ids":["string"]}'

Responses

200A call the other was making to the caller, answered

201The call, ringing — or over at once, busy

400`user_ids` is not 1 to 99 other people (`invalid_user_ids`), or more than the project lets a call have (`call_full`); `device_id`, `conversation_id`, `metadata` or the caller's name is not one (`invalid_…`); a place not named as places are (`invalid_place`); a conversation_id other than its conversation:<id> place's (`invalid_conversation_id`)

401No key, a key of no project, a token not valid (the edge's answer), or no person's session (`user_required`)

403The project does not let the caller call them, or hold a call at the place (`not_allowed`)

404The caller is not in the conversation named (`conversation_not_found`)

409A call goes on at the place: join it (`place_busy`, with the call); the caller is in another call on another device (`in_another_call`)

429The caller started too many calls this minute or hour (`too_many_calls`), or the project's call data for the month is used up under its quota (`quota_exceeded`): calls going on go on, no new one starts

503Temporarily unavailable; retrying is safe after Retry-After

defaultAn error: the envelope names it (`error`) and explains it (`error_description`).

Operation StartCall of calls's contract.