Create an auth token
Generates a signed access token for embedding a dashboard or accessing a project. Choose a scenario from the table below:
| Token type | Scenario | Required fields | Use case |
|---|---|---|---|
dashboard | Single dashboard | dashboardId, dashboardSecret | Embed one dashboard; no user management needed |
project | Org user | projectId, projectSecret, orgUserId | Your organization's internal users accessing multiple dashboards |
project | Tenant user by ID | projectId, projectSecret, endUserId | Customer already provisioned in Semaphor |
project | Tenant user by email | projectId, projectSecret, endUserEmail, tenantId or tenantName | Customer identified by email and tenant |
project | Auto-provision user | projectId, projectSecret, endUserEmail, tenantId or tenantName, autoCreateEndUser: true | New customers created automatically on first access |
For auto-provisioning, the new user is assigned the role you
specify (defaults to VIEWER).
Dashboard selection (project tokens only): The dashboard loaded on first render is resolved in priority order:
| Priority | Field | Behavior |
|---|---|---|
| 1 | targetDashboardId | Hard navigation — always wins |
| 2 | (user preference) | User's saved preference for this project |
| 3 | initialDashboardId | Soft default — overridden by user preference |
| 4 | (project default) | The project's default dashboard |
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X post "https://semaphor.cloud/api/v1/token" \ -H "Content-Type: application/json" \ -d '{ "dashboardId": "d_abc123", "dashboardSecret": "dash_secret_123", "endUserEmail": "user@example.com", "tenantId": "tenant_123", "semanticDomainAccess": { "mode": "include", "domains": [ "sales", "finance_domain" ] } }'{
"accessToken": "string"
}{
"error": "string"
}{
"error": "string"
}{
"error": "string"
}