> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open.cx/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a participant token

> Mint a short-lived scoped token for one participant to power the drop-in thread component or a headless WebSocket — their lanes and language only.

Mint a client token for one participant. Pass it to the `<ConnectThread>` component or use it to open the thread WebSocket for a custom UI. The token grants exactly that participant's view: their lanes, their language, read/send only while the thread accepts messages.

Tokens expire after 24 hours by default — mint them server-side when your app opens the order screen, not at order creation.

## Path

<ParamField path="thread_id" type="string" required>
  Thread ID (`th_…`) or your `reference`.
</ParamField>

## Request

<ParamField body="participant_id" type="string" required>
  Participant ID (`prt_…`) or their `external_id`.
</ParamField>

<ParamField body="expires_in_seconds" type="number" default="86400">
  Token lifetime, max 7 days.
</ParamField>

## Response

<ResponseField name="token" type="string">
  The scoped participant token.
</ResponseField>

<ResponseField name="expires_at" type="string">
  ISO 8601 expiry.
</ResponseField>

<RequestExample>
  ```bash cURL theme={"dark"}
  curl -X POST https://api.open.cx/connect/threads/order_84421/tokens \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "participant_id": "cus_991" }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={"dark"}
  {
    "token": "cntk_eyJhbGciOiJIUzI1NiJ9...",
    "expires_at": "2026-07-31T14:05:00Z"
  }
  ```
</ResponseExample>
