AgentConnect
Agents

Mint a webchat token

Mints a short-lived token the browser presents to the relay pool to start or resume a playground webchat session with this agent. A resume is allowed for the conversation owner, and for any non-viewer member who may continue every session it currently stands on (org-visible sessions; private ones stay owner-only). A resume answers 409 once an agent’s next turn would reach a machine that does not hold its session. With coordinator, the token is for the caller’s private conversation with the agent’s coordinator, created on first use and answered with its current session; it needs a daemon that reads Auto and the legacy webchat protocol.

POST
/v1/orgs/{orgId}/agents/{agentId}/webchat/token

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

orgId*string
agentId*string
Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/orgs/string/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/webchat/token" \  -H "Content-Type: application/json" \  -d '{}'
{  "protocol": "legacy",  "ahp": {    "url": "http://example.com",    "sessionUri": "string",    "peers": [      {        "agentId": "bc309ecf-5f66-4057-93c5-6611cc9cb7b2",        "url": "http://example.com",        "sessionUri": "string"      }    ]  },  "token": "string",  "relayUrl": "string",  "conversationId": "string",  "expiresAt": "2019-08-24T14:15:22Z",  "sessionId": "string"}