{
  "openapi": "3.1.0",
  "info": {
    "title": "Caspar Manufaktur Agent API",
    "version": "1.1.4",
    "description": "Read-only material information plus idempotent, human-reviewed project handoffs."
  },
  "servers": [
    {
      "url": "https://www.caspar-manufaktur.de"
    }
  ],
  "paths": {
    "/wp-json/caspar-agent/v1/materials": {
      "get": {
        "summary": "List Caspar wallpaper materials and their verified technical characteristics.",
        "operationId": "listMaterials",
        "responses": {
          "200": {
            "description": "Material catalog."
          }
        }
      }
    },
    "/wp-json/caspar-agent/v1/materials/recommendation": {
      "get": {
        "summary": "Recommend one material for a declared project priority.",
        "operationId": "recommendMaterial",
        "parameters": [
          {
            "name": "priority",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["brandschutz", "robust", "effekt", "nachhaltig", "feuchtraum"]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Material recommendation."
          }
        }
      }
    },
    "/wp-json/caspar-agent/v1/handoffs": {
      "post": {
        "summary": "Create a safe, human-reviewed next-step URL for a project enquiry, sample request or Wallcheck.",
        "operationId": "createProjectHandoff",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A client-generated unique key. Reuse the same key only when retrying the same request.",
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 255
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["next_step"],
                "properties": {
                  "next_step": {
                    "type": "string",
                    "enum": ["project_enquiry", "sample_request", "wallcheck"]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "New handoff created."
          },
          "200": {
            "description": "Previously created handoff replayed safely."
          },
          "400": {
            "description": "Invalid request or missing idempotency key."
          }
        }
      }
    }
  }
}
