BogusApi Documentation

BogusApi is a free, zero-config REST API for developers who need realistic fake data instantly — for prototyping, UI development, QA testing, or demos. No sign-up required.

Whether you're a frontend developer waiting for a backend, a QA engineer building automated test suites, or a designer who needs populated UI screens, BogusApi gives you structured, consistent, and realistic JSON responses on demand. Every endpoint is designed to mirror real-world production API shapes so your integration code needs zero changes when you switch to a live service.

Zero Setup

No account, no API key, no config file. Open a URL and data comes back.

Safe to Use

All data is synthetically generated. No real personal information is ever stored or served.

Structured Data

Consistent schemas across collections — ids, timestamps, relationships, and pagination all included.

Base URL

All endpoints are relative to the following base URL. Prepend this to every path shown in this documentation:

Base URL
https://localhost:7001

All responses are in application/json format unless stated otherwise. The Content-Type response header will always be application/json; charset=utf-8.

Full example paths
https://localhost:7001/api/users
https://localhost:7001/api/products?page=1&pageSize=20
https://localhost:7001/api/organisations/5
https://localhost:7001/api/auth/login

HTTPS only. All traffic is served over TLS. If you are running locally in development mode, your browser may warn about a self-signed certificate — accept the exception or configure a trusted dev cert with dotnet dev-certs https --trust.

Quick Start

Make your first API call in under 10 seconds — paste the URL below into your browser, cURL, or any HTTP client:

1 — Fetch a list of users
GET /api/users?page=1&pageSize=10
2 — Fetch a single user by ID
GET /api/users/1
3 — Explore another collection
GET /api/products?page=1&pageSize=5
GET /api/organisations
GET /api/todos?page=1&pageSize=10

You'll get back a paginated JSON response with realistic data immediately. No headers, no tokens, no body required for GET requests.

Step 1 — Browse Collections

Visit the API Collection page to see all available endpoint groups. Collections are organised by domain so you can quickly identify which group fits your use case.

Each collection card shows the domain name, a short description, and links directly to the endpoint explorer for that group. Hover over a card to see related endpoints, or click through to start interacting with the live data.

Available collections
Auth
Users · Roles
Organisations · Departments · Employees · Teams
Blogs · Categories · Comments
Products · Cart
Todos
Transactions · Payments · Refunds

Not sure which collection to start with? If you're building a user-facing app, start with Users and Auth. For e-commerce UIs, try Products and Cart. For dashboard or admin tooling, Organisations and Transactions give rich relational data.

Step 2 — Pick an Endpoint

Click any collection card to open its endpoint explorer. Each endpoint documents the HTTP verb, full path, required and optional query parameters, request headers, and an example JSON response payload.

The endpoint explorer provides two quick-action buttons next to every URL:

Quick actions
Copy URL Copies the full endpoint path to your clipboard so you can paste it into any tool immediately.
Open in new tab Fires the GET request in your browser and displays the raw JSON response instantly.

Each endpoint section also shows example request headers. For public GET endpoints, no special headers are required. For endpoints that simulate protected resources, a sample Authorization: Bearer header is shown with the expected format.

Step 3 — Make a Request

All public GET endpoints accept requests with no authentication headers. Simply construct the URL and send the request from any client, framework, or language. Responses are returned synchronously — there is no polling or callback required.

cURL — minimal request
curl https://localhost:7001/api/users
cURL — with headers and verbose output
curl -v \
     -H "Accept: application/json" \
     https://localhost:7001/api/users?page=1&pageSize=5
JavaScript — Fetch
const res = await fetch('/api/users?page=1&pageSize=10');
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const { data, totalRecords, totalPages } = await res.json();
console.log(`Loaded ${data.length} of ${totalRecords} users`);
Python — requests library
import requests

r = requests.get('https://localhost:7001/api/users', params={'page': 1, 'pageSize': 10}, verify=False)
r.raise_for_status()
users = r.json()['data']
print(f"Fetched {len(users)} users")

Request headers: You do not need to set any headers for public endpoints. If you do send an Accept header, use application/json. Sending any other Accept value will still return JSON — BogusApi always responds in JSON.

