iblai-api-management
Administer an organization from the API: manage Users, Groups, Roles,
Policies, Teams, and Alerts for organization-level user and access
administration.
Auth & conventions
- Base URL:
https://api.iblai.app
- Header:
Authorization: Api-Token $IBLAI_API_KEY on every request.
- Path vars:
{org} = $IBLAI_ORG (a.k.a. platform_key),
{username} = $IBLAI_USERNAME.
- Host: these endpoints live on the DM host under
/api/core/…. The
exception is edX user roles (list / promote-demote / bulk sync), which flip
to the edX LMS/CMS host - see the Users > Roles (edX) entries below. The
org field on those calls is the edX course-organization short name, not
the ibl.ai org key - see the reference doc linked in ## Reference material.
- Not connected yet? Run
/iblai-api-login first to populate IBLAI_ORG,
IBLAI_USERNAME, and IBLAI_API_KEY.
Reads
Users
- GET
…/core/platform/users/?platform_key={org}&platform_org={org}&query={q}&page={n}&page_size=10&return_policies=true — user list + policies.
Roles (edX)
- GET
https://studio.learn.iblai.app/api/ibl/users/manage/roles/?username={username} - list a user's edX roles (global + course + org). Identify the user with username, email, or user_id. Full role catalog (what each role key means, which need course/org) and endpoint detail in references/edx-roles-reference.md.
Groups
…/core/rbac/groups/
- GET
…/groups/?platform_key={org}&include_users=true[&name=&email=&owner=&username=&page=&page_size=] — list.
- GET
…/groups/{id}/ — detail.
Roles
…/core/rbac/roles/ (all calls include include_global_roles=true)
- GET
…/roles/?include_global_roles=true&platform_key={org}[&name=&page=&page_size=] — list.
- GET
…/roles/{id}/?include_global_roles=true&platform_key={org} — detail.
Policies
…/core/rbac/policies/
- GET
…/policies/?platform_key={org}&include_groups=true&include_users=true[&role_id=&group=&name=&username=&email=&page=&page_size=] — list.
- GET
…/policies/{id}/?platform_key={org} — detail.
Teams
…/core/user-groups/ plus team access (…/core/rbac/teams/access/)
- GET
…/user-groups/?platform_key={org}[&include_users=&name=&with_permissions=&page=&page_size=] — list.
- GET
…/user-groups/{id}/?platform_key={org} — detail.
- GET
…/core/rbac/teams/access/?platform_key={org}&usergroup_id={id} — list a team's access policies.
Writes
Users
Roles (edX)
- POST
https://studio.learn.iblai.app/api/ibl/users/manage/roles/ - promote/demote, i.e. assign or unassign one role:{
"username": "string (required)",
"role": "e.g. org-instructor (required - see role catalog)",
"course": "course id - required for course roles",
"org": "edX course-org short name - required for org roles",
"active": "boolean (optional, default true - true assigns, false removes)"
}
General roles (staff, support-staff, course-creator) take neither
course nor org. course-creator is CMS-only (the LMS host rejects it
with 400). Full role catalog - what each key means and its scope
requirement - is in references/edx-roles-reference.md.
- POST
https://studio.learn.iblai.app/api/ibl/users/manage/roles/sync/ - bulk-replace a batch of role assignments for one user in a single atomic request (all entries validated first; all succeed or all roll back). Body and response shape, plus inactive-user and idempotency behavior, in the reference doc above.
- POST
…/core/users/platforms/ — activate/deactivate:{
"user_id": "number (required)",
"platform_key": "string (required)",
"active": "boolean (required)"
}
- PUT
…/core/platform/users/policies/ — set policies (array):[
{
"user_id": "number (required)",
"platform_key": "string (required)",
"policies_to_set": "string[] (required, may be [])"
}
]
Groups
…/core/rbac/groups/
- POST
…/groups/ — create:{
"name": "string (required)",
"platform_key": "string (required)",
"description": "string",
"users": "number[]"
}
- PUT
…/groups/{id}/ — update (same shape).
- DELETE
…/groups/{id}/?platform_key={org} — delete. Destructive — confirm with the user first.
Roles
…/core/rbac/roles/ (all calls include include_global_roles=true)
- POST
…/roles/?include_global_roles=true — create:{
"name": "string (required)",
"platform_key": "string (required)",
"actions": "string[] (RBAC action strings, e.g. Ibl.Mentor/Mentors/read)",
"data_actions": "string[]"
}
The permission list is actions (+ optional data_actions), not
permissions. See /iblai-api-rbac for the full role/policy model
(action namespaces, resource paths).
- PUT / PATCH
…/roles/{id}/?include_global_roles=true — update (same shape).
- DELETE
…/roles/{id}/?include_global_roles=true&platform_key={org} — delete. Destructive — confirm with the user first.
Policies
…/core/rbac/policies/
- POST
…/policies/ — create:{
"name": "string (required)",
"platform_key": "string (required)",
"role": "number role id (required)",
"resources": "string[]",
"users": "number[]",
"groups": "number[]"
}
- PUT / PATCH
…/policies/{id}/ — update (same shape).
- DELETE
…/policies/{id}/?platform_key={org} — delete. Destructive — confirm with the user first.
Teams
…/core/user-groups/ plus team access (…/core/rbac/teams/access/)
- POST
…/user-groups/ — create:{
"name": "string (required)",
"platform_key": "string (required)",
"description": "string",
"users": "number[]"
}
- PUT
…/user-groups/{id}/ — update (same shape).
- DELETE
…/user-groups/{id}/ — delete. Destructive — confirm with the user first.
- POST
…/core/rbac/teams/access/ — set team access:{
"platform_key": "string (required)",
"usergroup_id": "number (required)",
"groups": "[{group_id, role}]",
"users": "[{user_id, role}]"
}
Alerts
…/core/watched-groups/
- GET / POST
…/watched-groups/ — list / create watched group.
- GET / PATCH / DELETE
…/watched-groups/{id}/ — watched group detail / update / delete. DELETE is destructive — confirm with the user first.
- GET / POST
…/watched-groups/{watchedGroupPk}/watched-users/ — list / add watched users.
- DELETE
…/watched-users/{id}/ — remove watched user. Destructive — confirm with the user first.
- GET / POST
…/watched-groups/{watchedGroupPk}/watchers/ — list / add watchers.
- PATCH / DELETE
…/watchers/{id}/ — update / remove watcher (notification-event flags in body). DELETE is destructive — confirm with the user first.
Example
List the first page of organization users with their policies:
curl -s \
"https://api.iblai.app/dm/api/core/platform/users/?platform_key=$IBLAI_ORG&platform_org=$IBLAI_ORG&page=1&page_size=10&return_policies=true" \
-H "Authorization: Api-Token $IBLAI_API_KEY"
Notes
- Most endpoints require
platform_key={org} as a query param even on POST/PUT
bodies that also carry it — send both.
- The edX user-roles calls (list, promote/demote, bulk sync) are the only
ones on the edX LMS/CMS host and take no
platform_key; every other
endpoint here is on the DM host under /api/core/…. Prefer the CMS host
(studio.learn.iblai.app) for edX roles - it accepts every role key,
including course-creator, which the LMS host rejects.
- edX roles (this section) and DM
rbac/roles (the Roles subsection
below) are two unrelated systems that happen to share the word "role" - an
edX role key like org-instructor is not a DM RBAC role id, and vice versa.
- Policies bind a
role (RBAC role id) to resources, users, and groups —
create the Role first, then reference its id when creating the Policy.
- DELETE on any sub-section is destructive — confirm with the user before
removing groups, roles, policies, teams, watched groups/users, or watchers.
Reference material
references/edx-roles-reference.md - full edX role catalog (every global/course/org role key and what it grants), the list/assign/bulk-sync endpoint bodies and responses, and gotchas (inactive-user grant skipping, idempotency, course-creator's CMS-only restriction, Open edX release gates on course-limited-staff).
1---2name: iblai-api-management3description: iblai-api-management4---56# iblai-api-management78Administer an organization from the API: manage **Users, Groups, Roles,9Policies, Teams, and Alerts** for organization-level user and access10administration.1112## Auth & conventions1314- **Base URL:** `https://api.iblai.app`15- **Header:** `Authorization: Api-Token $IBLAI_API_KEY` on every request.16- **Path vars:** `{org}` = `$IBLAI_ORG` (a.k.a. `platform_key`),17 `{username}` = `$IBLAI_USERNAME`.18- **Host:** these endpoints live on the DM host under `/api/core/…`. The19 exception is edX user roles (list / promote-demote / bulk sync), which flip20 to the edX LMS/CMS host - see the **Users > Roles (edX)** entries below. The21 `org` field on those calls is the edX course-organization short name, not22 the ibl.ai `org key` - see the reference doc linked in `## Reference23 material`.24- Not connected yet? Run **`/iblai-api-login`** first to populate `IBLAI_ORG`,25 `IBLAI_USERNAME`, and `IBLAI_API_KEY`.2627## Reads2829### Users3031- **GET** `…/core/platform/users/?platform_key={org}&platform_org={org}&query={q}&page={n}&page_size=10&return_policies=true` — user list + policies.3233#### Roles (edX)3435- **GET** `https://studio.learn.iblai.app/api/ibl/users/manage/roles/?username={username}` - list a user's edX roles (global + course + org). Identify the user with `username`, `email`, or `user_id`. Full role catalog (what each role key means, which need `course`/`org`) and endpoint detail in **[`references/edx-roles-reference.md`](references/edx-roles-reference.md)**.3637### Groups3839`…/core/rbac/groups/`4041- **GET** `…/groups/?platform_key={org}&include_users=true[&name=&email=&owner=&username=&page=&page_size=]` — list.42- **GET** `…/groups/{id}/` — detail.4344### Roles4546`…/core/rbac/roles/` (all calls include `include_global_roles=true`)4748- **GET** `…/roles/?include_global_roles=true&platform_key={org}[&name=&page=&page_size=]` — list.49- **GET** `…/roles/{id}/?include_global_roles=true&platform_key={org}` — detail.5051### Policies5253`…/core/rbac/policies/`5455- **GET** `…/policies/?platform_key={org}&include_groups=true&include_users=true[&role_id=&group=&name=&username=&email=&page=&page_size=]` — list.56- **GET** `…/policies/{id}/?platform_key={org}` — detail.5758### Teams5960`…/core/user-groups/` plus team access (`…/core/rbac/teams/access/`)6162- **GET** `…/user-groups/?platform_key={org}[&include_users=&name=&with_permissions=&page=&page_size=]` — list.63- **GET** `…/user-groups/{id}/?platform_key={org}` — detail.64- **GET** `…/core/rbac/teams/access/?platform_key={org}&usergroup_id={id}` — list a team's access policies.6566## Writes6768### Users6970#### Roles (edX)7172- **POST** `https://studio.learn.iblai.app/api/ibl/users/manage/roles/` - promote/demote, i.e. assign or unassign one role:73 ```json74 {75 "username": "string (required)",76 "role": "e.g. org-instructor (required - see role catalog)",77 "course": "course id - required for course roles",78 "org": "edX course-org short name - required for org roles",79 "active": "boolean (optional, default true - true assigns, false removes)"80 }81 ```82 General roles (`staff`, `support-staff`, `course-creator`) take neither83 `course` nor `org`. `course-creator` is CMS-only (the LMS host rejects it84 with `400`). Full role catalog - what each key means and its scope85 requirement - is in **[`references/edx-roles-reference.md`](references/edx-roles-reference.md)**.86- **POST** `https://studio.learn.iblai.app/api/ibl/users/manage/roles/sync/` - bulk-replace a batch of role assignments for one user in a single atomic request (all entries validated first; all succeed or all roll back). Body and response shape, plus inactive-user and idempotency behavior, in the reference doc above.87- **POST** `…/core/users/platforms/` — activate/deactivate:88 ```json89 {90 "user_id": "number (required)",91 "platform_key": "string (required)",92 "active": "boolean (required)"93 }94 ```95- **PUT** `…/core/platform/users/policies/` — set policies (array):96 ```json97 [98 {99 "user_id": "number (required)",100 "platform_key": "string (required)",101 "policies_to_set": "string[] (required, may be [])"102 }103 ]104 ```105106### Groups107108`…/core/rbac/groups/`109110- **POST** `…/groups/` — create:111 ```json112 {113 "name": "string (required)",114 "platform_key": "string (required)",115 "description": "string",116 "users": "number[]"117 }118 ```119- **PUT** `…/groups/{id}/` — update (same shape).120- **DELETE** `…/groups/{id}/?platform_key={org}` — delete. Destructive — confirm with the user first.121122### Roles123124`…/core/rbac/roles/` (all calls include `include_global_roles=true`)125126- **POST** `…/roles/?include_global_roles=true` — create:127 ```json128 {129 "name": "string (required)",130 "platform_key": "string (required)",131 "actions": "string[] (RBAC action strings, e.g. Ibl.Mentor/Mentors/read)",132 "data_actions": "string[]"133 }134 ```135 The permission list is **`actions`** (+ optional **`data_actions`**), not136 `permissions`. See **`/iblai-api-rbac`** for the full role/policy model137 (action namespaces, resource paths).138- **PUT** / **PATCH** `…/roles/{id}/?include_global_roles=true` — update (same shape).139- **DELETE** `…/roles/{id}/?include_global_roles=true&platform_key={org}` — delete. Destructive — confirm with the user first.140141### Policies142143`…/core/rbac/policies/`144145- **POST** `…/policies/` — create:146 ```json147 {148 "name": "string (required)",149 "platform_key": "string (required)",150 "role": "number role id (required)",151 "resources": "string[]",152 "users": "number[]",153 "groups": "number[]"154 }155 ```156- **PUT** / **PATCH** `…/policies/{id}/` — update (same shape).157- **DELETE** `…/policies/{id}/?platform_key={org}` — delete. Destructive — confirm with the user first.158159### Teams160161`…/core/user-groups/` plus team access (`…/core/rbac/teams/access/`)162163- **POST** `…/user-groups/` — create:164 ```json165 {166 "name": "string (required)",167 "platform_key": "string (required)",168 "description": "string",169 "users": "number[]"170 }171 ```172- **PUT** `…/user-groups/{id}/` — update (same shape).173- **DELETE** `…/user-groups/{id}/` — delete. Destructive — confirm with the user first.174- **POST** `…/core/rbac/teams/access/` — set team access:175 ```json176 {177 "platform_key": "string (required)",178 "usergroup_id": "number (required)",179 "groups": "[{group_id, role}]",180 "users": "[{user_id, role}]"181 }182 ```183184### Alerts185186`…/core/watched-groups/`187188- **GET** / **POST** `…/watched-groups/` — list / create watched group.189- **GET** / **PATCH** / **DELETE** `…/watched-groups/{id}/` — watched group detail / update / delete. DELETE is destructive — confirm with the user first.190- **GET** / **POST** `…/watched-groups/{watchedGroupPk}/watched-users/` — list / add watched users.191- **DELETE** `…/watched-users/{id}/` — remove watched user. Destructive — confirm with the user first.192- **GET** / **POST** `…/watched-groups/{watchedGroupPk}/watchers/` — list / add watchers.193- **PATCH** / **DELETE** `…/watchers/{id}/` — update / remove watcher (notification-event flags in body). DELETE is destructive — confirm with the user first.194195## Example196197List the first page of organization users with their policies:198199```bash200curl -s \201 "https://api.iblai.app/dm/api/core/platform/users/?platform_key=$IBLAI_ORG&platform_org=$IBLAI_ORG&page=1&page_size=10&return_policies=true" \202 -H "Authorization: Api-Token $IBLAI_API_KEY"203```204205## Notes206207- Most endpoints require `platform_key={org}` as a query param even on POST/PUT208 bodies that also carry it — send both.209- The edX user-roles calls (list, promote/demote, bulk sync) are the only210 ones on the edX LMS/CMS host and take **no** `platform_key`; every other211 endpoint here is on the DM host under `/api/core/…`. Prefer the CMS host212 (`studio.learn.iblai.app`) for edX roles - it accepts every role key,213 including `course-creator`, which the LMS host rejects.214- edX roles (this section) and DM `rbac/roles` (the **Roles** subsection215 below) are two unrelated systems that happen to share the word "role" - an216 edX role key like `org-instructor` is not a DM RBAC role id, and vice versa.217- Policies bind a `role` (RBAC role id) to `resources`, `users`, and `groups` —218 create the Role first, then reference its id when creating the Policy.219- DELETE on any sub-section is destructive — confirm with the user before220 removing groups, roles, policies, teams, watched groups/users, or watchers.221222## Reference material223224- **[`references/edx-roles-reference.md`](references/edx-roles-reference.md)** - full edX role catalog (every global/course/org role key and what it grants), the list/assign/bulk-sync endpoint bodies and responses, and gotchas (inactive-user grant skipping, idempotency, `course-creator`'s CMS-only restriction, Open edX release gates on `course-limited-staff`).