Skip to content

Exchange App Session

POST
/app-sessions/exchange

PREVIEW. This endpoint is deployed but gated: it returns 404 unless the hosted app platform is enabled for your organization. It is published here so the contract describes the whole surface, not so it can be called today.

Mint a short-lived browser app token for the authenticated PropelAuth principal.

Auth is the EXISTING get_current_user PropelAuth dependency — no valid principal -> 401. subject / client_org_id / role are derived SERVER-SIDE from that validated principal (derive_browser_identity), never from body — a forged identity/role in the body has no effect. Minting also requires a consented installation of the target app in the principal’s org (403). A fail-closed per-principal / per-app limiter throttles the mint (429).

Authorizations

Parameters

Header Parameters

X-Org-Id
Any of:
string

The organization ID to use for the request

Request Body required

Body for the browser exchange — target app + non-identity params ONLY.

Identity is DERIVED SERVER-SIDE from the authenticated PropelAuth principal (locked decision §5: “browser auth = PropelAuth login -> short-lived graph8 app token”): subject / client_org_id / role come from the validated principal, never from this body, so a client cannot self-assert who it is or escalate its role. Any subject / client_org_id / role keys a caller forges into the body are ignored (pydantic drops unknown fields).

object
app_id
required

Target app id (dapp_-prefixed)

string
scopes

Scopes to embed in the token

Array<string>

Responses

200

Successful Response

object
data
required

The minted token + the non-secret metadata a client needs.

object
access_token
required

The signed app JWT

string
app_id
required

App the token is bound to

string
audience
required

The distinct-per-app, per-environment audience

string
expires_in
required

Lifetime in seconds

integer
kid
required

Signing key id (matches a JWKS entry)

string
token_type

Always ‘Bearer’

string
default: Bearer
pagination
Any of:
object
has_next
required

Whether there are more pages

boolean
limit
required

Items per page

integer
next_cursor
Any of:
string
page
required

Current page number (1-indexed)

integer
total
required

Total number of items

integer

422

Validation Error

object
detail
Array<object>
object
loc
required
Array
msg
required
string
type
required
string