Documentation

Guides and references

Backend

API Routes

Full list of API routes in NextBento.

Overview

API routes live in app/api/. NextBento includes routes for auth, billing, teams, keys, feedback, and more.

This page describes APIs in the product repo. The marketing site (www.nextbento.dev) publishes a separate public catalog at /.well-known/api-catalog.

Auth Routes

RouteMethodDescription
/api/auth/loginPOSTEmail/password login
/api/auth/signupPOSTUser registration
/api/auth/forgot-passwordPOSTRequest password reset email
/api/auth/reset-passwordPOSTReset password with token
/api/auth/magic-linkPOSTSend magic link email
/api/auth/oauthGETOAuth callback (Google, etc.)

Billing Routes

RouteMethodDescription
/api/checkoutPOSTCreate Stripe checkout session
/api/webhooks/stripePOSTHandle Stripe webhooks (subscription, payment)
/api/billing/portalPOSTCreate Stripe Customer Portal session
/api/subscription/currentGETGet current subscription for user

Teams Routes

RouteMethodDescription
/api/teams/invitePOSTInvite team member
/api/teams/accept-invitationPOSTAccept team invitation

API Keys

RouteMethodDescription
/api/keysGET, POSTList keys, create new key
/api/keys/[id]GET, DELETEGet or revoke key

Other Routes

RouteMethodDescription
/api/feedbackPOSTSubmit feedback
/api/indexnowPOSTSubmit URL to IndexNow (Bing)
/api/healthGETHealth check

Adding Routes

Create a route.ts file in app/api/your-route/:

import { NextResponse } from 'next/server'

export async function GET() {
  return NextResponse.json({ message: 'Hello' })
}

Security

  • Validate webhook signatures (Stripe)
  • Use environment variables for secrets
  • Rate limiting on auth endpoints (see Middleware)
  • Gate every action — verify user identity before returning data