---
title: "Issue a short-lived token for the agent conversation"
method: POST
path: "/agents/{id}/console-token"
tags: ["agents"]
---

# Issue a short-lived token for the agent conversation

`POST /agents/{id}/console-token`

## Request

- Base URL: `https://api.mailly.site` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mailly.site/agents/{id}/console-token`
- Auth: HTTP bearer

For direct browser connections to agent conversations; body.thread_id is optional: with it you get that thread conversation, otherwise the main conversation.

## Path parameters

- `id` string, required: agent ID

## Request body

- object
  - `thread_id` string: Inbox thread ID

## Response `200`

Token issued

- object
  - `success` boolean, required
  - `url` string, required
  - `token` string, required
  - `expires_at` number, required
  - `name` string, required

## Other responses

- `400`: Invalid parameters
- `401`: Missing or invalid API key
- `404`: Agent not found

---

[API](https://skmtc.dev/mailly/apis/mailly-api.md) · [All operations](https://skmtc.dev/mailly/apis/mailly-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mailly/apis/mailly-api/revisions/1ceb29637301?raw)
