30 days free. No credit card. Full access from the moment you connect your site.

Start free trial

LearnDash Manage Group Membership

learndash/manage-group-membership adds learners to a group or removes them from it.

Adding somebody grants every course the group carries, in one call.

At a glance

Abilitylearndash/manage-group-membership
ToolsetLearnDash — toolset/learndash
GroupLearnDash › Groups
RequiresAcrossAI Pro, plus LearnDash LMS active on the site
Capabilitymanage_options
SafetyWrites data
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Pro 0.9.16 and later

How it works

So the scale runs the other way from the course ability: one member, many courses. A group carrying twelve courses grants twelve on every addition.

Removing revokes that access, unless the learner also holds the course directly — a direct enrolment outlives group membership, which is the usual reason somebody removed from a group still has a course.

This is incremental. Pass add and remove as arrays; anything you do not mention is left alone. That makes a single change a single call, and it means a caller cannot wipe a list by sending a short one.

Learners can be given as user IDs, logins or email addresses, and the response names anything that could not be resolved to a user — which matters when the list came from a spreadsheet.

Progress is never deleted. A learner removed and re-added picks up where they left off.

The response reports the resulting member count, which is the number to check against what was expected.

Idempotent.

Input

NameTypeRequiredWhat it is
group_idintegerYesThe group.
addarrayNoUser IDs, logins or emails to add.
removearrayNoUser IDs, logins or emails to remove.

What comes back

NameTypeWhat it is
member_countintegerHow many members the group has afterwards.
unresolvedarrayEntries that could not be matched to a user.
successbooleanWhether the call completed.
messagestringA one-line summary of what happened, suitable for showing a human.
error_codestringPresent only on failure — a stable machine-readable reason, such as a missing field, a wrong field type or an unmet confirmation.

Example

Ask your assistant:

Add these three people to the January cohort.

It resolves to one call:

{
  "ability": "learndash/manage-group-membership",
  "parameters": {
    "group_id": 700,
    "add": ["sam@example.com", "alex@example.com", 91]
  }
}

Worth knowing

  • Adding grants every course the group carries.
  • A direct enrolment survives removal from the group.
  • Unresolvable entries are named rather than silently dropped.
  • Progress survives removal and re-addition.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading