Users API Routes
A user is an admin user that can authenticate and perform functionalities as an admin user.
An admin user can invite other users to join their team. Once they accept the invite, they'll become admin users as well.
These API routes allow admin users to manage their team.
GET /admin/users#
List Users
Retrieve a list of users. The users can be filtered by fields such as id. The users can also be sorted or paginated.
Authentication: cookie session, JWT bearer token.
Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.offsetnumberOptionallimitnumberOptionalorderstringOptional-.qstringOptionalidstring | string[]OptionalemailstringOptionalfirst_namestringOptionallast_namestringOptionalcreated_atobjectOptionalupdated_atobjectOptionaldeleted_atobjectOptionalwith_deletedbooleanOptionalRequest examples
Responses
200 OK
limitnumberoffsetnumbercountnumberusersobject[]The list of users.
usersobject[]estimate_countnumberOptional400, 401, 404, 409, 422, 500: an error response is returned.
GET /admin/users/me#
Get Logged-In User
Retrieve the logged-in user's details.
Authentication: cookie session, JWT bearer token.
Query parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request examples
Responses
200 OK
userobjectThe user's details.
userobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/users/me#
Update Logged-In User
Update the logged-in user's details. Unlike the Update a User API route, this API route doesn't require the user:update permission, so any user can update their own details.
Authentication: cookie session, JWT bearer token.
Request body (application/json)
first_namestringOptionallast_namestringOptionalavatar_urlstringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
userobjectThe user's details.
userobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
user.updated: Emitted when users are updated.
GET /admin/users/{id}#
Get a User
Retrieve a user by its ID. You can expand the user's relations or select the fields that should be returned.
Authentication: cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request examples
Responses
200 OK
userobjectThe user's details.
userobject400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/users/{id}#
Update a User
Update a user's details.
Authentication: cookie session, JWT bearer token.
Path parameters
idstringQuery parameters
fieldsstringOptional+ it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.Request body (application/json)
first_namestringOptionallast_namestringOptionalavatar_urlstringOptionalmetadataobjectOptionalRequest examples
Responses
200 OK
userobjectThe user's details.
userobject400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
user.updated: Emitted when users are updated.
DELETE /admin/users/{id}#
Delete a User
Delete a user.
Authentication: cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
idstringobjectstringDefault: "user"
deletedboolean400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
user.deleted: Emitted when users are deleted.
GET /admin/users/{id}/auth-providers#
List Auth Providers of a User
Retrieve a list of auth providers that a user can authenticate with. These represent the auth providers that the user has previously used to log in or register with the system.
Authentication: cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
providersstring[]emailpass.400, 401, 404, 409, 422, 500: an error response is returned.
POST /admin/users/{id}/reset-password#
Generate Reset Password Token for a User
Generate a reset password token for a user. This is useful if another user wants to reset the password of a user. The reset password token can be used to reset the user's password. This route only emits the auth.password_reset event. You can listen to this event to send a reset password email to the user, for example.
Authentication: cookie session, JWT bearer token.
Path parameters
idstringRequest examples
Responses
200 OK
tokenstring/reset-password page as a token query parameter to build a link the
user can open to set a new password.
The token is short-lived, can only be used once, and generating it
invalidates any reset password token previously issued for the user.400, 401, 404, 409, 422, 500: an error response is returned.
Emitted events
auth.password_reset: Emitted when a reset password token is generated. You can listen to this event to send a reset password email to the user or customer, for example.