SaaSyBase
SaaSyBase

API Reference

Every endpoint SaaSyBase exposes — grouped by domain, with auth requirements, rate-limit tiers, request/response shapes, and a changelog of recent contract updates.

190 endpoints across 27 categories

Authentication

Register, sign in, verify email, and reset passwords across the self-hosted auth lanes. Availability depends on the active auth provider for each route.

9
POST
/api/auth/registerRegister a new user
PUBLIC
POST
/api/auth/credentials-loginSign in with email and password
PUBLIC
POST
/api/auth/login-statusCheck whether credentials can sign in
PUBLIC
POST
/api/auth/magic-linkRequest Better Auth magic-link sign-in
PUBLIC
POST
/api/auth/verify-emailVerify email address
AUTH
GET
/api/auth/verify-emailComplete email verification link
PUBLIC
POST
/api/auth/forgot-passwordRequest password reset
PUBLIC
POST
/api/auth/reset-passwordReset password with token
PUBLIC
POST
/api/auth/resend-verificationResend verification email
PUBLIC

Public & account utilities

Health checks, contact form, and authenticated self-service account endpoints used by the dashboard.

11
GET
/api/healthHealth check
PUBLIC
POST
/api/contactSubmit contact form
PUBLIC
GET
/api/settings/formatRead public format preferences
PUBLIC
GET
/api/site-infoRead site branding info
PUBLIC
GET
/api/plan-previewDeprecated plan preview placeholder
PUBLIC
GET
/api/billing/testDeprecated billing test placeholder
PUBLIC
POST
/api/fix-statusDeprecated status fix placeholder
PUBLIC
GET
/api/minimalMinimal health stub
PUBLIC
GET
/api/user/export-account-dataDownload account data
AUTH
DELETE
/api/user/delete-accountDelete my account
AUTH
GET
/api/user/profileGet current user profile
AUTH

User management

Fetch users, elevate access, adjust token balances, and inspect payment history without leaving the dashboard.

7
GET
/api/admin/usersList users
ADMIN
GET
/api/admin/users/searchSearch users (typeahead)
ADMIN
GET
/api/admin/users/[userId]Get user details
ADMIN
PATCH
/api/admin/users/[userId]Perform a user admin action
ADMIN
DELETE
/api/admin/users/[userId]Delete a user
ADMIN
GET
/api/admin/users/[userId]/paymentsInspect user payments
ADMIN
PATCH
/api/admin/users/[userId]/roleChange user role
ADMIN

Payments & refunds

Manage invoices, trigger refunds, and backfill historical events.

3
GET
/api/admin/paymentsList payments
ADMIN
POST
/api/admin/payments/[paymentId]/refundRefund a payment (full refund)
ADMIN
POST
/api/admin/payments/backfill-invoicesBackfill Stripe external payment IDs
ADMIN

Plans & subscriptions

Create, activate, and audit subscription plans across the catalog.

7
GET
/api/admin/plansList subscription plans
ADMIN
POST
/api/admin/plansCreate plan
ADMIN
PATCH
/api/admin/plans/[planId]Toggle plan active flag
ADMIN
PUT
/api/admin/plans/[planId]Update plan metadata
ADMIN
DELETE
/api/admin/plans/[planId]Delete plan
ADMIN
POST
/api/admin/plans/[planId]/create-stripeCreate provider price for a plan
ADMIN
POST
/api/admin/plans/verifyVerify a provider price ID
ADMIN

Support & notifications

Drive the helpdesk, reply to tickets, and broadcast announcements.

