MockBite Iconmockbite
API documentation

Build with MockBite in minutes.

Use API keys to access private endpoints, generate fake users and track usage per key. These examples target the local backend at http://localhost:8080.

GET /health

Check if the API is online.

Public
POST /waitlist

Capture an early access lead.

Public
POST /auth/register

Internal BFF route to issue an API key for logged-in users.

Internal
GET /me

Inspect the authenticated user and API key metadata.

Bearer API key
GET /v1/fake-user

Generate a fake user and track usage for the API key.

Bearer API key
GET /v1/usage

Read the total request count logged for the API key.

Bearer API key
Step 1

Create an API key

Keys are now securely generated via NextAuth. Follow these steps to provision your key:

  1. Log in to the MockBite platform.
  2. Navigate to your Dashboard.
  3. Open Settings (⚙️) and click Generate new API Key.
Step 2

Call the private endpoint

Send your API key with the Bearer authorization scheme.

curl "http://localhost:8080/v1/fake-user?country=Brazil&role=Backend%20Engineer&company=MockBite&seed=lucas" \
  -H "Authorization: Bearer df_your_api_key"
Step 3

Open the console

Paste the generated key in the dashboard to inspect account metadata and usage.

curl http://localhost:8080/v1/usage \
  -H "Authorization: Bearer df_your_api_key"
Query params

Customize fake users

country

Override the generated user country.

role

Override the generated user role.

company

Override the generated user company.

seed

Select a deterministic name and email variation.

Responses

Example payloads

Each authenticated request to /v1/fake-user is logged for usage tracking.

{
  "name": "Maya Chen",
  "email": "maya@mockbite.dev",
  "company": "MockBite",
  "country": "Brazil",
  "role": "Backend Engineer"
}

The /v1/usage endpoint returns aggregate metrics for the authenticated API key.

{
  "total_requests": 12,
  "last_24h": 5,
  "last_request_at": "2026-06-21T20:45:00Z",
  "by_endpoint": [
    {
      "endpoint": "/v1/fake-user",
      "requests": 12
    }
  ]
}
Rate limit

Abuse prevention

The API applies a fixed-window rate limit per client IP. Defaults are configured by environment variables and can be tuned per deploy.

RATE_LIMIT_MAX controls the request count.
RATE_LIMIT_WINDOW_SECONDS controls the time window.
X-RateLimit-Limit Maximum requests allowed in the current window.
X-RateLimit-Remaining Requests still available before the window resets.
X-RateLimit-Reset Unix timestamp for the current window reset.
Retry-After Seconds until retrying after the limit is exceeded.
Errors

Common failures

400 invalid json payload

The request body could not be parsed.

401 missing bearer token

A private endpoint was called without Authorization.

401 invalid api key

The provided API key was not found or did not match.

429 rate limit exceeded

The client exceeded the configured request window.