Exchange A Widget Session For A Run Token (M2M)
Issue the widget run token agent-runtime runs a widget conversation with, from the session the browser holds: a signed widget session token, or a legacy widget session BundleAccessToken. The run acts as the session's subject and carries its end user.
Header Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Body of POST /v1/bundler/widget-session/exchange: the agent the session is presented for, which must be the agent it was minted for, and the modality of the run it starts (which bounds the run's life).
Response Body
application/json
application/json
curl -X POST "https://example.com/v1/bundler/widget-session/exchange" \ -H "Content-Type: application/json" \ -d '{ "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "modality": "text" }'{ "run": { "token": "string", "run_id": "string", "expires_at": "2019-08-24T14:15:22Z", "deadline_at": "2019-08-24T14:15:22Z" }, "agent": { "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "name": "string", "deployment_id": "6ef0ac85-9892-4664-a2a5-58bf2af5a8a6", "llm_provider_id": "01f100ab-eef6-496a-9799-f8fbf49c6288", "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b", "system_prompt": "string", "has_workflow": false, "event_org_id": "38381290-8ff7-413c-a0d2-e750a21c5122", "creator_id": "9cceffdd-8381-4074-8256-eafae24ebee6", "first_message": "string", "state_schema": {}, "evaluation_criteria_defs": [] }}Empty
Empty
Empty
Empty
{ "detail": [ { "loc": [ "string" ], "msg": "string", "type": "string" } ]}