
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Overview
The v1 and v2 public channel API endpoints need to return a library enum field to allow Kolibri to identify whether a channel is part of the Kolibri Library, Community Library, or neither.
Complexity: Medium
Target branch: unstable
Context
The v1 public channel endpoint at /api/public/v1/channels/lookup/{token} already distinguishes between channel-level tokens and channel version tokens (#5772). Community library tokens are channel version tokens — they are created when a CommunityLibrarySubmission is made, and attached to the corresponding ChannelVersion via its secret_token field.
Studio can determine whether a token is a community library token by checking if the ChannelVersion associated with the resolved token has a matching CommunityLibrarySubmission with an approved or live status. The Channel.is_community_channel() method already exists for this check at the channel level.
The relevant code is in:
contentcuration/kolibri_public/views_v1.py — v1 endpoint handler
contentcuration/contentcuration/models.py — ChannelVersion, CommunityLibrarySubmission, Channel.is_community_channel()
The Change
When the v1 endpoint resolves a token, include a library enum field in the response using values from le-utils (learningequality/le-utils#214): "KOLIBRI" for public channels, "COMMUNITY" for community library version tokens (where the associated ChannelVersion has a CommunityLibrarySubmission with approved or live status), and null otherwise.
Add a library field to the v2 channel metadata response: "KOLIBRI" for public channels, "COMMUNITY" for non-public channels.
Update the le-utils dependency to include the new library constants.
We should also update the v1 endpoint to require a special query parameter in order to resolve tokens against ChannelVersion objects - "channel_versions=true". Otherwise, the ChannelVersion lookup path should be skipped. This will prevent older Kolibris from accidentally retrieving data they will not parse correctly.
How to Get There
The v1 lookup logic in contentcuration/kolibri_public/views_v1.py already has the resolved token type available:
- For channel version tokens, the
ChannelVersion object is available — check if it has a CommunityLibrarySubmission with approved or live status → "COMMUNITY"
- For regular channel tokens, check
channel.public → "KOLIBRI"
- Otherwise →
null
Acceptance Criteria
Testing
References
AI usage
Used Claude Code to draft this issue interactively. I provided the requirements and Claude explored the Studio codebase to understand the token resolution and community library submission models. All content reflects my decisions and was reviewed section by section.
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
The v1 and v2 public channel API endpoints need to return a
libraryenum field to allow Kolibri to identify whether a channel is part of the Kolibri Library, Community Library, or neither.Complexity: Medium
Target branch: unstable
Context
The v1 public channel endpoint at
/api/public/v1/channels/lookup/{token}already distinguishes between channel-level tokens and channel version tokens (#5772). Community library tokens are channel version tokens — they are created when aCommunityLibrarySubmissionis made, and attached to the correspondingChannelVersionvia itssecret_tokenfield.Studio can determine whether a token is a community library token by checking if the
ChannelVersionassociated with the resolved token has a matchingCommunityLibrarySubmissionwith an approved or live status. TheChannel.is_community_channel()method already exists for this check at the channel level.The relevant code is in:
contentcuration/kolibri_public/views_v1.py— v1 endpoint handlercontentcuration/contentcuration/models.py—ChannelVersion,CommunityLibrarySubmission,Channel.is_community_channel()The Change
When the v1 endpoint resolves a token, include a
libraryenum field in the response using values from le-utils (learningequality/le-utils#214):"KOLIBRI"for public channels,"COMMUNITY"for community library version tokens (where the associatedChannelVersionhas aCommunityLibrarySubmissionwith approved or live status), andnullotherwise.Add a
libraryfield to the v2 channel metadata response:"KOLIBRI"for public channels,"COMMUNITY"for non-public channels.Update the le-utils dependency to include the new library constants.
We should also update the v1 endpoint to require a special query parameter in order to resolve tokens against ChannelVersion objects - "channel_versions=true". Otherwise, the ChannelVersion lookup path should be skipped. This will prevent older Kolibris from accidentally retrieving data they will not parse correctly.
How to Get There
The v1 lookup logic in
contentcuration/kolibri_public/views_v1.pyalready has the resolved token type available:ChannelVersionobject is available — check if it has aCommunityLibrarySubmissionwith approved or live status →"COMMUNITY"channel.public→"KOLIBRI"nullAcceptance Criteria
libraryfieldlibraryfieldCommunityLibrarySubmissionreturnlibrary: "COMMUNITY"library: "KOLIBRI"library: nulllibrary: "KOLIBRI", non-public returnlibrary: "COMMUNITY"Testing
libraryvalues (KOLIBRI, COMMUNITY, null) across token types on v1libraryfield on v2 for public and non-public channelsReferences
AI usage
Used Claude Code to draft this issue interactively. I provided the requirements and Claude explored the Studio codebase to understand the token resolution and community library submission models. All content reflects my decisions and was reviewed section by section.