Step 4 — Paginate Results

Every list endpoint supports cursor-free offset pagination via two query parameters. Omitting them defaults to page=1 and pageSize=10.

Pagination parameters
page Integer ≥ 1. The page number to return. Defaults to 1.
pageSize Integer between 1–100. Number of records per page. Defaults to 10.
Request — page 2, 5 records
GET /api/users?page=2&pageSize=5
Response envelope
{
  "data": [
    { "id": 6, "name": "Carol White", "email": "carol@example.com" },
    { "id": 7, "name": "Dan Brown",  "email": "dan@example.com"   }
  ],
  "page": 2,
  "pageSize": 5,
  "totalRecords": 100,
  "totalPages": 20
}

Use totalPages and page together to build next/previous controls. When page exceeds totalPages, data will be an empty array.

JavaScript — iterate all pages
let page = 1, all = [];
do {
  const res = await fetch(`/api/users?page=${page}&pageSize=20`);
  const json = await res.json();
  all = all.concat(json.data);
  if (page >= json.totalPages) break;
  page++;
} while (true);
console.log(`Total users fetched: ${all.length}`);

Step 5 — Auth Endpoints

Endpoints under /api/auth simulate a complete token-based authentication flow — login, token refresh, and logout. The mock JWT returned is structurally valid (three Base64 segments) and can be decoded by any standard JWT library, though it is not cryptographically signed with a real secret in development mode.

Login — POST /api/auth/login
POST /api/auth/login
Content-Type: application/json

{
  "email": "user@example.com",
  "password": "password123"
}
Login response
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresIn": 3600,
  "tokenType": "Bearer",
  "user": {
    "id": 42,
    "name": "Alice Johnson",
    "email": "user@example.com",
    "role": "Admin"
  }
}
Using the token — Authorization header
GET /api/users/me
Authorization: Bearer <your-token>
Refresh token — POST /api/auth/refresh
POST /api/auth/refresh
Content-Type: application/json

{
  "refreshToken": "<refresh-token-from-login>"
}
Logout — POST /api/auth/logout
POST /api/auth/logout
Authorization: Bearer <your-token>

Testing protected flows: Use the login endpoint to obtain a token, store it in your test environment (e.g., a Postman variable or a React context), then attach it to all subsequent requests via the Authorization header. The token expiry is simulated — you can call /api/auth/refresh to receive a new token.

Swagger UI

The built-in Swagger UI is auto-generated from the ASP.NET Core OpenAPI spec and lists every registered endpoint with full schema documentation and a live try-it-out interface. It requires no installation or configuration — just open the page in your browser.

How to use Swagger UI
1. Open https://localhost:7001/swagger in your browser
2. Find the endpoint group you want (e.g. Users)
3. Click to expand an operation (e.g. GET /api/users)
4. Click "Try it out" in the top-right of the panel
5. Fill in any parameters (page, pageSize, id…)
6. Click "Execute"
7. Inspect the response body, status code, and headers inline

Swagger UI also shows you the full request schema model — useful for understanding exactly which fields are required or optional before you write client code. For authenticated endpoints, click the Authorize button at the top of the page, paste your Bearer token, and all subsequent Try-it-out calls will include it automatically.

Best for Interactive exploration, schema inspection, and quick one-off requests without writing code

Postman

Postman is the most popular GUI HTTP client for API development. It supports saved collections, environment variables, pre-request scripts, automated test assertions, and team sharing. Import the BogusApi base URL into a new collection and you can build a full request library in minutes.

Setup — create environment
Environments → New Environment → "BogusApi Local"
Variable: baseUrl  →  https://localhost:7001
Variable: token    →  (leave empty, populated after login)
Setup — first GET request
New Request → GET
URL: {{baseUrl}}/api/users?page=1&pageSize=10
Headers: Accept: application/json
Send
Auto-save token after login (Pre-request script)
// Add this to the "Tests" tab of your login request
const json = pm.response.json();
pm.environment.set('token', json.token);
Use token in subsequent requests
Authorization tab → Bearer Token → {{token}}
Best for Team collaboration, saved collections, automated test runs, and managing auth tokens across requests

