Skip to main content
POST
Exchange a refresh token for a session, optionally acting for an account

Authorizations

Authorization
string
header
required

Platform access token from POST /auth/token, carrying the platform audience and the developer_key_id of the registration that minted it. It acts as your own account; name a client you created with X-Hevn-Account: cl_…. Every request re-checks that the registration is still active and that the caller's source IP is inside its allowlist. A token is valid only against the server that issued it, so sandbox tokens are refused in production and production tokens in the sandbox.

Headers

x-api-key
string | null
user-agent
string | null

Body

application/json
userId
string | null

Account to act for; omit it to continue acting as the authenticated account.

Pattern: ^(?:cl_)?[A-Za-z0-9._:\-]{1,216}$
Example:

"cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"

Response

Successful Response

accessToken
string
required

Short-lived bearer token used to authorize API requests.

expiresIn
integer
required

Number of seconds until the access token expires.

userId
string
required

Account selected for the issued session.

Pattern: ^(?:cl_)?[A-Za-z0-9._:\-]{1,216}$
Example:

"cl_9f2c1ab84d7e4f1fa3c65b0e7d9a2c41"