REST API Reference
Free & ProThis page documents the REST routes that shipped or changed in Learnomy 1.7.0. For the conceptual overview (authentication, response envelope, rate limiting), see REST API and App. For the complete endpoint inventory, see audit/manifest.json and audit/manifest.summary.json in the plugin repository.
Free routes live under learnomy/v1. Pro routes live under learnomy-pro/v1. Every endpoint below returns the standard envelope: { "data": ... } for a single resource, { "data": [...], "meta": {...} } for a list.
Free: learnomy/v1
| Route | Method | Auth | Purpose |
|---|---|---|---|
/app/config |
GET | Public | Mobile-app bootstrap: white-label branding, feature flags, legal URLs, min_app_version, and the app_enabled gate. Called before the app holds any credential. |
/users/{id}/block |
POST | Logged-in | Block a member. Idempotent - blocking an already-blocked user returns 200. |
/users/{id}/block |
DELETE | Logged-in | Unblock a member. Idempotent - unblocking a non-blocked user returns 200. |
/users/me/blocks |
GET | Logged-in | List the members the caller has blocked. |
/courses/teaching |
GET | Logged-in | Courses the caller teaches, as author or co-instructor. |
/grading/pending |
GET | can_view_grading_queue |
The instructor's manual-grading inbox: submitted attempts awaiting a score, scoped to the caller's own courses (admins see all). |
Example: check a caller's block list
$response = wp_remote_get(
rest_url( 'learnomy/v1/users/me/blocks' ),
[ 'headers' => [ 'Authorization' => 'Bearer ' . $token ] ]
);
Pro: learnomy-pro/v1
🔶 Pro feature. These routes only register when Learnomy Pro is active.
| Route | Method | Auth | Purpose |
|---|---|---|---|
/assignments/{id}/my-submission |
GET | Authenticated + ownership | A student re-fetches their own submission for one assignment. Returns data: null when the caller has not submitted yet - not a 404. |
/users/me/assignments |
GET | Authenticated, enrollment-gated | Every open assignment across the courses the caller is enrolled in. |
viewer_submission on the lesson assignments list
GET /lessons/{id}/assignments (existing route) now includes a viewer_submission object inline on each assignment, so a client can render submission status without a second call:
{
"data": [
{
"id": 42,
"title": "Week 3 essay",
"viewer_submission": {
"submission_id": 1087,
"status": "graded",
"score": 88
}
}
]
}
submission_id is the same value the app also reads from GET /assignments/{id}/my-submission - use either field, they never drift. viewer_submission is null when the caller has not submitted.
Removed in 1.7.0
POST /memberships/{id}/refund was removed from Learnomy Pro. It duplicated Free's canonical refund endpoint and bypassed the learnomy_payment_refunded action, so Stripe/PayPal refund echoes and commission reversal could drift from the ledger.
Refunds now run through Free's canonical route only:
POST /learnomy/v1/admin/transactions/{id}/refund
This is the single refund path for both Free-only and Pro sites. It fires learnomy_payment_refunded, which Pro's Stripe Connect payout-clawback listener consumes to reverse an instructor payout when applicable.