Semaphor

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 typeScenarioRequired fieldsUse case
dashboardSingle dashboarddashboardId, dashboardSecretEmbed one dashboard; no user management needed
projectOrg userprojectId, projectSecret, orgUserIdYour organization's internal users accessing multiple dashboards
projectTenant user by IDprojectId, projectSecret, endUserIdCustomer already provisioned in Semaphor
projectTenant user by emailprojectId, projectSecret, endUserEmail, tenantId or tenantNameCustomer identified by email and tenant
projectAuto-provision userprojectId, projectSecret, endUserEmail, tenantId or tenantName, autoCreateEndUser: trueNew 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:

PriorityFieldBehavior
1targetDashboardIdHard navigation — always wins
2(user preference)User's saved preference for this project
3initialDashboardIdSoft default — overridden by user preference
4(project default)The project's default dashboard
POST
/api/v1/token

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"
}