Appearance
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
| Parameter | Type |
|---|---|
opts | TalklineOptions |
Returns
Talkline
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
applications | readonly | ApplicationsApi | The platform operator's routes; a tenant key is refused. |
calls | readonly | CallsApi | Calls placed from the server, their history and timelines. |
credits | readonly | CreditsApi | The credit ledgers of the identities a tenant enforces. |
identities | readonly | IdentitiesApi | What a person chose — display name, availability — and where to ring them. |
presence | readonly | PresenceApi | Who is online or in a call. |
queues | readonly | QueuesApi | Routing 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. |
recordings | readonly | RecordingsApi | Recording a room, and the files a recording leaves. |
rooms | readonly | RoomsApi | Rooms, the participants in them, and acting on a live one. |
tokens | readonly | TokensApi | Minting and checking access tokens on the server. |
usage | readonly | UsageApi | What was used, and what a credit buys. |
webhooks | readonly | WebhooksApi | Where 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
| Parameter | Type |
|---|---|
opts | Omit<MintOptions, "apiKey" | "apiSecret"> |
Returns
Promise<string>