Skip to content

User

DANGER

This document has not been updated since version 0.0.3 and is not ready for production. It will be updated before version 1.0 of the project is released.

The current session user.

The User object

json
// user object
{
  "id": "usr_1234567890",
  "created": 1670636064,
  "last_login": 1708348174,
  "username": "jamesdoe",
  "name": "James Doe",
  "email": "jamesdoe@acmecorp.com",
  "avatar": "https://cdn.backstack.com/avatars/usr_1234567890.jpg"
}
PropertyTypeDescription
idStringThe user ID.
createdIntegerThe date the relationship was created.
usernameStringThe users log-in name.
nameStringThe users real name. Required when creating the relationship. Read-only once the user logs in.
emailStringThe users email address. Required when creating the relationship. Read-only once the user logs in.
avatarStringThe URL for avatar image uploaded by the user.
editableBooleanIndicates if the system will accept edits on the particular user.
rolesArrayThe role IDs assigned by the account to the user.
roles_csvStringThe roles assigned to the user in a comma separated string.
last_loginIntegerThe timestamp of the users last log in for the account.

Create a user

Users are added to accounts with assigned roles. See the account user workflow for more information.

Read a user

Retrieves the current session user information.

Request

sh
GET /v1/user

Response

The User object.

Update a user

Request

sh
POST /v1/user
{
  "name": "Jason Doe",
  ...
}
ParameterTypeDescription
usernameRequired stringMinimum 8 characters. Cannot be the same as the password.
passwordRequired stringMinimum 8 characters. Cannot be the same as the username.
nameRequired stringThe users name.
emailRequired stringThe users email address.

TIP

The API updates only the parameters that are submitted. Submitting an empty value deletes a parameter. If a required value is empty, the existing value is retained.

See the account user workflow for updating user information related to the account relationship (e.g. roles).

Response

The User object.

Delete a user

Deletes the current user and all account user relationships, then terminates the session.