Skip to content

API Reference

All API routes are under /api/. Authentication endpoints are managed by Better Auth; application endpoints are under /api/v1/.

Authentication

MethodEndpointDescription
*/api/auth/[...all]Better Auth catch-all (sign-in, sign-up, OAuth, sessions, etc.)

Readings

MethodEndpointDescription
POST/api/v1/readingsCreate a new tarot reading (enqueues BullMQ job)
GET/api/v1/readings/can-playCheck if user can start a reading (credit/limit check)

Chat

MethodEndpointDescription
POST/api/v1/chats/[chatId]Send a follow-up message in a reading chat

Credits

MethodEndpointDescription
POST/api/v1/credits/purchasePurchase a credit pack (creates Stripe checkout session)

Spreads and Questions

MethodEndpointDescription
GET/api/v1/spreadsList all available tarot spreads
GET/api/v1/questions/sampleGet sample questions for a category
GET/api/v1/spread-questions/sampleGet sample questions for a specific spread

Tarot Readers

MethodEndpointDescription
GET/api/v1/tarot-readersList all available tarot readers

Card of the Day

MethodEndpointDescription
GET/api/v1/card-of-dayGet today's Card of the Day entry
POST/api/v1/card-of-dayComplete Card of the Day (awards credits)

Card Skins

MethodEndpointDescription
GET/api/v1/card-skinsList all card skins with ownership status

Guidance (Insights)

MethodEndpointDescription
POST/api/v1/guidance/weeklyGenerate weekly guidance (enqueues async job)
POST/api/v1/guidance/soul-journeyGenerate/refresh Soul Journey (enqueues async job)

Text-to-Speech

MethodEndpointDescription
GET/api/v1/ttsSynthesize speech for a chat message (cached in R2)

AI Memory

MethodEndpointDescription
GET/api/v1/memoryGet user's AI memory facts

Notifications

MethodEndpointDescription
GET/api/v1/notificationsList notifications (paginated, filterable by category)
POST/api/v1/notifications/[id]/readMark a notification as read
POST/api/v1/notifications/read-allMark all notifications as read
GET/api/v1/notifications/unread-countGet unread notification count

Invitations

MethodEndpointDescription
GET/api/v1/invitations/summaryGet user's invitation stats and code
GET/api/v1/invitations/inviteesList invited users and their status

Membership

MethodEndpointDescription
GET/api/v1/membership/billingGet subscription and billing info

Feedback

MethodEndpointDescription
POST/api/v1/feedbackSubmit user feedback with optional screenshots

Analytics

MethodEndpointDescription
POST/api/v1/analytics/eventsTrack analytics events
POST/api/track-pageviewRecord a page view (visitor cookie)

User Profile

MethodEndpointDescription
GET/api/v1/app/profileGet current user's personal profile
PUT/api/v1/app/profileUpdate current user's personal profile
POST/api/me/avatarUpload user avatar
POST/api/v1/app/delete-accountInitiate account deletion

Admin

MethodEndpointDescription
POST/api/admin/uploadUpload files (images, assets)
POST/api/admin/translateAI-powered content translation

Internal (Telegram Bot)

Protected by INTERNAL_API_KEY header. Not for external use.

MethodEndpointDescription
POST/api/v1/internal/readings/createCreate reading from Telegram bot

Download

MethodEndpointDescription
GET/api/downloadDownload reading share images

Internal documentation for MysticX team