Exchange A Run Token For A Hand-off Target's Token (M2M)
Issue the run token a hand-off target runs with. The target must be a hand-off target of the snapshot the caller is executing (config_ref) and belong to the caller's organisation. The new token inherits the run, payer and end user, never staged access, and never outlives the caller's token.
Authorization
BundleAccessToken AuthorizationBearer <token>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Body of POST /v1/bundler/run-token/exchange: the hand-off target and the snapshot the caller is executing, which decides reachability.
Response Body
application/json
application/json
curl -X POST "https://example.com/v1/bundler/run-token/exchange" \ -H "Content-Type: application/json" \ -d '{ "target_agent_id": "b0b31ccc-0df2-496f-b84c-b8d90f867dcc", "config_ref": {} }'{ "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
{ "detail": [ { "loc": [ "string" ], "msg": "string", "type": "string" } ]}