{
  "openapi": "3.1.0",
  "info": {
    "title": "ClaudeWP public catalog API",
    "version": "1.0.0",
    "description": "Read-only HTTP catalog for Claude-to-WordPress Native. This API describes the product, the npm CLI, and the Elementor Free widget allowlist. It does not edit WordPress sites and it does not require authentication.",
    "license": {
      "name": "GPL-2.0-or-later",
      "identifier": "GPL-2.0-or-later"
    },
    "contact": {
      "name": "ClaudeWP",
      "email": "afanaus5@gmail.com",
      "url": "https://claudewp.online/contact"
    }
  },
  "externalDocs": {
    "description": "Product documentation, CLI reference, and import steps",
    "url": "https://claudewp.online/docs"
  },
  "servers": [
    {
      "url": "https://claudewp.online",
      "description": "Production"
    }
  ],
  "tags": [
    { "name": "catalog", "description": "Public product facts" }
  ],
  "paths": {
    "/api": {
      "get": {
        "operationId": "getApiIndex",
        "tags": ["catalog"],
        "summary": "Catalog API index",
        "description": "Return the public catalog API index: version and links to the v1 product, CLI, and widget endpoints.",
        "security": [],
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "description": "Response media type. Use application/json.",
            "schema": {
              "type": "string",
              "enum": ["application/json"],
              "default": "application/json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "API index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "ApiIndex",
                  "allOf": [{ "$ref": "#/components/schemas/ApiIndex" }]
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/api/v1": {
      "get": {
        "operationId": "getApiV1Index",
        "tags": ["catalog"],
        "summary": "Catalog API v1 index",
        "description": "Return the v1 catalog endpoints for product, CLI commands, and Elementor Free widgets.",
        "security": [],
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "description": "Response media type. Use application/json.",
            "schema": {
              "type": "string",
              "enum": ["application/json"],
              "default": "application/json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "v1 index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "ApiV1Index",
                  "allOf": [{ "$ref": "#/components/schemas/ApiV1Index" }]
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/api/v1/product": {
      "get": {
        "operationId": "getProduct",
        "tags": ["catalog"],
        "summary": "Product record",
        "description": "Return the Claude-to-WordPress Native product record: name, description, homepage, repository, npm package, and license.",
        "security": [],
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "description": "Response media type. Use application/json.",
            "schema": {
              "type": "string",
              "enum": ["application/json"],
              "default": "application/json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product record",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Product",
                  "additionalProperties": false,
                  "required": ["name", "brand", "description", "url", "repository", "npm", "cli", "license"],
                  "properties": {
                    "name": { "type": "string", "examples": ["Claude-to-WordPress Native"] },
                    "brand": { "type": "string", "examples": ["ClaudeWP"] },
                    "description": { "type": "string" },
                    "url": { "type": "string", "format": "uri" },
                    "repository": { "type": "string", "format": "uri" },
                    "npm": { "type": "string", "format": "uri" },
                    "cli": { "type": "string", "examples": ["claude-to-wordpress-native"] },
                    "license": { "type": "string", "examples": ["GPL-2.0-or-later"] }
                  }
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/api/v1/cli": {
      "get": {
        "operationId": "getCliCommands",
        "tags": ["catalog"],
        "summary": "CLI command list",
        "description": "Return the published npm CLI commands for claude-to-wordpress-native, including the install string and a one-line purpose for each command.",
        "security": [],
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "description": "Response media type. Use application/json.",
            "schema": {
              "type": "string",
              "enum": ["application/json"],
              "default": "application/json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CLI catalog",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "CliCatalog",
                  "additionalProperties": false,
                  "required": ["package", "install", "commands"],
                  "properties": {
                    "package": { "type": "string" },
                    "install": { "type": "string" },
                    "commands": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": ["id", "invoke", "summary"],
                        "properties": {
                          "id": { "type": "string" },
                          "invoke": { "type": "string" },
                          "summary": { "type": "string" }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/api/v1/widgets": {
      "get": {
        "operationId": "getWidgets",
        "tags": ["catalog"],
        "summary": "Elementor Free widget allowlist",
        "description": "Return the 27 Elementor Free widget slugs that the companion plugin accepts. Pro widgets and unknown widgets are rejected.",
        "security": [],
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "description": "Response media type. Use application/json.",
            "schema": {
              "type": "string",
              "enum": ["application/json"],
              "default": "application/json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Widget allowlist",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "WidgetCatalog",
                  "additionalProperties": false,
                  "required": ["count", "widgets"],
                  "properties": {
                    "count": { "type": "integer", "minimum": 1 },
                    "widgets": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": ["slug", "label", "group"],
                        "properties": {
                          "slug": { "type": "string" },
                          "label": { "type": "string" },
                          "group": { "type": "string", "enum": ["Basic", "General"] }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "405": { "$ref": "#/components/responses/MethodNotAllowed" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiIndex": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "version", "description", "links"],
        "properties": {
          "name": { "type": "string" },
          "version": { "type": "string" },
          "description": { "type": "string" },
          "links": {
            "type": "object",
            "additionalProperties": { "type": "string", "format": "uri" }
          }
        }
      },
      "ApiV1Index": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "version", "endpoints"],
        "properties": {
          "name": { "type": "string" },
          "version": { "type": "string" },
          "endpoints": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["href", "description"],
              "properties": {
                "href": { "type": "string", "format": "uri" },
                "description": { "type": "string" }
              }
            }
          }
        }
      },
      "Product": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "brand", "description", "url", "repository", "npm", "cli", "license"],
        "properties": {
          "name": { "type": "string", "examples": ["Claude-to-WordPress Native"] },
          "brand": { "type": "string", "examples": ["ClaudeWP"] },
          "description": { "type": "string" },
          "url": { "type": "string", "format": "uri" },
          "repository": { "type": "string", "format": "uri" },
          "npm": { "type": "string", "format": "uri" },
          "cli": { "type": "string", "examples": ["claude-to-wordpress-native"] },
          "license": { "type": "string", "examples": ["GPL-2.0-or-later"] }
        }
      },
      "CliCatalog": {
        "type": "object",
        "additionalProperties": false,
        "required": ["package", "install", "commands"],
        "properties": {
          "package": { "type": "string" },
          "install": { "type": "string" },
          "commands": { "type": "array", "items": { "type": "object" } }
        }
      },
      "WidgetCatalog": {
        "type": "object",
        "additionalProperties": false,
        "required": ["count", "widgets"],
        "properties": {
          "count": { "type": "integer", "minimum": 1 },
          "widgets": { "type": "array", "items": { "type": "object" } }
        }
      },
      "Problem": {
        "type": "object",
        "additionalProperties": true,
        "required": ["type", "title", "status", "code", "error", "message", "detail", "hint", "resolution"],
        "properties": {
          "type": { "type": "string", "format": "uri" },
          "title": { "type": "string" },
          "status": { "type": "integer" },
          "code": { "type": "string" },
          "error": { "type": "string" },
          "message": { "type": "string" },
          "detail": { "type": "string" },
          "hint": { "type": "string" },
          "resolution": { "type": "string" },
          "instance": { "type": "string" },
          "documentation_url": { "type": "string", "format": "uri" }
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request is invalid.",
        "content": {
          "application/json": {
            "schema": { "type": "object", "allOf": [{ "$ref": "#/components/schemas/Problem" }] }
          },
          "application/problem+json": {
            "schema": { "type": "object", "allOf": [{ "$ref": "#/components/schemas/Problem" }] }
          }
        }
      },
      "NotFound": {
        "description": "No catalog resource matches this path.",
        "content": {
          "application/json": {
            "schema": { "type": "object", "allOf": [{ "$ref": "#/components/schemas/Problem" }] }
          },
          "application/problem+json": {
            "schema": { "type": "object", "allOf": [{ "$ref": "#/components/schemas/Problem" }] }
          }
        }
      },
      "MethodNotAllowed": {
        "description": "The method is not allowed. Use GET.",
        "content": {
          "application/json": {
            "schema": { "type": "object", "allOf": [{ "$ref": "#/components/schemas/Problem" }] }
          },
          "application/problem+json": {
            "schema": { "type": "object", "allOf": [{ "$ref": "#/components/schemas/Problem" }] }
          }
        }
      },
      "ServerError": {
        "description": "The server could not complete the request.",
        "content": {
          "application/json": {
            "schema": { "type": "object", "allOf": [{ "$ref": "#/components/schemas/Problem" }] }
          },
          "application/problem+json": {
            "schema": { "type": "object", "allOf": [{ "$ref": "#/components/schemas/Problem" }] }
          }
        }
      }
    }
  }
}
