Start a Voxbi AI Chat session (user)
Mints the short-lived chat token that POST /api/v1/chat/message (and,
for a client that wants raw MCP transport instead, POST /mcp/cockpit)
requires.
This is the only endpoint in the Voxbi AI Chat surface that accepts an
ordinary user app token (a Sanctum token minted with no explicit
abilities, which Sanctum stores as ["*"]). Every other call in this
flow requires the token returned here instead.
The minted token carries abilities exactly ["mcp:use"] and expires
after MCP_SESSION_TTL_MINUTES (default 15 minutes). It is deliberately
narrower than the caller's own app token: the assistant holds it for the
life of one conversation, and revoking it does not end the user's app
session. Minting again immediately revokes any chat token this user
already held, so a user has at most one live chat session.
The plaintext token is returned once and cannot be retrieved again. When
a long-running conversation gets a 403 from POST /api/v1/chat/message
because the token expired mid-conversation, the client's only recovery is
to call this endpoint again (the app token is still valid) and resume
with the new chat token; the message history the client already holds is
unaffected and is simply replayed on the next /chat/message call.
User bearer token. Default authentication for customer-facing endpoints.
Obtain a token by calling POST /login with your credentials, then send it
on every subsequent request as Authorization: Bearer <token>. The token
inherits the permissions and PBX scope of the authenticated user.
- HTTP Authorization Scheme
bearer- Bearer format
Bearer <token>
Responses
dataobject
9f8b1c2d-0000-4a1b-9c3d-000000000001|Zt7Qk2xR8vLmA1sD4fG6hJ9kN0pB3cE5uY7iO2wT2026-09-04T21:15:00+00:00Authorization Token is missingThis action is unauthorized.Exception occurred while starting a chat session.https://cockpit.voxbi.com/api/v1/chat/session
curl -X POST 'https://cockpit.voxbi.com/api/v1/chat/session' \
-H 'Authorization: Bearer YOUR_TOKEN'
const response = await fetch('https://cockpit.voxbi.com/api/v1/chat/session', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${YOUR_TOKEN}`,
},
});
const data = await response.json();
console.log(data);
import requests
response = requests.post('https://cockpit.voxbi.com/api/v1/chat/session',
headers={'Authorization': f'Bearer {YOUR_TOKEN}'}
)
response.raise_for_status()
data = response.json()
print(data)
<?php
$context = stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/json\r\nAuthorization: Bearer YOUR_TOKEN",
],
]);
$response = file_get_contents('https://cockpit.voxbi.com/api/v1/chat/session', false, $context);
$data = json_decode($response, true);
print_r($data);
{ … }
"data": { … }
{ … }
private, must-revalidatekeep-aliveapplication/jsonOrigin6057