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
| Route | Method | Description |
|---|---|---|
/api/auth/login | POST | Email/password login |
/api/auth/signup | POST | User registration |
/api/auth/forgot-password | POST | Request password reset email |
/api/auth/reset-password | POST | Reset password with token |
/api/auth/magic-link | POST | Send magic link email |
/api/auth/oauth | GET | OAuth callback (Google, etc.) |
Billing Routes
| Route | Method | Description |
|---|---|---|
/api/checkout | POST | Create Stripe checkout session |
/api/webhooks/stripe | POST | Handle Stripe webhooks (subscription, payment) |
/api/billing/portal | POST | Create Stripe Customer Portal session |
/api/subscription/current | GET | Get current subscription for user |
Teams Routes
| Route | Method | Description |
|---|---|---|
/api/teams/invite | POST | Invite team member |
/api/teams/accept-invitation | POST | Accept team invitation |
API Keys
| Route | Method | Description |
|---|---|---|
/api/keys | GET, POST | List keys, create new key |
/api/keys/[id] | GET, DELETE | Get or revoke key |
Other Routes
| Route | Method | Description |
|---|---|---|
/api/feedback | POST | Submit feedback |
/api/indexnow | POST | Submit URL to IndexNow (Bing) |
/api/health | GET | Health 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