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,
"requiredActions": []
}
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
requiredActionsstring[]Pending setup actions (e.g. ["SET_PASSWORD"] for invited users). Empty when account is fully activated

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. You can either set a password directly or send an invite email so the user sets their own password.

Request body (with password):

{
"username": "bob",
"email": "bob@example.com",
"fullName": "Bob Jones",
"password": "correct-horse-battery"
}

Request body (with invite):

{
"username": "bob",
"email": "bob@example.com",
"fullName": "Bob Jones",
"sendInvite": true
}
FieldRequiredConstraints
usernameYesPattern [a-zA-Z0-9._-]+, unique in workspace
emailYesValid email, unique in workspace
fullNameYesNon-empty string
passwordConditionalRequired unless sendInvite is true. Workspace password policy applies
sendInviteNoWhen true, sends an invite email instead of setting a password. Requires SMTP to be configured. Default: false

When sendInvite is true, the created user will have requiredActions: ["SET_PASSWORD"] and emailVerified: false until they complete the invite flow.

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


POST /t/{slug}/api/v1/users/{userId}/resend-invite

Resends the invite email for a user who has a pending SET_PASSWORD required action. Generates a new 72-hour token and invalidates any previous invite tokens for this user.

Response 200 OK

Error responses:

StatusCondition
400 Bad RequestUser does not have a pending invite
500 Internal Server ErrorSMTP not configured or email delivery failed