List roles
Returns all roles in the authenticated admin's organisation.
Authorization: Requires admin role in the organisation.
Role Scope: Roles can be at organisation or workspace level:
- Organisation-level:
scope: "organisation"withscopeId: org_id - Workspace-level:
scope: "workspace"withscopeId: workspace_id
Role Structure: Each role contains:
permissions: Array of permission strings (e.g.,products:read,orders:write)
Filtering:
displayName eq "Purchasing Manager"- Exact matchscope eq "organisation"- Organisation roles onlyscopeId eq "ws_fruits"- Roles for specific workspace
Query Parameters
- Type: stringfilter
SCIM filter expression
- Type: integerstart
Index min:1Integer numbers.
- Type: integercountmin:1max:200
Integer numbers.
- Type: stringsort
By - Type: "ascending" or "descending"enumsort
Order
Responses
- application/scim+json
- application/scim+json
- application/scim+json
Request Example for get/v2/scim2/Roles
curl 'https://api.consentio.co/v2/scim2/Roles?filter=scope%20eq%20%22organisation%22&startIndex=1&count=100&sortBy=displayName&sortOrder=ascending' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
"schemas": [
"urn:ietf:params:scim:api:messages:2.0:ListResponse"
],
"totalResults": 3,
"startIndex": 1,
"itemsPerPage": 100,
"Resources": [
{
"schemas": [
"urn:consentio:params:scim:schemas:Role:1.0"
],
"id": "role_purchasing_manager",
"externalId": "idp-role-purchasing",
"displayName": "Purchasing Manager",
"description": "Manager with full purchasing access",
"scope": "organisation",
"scopeId": "org_abc123",
"permissions": [
"products:read",
"products:write",
"orders:read",
"orders:write",
"orders:approve"
],
"meta": {
"resourceType": "Role"
}
},
{
"schemas": [
"urn:consentio:params:scim:schemas:Role:1.0"
],
"id": "role_product_editor",
"displayName": "Product Editor",
"scope": "workspace",
"scopeId": "ws_products",
"permissions": [
"products:read",
"products:write"
],
"meta": {
"resourceType": "Role"
}
}
]
}