Create a session token (browser channel)
POST
/sessions
const url = 'https://demo.yourapp.com/api/v1/sessions';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://demo.yourapp.com/api/v1/sessions \ --header 'Authorization: Bearer <token>'Mints a short-lived (1 hour) session token bound to the API key and the calling origin. Required before calling write endpoints from a browser. Server-to-server callers do not need sessions.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Session token created
Media typeapplication/json
object
data
object
sessionToken
required
JWT to send in X-Session-Token
string
expiresAt
required
string format: date-time
Examplegenerated
{ "data": { "sessionToken": "example", "expiresAt": "2026-04-15T12:00:00Z" }}Missing/invalid/revoked/expired API key (API_KEY_REQUIRED, API_KEY_INVALID, API_KEY_REVOKED, API_KEY_EXPIRED) or missing/invalid session token on the browser channel (SESSION_REQUIRED, SESSION_INVALID, SESSION_EXPIRED).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Array<object>
object
path
string
message
string
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": [ { "path": "example", "message": "example" } ] }}Origin not allowed (ORIGIN_NOT_ALLOWED), missing scope (SCOPE_NOT_GRANTED), or account issues (TENANT_SUSPENDED, SUBSCRIPTION_CANCELLED, SUBSCRIPTION_PAST_DUE, MODULE_NOT_ENABLED).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Array<object>
object
path
string
message
string
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": [ { "path": "example", "message": "example" } ] }}Rate limit exceeded (RATE_LIMITED)
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
Array<object>
object
path
string
message
string
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": [ { "path": "example", "message": "example" } ] }}Headers
Section titled “Headers”Retry-After
integer
Seconds until the window resets
X-RateLimit-Limit
integer
X-RateLimit-Remaining
integer
X-RateLimit-Reset
integer
Unix timestamp (seconds) of the window reset