Education

Api Learning Path Cohort Badge

F.2 alternative — private top-decile cohort badge.

Returns {active, cohort_size, user_count, cutoff_pct, min_cohort}. active=True only when:

  • cohort_size >= 100 (anti-thin-data gate; PATH_BADGE_COHORT_MIN)
  • user has ≥1 mastery_passed module on this path
  • user's mastery_passed count is in the top 10% of the cohort (PATH_BADGE_TOP_PCT)

SELF-ONLY: the caller's user_id is the only identity referenced. No other users' counts or names appear in the response payload.

get/api/learning/path/{path_id}/cohort-badge

Request

  • Base URL: https://www.oxfordledge.com (the document declares no server; this is the origin it was published from)
  • URL: https://www.oxfordledge.com/api/learning/path/{path_id}/cohort-badge
  • Auth: none declared

Path parameters

path_idstring required

learning-paths.json path id

Response

Successful Response

activeboolean required

Whether the badge should be rendered for this user/path pair. False means either the cohort is below the 100-user threshold, the user has no mastery_passed modules, or the user is below the top-10% cutoff.

cohort_sizeinteger required

Number of distinct users with ≥1 mastery_passed module on this learning path. Disclosed even when active=False so the FE can render a 'this cohort is still small' affordance if needed.

user_countinteger nullable

The requesting user's own count of mastery_passed modules on this path. Null for anonymous callers. Never includes other users.

cutoff_pctinteger

The top-N% threshold used for the active=True decision. Mirrors pg_db.queries.learn.PATH_BADGE_TOP_PCT.

min_cohortinteger

Minimum cohort size before the badge can activate. Mirrors pg_db.queries.learn.PATH_BADGE_COHORT_MIN.

Changes

No recorded changes to this operation across all 1 revision of this API.