API Endpoints
Live route signatures from the backend implementation in /Users/weshuber/Reactnative/Backend/routes/*.js.
Base URL: https://api.thetrickbook.com/api
Conventions
- Authenticated routes use
x-auth-token: <jwt>. - Some route files include admin/account checks in middleware; see the route file for exact authorization rules.
- This page documents implemented signatures (method + path), not payload schema details.
Health (/health, /api/health)
GET /health: liveness and readiness probe, no auth, not rate limited. Pings the database and answers200 { status: "ok" }or503 { status: "degraded" }. The body carriesversion(setAPP_VERSIONto the deployed SHA),uptimeSeconds,db,dbLatencyMsandtimestamp, nothing else. Point uptime checks and the deploy smoke test at this route.
Auth (/api/auth)
POST /api/authPOST /api/auth/google-authPOST /api/auth/apple-auth
User Profile (/api/user)
GET /api/user/meGET /api/user/countGET /api/user/:idGET /api/user/:id/publicGET /api/user/:id/statsPUT /api/user/:idGET /api/user/:id/activityGET /api/user/homie-status/:targetId
Users And Network (/api/users)
POST /api/usersGET /api/usersGET /api/users/allDELETE /api/users/:idPOST /api/users/forgot-passwordPOST /api/users/reset-passwordGET /api/users/network-statusPUT /api/users/:id/networkGET /api/users/discoverablePOST /api/users/:id/homie-requestPOST /api/users/:id/accept-homiePOST /api/users/:id/reject-homieGET /api/users/homiesGET /api/users/homie-requestsDELETE /api/users/homie/:idGET /api/users/homie-status/:targetId
Trick Lists (/api/listings)
GET /api/listingsGET /api/listings/countTrickListsPOST /api/listingsDELETE /api/listings/:idPUT /api/listings/editGET /api/listings/allGET /api/listings/publicPUT /api/listings/:id/visibility
Tricks In Lists (/api/listing)
GET /api/listingGET /api/listing/allDataGET /api/listing/allTricksGET /api/listing/graphDELETE /api/listing/:idPUT /api/listing/editPUT /api/listing/updatePUT /api/listing
Trickipedia (/api/trickipedia)
GET /api/trickipediaGET /api/trickipedia/category/:categoryGET /api/trickipedia/:idPOST /api/trickipediaPUT /api/trickipedia/:idDELETE /api/trickipedia/:id
Categories (/api/categories)
GET /api/categoriesGET /api/categories/:idPOST /api/categoriesPUT /api/categories/:idDELETE /api/categories/:id
Spots (/api/spots)
GET /api/spots/sport-typesGET /api/spots/places-searchGET /api/spots/places/:placeIdGET /api/spots/reverse-geocodePOST /api/spotsPOST /api/spots/bulkGET /api/spotsGET /api/spots/allGET /api/spots/pendingGET /api/spots/searchGET /api/spots/my-spotsGET /api/spots/:idPUT /api/spots/:idPUT /api/spots/:id/approvePUT /api/spots/:id/rejectDELETE /api/spots/:idGET /api/spots/:id/listsGET /api/spots/:id/places-infoGET /api/spots/:id/photosPOST /api/spots/:id/photosDELETE /api/spots/:id/photos/:photoKey
Spot Lists (/api/spotlists)
POST /api/spotlistsGET /api/spotlists/usageGET /api/spotlistsGET /api/spotlists/:idPUT /api/spotlists/:idDELETE /api/spotlists/:idPOST /api/spotlists/:id/spotsDELETE /api/spotlists/:id/spots/:spotIdGET /api/spotlists/:id/spots
Spot Reviews (/api/spot-reviews)
GET /api/spot-reviews/:spotIdPOST /api/spot-reviewsPUT /api/spot-reviews/:reviewIdDELETE /api/spot-reviews/:reviewIdPOST /api/spot-reviews/:reviewId/helpfulGET /api/spot-reviews/user/:userId
Feed (/api/feed)
GET /api/feedGET /api/feed/trendingGET /api/feed/user/:userIdGET /api/feed/sport/:sportTypeGET /api/feed/:postIdGET /api/feed/:postId/streamGET /api/feed/debug-token/:videoIdPOST /api/feedPUT /api/feed/:postIdDELETE /api/feed/:postIdPOST /api/feed/:postId/reactionDELETE /api/feed/:postId/reaction/:typeGET /api/feed/:postId/commentsPOST /api/feed/:postId/commentsDELETE /api/feed/:postId/comments/:commentIdGET /api/feed/:postId/comments/:commentId/repliesPOST /api/feed/:postId/comments/:commentId/lovePOST /api/feed/:postId/saveGET /api/feed/savedPOST /api/feed/:postId/viewPOST /api/feed/:postId/report
Direct Messages (/api/dm)
GET /api/dm/conversationsGET /api/dm/conversations/:conversationIdGET /api/dm/conversations/:conversationId/messagesPOST /api/dm/conversationsPOST /api/dm/conversations/:conversationId/messagesPUT /api/dm/conversations/:conversationId/readGET /api/dm/unread-count
Media Library (/api/media)
GET /api/media/libraryGET /api/media/library/:idGET /api/media/featuredGET /api/media/collectionsGET /api/media/collections/:idGET /api/media/searchPOST /api/media/library/:id/ratePOST /api/media/library/:id/viewGET /api/media/library/:id/relatedGET /api/media/library/sport/:sportTypePOST /api/media/libraryPUT /api/media/library/:idDELETE /api/media/library/:idPOST /api/media/collections
The Couch (/api/couch)
GET /api/couch/videosGET /api/couch/featuredGET /api/couch/videos/:idGET /api/couch/videos/:id/streamGET /api/couch/collectionsGET /api/couch/collections/:idGET /api/couch/videos/:id/reactionPOST /api/couch/videos/:id/reactionDELETE /api/couch/videos/:id/reaction/:typeGET /api/couch/videos/:id/commentsPOST /api/couch/videos/:id/commentsDELETE /api/couch/videos/:videoId/comments/:commentIdPOST /api/couch/requestsGET /api/couch/requests/minePOST /api/couch/admin/syncGET /api/couch/admin/videosPOST /api/couch/admin/youtube-metadataPOST /api/couch/admin/bunny/create-videoGET /api/couch/admin/bunny/upload-url/:bunnyVideoIdGET /api/couch/admin/bunny/video/:bunnyVideoIdPOST /api/couch/admin/videosPUT /api/couch/admin/videos/:idDELETE /api/couch/admin/videos/:idPOST /api/couch/admin/collectionsPUT /api/couch/admin/collections/:idGET /api/couch/admin/requestsPUT /api/couch/admin/requests/:id
Upload (/api/upload)
POST /api/upload/video/createGET /api/upload/video/:videoId/statusDELETE /api/upload/video/:videoIdPOST /api/upload/video/:videoId/thumbnailGET /api/upload/videosPOST /api/upload/image/presignPOST /api/upload/image/base64DELETE /api/upload/image
Payments (/api/payments)
POST /api/payments/create-checkout-sessionGET /api/payments/subscriptionPOST /api/payments/admin/toggle-subscriptionPOST /api/payments/cancel-subscriptionPOST /api/payments/reactivate-subscriptionGET /api/payments/verify-session?session_id=(auth): confirms the caller's own paid Checkout Session after the redirect back from Stripe and activates itPOST /api/payments/reconcile(auth): applies any live Stripe subscription found for the caller's customer; never downgradesPOST /api/payments/webhook(Stripe signature over the raw body; deliveries are idempotent by event id)
Analytics (/api/analytics)
Ingestion is public (the user is taken from x-auth-token when present); every dashboard route requires an admin token.
POST /api/analytics/events: one event in the canonical envelopePOST /api/analytics/events/batch: up to 100 events, idempotent byeventIdGET /api/analytics/dashboard/retention?weeks=: signups, 48 h activation, time to value, weekly retention windows W1 to W4, exclusion summaryGET /api/analytics/dashboard/wpr?weeks=: Weekly Progressing Riders per rolling week with depth (actions per rider)GET /api/analytics/dashboard/feature-value?days=: riders and actions per meaningful eventGET /api/analytics/dashboard/ltv: plan counts and run-rateGET /api/analytics/dashboard/overview|traffic|pages|sections|scroll-depth|ctas|app-stores|funnel|referrers: website traffic dashboardsGET /api/analytics/dashboard/app-users: DAU, WAU, MAU across content collections and events, latest activityGET /api/analytics/dashboard/downloads: store download exports
Accounts with role: admin, isBot: true or analyticsExcluded: true are excluded from every metric and reported in the excluded field.
Blog (/api/blog)
POST /api/blogGET /api/blogGET /api/blog/:idGET /api/blog/url/:urlPATCH /api/blog/update/:idPATCH /api/blog/:idDELETE /api/blog/:id
Image Upload Routes
Profile Image (/api/image)
GET /api/image: default avatarPOST /api/image: sets the caller's own avatar (auth required; multipart fieldfile, image types only, 25 MB max). The target is the token holder, never a body field.
Trick Images (/api/trickImage)
POST /api/trickImage/uploadDELETE /api/trickImage/delete-folder/:slug
Blog Images (/api/blogImage)
POST /api/blogImage/uploadDELETE /api/blogImage/delete-folder/:slug
Utility And Legacy
GET /api/messagesPOST /api/messagesGET /api/my/listingsPOST /api/expoPushTokensPOST /api/contact/send-emailPOST /api/newsletter/subscribeGET /api/newsletter/statsPOST /api/newsletter/unsubscribe
Socket.IO Namespaces
/feed/messages
Common event patterns implemented in socket handlers:
- Feed rooms/events:
join:post,leave:post,comment:new,comment:deleted,comment:loved - Messaging rooms/events:
join:conversation,leave:conversation,typing:start,typing:stop,message:new,messages:read