cURL

cURL ships pre-installed on macOS, most Linux distributions, and Windows 10+ (PowerShell). It requires no configuration and is the fastest way to probe an endpoint directly from a terminal or script. Use -s for silent output, -v for verbose headers, and pipe through jq for formatted JSON.

Common GET requests
# Basic list
curl https://localhost:7001/api/users

# With pagination
curl "https://localhost:7001/api/users?page=1&pageSize=5"

# Pretty-print with jq
curl -s https://localhost:7001/api/users | jq .

# Get a single record by ID
curl https://localhost:7001/api/users/3
Auth requests
# Login and capture token
TOKEN=$(curl -s -X POST https://localhost:7001/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"user@example.com","password":"password123"}' \
  | jq -r '.token')

# Use token in next request
curl -H "Authorization: Bearer $TOKEN" \
     https://localhost:7001/api/users/me
Ignore TLS errors in local dev
curl -k https://localhost:7001/api/users
Best for Quick terminal checks, shell scripts, CI pipelines, and chaining requests with variables

Fetch API

The browser-native fetch() function is available in all modern browsers and Node.js 18+. It supports async/await, streaming responses, AbortController for timeouts, and full control over headers and body. No third-party library is needed — it works out of the box in any JavaScript or TypeScript project.

GET — list with error handling
const res = await fetch('/api/users?page=1&pageSize=10');
if (!res.ok) throw new Error(`Request failed: ${res.status}`);
const { data, totalRecords, totalPages } = await res.json();
console.log(`Page 1 of ${totalPages} — ${totalRecords} total users`);
POST — login and store token
const loginRes = await fetch('/api/auth/login', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ email: 'user@example.com', password: 'password123' })
});
const { token } = await loginRes.json();
sessionStorage.setItem('token', token);
GET — authenticated request
const token = sessionStorage.getItem('token');
const meRes = await fetch('/api/users/me', {
  headers: { 'Authorization': `Bearer ${token}` }
});
const user = await meRes.json();
console.log('Logged in as:', user.name);
With timeout using AbortController
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), 5000); // 5s timeout
try {
  const res = await fetch('/api/users', { signal: controller.signal });
  const json = await res.json();
} finally {
  clearTimeout(timer);
}
Best for Frontend JavaScript, React/Vue/Angular apps, and Node.js 18+ without extra dependencies

Axios

Axios is the most widely used HTTP client library in the JavaScript ecosystem. It supports automatic JSON serialisation and parsing, request/response interceptors, request cancellation, timeout configuration, and clean error objects. It works identically in the browser and in Node.js.

Install
npm install axios
# or
yarn add axios
Create a reusable instance
// api.js
import axios from 'axios';

const api = axios.create({
  baseURL: 'https://localhost:7001',
  timeout: 8000,
  headers: { 'Accept': 'application/json' }
});

export default api;
GET and POST
import api from './api';

// GET with query params
const { data } = await api.get('/api/users', { params: { page: 1, pageSize: 10 } });
console.log(data.data); // array of users

// POST login
const { data: auth } = await api.post('/api/auth/login', {
  email: 'user@example.com',
  password: 'password123'
});
Interceptor — auto-attach token
api.interceptors.request.use(config => {
  const token = localStorage.getItem('token');
  if (token) config.headers['Authorization'] = `Bearer ${token}`;
  return config;
});

// Auto-redirect on 401
api.interceptors.response.use(
  res => res,
  err => {
    if (err.response?.status === 401) window.location.href = '/login';
    return Promise.reject(err);
  }
);
Best for React, Vue, and Angular projects that need interceptors, centralised auth, and clean error handling

HTTPie

HTTPie is a modern CLI HTTP client designed for human readability. It colour-codes response bodies, auto-formats JSON, and uses an intuitive key=value syntax for request bodies and query parameters. It also supports sessions, file uploads, and plugin extensions.

Install
# pip
pip install httpie

# macOS
brew install httpie

