Skip to main content

Create a user

POST 

/users

Creates a user in your tenant.

Send "enabled": true. The field has no default: omit it and the user is created unable to log in, with nothing in the response saying so beyond enabled: false.

Three things this operation does after the user exists, none of which are reflected in the response body, since it is read back the instant the user is created, before any of them run:

  • The directory's default realm role is removed.
  • The offline_access realm role is granted.
  • The user is added to each group named in groups.

All three are best-effort. In particular a group name that matches no group is skipped silently and the call still returns 200, so a typo in groups looks exactly like success. Confirm memberships afterwards with GET /users/{username}/effective-assignments.

Two shape notes. The response is 200, not 201, and carries no Location header. And a username or email that is already taken comes back as a 500, not a 409. Prism does not translate the directory's conflict, so read error to tell a duplicate from a genuine failure.

The body of this response is the directory's own administrative user representation, passed through unmodified. Prism does not map it to a shape of its own, so its exact field set depends on the version and the configuration of the directory behind your deployment, and additional fields may be present that are not listed here. Treat the response as sensitive: do not log it, and read only the fields you need.

Request​

Responses​

The user was created. The body is the directory's representation of the user as stored, before the role and group steps described above ran.