API Reference
Create a user
POST
/api/users
Creates a new user account with a one-time invite token. Superadmin can create admins and viewers. Admins can only create viewers. The invite token should be shared with the user so they can set their own password and enroll TOTP via /invite/{token}.
Operation IDcreateUser
Authentication
- BearerAuth
http bearerAPI key token (envoy_<hex>). Create keys from Settings → API Keys — see Using the API.
Request body
This request body is required.
Content typeapplication/json
requestobject2 properties
usernamestringrequiredrolestringSuccess response body
201User created with invite token
User created with invite token
Content typeapplication/json
responseobject8 properties
idintegerusernamestringrolestringtotp_verifiedintegerinvite_pendingbooleancreated_atstring · date-timeupdated_atstring · date-timeinvite_tokenstringOne-time invite token (48h expiry)
Error responses
400Validation error
Validation error
Content typeapplication/json
responseobject2 properties
errorstringmessagestringExample response
{
"error": "VALIDATION_ERROR",
"message": "Invalid input"
}403Insufficient permissions
Insufficient permissions
No response content schema is documented.