⚠️ Work in progress — createCMS is pre-1.0 and not production-ready (not tested in production). Expect breaking changes.
createCMS
Reference

Users API

Current-user identity and reviewer discovery, via cms.api.users.

User-directory reads for identifying the current request's user and listing candidate reviewers. These methods live on the system namespace at cms.api.users.<method> and mirror on the client as client.users.<method> with identical types. Both project the id plus the configured user.exposeColumns allowlist (password hashes and tokens are never selected), and both degrade when no user.table is configured: whoami returns { user: null } and listReviewers returns [].

Identify the Current User

Find out who the current request is authenticated as, so a client can learn its own identity without you supplying the id. You get back the user id plus the resolved user row (the configured exposeColumns). Both fields are null when unauthenticated, and user is null when no user.table is configured or the id matches no row.

user:read
GET/users/whoami
const { data, error } = await client.users.whoami();
Returns
userIdstring | null

The current request's user id (`ctx.userId`), or `null` when unauthenticated.

userExposedUser | null

The resolved user row `{ id, ...exposeColumns }`, or `null` when unauthenticated, no `user.table` is configured, or the id matches no row.

The resolved user is { id, ...exposeColumns } or null.

List Reviewers

List candidate reviewer users from your configured user.table — the picker source for approval workflows. Each user comes back as { id, ...exposeColumns }, ordered by id, and you get an empty list when no user.table is configured. All query fields are optional.

user:read
GET/users/listReviewers
const { data, error } = await client.users.listReviewers({
  query: { limit: 50 }, // all optional
});
Parameters
limitnumber= 100

Max users to return, 1 to 100.

offsetnumber= 0

Rows to skip.

Returns
reviewersExposedUser[]

Candidate reviewer users, each `{ id, ...exposeColumns }`, ordered by id. Empty when no `user.table` is configured.

On this page