- Workspace API keys for trusted server-side integrations and MCP clients.
- Programmatic session tokens for email/password authentication flows.
Workspace API keys
Send the workspace API key as a Bearer token in theAuthorization header:
Obtain an API key
- Log in to the Trellis Dashboard.
- Open the workspace where the integration should operate.
- Go to Settings > Developer and open the Developer / API section.
- In API Keys, click Create Key.
- Give the key a clear name, such as “Operations MCP” or “Reporting worker”.
- For a server integration, select each workspace the key should access.
- Copy the key immediately and store it in your server-side secret manager.
Key scope
Each API key has exactly one owner workspace where administrators manage it. Trellis rejects requests when the workspace in the URL is not that owner workspace. CallGET /api/v1/workspaces with the key to discover its owner workspace id and display name. Use that id in workspace-scoped API requests.
To change an existing server integration key, open its Permissions action in Settings > Developer. You can update its scopes without replacing or revealing the key. Its workspace cannot be changed.
The same key format works for the Public REST API and Trellis MCP Server.
Revoking a key
- Go to Settings > Developer and open the Developer / API section.
- Find the key you want to revoke.
- Click Revoke.
- Confirm the action.
401 Unauthorized.
Programmatic session authentication
Use the auth endpoints to authenticate with email and password and receive a session token. This is useful for integrations that run under a specific Trellis user account.Create a session
accessToken as a Bearer token for subsequent requests:
Refresh a session
Access tokens expire. Use the refresh token to get a new access token without re-authenticating:POST /auth/token. Store the new refreshToken for subsequent refreshes.
Get the authenticated profile
Auth endpoints summary
The auth endpoints authenticate existing Trellis user profiles. They do not create new users or
workspace memberships. Workspace API keys (
trls_...) do not have user profiles and will receive
401 from GET /auth/me.Security best practices
- Store keys and tokens in environment variables or a secret manager.
- Never commit a key to source control.
- Rotate keys periodically.
- Create separate keys for separate systems so you can revoke one integration without disrupting others.
- Use explicit user confirmation before any connected client creates tasks, updates records, or sends messages.
- For programmatic sessions, store refresh tokens securely and refresh proactively before the access token expires.