API Reference

Complete reference for MockBoost REST API endpoints and request/response formats.

Base URL

https://api.mockboost.com/v1

All API requests should be made to this base URL followed by the specific endpoint path.

Note: Configure NEXT_PUBLIC_API_URL environment variable for your deployment.

Authentication

Session-Based Auth

MockBoost uses HTTP-only cookies for session management. After logging in, your session cookie is automatically included in requests.

// Login request

POST /auth/login

{ "email": "user@example.com", "password": "yourpassword" }

API Keys (Coming Soon)

API key authentication for server-to-server requests will be available in a future update.

Endpoints

GET/workspaces/:workspaceId/:path

Fetch mock data from a specific endpoint in your workspace.

Parameters

  • workspaceId - Your workspace ID
  • path - The endpoint path (e.g., users, products)

Query Parameters (Optional)

  • page - Page number for pagination
  • limit - Number of items per page
  • sort - Field to sort by
  • order - Sort order (asc/desc)

Example Request

curl -X GET \
  'https://api.mockboost.com/v1/workspaces/abc123/users?page=1&limit=10' \
  --cookie 'session=your-session-cookie'

Response (200 OK)

{
  "data": [
    {
      "id": 1,
      "name": "John Doe",
      "email": "john@example.com",
      "role": "developer"
    }
  ],
  "meta": {
    "page": 1,
    "limit": 10,
    "total": 50
  }
}
POST/endpoints

Create a new mock endpoint in your workspace.

Request Body

{
  "name": "Users API",
  "path": "users",
  "method": "GET",
  "statusCode": 200,
  "responseData": {
    "users": [
      {
        "id": 1,
        "name": "John Doe"
      }
    ]
  },
  "workspaceId": "abc123"
}

Response (201 Created)

{
  "id": "endpoint-xyz789",
  "name": "Users API",
  "path": "users",
  "method": "GET",
  "statusCode": 200,
  "url": "https://api.mockboost.com/v1/workspaces/abc123/users",
  "createdAt": "2026-01-22T00:00:00.000Z"
}
PATCH/endpoints/:endpointId

Update an existing endpoint's configuration or data.

Request Body (Partial)

{
  "statusCode": 404,
  "responseData": {
    "error": "Not Found"
  }
}

Response (200 OK)

{
  "id": "endpoint-xyz789",
  "statusCode": 404,
  "updatedAt": "2026-01-22T01:00:00.000Z"
}
DELETE/endpoints/:endpointId

Delete an endpoint permanently.

Response (204 No Content)

No response body returned.

GET/endpoints/:endpointId/logs

Retrieve request logs for a specific endpoint.

Response (200 OK)

{
  "logs": [
    {
      "id": "log-123",
      "method": "GET",
      "path": "/users",
      "statusCode": 200,
      "ip": "192.168.1.1",
      "userAgent": "Mozilla/5.0...",
      "timestamp": "2026-01-22T00:30:00.000Z"
    }
  ],
  "total": 100
}

Error Responses

400 Bad Request

Invalid request parameters or malformed JSON

{ "error": "Invalid request body" }
401 Unauthorized

Missing or invalid authentication

{ "error": "Unauthorized" }
404 Not Found

Endpoint or resource not found

{ "error": "Endpoint not found" }
500 Internal Server Error

Server error - contact support

{ "error": "Internal server error" }

Rate Limits

Monthly API request limits vary by plan. When you exceed your limit, the runtime returns 429 Too Many Requests with a JSON body explaining the limit.

  • DEV Plan: 5,000 API requests/month
  • QA Plan: 50,000 requests/month (planned)
  • PROD Plan: 200,000 requests/month (planned)

429 Response (limit reached)

HTTP 429 Too Many Requests

{ "code": "REQUEST_LIMIT_REACHED", "message": "Monthly API request limit reached. Upgrade your plan or wait until next month.", "current": 5000, "limit": 5000 }

Check your usage in the Dashboard. Limits reset at the start of each calendar month.