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

Start free trial

LearnDash Get Achievement

learndash/get-achievement fetches a single achievement definition: its trigger, points, occurrence limit, badge image, popup message, the five scope keys, and its award count.

The scope keys are where most misconfiguration lives.

At a glance

Abilitylearndash/get-achievement
ToolsetLearnDash — toolset/learndash
GroupLearnDash › Achievements
RequiresAcrossAI Pro, plus LearnDash LMS active on the site
Capabilitymanage_options
SafetyRead-only — changes nothing
RepeatableIdempotent — running it twice leaves the same result
Ships inAcrossAI Pro 0.9.16 and later

How it works

There are five: course, lesson, topic, quiz and group. Each can hold a post ID to restrict the badge to that object, the string all as a wildcard, or nothing at all.

Nothing at all means the key is not applicable to this trigger — a login-streak badge has no course scope — which is a different state from all, and reading one as the other is how a badge ends up scoped to nothing.

A badge scoped to a course that has since been deleted never fires and looks correctly configured.

The award count confirms whether the configuration works in practice, which the definition alone cannot.

The popup message is what the learner sees when they earn it, and the badge image is what appears on their profile — both are presentation rather than logic, and both are commonly left unset on badges created programmatically.

Input

NameTypeRequiredWhat it is
achievement_idintegerYesThe achievement.

What comes back

NameTypeWhat it is
achievementobjectTrigger, points, occurrence limit, image, message, scope keys and award count.
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:

How is this badge configured?

It resolves to one call:

{
  "ability": "learndash/get-achievement",
  "parameters": {
    "achievement_id": 900
  }
}

Worth knowing

  • An empty scope key and all mean different things.
  • A badge scoped to a deleted course looks fine and never fires.
  • The award count is the only proof the configuration works.
  • Requires the LearnDash Achievements add-on.

Related abilities


Get the plugins:
AcrossAI Abilities Manager · AcrossAI MCP Manager

Browse the rest: Every ability, by category


Keep reading