Account Users
Accounts can have multiple users with different roles.
Account user object
The account user object is a subset of the user object with additional user-specific information.
GET https://api.backstack.com/account/users/:id
Returns an account user object.
{
"id": "usr_1234567890",
"created": 1670636064,
"username": "jamesdoe",
"name": "James Doe",
"email": "jamesdoe@acmecorp.com",
"last_login": 1708348174,
"avatar": "<svg>...</svg>",
"avatar_color": "#ff0000",
"roles": [
"rol_751TqkACiLYbUMDe",
...
],
"roles_csv": "Super User, ...",
"editable": false
}
Resources
Account users list
GET https://api.backstack.com/account/users
Returns a records list of account users.
{
"list": [
{
"id": "usr_1234567890",
"username": "jamesdoe",
"name": "James Doe",
"email": "jamesdoe@acmecorp.com",
"last_login": 1708348174,
"avatar": "<svg>...</svg>",
"roles_csv": "Super User, ...",
"editable": false
},
...
],
"total": 20,
"search": "",
"filter": "",
"filters": [
"active",
"inactive"
],
"pages": 2
}
Resources
Account users selection
GET https://api.backstack.com/account/users
?selection=true
Returns a selection list of all user IDs and names.
[
{
"usr_1234567890": "John Doe"
},
...
]
Resources
Create account user
Prerequisites
Your app must have the log-in URL defined in the dashboard settings. This URL is provided in the new user email.
Example link included in the email:
https://yourapp.com/login
Initiate the account user creation
Create a form to submit the new user information.
<form id="new-user-form">
<input type="text" name="name" placeholder="Name" required>
<input type="email" name="email" placeholder="Email" required>
<select name="roles" required>
<option value="rol_1234567890">Super User</option>
...
</select>
<button type="submit">Create</button>
</form>
Form data
Make a call to the API to retrieve the roles available for the account.
GET https://api.backstack.com/account/roles
?selection=true
Returns a selection list of role values.
[
{
"rol_1234567890": "Super User"
},
...
]
Submit the new account user
Submit the new user data to the API for processing. An activation email is sent to the new user with a link to your log-in page to begin the log-in process.
POST https://api.backstack.com/account/users
{
"name": "James Doe",
"email": "jamesdoe@acme.com"
"roles": [
"rol_1234567890",
...
]
}
Sends an activation email to the new user. Returns the user object.
Resources
Update account user
If a user has not activated their account, you can update their information.
POST https://api.backstack.com/account/users/:id
{
"name": "James Doe",
"email": "jdoe@acme-corp.com",
"roles": [
"rol_1234567890",
...
],
"resend_email": true // optional
}
Otherwise, only the user's roles can be updated.
INFO
The system will not allow users to update their own roles.
POST https://api.backstack.com/account/users/:id
{
"roles": [
"rol_1234567890",
...
]
}
Returns the updated user object.
Resources
Delete account user
DELETE https://api.backstack.com/account/users/:id
Returns the deleted user ID.
{
"id": "usr_1234567890"
}
INFO
If a user is a member of multiple accounts, they will still have access to those accounts. Otherwise, the user will be removed from the system.