Skip to content

Class: Talkline ​

The control API, as your backend calls it: one method per route, grouped as the reference groups them — rooms, calls, recordings, queues, webhooks and the rest — each answering what its route answers, and throwing a TalklineApiError for a problem answer. Each method's description begins with the route it calls.

Every list… and iterate… method's query is optional: leave it out for the route's defaults. A list… answers one page, { data, nextCursor }; the matching iterate… reads every page in turn, as for await (const room of talkline.rooms.iterate()). The types of each route's query, body and answer are the reference's, by the same names: Queue is the schema Queue.

Constructors ​

Constructor ​

ts
new Talkline(opts): Talkline;

Parameters ​

ParameterType
optsTalklineOptions

Returns ​

Talkline

Properties ​

PropertyModifierTypeDescription
applicationsreadonlyApplicationsApiThe platform operator's routes; a tenant key is refused.
callsreadonlyCallsApiCalls placed from the server, their history and timelines.
creditsreadonlyCreditsApiThe credit ledgers of the identities a tenant enforces.
identitiesreadonlyIdentitiesApiWhat a person chose — display name, availability — and where to ring them.
presencereadonlyPresenceApiWho is online or in a call.
queuesreadonlyQueuesApiRouting a call to whichever member is free, and why it chose whom it did. Queues are addressed by id here; a call names one by slug or id.
recordingsreadonlyRecordingsApiRecording a room, and the files a recording leaves.
roomsreadonlyRoomsApiRooms, the participants in them, and acting on a live one.
tokensreadonlyTokensApiMinting and checking access tokens on the server.
usagereadonlyUsageApiWhat was used, and what a credit buys.
webhooksreadonlyWebhooksApiWhere Talkline sends what it knows, and what it sent.

Methods ​

health() ​

ts
health(): Promise<Health>;

GET /v1/health: whether the API reaches its database and Redis.

Returns ​

Promise<Health>


mintToken() ​

ts
mintToken(opts): Promise<string>;

An access token, minted here in this process — no network call, and a call still starts when Talkline's control plane is down. The way to mint; tokens.mint is the round trip for those that would rather not.

Parameters ​

ParameterType
optsOmit<MintOptions, "apiKey" | "apiSecret">

Returns ​

Promise<string>

Talkline documentation