Mint a short-lived live-activity token (dashboard session)

​

Mints a short-lived, analytics-scoped Portal JWT used to open the environment's live-activity WebSocket on the realtime edge. Dashboard session auth — this route is authenticated with a Clerk dashboard session (the same session the Portal dashboard uses), not with a secret key, and the caller must belong to the organization that owns the environment.

Flagged in the PR: OpenAPI's http bearer scheme does not cleanly model a browser-cookie dashboard session, so this operation is described with a dashboard-session security scheme (documentation-only — it carries no header a client sends programmatically). Integrators building custom dashboards should use the Portal dashboard instead of calling this route directly. The token has a fixed 15-minute TTL and an analytics scope; it is refused on channel and inbox routes.

Path Parameters

  • The environment id.

Responses

  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/v1/environments/{envId}/logs-token
curl https://api.useportal.co/v1/environments/env_abc123/logs-token \
  --request POST \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN'
A 15-minute analytics-scoped JWT
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImVudl8xMjMifQ.eyJzdWIiOiJkYXNoYm9hcmQ6dXNlcl9hYmMiLCJhbm9uIjpmYWxzZSwic2NvcGUiOiJhbmFseXRpY3MiLCJpYXQiOjE3NTI5MTIwMDAsImV4cCI6MTc1MjkxMjkwMH0.signature",
  "expiresAt": "2026-07-19T02:15:00.000Z"
}