Skip to content

Identity API

The Identity API tells your application who the signed-in user is and what they can do. Its main resource is the current user (/identity/users/me). A second, separate set of routes manages ticketing admin and customer accounts; it is documented in Identity API: ticketing accounts.

To sign a user in and get a token, use the Authentication API. This page starts where that one ends.

Resources

Resource What it is
Current user The signed-in person: profile, platform role, and the organization and workspaces they can use, each with its permissions.
Ticketing admin A staff account for the ticketing portal. See ticketing accounts.
Ticketing customer A person who buys tickets. See ticketing accounts.

Authentication and permissions

Both routes on this page need an access token issued by the Authentication API. The token is read from the Authorization: Bearer <ACCESS_TOKEN> header, or from the access_token cookie when the header is absent. See Authentication.

Neither route checks a named permission: any signed-in user can read and update their own state.

Action Permission
Read the current user Any valid token
Mark onboarding complete Any valid token

Base path

Served by CoreAPI.

https://<API_HOST>/api/v1/identity/…

The routes take no organization or workspace ID. They act on the user and the organization in the token.

Capabilities

  • Read the current user with their organization, workspaces and permissions
  • Record that the user finished the first sign-in wizard
  • Update the current user's profile (planned)

Object model

Current user

Field Type Description
user_id string (UUID) ID of the signed-in user. Read-only.
email string or null Email address.
username string or null Username used at sign-in.
first_name string or null Given name.
last_name string or null Family name.
platform_role string or null Platform-scope role, set only for PlayTelly staff. null for customers' users.
platform_permissions string[] or null Permissions of platform_role.
org object or null The user's organization. null for platform staff who belong to none. One token holds one organization.
onboarded boolean false until the user finishes the first sign-in wizard. true for users with no organization.

The org object:

Field Type Description
org_id string Organization ID.
org_name string Display name.
org_slug string URL-safe name.
org_role string The user's organization role, for example ORG_ADMIN.
org_permissions string[] Permissions that role holds, such as org:users:manage.
default_app string ID of the app the organization's users open after signing in. Empty when not set.
workspaces object[] Workspaces the user can use (below).

Each entry of workspaces:

Field Type Description
workspace_id string Workspace ID.
workspace_name string Display name.
app_ids string[] IDs of the apps enabled for the workspace.
role string The user's workspace role: WORKSPACE_ADMIN, WORKSPACE_MEMBER, VIEWER or a custom role ID.
permissions string[] Permissions that role holds, such as workspace:media:view.

An app is one of the PlayTelly products a user signs in to: playout, tellyboard or spatioview. An organization is granted a set of apps; each workspace then enables some of them (at least one), and app_ids lists the workspace's. default_app is the one app, chosen by an organization admin, that people open after signing in; it must be one the organization has enabled. Change it with PUT /api/v1/tenancy/organizations/{orgId}/default-app (Organizations); change a workspace's apps in Workspaces.

workspaces is sorted by workspace name, then by ID, so workspaces[0] is a stable default. Two rules decide what is listed:

  • An ORG_OWNER or ORG_ADMIN sees every workspace of the organization, each with role: "WORKSPACE_ADMIN", whether or not they are a member.
  • Everyone else sees the workspaces they belong to directly or through a team. If both paths give a role, the highest wins (WORKSPACE_ADMIN, then WORKSPACE_MEMBER, then VIEWER).
{
  "user_id": "5b0c9a52-3c1e-4a35-9f43-0e8d6c0b7a11",
  "email": "alice@example.com",
  "username": "alice",
  "first_name": "Alice",
  "last_name": "Ng",
  "platform_role": null,
  "platform_permissions": null,
  "org": {
    "org_id": "9b2e4d71-0c3a-4f8e-b6d2-5a1c7e9f3b20",
    "org_name": "Example Cinemas",
    "org_slug": "example-cinemas",
    "org_role": "ORG_ADMIN",
    "org_permissions": ["org:users:manage", "org:teams:manage"],
    "default_app": "tellyboard",
    "workspaces": [
      {
        "workspace_id": "0f6d2f0e-6c1a-4a54-8a77-5d0f3c9b2e10",
        "workspace_name": "Default",
        "app_ids": ["playout", "tellyboard"],
        "role": "WORKSPACE_ADMIN",
        "permissions": ["workspace:general-settings:manage"]
      }
    ]
  },
  "onboarded": true
}

Errors

Status When What to do
401 No token, a malformed Authorization header, or an expired or invalid token. The body is {"message": "Unauthorized - ..."}, or {"error": "unauthorized"} when no user identity reaches the route. Sign in again or refresh the token with the Authentication API.
500 POST /identity/users/me/onboarding could not save. The body is {"error": "failed to record onboarding"}. Retry. The call is safe to repeat.

Example bodies:

{ "message": "Unauthorized - No token provided" }

401 from the token check. The text after the dash changes with the cause (for example Invalid token format). When the request reaches the route without a user identity after the token check, both routes return 401 with the body { "error": "unauthorized" } instead.

{ "error": "failed to record onboarding" }

500. No route on this page returns a list or has pagination; the lists of ticketing accounts are in ticketing accounts.

Endpoints