staqlydocs
REST APIAPI referenceAuth

Current principal, workspace and CSRF token

Current principal, workspace and CSRF token

Every request sends Authorization: Bearer ...: the access token in local mode, an API key stk_... in cloud mode. Use Send to try it against your cloud instance with your API key.

GET
/v1/session

Authorization

headerAuthorizationBearer <token>

API key (stk_...), or in the Community Edition the access token (stk_local_...)

Response Body

OK

application/json
  1. response
mode*string
Value in"local""cloud"
workspace*
principal*
csrf_token*string

Empty for API-key callers

user?
role?Role

viewer: read; editor: write, schedule and publish; admin: everything in the workspace; owner: admin who may also manage owners

Value in"owner""admin""editor""viewer"
account_owner?boolean

Owns the account this workspace belongs to (creates and deletes workspaces, billing)

accounts_enabled?boolean

Cloud accounts with Google sign-in are on

workspaces?array<>

Workspaces this person can switch to

onboarded?boolean

The welcome wizard is done (per person in an account; in the Community Edition per workspace, and a workspace with channels or posts counts as done). False sends the dashboard to /welcome once.

defaults?

Server defaults that apply when a collection sets no value.

curl -X GET 'https://staqly.example.com/v1/session'
{  "mode": "local",  "workspace": {    "id": "string",    "name": "string",    "plan": "plus",    "recovery_rotated_at": "string",    "created_at": "string",    "timezone": "Europe/Warsaw"  },  "principal": {    "type": "local",    "id": "string",    "name": "string",    "scopes": [      "collections:read"    ]  },  "csrf_token": "string",  "user": {    "id": "string",    "name": "string",    "email": "string",    "avatar_url": "string"  },  "role": "owner",  "account_owner": true,  "accounts_enabled": true,  "workspaces": [    {      "id": "string",      "name": "string",      "role": "owner",      "current": true    }  ],  "onboarded": true,  "defaults": {    "processing_timeout_seconds": 0  }}