List users
Returns a paginated list of team members. Each user includes their scopes array (["*"] for admins).
query Parameters
rolestatussearchSearch by name or email
Search by name or email
limitoffsetList users › Responses
List of users
Create user
Creates a new team member. Admin only.
What happens:
- A user account is created in the database with a secure temporary password
- The password is hashed using scrypt (same algorithm as better-auth)
- An API key is generated for programmatic access
- Initial permission scopes are assigned (if role is staff)
- A best-effort invite email is sent via Sendili when the store's email config exists and is enabled — the outcome is reported in
emailSent/emailError, and creation never fails because of the email
Authentication:
- The new user receives a temporary password (returned once in this response, and included in the invite email when it sends)
- They can sign in using email + temporary password
- They should change their password on first login for security
Note: scopes are ignored for admin users — admins always have ["*"]. The API key is never emailed.
Create user › Request Body
emailnameroleDefaults to staff.
scopesInitial permission scopes. Ignored if role is admin.
languageLanguage for the invite email. Defaults to en.
Create user › Responses
User created. The apiKey and tempPassword fields are returned only in this response — store them immediately.
successTeam member record with permission scopes
apiKeyThe raw API key for the new user — returned once at creation. Use POST /{id}/api-key/rotate to issue a new key.
tempPasswordTemporary password for the new user — returned once at creation. Share this with the user securely. They should change it on first login.
emailSentWhether the invite email was handed to Sendili. False when email sending is not configured or the send failed — check emailError.
emailErrorStable failure code when the invite email could not be sent: out_of_credits | invalid_key | forbidden | rate_limited | validation | transient. Null when sent or simply not configured.
messageGet user
Returns full user record including their scopes array.
path Parameters
idUser ID
User ID
Get user › Responses
User detail with scopes
successTeam member record with permission scopes
Update user
Partial update — only include fields you want to change. To change scopes, use POST /{id}/scopes and DELETE /{id}/scopes/{scope}. To change role only, prefer PATCH /{id}/role.
path Parameters
idUser ID
User ID
Update user › Request Body
emailnamerolestatusUpdate user › Responses
User updated
successTeam member record with permission scopes
messageUpdate user role
Dedicated endpoint for role-only changes. Changing to admin effectively grants ["*"] scope.
path Parameters
idUser ID
User ID
Update user role › Responses
Role updated
successTeam member record with permission scopes
messageGrant scope to user
Grants a single permission scope to the user. Returns the full updated user record.
path Parameters
idUser ID
User ID
Grant scope to user › Responses
Scope granted
successTeam member record with permission scopes
messageRevoke scope from user
Removes a permission scope from the user. If the scope was not granted, the operation succeeds silently.
path Parameters
idUser ID
User ID
scopeThe scope to revoke
The scope to revoke
Revoke scope from user › Responses
Scope revoked. Returns full updated user record.
successTeam member record with permission scopes
messageRotate API key
Generates a new API key for the user, invalidating the previous one. Admin only. The raw key is returned only once — store it securely.
path Parameters
idUser ID
User ID
Rotate API key › Responses
New API key issued. The raw key is shown only in this response.
successmessage