Authentication
Tokens, sessions, the CLI device flow, and workspace scoping.
Auth methods
Floom Cloud accepts three credentials. Pick one by where your code runs.
API tokenheaderx-floom-token. The right choice for scripts, servers, CI, and MCP clients. Personal (floom_…) or workspace-scoped (wst_…).Session JWTheaderAuthorization: Bearer. Used by the dashboard; expires hourly and must be refreshed. Rarely what you want for automation.Device flowinteractivePersonal & workspace tokens
Tokens are sent in the x-floom-token header. There are two kinds:
- Personal access token (
floom_…) — tied to your user, valid across every workspace you belong to. Mint in the dashboard under Settings → API tokens, or via the API. - Workspace token (
wst_…) — tied to one workspace, ideal for shared automation that should not follow a single person’s account.
curl https://workeros-api.floom.dev/api/workers \ -H "x-floom-token: floom_xxxxxxxxxxxxxxxxxxxxxxxx"
Manage tokens over the API:
/auth/tokens/auth/tokens/auth/tokens/{token_id}/api/workspace/tokens/api/workspace/tokens/api/workspace/tokens/{token_id}CLI device flow
floom login --cloud uses an OAuth-style device flow so you never paste a token by hand. The CLI requests a code, you approve it in the browser, and the CLI receives a token it stores at ~/.config/floom/credentials.json.
Under the hood:
- 1. CLI →
POST /api/cli-auth/devices→{ device_code, user_code, verification_url, polling_interval_seconds, expires_in_seconds }. - 2. CLI prints
user_code+ opensverification_url; you confirm the code matches and approve in the browser. - 3. CLI polls
POST /auth/cli-exchangewith{ device_code, user_code }until it returns a token (honoringRetry-Afteron 429). The olderGET /api/cli-auth/poll/…shape is self-hosted only.
user_code on screen matches the one in your terminal before approving.Session JWT
Browser sessions use a Supabase access token sent as Authorization: Bearer <jwt>. Access tokens last about an hour; the dashboard refreshes them via POST /auth/refresh using theworkeros_cloud_session cookie. (Cloud auth-overlay routes live under /auth, not /api;/auth/me is additionally aliased at /api/auth/me.) You generally only need this if you are building a web client that signs in users directly — for servers and scripts, use an API token instead.
curl https://workeros-api.floom.dev/auth/me \ -H "Authorization: Bearer <supabase_access_token>"
Workspace scoping
Every request runs in the context of one workspace. Resolution order:
- The
x-workeros-workspace: <workspace_id>header, if present (and you are a member). - Otherwise the token’s / session’s default (active) workspace.
List the workspaces you belong to, then scope a call explicitly:
# discover your workspaces curl https://workeros-api.floom.dev/api/workspaces -H "x-floom-token: floom_xxx" # target a specific one curl https://workeros-api.floom.dev/api/workers \ -H "x-floom-token: floom_xxx" \ -H "x-workeros-workspace: ws_123"
With the CLI, switch the active workspace once and every later command inherits it: floom workspaces switch <name-or-id>. See the CLI reference.
Auth errors
401Unauthorized403Forbidden429Too Many RequestsRetry-After header.Errors return a JSON body of the shape { "detail": "<message>" }.