Skip to main content
The users API is how administrators provision access to LightShip. Each user carries a username, an optional password hash, a role list, and an attribute map that policies can reference (for example user.tenant_id). All endpoints require the admin role.

POST /users

Create a user. Omit password_hash to have LightShip generate a password, return it once in the response, and set must_change_password: true so the user must change it on first sign-in.
string
required
Unique username.
string
Argon2id hash produced by lightship hash. Omit to have LightShip generate a password.
array of strings
Role names the user holds.
object
Attribute values referenced by policies, for example {"tenant_id": "acme"}.
boolean
Set to false only for non-interactive service accounts.
When a password is generated, it is returned in the response exactly once. Deliver it to the user through a secure channel; LightShip never displays it again.

GET /users

List every user.

GET /users/

Return one user, including roles and attributes.

PATCH /users/

Change roles or replace the password hash.
array of strings
Replaces the user’s role list.
string
Argon2id hash generated with lightship hash.

PATCH /users//attributes

Set or remove attribute values. Pass null for a key to remove that attribute.

DELETE /users/

Delete a user along with their sessions and API keys. Existing tokens stop working immediately.