# Windows (Chocolatey)
choco install httpie
GET requests
# Basic list (== is a query param in HTTPie)
http GET https://localhost:7001/api/users page==1 pageSize==10

# Get single record
http GET https://localhost:7001/api/users/5

# Ignore TLS in local dev
http --verify=no GET https://localhost:7001/api/products
POST and auth
# POST — key=value sends as JSON automatically
http POST https://localhost:7001/api/auth/login \
     email=user@example.com password=password123

# Authenticated GET
http GET https://localhost:7001/api/users/me \
     Authorization:"Bearer <token>"

# Session mode — stores cookies and headers across calls
http --session=./bogus.json GET https://localhost:7001/api/users
Best for Developers who prefer readable, colourised CLI output and minimal flags over raw cURL syntax

Response Format

All responses follow a consistent JSON envelope so your client code doesn't need to handle different shapes across collections. List endpoints always return a paginated wrapper. Single-resource endpoints (GET /api/users/{id}) return the resource object directly. Error responses always include a machine-readable error field.

List response — full users example
{
  "data": [
    {
      "id": 1,
      "name": "Alice Johnson",
      "email": "alice@example.com",
      "username": "alice.johnson",
      "phone": "+1-555-0100",
      "role": "Admin",
      "createdAt": "2024-03-15T08:30:00Z"
    },
    {
      "id": 2,
      "name": "Bob Smith",
      "email": "bob@example.com",
      "username": "bob.smith",
      "phone": "+1-555-0101",
      "role": "User",
      "createdAt": "2024-04-02T12:00:00Z"
    }
  ],
  "page": 1,
  "pageSize": 10,
  "totalRecords": 250,
  "totalPages": 25
}
Single resource response
{
  "id": 1,
  "name": "Alice Johnson",
  "email": "alice@example.com",
  "username": "alice.johnson",
  "phone": "+1-555-0100",
  "role": "Admin",
  "createdAt": "2024-03-15T08:30:00Z"
}
Error response
{
  "error": "NotFound",
  "message": "User with id 9999 was not found.",
  "statusCode": 404
}

All date/time fields are in ISO 8601 UTC format (2024-03-15T08:30:00Z). Numeric IDs are integers. String IDs (where used) are UUID v4s. Boolean fields use lowercase true / false. Nullable fields may be null rather than omitted.

Status Codes

BogusApi follows standard HTTP semantics. Every response includes an appropriate status code that your client code can branch on. The response body for error codes always includes error, message, and statusCode fields.

All status codes
200
OK Request succeeded. Response body contains the requested data.
201
Created Resource was created. Response body contains the new resource. The Location header points to its URL.
204
No Content Request succeeded but there is no response body (e.g. DELETE operations).
400
Bad Request The request was malformed. Check query parameters, body format, and field types.
401
Unauthorized No token was provided, or the token is expired or invalid. Re-authenticate via /api/auth/login.
403
Forbidden The authenticated user does not have permission to access this resource.
404
Not Found The requested resource does not exist. Check the ID or path segment in the URL.
422
Unprocessable Entity The request body was syntactically valid JSON but failed model validation (e.g. missing required fields).
500
Internal Server Error An unexpected error occurred on the server. Check application logs. This should not happen in normal usage.

Client code should always inspect the status code before reading the response body. A non-2xx code means data will not be present — use the error and message fields instead.

Query Parameters

The following query parameters are supported across all list endpoints. Parameters marked optional have sensible defaults and do not need to be sent on every request.

All supported parameters
page
optional Integer ≥ 1. Which page of results to return. Default: 1.
pageSize
optional Integer 1–100. Number of records per page. Default: 10.
search
optional String. Filters results by name or relevant text fields (collection-dependent).
sortBy
optional Field name to sort by (e.g. name, createdAt). Default varies by collection.
sortDir
optional asc or desc. Sort direction. Default: asc.
Example — search, sort, paginate
GET /api/users?search=alice&sortBy=createdAt&sortDir=desc&page=1&pageSize=5

Unknown or unsupported parameters are silently ignored and will not cause a 400 error.

API Collections

Every collection is documented with live endpoints. Click any name below to open its explorer: