Create a seed user
POST /admin/seed/users
Creates a user for seed data or tests, with an optional password and join date. If a user with exactly that username already exists, you get that user back with a 200 instead, and their details and password aren’t changed.
Leave out password, or send an empty one, and the user can’t sign
in with a password; a password you do send is stored hashed.
usergroup defaults to 2, the regular legacy group. This endpoint
doesn’t give the user any role.
A new user gets a federation encryption key, and so does an existing
user who doesn’t have one yet, so a 200 can still change something.
A new user also gets an admin.seed.user_created audit event,
written on a best-effort basis after the user is saved.
It’s for seed and test tooling, not everyday user management. You
need system.admin; the endpoint works on any instance, not only
demo ones.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”object
Must be unique; matching is exact, so case matters. If a user with this username exists, the request returns them instead of creating one.
Must be a valid address, or the request gets a 400. Only the address part is stored, so Ana <ana@example.com> is saved as ana@example.com.
A password for the new user, stored hashed. Leave it out, or send null or an empty string, to create a user who can’t sign in with a password.
The legacy permission group, 2 if you leave it out. Older parts of the app read it; it doesn’t give the user a role or capabilities.
Whether the account is approved. Defaults to true.
When the user joined. Defaults to now.
Responses
Section titled “ Responses ”A user with this username already exists. You get their ref;
their details aren’t changed.
object
The user’s ref. Pass it as author_user_ref when seeding their comments.
True if the username already existed (status 200), false for a new user (status 201).
User created.
object
The user’s ref. Pass it as author_user_ref when seeding their comments.
True if the username already existed (status 200), false for a new user (status 201).
Malformed request
object
Human-readable error summary
Example
the request could not be completedAuthentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}Authenticated but missing required capabilities
object
Human-readable error summary
Example
the request could not be completed