---
title: "Api Learning Path Cohort Badge"
method: GET
path: "/api/learning/path/{path_id}/cohort-badge"
tags: ["Education"]
---

# Api Learning Path Cohort Badge

`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

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.

## Path parameters

- `path_id` string, required: learning-paths.json path id

## Response `200`

Successful Response

- CohortBadgeResponse: `GET /api/learning/path/{path_id}/cohort-badge` — private percentile badge for the authed user on one learning path. Anti-thin-data invariants pinned by tests/test_routes_cohort_badge_contract.py: - `active=True` requires `cohort_size >= 100`. - `active=True` requires `user_count > 0` AND user is in the top 10% of mastery_passed counts on the path's modules. - Anonymous callers + users with no progress get `active=False`.
  - `active` boolean, 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_size` integer, 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_count` integer, nullable: The requesting user's own count of mastery_passed modules on this path. Null for anonymous callers. Never includes other users.
  - `cutoff_pct` integer: The top-N% threshold used for the active=True decision. Mirrors pg_db.queries.learn.PATH_BADGE_TOP_PCT.
  - `min_cohort` integer: Minimum cohort size before the badge can activate. Mirrors pg_db.queries.learn.PATH_BADGE_COHORT_MIN.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api.md) · [All operations](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api/llms.txt) · [OpenAPI document](https://skmtc.dev/oxfordledge/apis/oxford-ledge-api/revisions/e832a1260f0b?raw)
