Skip to content

Add public session discovery endpoint (HAR-93)#40

Open
zhiganov wants to merge 1 commit intomasterfrom
feature/public-sessions-endpoint
Open

Add public session discovery endpoint (HAR-93)#40
zhiganov wants to merge 1 commit intomasterfrom
feature/public-sessions-endpoint

Conversation

@zhiganov
Copy link
Member

Summary

  • New GET /api/v1/sessions/public endpoint — no auth required
  • Returns active sessions that hosts have marked as public via the existing "Public Access" toggle
  • Queries the permissions table for user_id='public' entries, joins with host_db for active sessions
  • Rate-limited by IP address (100 req/min) to prevent abuse
  • Each session includes a join_url for direct participant access (/chat?s={id})
  • Supports ?q= search and pagination (limit, offset)

Why

Enables My Community / Community Admin Chrome extensions to discover Harmonica sessions as "participation opportunities" without requiring an API key (HAR-93).

Files changed

  • src/lib/db.ts — new listPublicSessions() function
  • src/lib/api-types.ts — new PublicSessionListItem type
  • src/app/api/v1/_lib/mappers.ts — new toPublicSessionListItem() mapper
  • src/app/api/v1/sessions/public/route.ts — new endpoint
  • docs/api-spec.yaml — OpenAPI spec updated
  • Mintlify docs updated separately (pushed to harmonicabot/docs main)

Test plan

  • Mark a session as public via ShareSettings toggle
  • curl /api/v1/sessions/public returns the session with join_url
  • Unmark it — disappears from response
  • ?q=keyword filters by topic/goal
  • Pagination works (limit, offset, total)
  • 100+ rapid requests from same IP returns 429

🤖 Generated with Claude Code

GET /api/v1/sessions/public — no auth required, returns active sessions
that hosts have marked as public via the "Public Access" toggle. Uses
the existing permissions table (user_id='public') to discover sessions.
Rate-limited by IP address. Includes join_url for direct participant access.

Enables My Community / Community Admin integration to surface Harmonica
sessions as participation opportunities.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
harmonica-web-app Ready Ready Preview, Comment Feb 20, 2026 1:49pm
harmonica-web-app-dev Ready Ready Preview, Comment Feb 20, 2026 1:49pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant