VoiceGateway

Mint a short-lived, read-only token for some of the project's widgets

POST
/api/v1/org/{orgId}/project/{projectId}/embed-tokens

Authorization

cookievg_session<token>

The console's session cookie, set when you sign in. Every operation accepts it, at the role the operation names.

Path Parameters

orgId*string

Authorised orgId; the server must verify organisation/project ownership before any read.

Length1 <= length
projectId*string

Authorised projectId; the server must verify organisation/project ownership before any read.

Length1 <= length

Request Body

application/json
  1. body
widgets*array<>

The widgets the token opens. A recent-calls frame whose rows open a call needs both recent-calls and call.

Items1 <= items
origin*string

The one site that may frame the widgets, one of the project's allowedOrigins.

expiresInSeconds?integer

How long the token is valid.

Range60 <= value <= 86400
Default3600
transcriptsAndAudio?boolean

Share what was said with the framing site: the one-call view's turn text, span attributes (prompts, transcripts, tool arguments), the SDK call fields and recording audio. Off by default, when the call widget shows timings only and listCalls refuses the field filter. Needs the call widget, and an Admin or a project key.

Defaultfalse

Response Body

The token, shown in this answer only.

application/json
  1. response
token*string

vge_ followed by a signed JWT. Put it in the frame's address as ?token=. Shown once; VoiceGateway does not store it.

expiresAt*string

When the token stops working.

Formatdate-time
widgets*array<>

The widgets the token opens.

origin*string

The origin the token may be framed by, normalised.

transcriptsAndAudio*boolean

Whether the token shares turn text, span attributes and recording audio.

Example Request
curl -X POST 'https://example.com/api/v1/org/string/project/string/embed-tokens' \  -H 'Content-Type: application/json' \  -d '{  "widgets": [    "answer-time"  ],  "origin": "string"}'
Example Response
{  "token": "string",  "expiresAt": "2019-08-24T14:15:22Z",  "widgets": [    "answer-time"  ],  "origin": "string",  "transcriptsAndAudio": true}

Was this page helpful?