The FlagForge REST API lets you interact with challenges, flag submissions, leaderboards, and user data programmatically. All API routes are available under theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/flagForgeCTF/flagForge/llms.txt
Use this file to discover all available pages before exploring further.
/api/ path and return JSON responses. You can use the API from any HTTP client, including curl, fetch, or language-specific libraries.
Base URL
The hosted FlagForge instance is available at:/api/:
https://flagforgectf.com with your own domain throughout this reference.
Request format
Most endpoints accept JSON request bodies. Set theContent-Type header accordingly:
Response format
All responses return JSON. Successful responses include the requested data at the top level or nested under a named key (for example,data, pagination). Error responses include a message field describing what went wrong.
Authentication
Most read endpoints are publicly accessible. Endpoints that create, update, or delete resources require you to be signed in. FlagForge uses session-based authentication via NextAuth — authentication state is carried by an HTTP cookie (next-auth.session-token) that NextAuth sets when you sign in. In a browser context, the cookie is sent automatically with every request.
Admin-only endpoints additionally require that your account has the Admin role. See Authentication for details.
HTTP status codes
The API uses standard HTTP status codes to indicate the result of each request.| Code | Meaning |
|---|---|
200 OK | The request succeeded. |
201 Created | A resource was created successfully. |
400 Bad Request | The request was missing required fields or contained invalid data. |
401 Unauthorized | You are not authenticated, or you do not have the required role. |
403 Forbidden | You are authenticated but do not have admin privileges for this route. |
404 Not Found | The requested resource does not exist. |
410 Gone | The challenge has expired and is no longer available. |
500 Internal Server Error | An unexpected error occurred on the server. |
Pagination
GET /api/problems supports pagination and filtering through query parameters:| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | The page number to retrieve. |
limit | integer | 8 | The number of results per page. |
category | string | — | Filter by challenge category (e.g., Web, Crypto). Omit or pass All to return all categories. |
pagination object:
Explore the API
Authentication
Sign in with Google OAuth and pass authentication in API requests.
Challenges
List, retrieve, and create CTF challenges.
Flag submission
Submit flags and check whether a challenge has been solved.
Leaderboard
Fetch scores and rankings for all participants.
User profile
Retrieve user information, scores, and solved challenges.
Badges
List badge templates and retrieve badges awarded to users.
Admin
Admin-only routes for managing challenges, users, and badges.