Skip to main content

Documentation 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.

The Ad Management System exposes its backend functionality through Next.js App Router API routes located under 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

EndpointMethodsDescription
/api/loginPOSTAuthenticate with email and password
/api/registerPOSTCreate a new user account
/api/campaignGET, POST, PATCH, DELETEManage ad campaigns
/api/usersGETList all registered users

Request & Response Format

All requests must include the following header:
Content-Type: application/json
Successful responses are returned as JSON. Error responses from /api/login and /api/register return a plain text body (not JSON). The base URL in development is:
http://localhost:3000

Example Request

The following example fetches all campaigns using the native fetch API:
const res = await fetch("/api/campaign", {
  method: "GET",
  headers: { "Content-Type": "application/json" },
});
const { campaigns } = await res.json();
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.

Build docs developers (and LLMs) love