{
  "openapi": "3.0.0",
  "info": {
    "title": "MockerAPI - HTTP Mocking & Testing Service",
    "version": "3.0.0",
    "description": "A free API service for HTTP testing and mocking. Includes Status Code Tester, Mock API Generator, and HTTP Tester (httpbin alternative) with 10 request inspection endpoints. Test your application's handling of different HTTP responses with custom delays, headers, payloads, and authentication."
  },
  "servers": [
    {
      "url": "https://free.mockerapi.com",
      "description": "Production API Server"
    }
  ],
  "paths": {
    "/{statusCode}": {
      "get": {
        "tags": ["Status Code Tester"],
        "summary": "Get HTTP Status Code Response",
        "description": "Returns a response with the specified HTTP status code. Supports status codes from 100-599. Can also use query parameter ?delay=ms as alternative to x-delay header.",
        "parameters": [
          {
            "name": "statusCode",
            "in": "path",
            "required": true,
            "description": "The HTTP status code to return (100-599)",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 599,
              "example": 200
            }
          },
          {
            "name": "delay",
            "in": "query",
            "required": false,
            "description": "Delay response in milliseconds (1-60000ms) - alternative to x-delay header",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 60000,
              "example": 3000
            }
          },
          {
            "name": "x-delay",
            "in": "header",
            "required": false,
            "description": "Delay response in milliseconds (1-60000ms) - takes priority over query param",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 60000,
              "example": 3000
            }
          },
          {
            "name": "x-response",
            "in": "header",
            "required": false,
            "description": "Custom response headers in format: Header1:Value1,Header2:Value2",
            "schema": {
              "type": "string",
              "example": "X-API-Key:abc123,X-Rate-Limit:100"
            }
          },
          {
            "name": "x-payload",
            "in": "header",
            "required": false,
            "description": "Custom JSON payload to return in response body",
            "schema": {
              "type": "string",
              "example": "{\"user\":{\"id\":123,\"name\":\"John\"},\"active\":true}"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusCodeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid status code or parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/endpoints": {
      "post": {
        "tags": ["Mock API Generator"],
        "summary": "Create Mock API Endpoint",
        "description": "Create a custom mock API endpoint with your own response, authentication, and configuration.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["type", "method", "statusCode", "responseBody"],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["open", "bearer", "api-key", "basic-auth"],
                    "description": "Authentication type for the endpoint",
                    "example": "bearer"
                  },
                  "method": {
                    "type": "string",
                    "enum": ["GET", "POST", "PUT", "DELETE", "PATCH"],
                    "description": "HTTP method for the endpoint",
                    "example": "GET"
                  },
                  "statusCode": {
                    "type": "integer",
                    "minimum": 200,
                    "maximum": 599,
                    "description": "HTTP status code to return",
                    "example": 200
                  },
                  "responseBody": {
                    "type": "object",
                    "description": "JSON response body (max 10KB)",
                    "example": {"message": "Hello World", "status": "success"}
                  },
                  "headers": {
                    "type": "object",
                    "description": "Custom response headers",
                    "example": {"X-Custom-Header": "value"}
                  },
                  "delay": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 60000,
                    "description": "Response delay in milliseconds",
                    "example": 0
                  },
                  "token": {
                    "type": "string",
                    "description": "Authentication token (auto-generated if not provided for bearer/api-key)",
                    "example": "sk_test_1234567890abcdef"
                  },
                  "username": {
                    "type": "string",
                    "description": "Username for basic-auth (required if type is basic-auth)",
                    "example": "admin"
                  },
                  "password": {
                    "type": "string",
                    "description": "Password for basic-auth (required if type is basic-auth)",
                    "example": "secret123"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Endpoint created successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateEndpointResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad request - Invalid parameters",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/mock/{uuid}": {
      "get": {
        "tags": ["Mock API Generator"],
        "summary": "Call Mock Endpoint (GET)",
        "description": "Call your mock endpoint. Requires authentication if endpoint was created with auth.",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "Unique endpoint ID",
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "a4ee8fc9-7f54-470d-b64f-4795214dc872"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": false,
            "description": "Bearer token for authentication (if endpoint requires bearer auth)",
            "schema": {
              "type": "string",
              "example": "Bearer sk_test_1234567890abcdef"
            }
          },
          {
            "name": "X-API-Key",
            "in": "header",
            "required": false,
            "description": "API key for authentication (if endpoint requires api-key auth)",
            "schema": {
              "type": "string",
              "example": "sk_test_1234567890abcdef"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your custom mock response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Your custom response body"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Endpoint not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed for this endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Mock API Generator"],
        "summary": "Call Mock Endpoint (POST)",
        "description": "Call your mock endpoint with POST method",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your custom mock response"
          }
        }
      },
      "put": {
        "tags": ["Mock API Generator"],
        "summary": "Call Mock Endpoint (PUT)",
        "description": "Call your mock endpoint with PUT method",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your custom mock response"
          }
        }
      },
      "delete": {
        "tags": ["Mock API Generator"],
        "summary": "Call Mock Endpoint (DELETE)",
        "description": "Call your mock endpoint with DELETE method",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your custom mock response"
          }
        }
      },
      "patch": {
        "tags": ["Mock API Generator"],
        "summary": "Call Mock Endpoint (PATCH)",
        "description": "Call your mock endpoint with PATCH method",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Your custom mock response"
          }
        }
      }
    },
    "/get": {
      "get": {
        "tags": ["HTTP Tester"],
        "summary": "Inspect GET Request",
        "description": "Returns request details including query parameters and headers. httpbin alternative.",
        "parameters": [
          {
            "name": "example_param",
            "in": "query",
            "required": false,
            "description": "Any query parameters you send will be echoed back",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request inspection response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpBinResponse"
                }
              }
            }
          }
        }
      }
    },
    "/post": {
      "post": {
        "tags": ["HTTP Tester"],
        "summary": "Inspect POST Request",
        "description": "Returns request details including body data and headers. httpbin alternative.",
        "requestBody": {
          "description": "Any JSON data you send will be echoed back",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request inspection response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpBinResponseWithBody"
                }
              }
            }
          }
        }
      }
    },
    "/put": {
      "put": {
        "tags": ["HTTP Tester"],
        "summary": "Inspect PUT Request",
        "description": "Returns request details including body data and headers. httpbin alternative.",
        "requestBody": {
          "description": "Any JSON data you send will be echoed back",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request inspection response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpBinResponseWithBody"
                }
              }
            }
          }
        }
      }
    },
    "/patch": {
      "patch": {
        "tags": ["HTTP Tester"],
        "summary": "Inspect PATCH Request",
        "description": "Returns request details including body data and headers. httpbin alternative.",
        "requestBody": {
          "description": "Any JSON data you send will be echoed back",
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Request inspection response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpBinResponseWithBody"
                }
              }
            }
          }
        }
      }
    },
    "/delete": {
      "delete": {
        "tags": ["HTTP Tester"],
        "summary": "Inspect DELETE Request",
        "description": "Returns request details including query parameters and headers. httpbin alternative.",
        "parameters": [
          {
            "name": "example_param",
            "in": "query",
            "required": false,
            "description": "Any query parameters you send will be echoed back",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request inspection response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpBinResponse"
                }
              }
            }
          }
        }
      }
    },
    "/headers": {
      "get": {
        "tags": ["HTTP Tester"],
        "summary": "Inspect Request Headers",
        "description": "Returns all request headers. httpbin alternative.",
        "responses": {
          "200": {
            "description": "Headers inspection response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "headers": {
                      "type": "object",
                      "example": {
                        "User-Agent": "Mozilla/5.0",
                        "Accept": "*/*",
                        "Host": "free.mockerapi.com"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/basic-auth/{username}/{password}": {
      "get": {
        "tags": ["HTTP Tester"],
        "summary": "Test Basic Authentication",
        "description": "Tests HTTP Basic Authentication. Send Authorization header with credentials matching the URL parameters. httpbin alternative.",
        "parameters": [
          {
            "name": "username",
            "in": "path",
            "required": true,
            "description": "Expected username",
            "schema": {
              "type": "string",
              "example": "admin"
            }
          },
          {
            "name": "password",
            "in": "path",
            "required": true,
            "description": "Expected password",
            "schema": {
              "type": "string",
              "example": "secret123"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "description": "Basic authentication header: Basic base64(username:password)",
            "schema": {
              "type": "string",
              "example": "Basic YWRtaW46c2VjcmV0MTIz"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authentication successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "authenticated": {
                      "type": "boolean",
                      "example": true
                    },
                    "user": {
                      "type": "string",
                      "example": "admin"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "authenticated": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "example": "Unauthorized"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/bearer": {
      "get": {
        "tags": ["HTTP Tester"],
        "summary": "Test Bearer Token Authentication",
        "description": "Tests Bearer token authentication. Send Authorization header with Bearer token. httpbin alternative.",
        "parameters": [
          {
            "name": "Authorization",
            "in": "header",
            "required": true,
            "description": "Bearer token header: Bearer your-token-here",
            "schema": {
              "type": "string",
              "example": "Bearer sk_test_1234567890abcdef"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authentication successful",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "authenticated": {
                      "type": "boolean",
                      "example": true
                    },
                    "token": {
                      "type": "string",
                      "example": "sk_test_1234567890abcdef"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "authenticated": {
                      "type": "boolean",
                      "example": false
                    },
                    "message": {
                      "type": "string",
                      "example": "Missing or invalid Bearer token"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/status/{code}": {
      "get": {
        "tags": ["HTTP Tester"],
        "summary": "Test Any HTTP Status Code",
        "description": "Returns the specified HTTP status code. httpbin alternative for testing client error handling.",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "description": "HTTP status code to return (100-599)",
            "schema": {
              "type": "integer",
              "minimum": 100,
              "maximum": 599,
              "example": 404
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Status code response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 200
                    },
                    "message": {
                      "type": "string",
                      "example": "OK"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/delay/{seconds}": {
      "get": {
        "tags": ["HTTP Tester"],
        "summary": "Test Delayed Response",
        "description": "Returns a response after the specified delay. Useful for testing timeouts and loading states. httpbin alternative.",
        "parameters": [
          {
            "name": "seconds",
            "in": "path",
            "required": true,
            "description": "Delay in seconds (1-10)",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10,
              "example": 3
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Delayed response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "delay": {
                      "type": "integer",
                      "example": 3
                    },
                    "url": {
                      "type": "string",
                      "example": "https://free.mockerapi.com/delay/3"
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time",
                      "example": "2025-10-10T10:30:45.123Z"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "StatusCodeResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "status": {
            "type": "integer",
            "example": 200
          },
          "statusText": {
            "type": "string",
            "example": "OK - Request succeeded"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "example": "2025-10-10T10:30:45.123Z"
          },
          "request": {
            "type": "object",
            "properties": {
              "method": {
                "type": "string",
                "example": "GET"
              },
              "url": {
                "type": "string",
                "example": "/200"
              },
              "fullUrl": {
                "type": "string",
                "example": "https://free.mockerapi.com/200"
              }
            }
          },
          "delay": {
            "type": "object",
            "properties": {
              "requested": {
                "type": "integer",
                "example": 3000
              },
              "unit": {
                "type": "string",
                "example": "milliseconds"
              }
            }
          }
        }
      },
      "CreateEndpointResponse": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "example": true
          },
          "endpoint": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "example": "a4ee8fc9-7f54-470d-b64f-4795214dc872"
              },
              "url": {
                "type": "string",
                "example": "https://free.mockerapi.com/mock/a4ee8fc9-7f54-470d-b64f-4795214dc872"
              },
              "type": {
                "type": "string",
                "example": "bearer"
              },
              "method": {
                "type": "string",
                "example": "GET"
              },
              "statusCode": {
                "type": "integer",
                "example": 200
              },
              "responseBody": {
                "type": "object"
              },
              "headers": {
                "type": "object"
              },
              "delay": {
                "type": "integer",
                "example": 0
              },
              "token": {
                "type": "string",
                "description": "Only included if endpoint has authentication",
                "example": "sk_test_1234567890abcdef"
              },
              "username": {
                "type": "string",
                "description": "Only included for basic-auth endpoints",
                "example": "admin"
              },
              "password": {
                "type": "string",
                "description": "Only included for basic-auth endpoints",
                "example": "secret123"
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-10-10T14:41:07.895Z"
              },
              "hitCount": {
                "type": "integer",
                "example": 0
              }
            }
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "boolean",
            "example": true
          },
          "status": {
            "type": "integer",
            "example": 400
          },
          "statusText": {
            "type": "string",
            "example": "Bad Request - Malformed request syntax"
          },
          "message": {
            "type": "string",
            "example": "Invalid status code: 999. Must be between 100-599."
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "example": "2025-10-10T10:30:45.123Z"
          }
        }
      },
      "HttpBinResponse": {
        "type": "object",
        "properties": {
          "args": {
            "type": "object",
            "description": "Query parameters as key-value pairs",
            "example": {
              "name": "John",
              "age": "30"
            }
          },
          "headers": {
            "type": "object",
            "description": "Request headers",
            "example": {
              "User-Agent": "Mozilla/5.0",
              "Accept": "*/*"
            }
          },
          "origin": {
            "type": "string",
            "description": "Client IP address",
            "example": "1.2.3.4"
          },
          "url": {
            "type": "string",
            "description": "Full request URL",
            "example": "https://free.mockerapi.com/get?name=John&age=30"
          }
        }
      },
      "HttpBinResponseWithBody": {
        "type": "object",
        "properties": {
          "args": {
            "type": "object",
            "description": "Query parameters as key-value pairs",
            "example": {}
          },
          "data": {
            "type": "string",
            "description": "Raw request body as string",
            "example": "{\"name\":\"John\",\"age\":30}"
          },
          "json": {
            "type": "object",
            "description": "Parsed JSON request body",
            "example": {
              "name": "John",
              "age": 30
            }
          },
          "headers": {
            "type": "object",
            "description": "Request headers",
            "example": {
              "Content-Type": "application/json"
            }
          },
          "origin": {
            "type": "string",
            "description": "Client IP address",
            "example": "1.2.3.4"
          },
          "url": {
            "type": "string",
            "description": "Full request URL",
            "example": "https://free.mockerapi.com/post"
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Status Code Tester",
      "description": "Test any HTTP status code with optional delays and custom headers"
    },
    {
      "name": "Mock API Generator",
      "description": "Create custom mock API endpoints with authentication"
    },
    {
      "name": "HTTP Tester",
      "description": "httpbin alternative - Inspect and test HTTP requests with 10 endpoints for GET, POST, headers, auth, delays, and more"
    }
  ]
}
