Appearance
Video call
Internal
These endpoints are internal to Hailer and not part of the supported public API.
Video call sessions.
Endpoints
| Endpoint | Arguments | Returns |
|---|---|---|
v3.videoCall.decline | discussionId: string | object |
v3.videoCall.getStatus | discussionIds: string[] | object |
v3.videoCall.getToken | discussionId: string | object |
v3.videoCall.join | discussionId: string, options?: { silent?: boolean; requireActiveCall?: boolean } | object |
v3.videoCall.leave | discussionId: string | object |
v3.videoCall.ping | discussionId: string | object |
v3.videoCall.decline
Description
Decline an incoming video call. Notifies other participants that the user declined.
Parameters
Argument 1 (discussionId, optional): discussionId
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.videoCall.decline', [
'507f1f77bcf86cd799439011', // discussionId
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | yes |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v3.videoCall.getStatus
Description
Get video call status for multiple discussions (batch query)
Parameters
Argument 1 (discussionId[], required):
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.videoCall.getStatus', [
['507f1f77bcf86cd799439011'],
]);
console.log(result);Returns
Record<discussionId, object>
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v3.videoCall.getToken
Description
Get a JWT token for authenticated Jitsi access. Requires user to be a discussion participant with an active call.
Parameters
Argument 1 (discussionId, optional): discussionId
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.videoCall.getToken', [
'507f1f77bcf86cd799439011', // discussionId
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
token | string | yes | |
expiresAt | integer | yes |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v3.videoCall.join
Description
Join a video call in a discussion. Creates the call room if it does not exist. Returns room configuration. When options.silent is true the call starts without an in-app ring/snackbar and without push notifications; the chat system message and join pill still appear so others can join when they notice. When options.requireActiveCall is true the call is NOT created if none is active - the request fails with code NotFound instead. Used by the client ping-recovery path to re-register into an existing call without resurrecting one that has already ended.
Parameters
Argument 1 (discussionId, optional): discussionId
Argument 2 (object, optional):
| Field | Type | Required | Description |
|---|---|---|---|
silent | boolean | no | |
requireActiveCall | boolean | no |
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.videoCall.join', [
'507f1f77bcf86cd799439011', // discussionId
{
silent: false,
requireActiveCall: false,
},
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
callId | ObjectId | yes | |
roomName | string | yes | |
jitsiDomain | string | yes | |
isNewCall | boolean | yes | |
participantCount | integer | yes |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v3.videoCall.leave
Description
Notify that user has left a video call in a discussion
Parameters
Argument 1 (discussionId, optional): discussionId
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.videoCall.leave', [
'507f1f77bcf86cd799439011', // discussionId
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | yes | |
participantCount | integer | yes |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.
v3.videoCall.ping
Description
Ping to indicate user is still in a video call. Updates lastSeen timestamp for stale participant cleanup.
Parameters
Argument 1 (discussionId, optional): discussionId
Example
javascript
const { Client } = require('@hailer/cli');
const client = await Client.create({
host: 'https://api.hailer.com',
username: 'you@example.com',
password: '••••••',
});
const result = await client.request('v3.videoCall.ping', [
'507f1f77bcf86cd799439011', // discussionId
]);
console.log(result);Returns
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | yes |
Auth: requires an authenticated session.
Errors: on failure returns the standard Hailer error object { code, msg, details?, debug? }.