Appearance
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"
}
Property | Type | Description |
---|---|---|
id | String | The user ID. |
created | Integer | The date the relationship was created. |
username | String | The users log-in name. |
name | String | The users real name. Required when creating the relationship. Read-only once the user logs in. |
email | String | The users email address. Required when creating the relationship. Read-only once the user logs in. |
avatar | String | The URL for avatar image uploaded by the user. |
editable | Boolean | Indicates if the system will accept edits on the particular user. |
roles | Array | The role IDs assigned by the account to the user. |
roles_csv | String | The roles assigned to the user in a comma separated string. |
last_login | Integer | The 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",
...
}
Parameter | Type | Description |
---|---|---|
username | Required string | Minimum 8 characters. Cannot be the same as the password. |
password | Required string | Minimum 8 characters. Cannot be the same as the username. |
name | Required string | The users name. |
email | Required string | The 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.