Mobile API v1

API documentation

Connect a learner app to Allure LMS. Authenticate a member, read their courses and look up request and response types for the mobile API.

On this page

Make your first call

Install the convex JavaScript package. Set deploymentUrl to the Convex deployment URL supplied for your integration. The public version query works before sign-in.

TypeScript · Check the deployment
import { ConvexHttpClient } from "convex/browser";
import { makeFunctionReference } from "convex/server";

const client = new ConvexHttpClient(deploymentUrl);
const version = await client.query(
  makeFunctionReference<"query">("mobile/v1/meta:version"), {}
);
console.log(version.mobileApiVersion);
Example response
{
  "mobileApiVersion": "1.5.0",
  "minimumClientVersion": "1.0.0",
  "deprecations": []
}

Use the version returned by your deployment to decide which optional fields to request. Functions use the path mobile/v1/module:function. Call queries to read data, mutations to change records and actions to run operations such as SCORM launch.

Authenticate a learner

Sign in with the workspace’s Allure Account configuration. The example uses Clerk’s signed-in getToken and the same client as above. Set workspaceId to the member’s intended workspace. Obtain a fresh token when the session token expires.

TypeScript · Read the learner catalog
const token = await getToken({ template: "convex" });
if (!token) throw new Error("Sign in to continue");
client.setAuth(token);

const { courses } = await client.query(
  makeFunctionReference<"query">("mobile/v1/catalog:list"),
  { expectedTenantId: workspaceId }
);

If the server requests workspace selection, query me:workspaces and pass an authorized choice to me:selectWorkspace. Check me:get for enabled capabilities. Sending expectedTenantId pins the request to that workspace. Access still depends on the signed-in member’s role and enrollment.

Handle course access

Use catalog:course for the outline. For a required form, request content:activity with the required activity’s course ID, activity ID, enrollment ID and workspace pin. A locked activity includes the reason and any requirement the server can disclose.

For an available form block, open the following path on the workspace’s HTTPS learner site in an authenticated browser. Encode each identifier and use the opaque placement from the response.

Learner site path
/learn/courses/{courseId}/open/{placement}?enrollment={enrollmentId}&activity={activityId}

When the app returns to the foreground, read the activity and course access again. Only a confirmed submission satisfies a submission requirement. A browser launch or an offline queue entry leaves the requirement pending.

Pagination, errors and retries

For functions accepting paginationOpts, start with { numItems: 20, cursor: null }. Pass the returned continueCursor on the next call and stop when isDone is true. Course catalog reads return a bounded list with a truncated flag. For progress history, pass nextBefore back as before until it is null.

Read code, reason and retryable from ConvexError.data.error. For UNAUTHENTICATED, refresh the member’s session. For WORKSPACE_MISMATCH, check the selected workspace. For LOCKED, read the access rule before attempting the activity again.

When a write accepts a clientOpId, generate a UUID once for that learner action and reuse it with the same payload on retry. For a quiz requiring admission, save the admissionId from progress:beginQuiz and include it when submitting or retrying the attempt.

Function reference

Every public function is also published as a machine-readable OpenRPC 1.3.2 specification (JSON) with JSON Schema parameter, response and error definitions generated directly from the Convex contract.

  • API version — Check deployment compatibility and upcoming deprecations before making workspace calls.
  • Account and workspace — Read the signed-in member, available workspaces, capabilities, terminology and theme.
  • Course catalog — List courses, enroll a learner and open the outline for an enrollment.
  • Lesson content — Read activity blocks, prerequisites, completion state and authenticated form placements.
  • Progress and quizzes — Read learning records, record completion and manage quiz attempts.
  • SCORM playback — Launch an authorized SCORM package for the current learner.
  • Learning programs — Read assigned practice, goals, standings and rewards, and record learner actions.
  • Learning preferences — Read and update notification, playback, caption and time zone preferences.
  • Community — Browse groups and feeds, join discussions, react and report content.
  • Member directory — Read visible profiles, manage connections and update directory visibility.
  • Private messages — Open conversations, send messages and manage unread or blocked threads.
  • Notifications — Read the inbox, mark notifications as read and resolve their destinations.
  • Push notifications — Register devices and manage push notification preferences.
  • Documents and feedback — Upload and open learner documents, submit feedback and read coaching notes.