Authentication
The Modbox API uses Bearer tokens for authentication. Every request must include an Authorization header.
API Tokens (recommended)
API tokens are long-lived credentials ideal for server-to-server communication, CI/CD pipelines, and integrating Modbox into your backend.
Create a token
Go to Settings → API Tokens in the Modbox dashboard and click New token. Give it a descriptive name like production-backend or ci-pipeline.
You can also create tokens via the API:
Use the token
Include the token in every request:
Revoke a token
JWT Tokens (interactive sessions)
When users log in via the dashboard or your app, they receive short-lived JWT access tokens. Use these for user-facing flows.
Login
Response:
Refresh
Access tokens expire after 5 minutes. Refresh them with:
SSO (Google, GitHub, Microsoft)
Redirect users to the SSO login flow:
After authentication, users are redirected to your app with tokens in the URL fragment.
Workspace header
When making requests that are scoped to a workspace, include the X-Workspace-Id header:
You can find your workspace ID in the dashboard URL or via GET /workspaces.