Skip to content

Create a session token (browser channel)

POST
/sessions
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.

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"
}
]
}
}
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