add_user_user_group
Add a user to a specified user group using the group ID and user ID or email. Use this to create a group membership in LearnWorlds.
Instructions
🟡 WRITE · creates data · POST /v2/user_groups/{id}/users/{uid}
Add a user to a user group.
Behavior: creates a record or triggers an action in the live school. Not idempotent: a repeated call can duplicate the effect. 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: only when the user asked to create this. Check with a 🟢 read tool that the target exists and the record is not already there. Related User groups tools: remove_user_user_group, get_users_user_group, deletes_user_group, get_user_group, update_user_group.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"id": "<id>",
"uid": "<uid>"
},
"name": "add_user_user_group"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Unique identifier of the user group | |
| uid | Yes | User Id or email (encoded string) |