MockBite Iconmockbite
Documentación de API

Construye con MockBite en minutos.

Usa claves de API para acceder a endpoints privados, generar usuarios falsos y rastrear el uso. Estos ejemplos apuntan al backend local en 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
Paso 1

Crea una clave de API

Las claves ahora se generan de forma segura a través de NextAuth. Sigue estos pasos para provisionar tu clave:

  1. Inicia sesión en la plataforma MockBite.
  2. Navega a tu Panel de control.
  3. Abre Configuración (⚙️) y haz clic en Generar nueva Clave de API.
Paso 2

Llama al endpoint privado

Envía tu clave de API con el esquema de autorización Bearer.

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

Abre la consola

Pega la clave generada en el panel para inspeccionar los metadatos de la cuenta y el uso.

curl http://localhost:8080/v1/usage \
  -H "Authorization: Bearer df_your_api_key"
Parámetros de consulta

Personaliza usuarios falsos

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.

Respuestas

Ejemplos de payload

Cada solicitud autenticada a /v1/fake-user se registra para rastrear el uso.

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

El endpoint /v1/usage devuelve métricas agregadas para la clave de API autenticada.

{
  "total_requests": 12,
  "last_24h": 5,
  "last_request_at": "2026-06-21T20:45:00Z",
  "by_endpoint": [
    {
      "endpoint": "/v1/fake-user",
      "requests": 12
    }
  ]
}
Límite de tasa

Prevención de abusos

La API aplica un límite de tasa de ventana fija por IP de cliente. Los valores predeterminados se configuran mediante variables de entorno y se pueden ajustar.

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

Fallos comunes

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.