Authenticate with a session JWT, an agent session, or a workspace-bound personal access token.
Send a bearer token on every request:
Authorization: Bearer YOUR_TOKENA missing or invalid token returns 401.
Workspace-scoped means workspace-bound
Every Embrasure personal access token (PAT) belongs to the workspace selected when the token is created. Product endpoints still take an explicit workspace_id; with a PAT it must match the token's workspace, or the request returns 403 with workspace_token_mismatch. Call GET /v1/auth/whoami to see which workspace and scopes a token carries.
| Token | Best for | Notes |
|---|---|---|
| Session JWT | Web and interactive administration | Represents the signed-in user across their workspaces. Has every scope. Required to create PATs. |
Agent session (esa_…) | MCP clients and embrasure auth login | Issued by the browser OAuth flow. Bound to one workspace and to the scopes approved at sign-in. See MCP and the CLI. |
Personal access token (dpt_…) | Scripts, API integrations, CI, and dbt | Bound to one workspace. Must be allowed by workspace policy. Stored hashed; the raw value is shown once. |
SCIM provisioning under /scim/v2 uses its own token type and error schema; see SCIM provisioning.
You must be a workspace administrator, and Personal access tokens must be allowed for the workspace.
write.write token without admin, open Limit warehouse writes and list the databases the token can write to.dpt_… value immediately and store it in your deployment's secret manager. Embrasure does not show the raw token again.If token creation is disabled, ask a workspace administrator to allow PATs under Admin settings → Sign-in. Disabling PATs later blocks existing PATs from that workspace with personal_access_tokens_disabled; revoke tokens that are no longer needed. Workspaces that require SSO reject PATs with sso_required.
POST /v1/auth/tokens requires a signed-in session (session_required otherwise), admin scope, the workspace admin or owner role, and PATs allowed for the workspace.
curl --request POST https://api.embrasure.ai/v1/auth/tokens \
--header "Authorization: Bearer $EMBRASURE_SESSION_JWT" \
--header "Content-Type: application/json" \
--data '{
"workspace_id": "workspace-1",
"name": "ci dbt",
"expires_in_days": 30,
"scopes": ["read", "write"],
"client_kind": "automation"
}'| Field | Notes |
|---|---|
workspace_id | Required. The workspace the token is bound to. |
name | Required. 1 to 120 characters. |
expires_in_days | 1 to 365. Defaults to 30. |
scopes | Any of read, write, and admin. Defaults to ["read", "write"]; cannot be empty. |
client_kind | api_token (default), automation, cli, or mcp. |
warehouse_write_databases | Optional list of databases a write token may write to. Reads are never limited. |
The response contains the raw token once and its token_metadata.
| Operation | Notes |
|---|---|
GET /v1/auth/tokens | Lists your own tokens. Optional workspace_id filter and limit (1 to 500, default 100). Requires admin scope. |
POST /v1/auth/tokens/{token_id}/revoke | Revokes one of your own tokens. Requires admin scope. |
GET /v1/auth/whoami | Returns the caller, authentication method, bound workspace, and token scopes. Requires read scope. |
Available scopes are read, write, and admin; admin includes write, and write includes read. Endpoint scope checks are combined with workspace role checks, so a write-scoped token does not make a viewer into an editor.
Workspace roles, from least to most access, are viewer, billing_admin, editor, security_admin, admin, and owner. Writes need editor or higher. A token is denied with insufficient_scope when it lacks a scope and with insufficient_workspace_role when its user lacks the role.
A token with Limit warehouse writes can write only through warehouse SQL, and only to the listed databases. Other write operations, such as changing ingestion, return 403 with token_write_database_limited.
Pass the raw PAT as a bearer token. Keep it in a credential manager or secret store, inject it at runtime, and never place it in source control, screenshots, agent chat, or build logs.
For writes, the token needs write scope and its user must remain an editor or higher in the same workspace. Revoke and replace a token before it expires or whenever its secret may have been exposed.