Skip to content

API Endpoints

The RankHub API is a RESTful interface served by the SolidStart application. All endpoints are prefixed with /api.

Base URL: https://rankhub.app/api

Authentication

All endpoints (except public ones) require a valid JWT token sent as an Authorization: Bearer <token> header or as an auth cookie. See Authentication for details.

Matchups and Voting

MethodEndpointAuthDescription
GET/v1/matchupNoGet a matchup for a subcategory
POST/v1/voteYesSubmit a vote between two items
GET/v1/compareYesCompare two specific items
GET/v1/compare/suggestYesGet comparison suggestions
GET/v1/compare/randomNoGet a random comparison
GET/v1/guessYesGuess the ranking of an item
POST/v1/challengeYesSubmit a ranking challenge

Leaderboards

MethodEndpointAuthDescription
GET/v1/leaderboard/:slugNoGet leaderboard for a subcategory
GET/v1/categoriesNoList all categories
GET/v1/categories/:slugNoGet a category and its subcategories
GET/v1/subcategories/:slugNoGet subcategory details

Items

MethodEndpointAuthDescription
GET/v1/item/:slugNoGet item details by slug
GET/v1/items/:idNoGet item details by ID
GET/v1/items/:id/historyNoGet item rating history
POST/v1/community/submitYesSubmit a new item for review

User

MethodEndpointAuthDescription
GET/v1/auth/meYesGet current user profile
GET/v1/user/profileYesGet detailed user profile
PUT/v1/user/notification-preferencesYesUpdate notification preferences
GET/v1/user/votes/exportYesExport user's vote history
DELETE/v1/user/delete-accountYesDelete account and all data

Users (Public)

MethodEndpointAuthDescription
GET/v1/users/:idNoGet public user profile
GET/v1/users/:id/votesNoGet user's recent votes
GET/v1/users/:id/followersNoGet user's followers
GET/v1/users/:id/followingNoGet users being followed
GET/v1/users/:id/activityNoGet user activity feed
GET/v1/users/:id/achievementsNoGet user achievements
GET/v1/users/:id/rating-historyNoGet user's rating history
POST/v1/user/follow/:idYesFollow/unfollow a user

Authentication

MethodEndpointAuthDescription
POST/v1/auth/signupNoCreate a new account
POST/v1/auth/signinNoSign in with email/password
POST/v1/auth/signoutYesSign out and clear session
POST/v1/auth/verify-emailNoVerify email with token
POST/v1/auth/send-verificationNoResend verification email
POST/v1/auth/forgot-passwordNoRequest password reset
POST/v1/auth/reset-passwordNoReset password with token
GET/v1/auth/googleNoInitiate Google OAuth (302 redirect)
GET/v1/auth/google/callbackNoGoogle OAuth callback
GET/v1/auth/githubNoInitiate GitHub OAuth (302 redirect)
GET/v1/auth/github/callbackNoGitHub OAuth callback

Search and Discovery

MethodEndpointAuthDescription
GET/v1/searchNoSearch items and subcategories
GET/v1/search/suggestNoSearch autocomplete suggestions
GET/v1/discover/trendingNoGet trending items
GET/v1/discover/popular-subcategoriesNoGet popular subcategories
GET/v1/discover/controversialNoGet controversial matchups

Health

MethodEndpointAuthDescription
GET/health/liveNoLiveness check
GET/health/readyNoReadiness check (DB connectivity)

Error Responses

All errors return a JSON body with a message field and an appropriate HTTP status code:

json
{
  "message": "Item not found",
  "error": "NOT_FOUND"
}

Common status codes: 400 (bad request), 401 (unauthorized), 403 (forbidden), 404 (not found), 429 (rate limited), 500 (internal error).

Tournaments

MethodEndpointAuthDescription
GET/v1/tournamentsNoList tournaments (filter by ?status)
POST/v1/tournamentsYesCreate a tournament
GET/v1/tournaments/:idNoGet tournament detail with bracket
DELETE/v1/tournaments/:idYesCancel a tournament
POST/v1/tournaments/:id/startYesSeed and activate bracket
POST/v1/tournaments/:id/joinYesAdd items to a draft tournament
GET/v1/tournaments/:id/bracketNoGet full bracket structure
POST/v1/tournaments/:id/voteOptionalVote in a tournament match

Subscriptions

MethodEndpointAuthDescription
GET/v1/subscriptions/plansNoList available subscription plans
POST/v1/subscriptions/checkoutYesCreate a Stripe checkout session
GET/v1/subscriptions/statusYesGet current subscription status

Referrals

MethodEndpointAuthDescription
GET/v1/referral/codeYesGet or auto-generate referral code
GET/v1/referral/statsYesGet referral statistics
POST/v1/referral/claimYesClaim a referral during signup

Achievements

MethodEndpointAuthDescription
GET/v1/achievementsNoList all achievement definitions
POST/v1/achievementsAdminSeed achievements into database

Embed

MethodEndpointAuthDescription
GET/v1/embed/:slugNoGet leaderboard embed widget JavaScript

Webhooks

MethodEndpointAuthDescription
POST/v1/webhooksYesCreate a webhook subscription
GET/v1/webhooksYesList webhook subscriptions
DELETE/v1/webhooks/:idYesDelete a webhook subscription

API Keys

MethodEndpointAuthDescription
POST/v1/api-keysYesCreate an API key
GET/v1/api-keysYesList API keys
DELETE/v1/api-keys/:idYesRevoke an API key

User Settings

MethodEndpointAuthDescription
GET/v1/user/achievementsYesGet earned achievements and voting streak
GET/v1/user/exportYesFull GDPR data export
GET/v1/user/digestYesGet weekly digest summary
PATCH/v1/user/change-passwordYesChange account password
GET/v1/user/privacyYesGet privacy settings
PUT/v1/user/privacyYesUpdate privacy settings
GET/v1/user/notificationsYesList notifications (paginated)
PATCH/v1/user/notifications/:id/readYesMark notification as read
POST/v1/user/notifications/read-allYesMark all notifications as read

Push Notifications

MethodEndpointAuthDescription
GET/v1/notifications/pushYesList registered push subscriptions
POST/v1/notifications/pushYesRegister a push subscription
DELETE/v1/notifications/pushYesRemove a push subscription

Comments

MethodEndpointAuthDescription
GET/v1/commentsNoList comments for an entity
POST/v1/commentsYesCreate a comment
PATCH/v1/commentsYesEdit own comment
DELETE/v1/commentsYesDelete own comment

Community

MethodEndpointAuthDescription
GET/v1/community/top-votersNoGet top 50 all-time voters

Cron (Internal, requires CRON_SECRET)

MethodEndpointAuthDescription
GET/v1/cron/check-do-healthCRON_SECRETCheck DO worker health
GET/v1/cron/evaluate-alertsCRON_SECRETEvaluate and dispatch alerts
GET/v1/cron/streak-recoveryCRON_SECRETSend streak recovery emails
GET/v1/cron/send-digestCRON_SECRETSend weekly digest emails
GET/v1/cron/rotate-challengeCRON_SECRETRotate daily challenge

Admin

MethodEndpointAuthDescription
GET/v1/admin/statsAdminPlatform statistics
GET/v1/admin/analyticsAdminDetailed analytics metrics
GET/v1/admin/challengeAdminGet/set daily challenge
POST/v1/admin/challengeAdminSet daily challenge
GET/v1/admin/email-digestAdminGenerate weekly digest email HTML

CSP Reporting

MethodEndpointAuthDescription
POST/v1/csp-reportNoAccept browser CSP violation reports