Skip to content
uxTools
Developer

API Mock Builder

Paste a JSON response, set the method and status, and get copy-ready output for frontend, docs, and local mocks.

Status

200

The response code your mock returns.

Headers

2

Response header lines included in the mock.

Body shape

object

3 fields

Mock editor

Define a method, path, headers, and JSON body, then turn the same mock into curl, fetch, TypeScript, and OpenAPI output.

Mock payload

Drop this directly into a local fixture or lightweight mock service.

{
  "status": 200,
  "delayMs": 0,
  "headers": [
    {
      "key": "Content-Type",
      "value": "application/json"
    },
    {
      "key": "Cache-Control",
      "value": "no-store"
    }
  ],
  "body": {
    "id": "evt_42",
    "status": "ok",
    "data": {
      "project": "uxTools",
      "features": [
        "json",
        "regex",
        "discord"
      ]
    }
  }
}

Fetch example

Quick frontend-friendly request snippet.

fetch("/api/projects/42", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "Cache-Control": "no-store"
  },
});

cURL example

Useful for docs and import flows.

curl -X GET "https://example.com/api/projects/42" \
  -H "Content-Type: application/json" \
  -H "Cache-Control: no-store"

TypeScript type

A fast type draft inferred from the response shape.

type MockResponse = {
  id: string;
  status: string;
  data: {
  project: string;
  features: string[];
};
};

OpenAPI snippet

Minimal response schema you can move into Swagger.

/api/projects/42:
  get:
    summary: Mock endpoint
    responses:
      "200":
        description: Mock response
        headers:
          Content-Type:
            schema:
              type: string
            example: "application/json"
          Cache-Control:
            schema:
              type: string
            example: "no-store"
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                status:
                  type: string
                data:
                  type: object
                  properties:
                    project:
                      type: string
                    features:
                      type: array
                      items:
                        type: string