getRole
GET
/api/v1/roles/{key}
const url = 'https://example.com/api/v1/roles/owner';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/api/v1/roles/ownerRead one role. Requires users.manage or roles.manage and the admin scope.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”key
required
Role key. The built-in roles are owner, administrator, editor, contributor, and viewer. Custom role keys start with “custom.”. Decide authorization from the capabilities the server reports, not from the role key.
string
Responses
Section titled “ Responses ”Role
Media typeapplication/json
object
data
required
object
key
required
Role key. The built-in roles are owner, administrator, editor, contributor, and viewer. Custom role keys start with “custom.”. Decide authorization from the capabilities the server reports, not from the role key.
string
name
required
string
description
required
string
builtin
required
boolean
capabilities
required
Array<string>
userCount
required
Active accounts on the role.
integer
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
editable
required
Whether the caller may change or delete the role.
boolean
assignable
required
Whether the caller may place accounts on the role.
boolean
Example
{ "data": { "key": "owner" }}Dashboard authentication required
Insufficient role
Role not found