10
GET
/api/support/ticketsList my support tickets
AUTH
POST
/api/support/ticketsCreate support ticket
AUTH
GET
/api/support/tickets/[ticketId]Get my support ticket
AUTH
PATCH
/api/support/tickets/[ticketId]Close my support ticket
AUTH
POST
/api/support/tickets/[ticketId]/replyReply to my ticket
AUTH
GET
/api/admin/support/ticketsList support tickets (admin)
ADMIN
POST
/api/admin/support/ticketsCreate ticket on behalf of a user
ADMIN
GET
/api/admin/support/tickets/[ticketId]Get support ticket (admin)
ADMIN
PATCH
/api/admin/support/tickets/[ticketId]Update ticket status (admin)
ADMIN
POST
/api/admin/support/tickets/[ticketId]/replyReply to ticket (admin)
ADMIN

Team & organizations

Provision team workspaces, manage invites, and adjust shared-token settings.

14
GET
/api/team/summaryTeam dashboard summary
AUTH
GET
/api/user/active-orgGet active workspace state
AUTH
POST
/api/user/active-orgSet or clear the active workspace
AUTH
POST
/api/team/provisionProvision a team workspace
AUTH
PATCH
/api/team/settingsUpdate workspace shared-token caps
AUTH
GET
/api/organization/check-deletion-eligibilityCheck whether a workspace can be deleted
AUTH
DELETE
/api/organization/deleteDelete a team workspace
AUTH
PATCH
/api/team/members/cap-overrideOverride a member shared-token cap
AUTH
POST
/api/team/inviteInvite a member
AUTH
POST
/api/team/invite/acceptAccept invite
AUTH
POST
/api/team/invite/declineDecline invite
PUBLIC
POST
/api/team/invite/resendResend invite email
AUTH
POST
/api/team/invite/revokeRevoke invite
AUTH
POST
/api/team/members/removeRemove a member
AUTH

Checkout

Initiate checkouts and confirm completion across payment providers.

5
POST
/api/checkoutCreate hosted checkout session
AUTH
GET
/api/checkout/confirmConfirm checkout completion
AUTH
GET
/api/checkout/embeddedCreate embedded checkout intent (or redirect)
AUTH
POST
/api/checkout/embeddedCreate embedded checkout intent (or redirect)
AUTH
GET
/api/checkout/embedded/confirmConfirm embedded checkout
AUTH

Billing & subscriptions

Manage billing portal access, cancellations, invoices, and subscription lifecycle (including proration upgrades).

17
POST
/api/billing/customer-portalOpen customer billing portal
AUTH
POST
/api/billing/cancelSchedule cancellation at period end
AUTH
POST
/api/billing/undo-cancelUndo scheduled cancellation
AUTH
GET
/api/billing/invoice/[paymentId]Download invoice PDF
AUTH
GET
/api/billing/refund-receipt/[paymentId]Download refund receipt PDF
AUTH
GET
/api/subscriptionGet subscription status
AUTH
POST
/api/subscription/activateActivate a pending subscription
AUTH
GET
/api/subscription/prorationPreview proration (recurring plan swap)
AUTH
POST
/api/subscription/prorationApply proration (recurring plan swap)
AUTH
GET
/api/admin/subscriptionsList subscriptions (admin/moderator)
ADMIN
POST
/api/admin/subscriptions/[id]/schedule-cancelSchedule cancellation (admin)
ADMIN
POST
/api/admin/subscriptions/[id]/undoUndo cancellation (admin)
ADMIN
POST
/api/admin/subscriptions/[id]/force-cancelForce cancel immediately (admin)
ADMIN
POST
/api/admin/subscriptions/[id]/expireExpire subscription (admin)
ADMIN
POST
/api/admin/subscriptions/[id]/editEdit subscription state and billing date
ADMIN
POST
/api/admin/billing/syncSync billing catalog (admin)
ADMIN
GET
/api/admin/billing/paddle-configPaddle config health check (admin)
ADMIN

Organizations (admin)

Inspect and administer organization workspaces: seat limits, token pooling policies, and membership caps.

