get_user_roles
Retrieve all user roles from a LearnWorlds school, filtered by role ID or access level. Read-only lookup for reporting and access analysis.
Instructions
๐ข READ-ONLY ยท GET /v2/user-roles
Get all user roles. Returns a list with all the user roles of the school. The roles are in alphabetical ascending order according to their title.
Behavior: read-only lookup against the live school; creates, changes and deletes nothing. Auth (admin API token + Lw-Client id) is injected server-side, never by the model; calls are throttled to stay under LearnWorlds' 30-per-10s cap and retried on 429/5xx.
Returns: HTTP <status> followed by the LearnWorlds JSON response body. A non-2xx reply surfaces as a tool error with that status and the API error payload โ 401 bad/expired token, 403 not permitted, 404 no such record, 422 rejected input.
Use when: safe to call speculatively for lookups and reporting. Not for changing anything โ use the matching ๐ก write tool.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role_id | No | Unique identifier of the user role; use this query parameter to return a specific user role. | |
| access_level | No | Filter roles by their access level. Values can be comma seperated to filter one or more access levels |