The Ad Management System exposes its backend functionality through Next.js App Router API routes located underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Priyanshu471/ad-management/llms.txt
Use this file to discover all available pages before exploring further.
app/api/. Requests must send a Content-Type: application/json header and pass a JSON body where required. Most successful responses return a JSON body, but authentication error responses (400, 500 on /api/login and /api/register) return plain text strings rather than JSON. No authentication headers or API tokens are required; the base URL for every endpoint is your app’s origin (e.g. http://localhost:3000 in development).
Endpoint Summary
| Endpoint | Methods | Description |
|---|---|---|
/api/login | POST | Authenticate with email and password |
/api/register | POST | Create a new user account |
/api/campaign | GET, POST, PATCH, DELETE | Manage ad campaigns |
/api/users | GET | List all registered users |
Request & Response Format
All requests must include the following header:/api/login and /api/register return a plain text body (not JSON). The base URL in development is:
Example Request
The following example fetches all campaigns using the nativefetch API:
There is currently no API key or token-based authentication on any of these endpoints — they are accessible to any client that can reach the server. Before deploying to production, add middleware-level auth guards (e.g. Next.js
middleware.ts with session validation) to protect all routes from unauthorized access.Explore the Endpoints
Auth Endpoints
Login and register users via
POST /api/login and POST /api/register.Campaigns Endpoint
Full CRUD for ad campaigns via
GET, POST, PATCH, and DELETE on /api/campaign.Users Endpoint
Retrieve all registered users via
GET /api/users.