Skip to main content
This document provides a comprehensive reference for all API endpoints in the trip-page application.

Base URL

All API endpoints are prefixed with /api/v1

Authentication

Protected endpoints require authentication via a bearer token in the request header:
Authorization: Bearer <your_token>

Endpoints

Trip Endpoints

Base path: /api/v1/trips
MethodEndpointDescriptionAuthentication
GET/Get all public tripsNo
GET/landing-pageGet landing page dataNo
GET/id/:tripIdGet a specific trip by IDYes
GET/:hostSlug/:tripSlugGet trip details by host and trip slugNo

Payment Endpoints

Base path: /api/v1/payments
MethodEndpointDescriptionAuthentication
POST/create-orderCreate a new payment orderNo
POST/verify-paymentVerify a paymentNo
POST/webhookHandle regular payment webhooksNo
POST/payment-link-webhookHandle payment link webhooksNo
GET/payment-remindersGet all payment reminders (with optional filters)Yes
POST/send-payment-reminderSend a manual payment reminderYes
GET/payment-reminders/:leadIdGet reminder history for a specific leadYes

Media Endpoints

Base path: /api/v1/media
MethodEndpointDescriptionAuthentication
POST/uploadUpload media file (images/videos)Yes
POST/deleteDelete media fileYes

Coupon Endpoints

Base path: /api/v1/coupons
MethodEndpointDescriptionAuthentication
POST/Create a new couponYes
GET/Get all couponsYes
PATCH/:idUpdate a specific couponYes
DELETE/:idDelete a specific couponYes
POST/validateValidate a couponNo
GET/trip/:tripIdGet coupons for a specific tripNo

Analytics Endpoints

Base path: /api/v1/analytics
MethodEndpointDescriptionAuthentication
GET/tripsGet trip analyticsYes
POST/track/:hostName/:tripSlugTrack trip clicksNo

PostHog Analytics Endpoints

Base path: /api/v1/posthog-analytics
MethodEndpointDescriptionAuthentication
GET/tripsGet all trips for analytics dropdownYes
GET/trips/:tripSlug/statsGet analytics for a specific tripYes

Host Endpoints

Base path: /api/v1/hosts
MethodEndpointDescriptionAuthentication
GET/:hostSlugGet host profileNo
GET/:hostSlug/tripsGet host’s tripsNo
POST/Create new hostYes
PUT/:hostSlugUpdate hostYes

Admin Endpoints

Base path: /api/v1/admin
MethodEndpointDescriptionAuthentication
POST/loginAdmin loginNo
GET/profileGet admin profileYes
POST/createCreate new adminYes
GET/hostsGet all hostsYes
POST/hostsCreate hostYes
PUT/hosts/:hostIdUpdate hostYes
GET/tripsGet all tripsYes
GET/trips/:tripIdGet specific tripYes
POST/tripsCreate tripYes
PUT/trips/:tripIdUpdate tripYes
DELETE/trips/:tripIdDelete tripYes
POST/trips/:tripId/duplicateDuplicate a tripYes

General Notes

  • Base API path: /api/v1
  • Authentication is required for protected endpoints and should be provided via an authentication token
  • All authenticated routes require a valid auth token in the request header
  • The server includes a health check endpoint at /api/v1/health that returns server status