add_invite_users_community_space
Add or invite users to a community space. If the space requires invitations, sends email invites; otherwise, adds users directly. Returns affected users.
Instructions
🟡 WRITE · creates data · POST /v2/community/spaces/{id}/users
Add/Invite users to a community space. Adds or invites users to a space. If space has is_invitation_required property set to true then users will be sent an invitation in their inbox to join, otherwise they will be directly added.
Returns an array of the affected users, if the user is already in space, the user will not be returned.
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.
Parameters: the whole JSON payload goes in the single body argument, forwarded verbatim (the spec leaves body optional, but this endpoint expects one).
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 Community tools: get_users_community_space, remove_user_community_space, delete_community_space, get_community_space, update_community_space.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Unique identifier of the community space | |
| body | No | Request body (application/json). |