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

Start free trial

LearnDash Revoke Achievement

learndash/revoke-achievement removes badges a learner has earned. It requires confirm_user_email matching the learner.

The ID distinction is the thing to get right.

Before you run it

The award records are deleted outright and the learner’s points total drops. It takes award_ids — the per-award row IDs from learndash/list-user-achievements, not achievement post IDs. A learner can hold the same badge more than once and each earn is a separate record, so passing the wrong kind of ID either fails or removes the wrong thing.

At a glance

Abilitylearndash/revoke-achievement
ToolsetLearnDash — toolset/learndash
GroupLearnDash › Achievements
RequiresAcrossAI Pro, plus LearnDash LMS active on the site
Capabilitymanage_options
SafetyDestructive and irreversible — award records are deleted and the learner’s points drop. Requires confirm_user_email.
RepeatableNot idempotent — each call changes the row set, so re-running is not a no-op
Ships inAcrossAI Pro 0.9.16 and later

How it works

An achievement post ID identifies the badge definition. An award ID identifies one learner earning it once. This takes the second.

That matters because a repeatable badge produces many awards, and revoking “the badge” is not a coherent instruction — you are removing specific earns.

learndash/list-user-achievements returns those IDs.

The points drop accordingly, by the points recorded on each award at the time it was made — which may not match the badge’s current points value.

Deleting the achievement definition itself is a different and much wider operation. learndash/delete-achievement with permanent deletion erases every award of that badge for every learner on the site.

Not idempotent.

Input

NameTypeRequiredWhat it is
learnerstring | integerYesUser ID, login or email.
award_idsarrayYesPer-award row IDs from learndash/list-user-achievements.
confirm_user_emailstringYesMust match the learner’s email address.
confirmbooleanYes — must be trueThe irreversibility gate. Without it the call is refused before anything is touched.

What comes back

NameTypeWhat it is
revokedintegerHow many awards were removed.
points_removedintegerHow far the learner’s total dropped.
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:

Take back that badge I awarded by mistake.

It resolves to one call:

{
  "ability": "learndash/revoke-achievement",
  "parameters": {
    "learner": "sam@example.com",
    "award_ids": [4412],
    "confirm_user_email": "sam@example.com"
  }
}

Worth knowing

  • Award IDs, not achievement post IDs.
  • Each earn of a repeatable badge is a separate record.
  • Points drop by what was recorded at award time.
  • Deleting the definition is a far wider operation.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading