client_id and client_secret (Basic Auth)https://auth.aworld.cloud/oauth2/token with grant_type=client_credentialsaccess_token with configured scopesapp/read: read end-user API dataapp/write: write end-user API data (e.g., log activity on behalf of user)dashboard/read: read configurations and analyticsdashboard/write: create/modify missions, content, usersx-external-user-id header (your system's user identifier) or x-user-id header (AWorld internal user ID) to specify the user to impersonate, one per requestauth.{CUSTOM_DOMAIN} with selective routingexpiresAt > now before return/oauth2/token → Lambda (with caching logic for client_credentials)/.well-known/openid-configuration → Lambda (cached response with URL rewriting)workspaceId in token and requested workspaceidentityId as principalIsAuthorizedWithToken API of Verified PermissionsworkspaceId, resourceId extracted from URL| Claim | Description | Security importance |
|---|---|---|
sub | Cognito user ID | Unique user identifier |
workspaceId | Workspace ID | CRITICAL: Multi-tenant isolation |
accountId | Account ID | Tenant membership |
userId | Application user ID | Application user ID |
context | "dashboard" | "app" | Authorized API context |
platform | "web" | "mobile" | "m2m" | Client type |
role | User role | RBAC permissions |
exp | Unix timestamp | Token expiration |
platform: "m2m"x-external-user-id: {externalId}: the user identifier in the client's own system, set as externalId when the user is created. The client never has to store AWorld's internal IDsx-user-id: {userId}: the AWorld internal user ID400 if both headers are sent401 if no header is sent on an endpoint that requires a user401 if the user is not found thereplatform: "web" or "mobile") are never affected: the headers are ignoreduserId: User ID to impersonateprincipalId: User principal IDlang, timezone, currency: User preferencesstatus: User statusapp/write or dashboard/write