Returns { slug, label } pairs rather than bare slugs — a slug like 'daily_activity' isn't translatable display text on its own, and the frontend has no business hardcoding a slug -> label map that would drift out of sync with what's actually registered server-side. Labels come from Gamification_Registry::get_achievement_categories(), which every category slug in use is registered against in Gamification_Initializer::register_achievements().
Mirrors GET /gamification/challenges exactly: definitions are configuration data (rarely changes), kept separate from per-user progress state. The frontend merges this catalogue with /users/{id}/achievements or /me/gamification/achievements client-side, matching on 'id' (definition) against 'achievement_id' (state row). Paginated in-memory (see paginate_array()) rather than at the database layer, since achievement definitions live in Gamification_Registry, not a table — but the response still carries the same X-WP-Total / X-WP-TotalPages headers as every other paginated list endpoint in this domain, so API consumers don't need to know the difference.
Callback: GET /gamification/dashboard-stats — aggregate stats for the admin dashboard. Administrator-only (see require_admin()) — this exposes the full site-wide reputation/XP economy, not something a regular viewer or even a content moderator needs.
Public and capability-free by design — see register_user_display_routes()'s docblock for why this exists as its own domain-owned endpoint rather than relying on /wp/v2/users.
Hidden/secret achievements (e.g. 'early_supporter', 'beta_tester') are omitted from the response entirely when they are not yet unlocked and the requester is neither the profile owner nor an admin — a viewer should not be able to discover a secret achievement exists just by seeing a locked row for it. Once unlocked, a hidden achievement is visible to everyone, same as any public one; hiding it permanently even after unlock would make earning it pointless to show off. This was previously a known gap (flagged during the production audit): this endpoint returned identical data regardless of viewer.
Returns 404 rather than the row itself when the achievement is hidden, not yet unlocked, and the requester is neither the owner nor an admin — same rationale as get_user_achievements() above. A 404 here (rather than a filtered/empty 200) avoids confirming or denying whether the achievement ID is even valid to an unauthorized viewer.
Handler: get_user_achievement()
Parameters of GET /users/{id}/achievements/{achievement_id}
Note. Generated from the plugin source. Parameters are the ones declared when the route is registered; a parameter marked “see source” uses a shared definition. Responses are not documented here. Authenticate as for any WordPress REST route, for example with an application password over HTTPS; the example paths use https://example.com.