Role Resource (since 1.0.12)
A role is a configurable set of permissions that can be assigned to multiple users, so they all share the same privileges.
There are two types or roles:
Built-in
These are immutable system roles. Their set of permissions will probably change over time, but their name and key are fixed values. As of version 1.0.12 there are two built-in roles: invitee
and admin
. The latter administrator role will always contain all permissions (available at that time). In free networks the default administrator role has type founder
. For enterprise networks this is enterprise_admin
. Version 1.0.22 introduced the external
built-in role for premium networks.
User-defined
These roles are created by end-users of Speakap and are fully customizable. An API consumer should only ever rely on the set of permissions of such a role and never on its name or EID (in terms of permission checks).
Changelog
1.0.22
- External role
1.0.23
- Default Property
Endpoints
- Create user-defined Role (since 1.0.12)
- Retrieve Role (since 1.0.12)
- Update user-defined Role (since 1.0.12)
- Retrieve Role collection (since 1.0.12)
- Delete user-defined Role (since 1.0.12)
- Bulk Change Role
Representations
JSON Properties
Name | Type | Description |
---|---|---|
EID | EID | Unique entity identifier |
key | string | Unique identifier for built-in, non-editable, roles |
type | string | "role" |
roleType | string | Read-only Role type: built_in or user_defined |
permissions | array | List of permissions |
renameable | boolean | Read-only Whether or not the name of the role can be changed |
editable | boolean | Read-only Whether or not the permissions can be reconfigured |
deletable | boolean | Read-only Whether or not the role can be deleted |
default | boolean | Since 1.0.23 Read-only Whether or not it is the default network role |
numUsers | integer | Read-only Number of users with this role |
Links (user-defined roles)
Relation | Resource | Description |
---|---|---|
network | network | Network |
Example - User-defined Role
{
"_links": {
"self": {
"href": "https://api.speakap.io/networks/FEDCBA0987654321/roles/1234567890ABCDEF/"
},
"network": {
"href": "https://api.speakap.io/networks/FEDCBA0987654321/"
}
},
"EID": "1234567890ABCDEF",
"type": "role",
"roleType": "user_defined",
"name": "News Editor",
"permissions": [
"...",
"post_news",
"delete_news",
"..."
],
"renameable": true,
"editable": true,
"deletable": true,
"default": false,
"numUsers": 2
}
Example - Built-in admin role
{
"_links": {
"self": {
"href": "https://api.speakap.io/roles/admin/"
}
},
"key": "admin",
"type": "role",
"roleType": "built_in",
"name": "Administrator",
"permissions": [
"..."
],
"renameable": false,
"editable": false,
"deletable": false,
"default": false,
"numUsers": 1
}