8
GET
/api/admin/organizationsList organizations
ADMIN
GET
/api/admin/organizations/[orgId]Get organization detail
ADMIN
POST
/api/admin/organizations/[orgId]/suspendSuspend organization access
ADMIN
PATCH
/api/admin/organizations/[orgId]Update organization
ADMIN
GET
/api/admin/organizations/[orgId]/membersList organization members + invites
ADMIN
DELETE
/api/admin/organizations/[orgId]/members/[membershipId]Remove member from organization
ADMIN
POST
/api/admin/organizations/[orgId]/adjust-balanceAdjust organization token balance
ADMIN
DELETE
/api/admin/organizations/[orgId]/deleteDelete organization
ADMIN

Notifications

User inbox notifications and admin broadcast tooling.

6
GET
/api/notificationsList my notifications
AUTH
POST
/api/notifications/mark-all-readMark all notifications read
AUTH
PATCH
/api/notifications/[id]/readMark a notification read
AUTH
POST
/api/notifications/[id]/readMark a notification read
AUTH
GET
/api/admin/notificationsList notifications (admin/moderator)
ADMIN
POST
/api/admin/notifications/createCreate notification (admin/moderator)
ADMIN

Emails (admin)

Manage stored email templates and send test emails using rendered variables.

7
GET
/api/admin/emailsList email templates
ADMIN
POST
/api/admin/emailsCreate email template
ADMIN
GET
/api/admin/emails/[templateId]Get email template
ADMIN
PATCH
/api/admin/emails/[templateId]Update email template
ADMIN
DELETE
/api/admin/emails/[templateId]Delete email template
ADMIN
POST
/api/admin/emails/seedSeed default templates
ADMIN
POST
/api/admin/emails/testSend test email
ADMIN

Payment providers

Inspect supported payment providers and configuration status without exposing secrets.

1
GET
/api/admin/payment-providersList payment providers + configuration status
ADMIN

Content (pages & blog)

Create and manage site pages, blog posts, and blog categories.

18
GET
/api/admin/pagesList site pages
ADMIN
POST
/api/admin/pagesCreate site page
ADMIN
GET
/api/admin/pages/[id]Read site page
ADMIN
PUT
/api/admin/pages/[id]Update site page (replace fields)
ADMIN
PATCH
/api/admin/pages/[id]Update site page (partial)
ADMIN
DELETE
/api/admin/pages/[id]Trash site page
ADMIN
POST
/api/admin/pages/bulkBulk page action (trash/restore/delete)
ADMIN
GET
/api/admin/blogList blog posts
ADMIN
POST
/api/admin/blogCreate blog post
ADMIN
GET
/api/admin/blog/[id]Read blog post
ADMIN
PUT
/api/admin/blog/[id]Update blog post (replace fields)
ADMIN
PATCH
/api/admin/blog/[id]Update blog post (partial)
ADMIN
DELETE
/api/admin/blog/[id]Trash blog post
ADMIN
POST
/api/admin/blog/bulkBulk blog action (trash/restore/delete)
ADMIN
GET
/api/admin/blog/categoriesList blog categories
ADMIN
POST
/api/admin/blog/categoriesCreate blog category
ADMIN
PATCH
/api/admin/blog/categories/[id]Update blog category
ADMIN
DELETE
/api/admin/blog/categories/[id]Delete blog category
ADMIN

Coupons

Create and manage discount coupons, including provider artifacts and redemption safety rules.

4
GET
/api/admin/couponsList coupons
ADMIN
POST
/api/admin/couponsCreate coupon
ADMIN
PUT
/api/admin/coupons/[couponId]Update coupon (limited fields)
ADMIN
DELETE
/api/admin/coupons/[couponId]Delete coupon
ADMIN

One-time purchases (admin)

Inspect and manage non-recurring purchases; supports refund + forced expiry flows.

3
GET
/api/admin/purchasesList one-time purchases
ADMIN
POST
/api/admin/purchases/[id]/[action]Refund a purchase
ADMIN
POST
/api/admin/purchases/[id]/expireExpire a purchase subscription
ADMIN

Files & uploads (admin)

Upload and manage images/assets used by the dashboard and marketing pages.

