LearnDash icon

LearnDash

Interact with the LearnDash LMS REST API

Actions60

User Groups → Add

AI-generated

Summary

Add one or more LearnDash groups to a specified user.

Inputs

  • parentId (required) — The ID of the user to assign groups to.
  • itemIds — Collection of group IDs to associate with the user.

Output shape

A JSON object or array returned by the LearnDash API containing the updated user group association details.

Sends a POST request to the LearnDash REST API endpoint /ldlms/v2/users/{parentId}/groups with an array of group_ids.

Examples

Example 1: Assign groups to a user

Set Parent ID to "45" and add group IDs 101 and 102 in Item IDs.

Discussion