APIAPI Reference

REST API endpoints for integrating with Biozy.

API Reference

Biozy exposes REST API routes for interacting with profiles, links, and social connections.

All routes are Next.js Route Handlers in src/app/api/. Authentication uses Supabase session cookies.


Social connections

GET /api/social/connections

Returns all social connections for the authenticated user.

json
{
  "connections": [
    {
      "platform": "youtube",
      "username": "@yourchannel",
      "follower_count": 148000,
      "last_synced_at": "2025-03-12T14:22:00Z"
    }
  ]
}

POST /api/social/sync

Refreshes follower counts. Pass { "platform": "youtube" } to sync one platform, or omit body to sync all.


DELETE /api/social/disconnect

json
{ "platform": "youtube" }

YouTube OAuth

GET /api/youtube/connect

Initiates the OAuth flow. Redirects to Google authorization.

GET /api/youtube/callback

OAuth callback. On success, redirects to /dashboard/connections?social_connected=youtube.

Error codes: youtube_denied | youtube_invalid_state | youtube_token_error | youtube_no_channel | youtube_session_mismatch | youtube_db_error


Changelog

POST /api/changelog/subscribe

Subscribe an email. Sends confirmation via Resend.

GET /api/changelog/confirm?token=xxx

Confirm subscription from email link.

GET /api/changelog/unsubscribe?token=xxx

One-click unsubscribe.

POST /api/changelog/notify

Send release notification to all confirmed subscribers. Protected by CHANGELOG_NOTIFY_SECRET.

json
{
  "secret":  "your-secret",
  "version": "1.5.0",
  "date":    "March 20, 2025",
  "summary": "Release description",
  "changes": [
    { "type": "new", "text": "Feature description" }
  ]
}