5
GET
/api/admin/file/listList uploaded admin files
ADMIN
POST
/api/admin/file/uploadUpload an image file
ADMIN
DELETE
/api/admin/file/deleteDelete an uploaded admin file
ADMIN
POST
/api/admin/logo/uploadLegacy logo upload endpoint (moved)
ADMIN
POST
/api/admin/uploadLegacy form-data upload (deprecated)
ADMIN

Theme & branding (admin)

Manage theme links, footer text, and injected custom code snippets.

4
GET
/api/admin/themeRead theme settings
ADMIN
PUT
/api/admin/themeUpdate theme settings
ADMIN
GET
/api/admin/theme/exportExport theme settings
ADMIN
POST
/api/admin/theme/importImport theme settings
ADMIN

Maintenance & operations (admin)

Operational helpers for internal cache inspection and cleanup tasks.

2
GET
/api/admin/maintenance/discounted-subscription-price-cacheInspect discounted subscription price cache
ADMIN
POST
/api/admin/maintenance/discounted-subscription-price-cacheClean discounted subscription price cache
ADMIN

Logs & audit (admin)

Inspect server logs and administrator/moderator actions for operational debugging and compliance.

4
GET
/api/admin/logsList system logs
ADMIN
DELETE
/api/admin/logsClear system logs
ADMIN
GET
/api/admin/moderator-actionsList admin/moderator actions (admin only)
ADMIN
DELETE
/api/admin/moderator-actionsClear admin/moderator action log (admin only)
ADMIN

Configuration & preferences

Read and update global settings, plus user preference storage.

8
GET
/api/admin/settingsRead a setting by key
ADMIN
GET
/api/admin/settings/exportExport settings snapshot
ADMIN
POST
/api/admin/settings/importImport settings snapshot
ADMIN
POST
/api/admin/settingsSet a setting (cache-aware)
ADMIN
PATCH
/api/admin/settingsUpsert a setting (direct DB)
ADMIN
GET
/api/user/settingsList user settings
AUTH
PATCH
/api/user/settingsUpdate a user setting
AUTH
GET
/api/settings/tokensRead token reset policy flags
PUBLIC

Account & entitlements

Fetch current-user profile, token balances, and entitlement checks used by the app runtime.

16
POST
/api/internal/spend-tokensSpend/deduct tokens (internal, server-to-server)
INTERNAL
GET
/api/user/profileFetch current user profile + token balances
AUTH
PATCH
/api/user/profileUpdate current user profile
AUTH
GET
/api/user/active-orgGet active workspace selection
AUTH
POST
/api/user/active-orgSet active workspace selection
AUTH
POST
/api/user/change-passwordChange password
AUTH
DELETE
/api/user/pending-email-changeCancel pending email change
AUTH
GET
/api/user/sessionsList current user sessions
AUTH
GET
/api/user/grace-statusCheck paid-token expiry grace window
AUTH
POST
/api/user/ping-expiry-cleanupTrigger lazy paid-token cleanup check
AUTH
POST
/api/user/validate-org-accessValidate workspace access against owner plan
AUTH
POST
/api/user/spend-tokensSpend tokens for user actions
AUTH
GET
/api/internal/payment-scriptsResolve active payment provider scripts
INTERNAL
POST
/api/internal/track-visitRecord a visit log entry
INTERNAL
POST
/api/user/welcomeSend welcome email (idempotent)
AUTH
DELETE
/api/user/delete-accountDelete current user data (DB only)
AUTH

Sessions & security

Inspect and revoke active auth sessions for the signed-in user when the active auth provider supports session management.

7
GET
/api/sessions/[sessionId]Get session detail
AUTH
POST
/api/sessions/[sessionId]/revokeRevoke one session
AUTH
POST
/api/sessions/revoke-othersRevoke all other sessions
AUTH
GET
/api/recent-sessionsDeprecated recent sessions placeholder
AUTH
POST
/api/sessions/[sessionId]Deprecated session detail alias
AUTH
GET
/api/sessions/[sessionId]/revokeDeprecated session revoke alias
AUTH
GET
/api/sessions/revoke-othersDeprecated revoke-others alias
AUTH

