API

ThreadPreviewAccess

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/thread_preview_access/redeem create Viewer session token for the preview's host-only cookie
POST /api/v1/thread_preview_access/upstream create Token to send as X-Blaxel-Preview-Token until it expires
GET /api/v1/thread_preview_access/start load

Fields

Field Type Required Description

create

POST /api/v1/thread_preview_access/redeem

Operation ID: api_v1_thread_preview_access_redeem.

Authentication: bearer token (bearerAuth).

Request body

application/json

Property Type Required Description
host string Yes
token string Yes

Responses

application/json

Property Type Required Description
max_age integer Yes
session_token string Yes
401: Missing proxy bearer, or an invalid, expired or replayed token
403: The signed-in user can no longer open the preview

POST /api/v1/thread_preview_access/upstream

Operation ID: api_v1_thread_preview_access_upstream.

Authentication: bearer token (bearerAuth).

Request body

application/json

Property Type Required Description
host string Yes

Responses

200: Token to send as X-Blaxel-Preview-Token until it expires

application/json

Property Type Required Description
expires_at string (date-time) Yes
token string Yes
401: Missing proxy bearer
404: Unknown thread or service
409: The thread's machine is not running or the thread is no longer available
503: Blaxel is unavailable; retry

load

GET /api/v1/thread_preview_access/start

Operation ID: api_v1_thread_preview_access_start.

Authentication: not required.

Parameters

Parameter In Type Required Description
host query string Yes Preview hostname, for example p3000-0123abcd0123abcd0123abcd0123abcd-g1.us-was-1.preview.example.com
return_to query string No Relative path to open after sign-in

Responses

302: Redirect to login or to the preview's callback
403: HTML page explaining that only the bot's owner can open the preview

text/html

The response is string.

404: HTML page for an unknown thread or service

text/html

The response is string.