Skip to content

Users

import { Aside } from ‘@astrojs/starlight/components’;

Users are identity records within a workspace. The Users API covers listing, creating, updating, disabling, and role assignment.

Required scopes: users:read for GET requests, users:write for POST / PUT / DELETE.


{
"id": 42,
"username": "alice",
"email": "alice@example.com",
"fullName": "Alice Smith",
"emailVerified": true,
"enabled": true,
"mfaEnabled": false
}
FieldTypeDescription
idintegerInternal numeric ID
usernamestringUnique within the workspace. Pattern: [a-zA-Z0-9._-]+
emailstringEmail address
fullNamestringDisplay name
emailVerifiedbooleanWhether the email has been verified
enabledbooleanfalse = disabled, cannot log in
mfaEnabledbooleanWhether the user has enrolled in MFA

GET /t/{slug}/api/v1/users

Returns a paginated list of users in the workspace. Optionally filter by a search string.

Query parameters:

ParameterTypeDescription
searchstringFilter by username, email, or full name prefix (optional)
offsetintegerPagination offset (default: 0)
limitintegerPage size (default: 20, max: 100)

Example request:

Terminal window
curl https://auth.yourdomain.com/t/my-app/api/v1/users?search=alice \
-H "Authorization: Bearer kauth_my-app_KEY"

Response 200 OK:

{
"data": [
{
"id": 42,
"username": "alice",
"email": "alice@example.com",
"fullName": "Alice Smith",
"emailVerified": true,
"enabled": true,
"mfaEnabled": false
}
],
"meta": { "total": 1, "offset": 0, "limit": 20 }
}

POST /t/{slug}/api/v1/users

Creates a new user account. The account is enabled immediately and the email is marked unverified. To trigger a verification email, SMTP must be configured in the workspace.

Request body:

{
"username": "bob",
"email": "bob@example.com",
"fullName": "Bob Jones",
"password": "correct-horse-battery"
}
FieldRequiredConstraints
usernameYesPattern [a-zA-Z0-9._-]+, unique in workspace
emailYesValid email, unique in workspace
fullNameYesNon-empty string
passwordYesMinimum 4 characters; workspace password policy applies

Response 201 Created: Returns the created user object.

Error responses:

StatusCondition
409 ConflictUsername or email already in use
422 UnprocessableValidation error (e.g. invalid username format, policy violation)

GET /t/{slug}/api/v1/users/{userId}

Path parameters:

ParameterTypeDescription
userIdintegerThe user’s numeric ID

Example request:

Terminal window
curl https://auth.yourdomain.com/t/my-app/api/v1/users/42 \
-H "Authorization: Bearer kauth_my-app_KEY"

Response 200 OK: Returns the user object.


PUT /t/{slug}/api/v1/users/{userId}

Updates a user’s email and/or display name. Username changes are not supported through the API — use the admin console.

Request body:

{
"email": "alice-new@example.com",
"fullName": "Alice M. Smith"
}
FieldRequiredDescription
emailYesNew email address
fullNameYesNew display name

Response 200 OK: Returns the updated user object.


DELETE /t/{slug}/api/v1/users/{userId}

Soft-disables the user account. Disabled users cannot log in, but their data, roles, and session history are preserved. To permanently delete a user, use the admin console.

Response 204 No Content


POST /t/{slug}/api/v1/users/{userId}/roles/{roleId}

Assigns the specified role directly to the user. This is in addition to any roles inherited through group membership.

Path parameters:

ParameterTypeDescription
userIdintegerThe user’s numeric ID
roleIdintegerThe role’s numeric ID

Response 204 No Content


DELETE /t/{slug}/api/v1/users/{userId}/roles/{roleId}

Removes a directly assigned role from the user. Roles inherited through group membership are not affected.

Response 204 No Content