Dashboard utilities

Signed-in user helpers for redeemed coupons and payment history shown in the dashboard UI.

3
GET
/api/dashboard/couponsList my redeemed coupons
AUTH
POST
/api/dashboard/couponsRedeem coupon
AUTH
GET
/api/dashboard/paymentsList my payments
AUTH

Analytics & traffic

Query revenue, subscriber, and engagement dashboards programmatically.

3
GET
/api/admin/analyticsAnalytics snapshot
ADMIN
GET
/api/admin/trafficTraffic snapshot
ADMIN
GET
/api/admin/traffic?group=devicesTraffic breakdown
ADMIN

Webhook ingress

Inbound webhook endpoints for payments and auth providers. All payment webhooks enforce signature verification and shared routing behavior.

6
POST
/api/webhooks/paymentsUnified payments webhook router
PUBLIC
POST
/api/webhooks/stripeStripe webhook ingress
PUBLIC
POST
/api/webhooks/paystackPaystack webhook ingress
PUBLIC
POST
/api/webhooks/paddlePaddle webhook ingress
PUBLIC
POST
/api/webhooks/clerkClerk webhook ingress
PUBLIC
POST
/api/stripe/webhookLegacy Stripe webhook alias
PUBLIC

Cron & lifecycle jobs

Privileged maintenance endpoints intended for scheduled jobs and internal automation.

2
GET
/api/cron/demo-refreshRefresh demo dataset timestamps and activity windows
INTERNAL
GET
/api/cron/process-expiryProcess subscription expiry and org cleanup
INTERNAL

API changelog

Recent API contract and reference updates reflected on this page.

  • Version 2026.05.05May 5, 2026, 12:00 AM
    • Added curated docs for GET /api/organization/check-deletion-eligibility and DELETE /api/organization/delete.
    • Expanded team API coverage for GET/POST /api/user/active-org, including personal-workspace clearing after organization deletion.
    • Documented the team-dashboard organization deletion flow, including active-plan gating inside the confirmation modal.
  • Version 2026.04.16Apr 16, 2026, 12:00 AM
    • Added admin organization suspension endpoint coverage and documented suspended-workspace response fields.
    • Expanded admin user endpoint docs to include suspension state and the new setSuspension/clearSuspension actions.
    • Updated organization billingEmail docs to note owner-email fallback when no dedicated billing inbox is stored.
  • Version 2026.04Apr 6, 2026, 12:00 AM
    • Audited curated request, response, and auth notes against the live route handlers and corrected drift.
    • Updated shared authentication guidance to describe provider-aware sessions instead of Clerk-specific behavior.
    • Refreshed health, refund, and internal token-spend entries to match current response shapes, rate limits, and auth outcomes.
    • This changelog now tracks API-reference changes only; broader product release notes belong in the app changelog.
  • Version 2026.02Feb 7, 2026, 12:00 AM
    • Added internal server-to-server token spend endpoint (POST /api/internal/spend-tokens).
    • Added user token spend endpoint for SaaSyApp (POST /api/user/spend-tokens).
    • Expanded token-spend coverage in the reference to distinguish browser and server-to-server callers.
    • Expanded curated docs for token/account endpoints to reduce inventory drift.
    • Hardened legacy admin upload endpoint (API admin guard + rate limiting).
    • API docs UI: body schema rows wrap cleanly on narrow screens.
  • Version 2025.09Sep 20, 2025, 12:00 AM
    • Traffic API now exposes breakdown pagination.
    • Notification broadcasts support INFO | SUCCESS | WARNING | ERROR types.
  • Version 2025.07Jul 12, 2025, 12:00 AM
    • User PATCH endpoint adds assignPlan action.
    • Payments backfill can repair missing Stripe payment_intent IDs.