{
  "openapi": "3.1.0",
  "info": {
    "title": "Corbah: open line for agents",
    "version": "0.3.0",
    "description": "An open line from AI agents to Jon, founder of the cycling apparel brand Corbah: send anything and get a private reply link, and browse Corbah's live catalog of cycling kit. No auth."
  },
  "servers": [
    {
      "url": "https://corbah-agents.corbah.workers.dev"
    }
  ],
  "paths": {
    "/message": {
      "post": {
        "operationId": "sendMessage",
        "summary": "Send anything to Jon at Corbah",
        "requestBody": {
          "required": true,
          "content": {
            "text/plain": {
              "schema": {
                "type": "string"
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Received",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "reference": {
                      "type": "integer"
                    },
                    "token": {
                      "type": "string"
                    },
                    "reply_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/reply/{reference}": {
      "get": {
        "operationId": "checkReply",
        "summary": "Check for Jon's reply to a message",
        "parameters": [
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "t",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Token returned with the message receipt"
          }
        ],
        "responses": {
          "200": {
            "description": "Status and any replies"
          },
          "404": {
            "description": "Unknown reference or wrong token"
          }
        }
      }
    },
    "/catalog": {
      "get": {
        "operationId": "browseCatalog",
        "summary": "Search Corbah's live product catalog",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Free-text search"
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Product type, e.g. Cycling Jersey, Bib Shorts, Skinsuit"
          },
          {
            "name": "collection",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Collection handle"
          },
          {
            "name": "size",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Only products available in this size, e.g. MD"
          },
          {
            "name": "max_price",
            "in": "query",
            "schema": {
              "type": "number"
            },
            "description": "Maximum price in USD"
          },
          {
            "name": "include_unavailable",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching products with prices, sizes, images and URLs"
          }
        }
      }
    },
    "/catalog/{handle}": {
      "get": {
        "operationId": "getProduct",
        "summary": "Full details for one product",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product with variants, images, collections and ordering notes"
          },
          "404": {
            "description": "No such product"
          }
        }
      }
    },
    "/collections": {
      "get": {
        "operationId": "listCollections",
        "summary": "Collections and design series with available product counts",
        "responses": {
          "200": {
            "description": "Collections"
          }
        }
      }
    },
    "/collections/{handle}": {
      "get": {
        "operationId": "getCollection",
        "summary": "Products in one collection",
        "parameters": [
          {
            "name": "handle",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Products"
          }
        }
      }
    },
    "/mcp": {
      "post": {
        "operationId": "mcp",
        "summary": "MCP over streamable HTTP (JSON-RPC 2.0)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          }
        }
      }
    },
    "/a2a": {
      "post": {
        "operationId": "a2a",
        "summary": "A2A JSON-RPC (message/send)",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC response"
          }
        }
      }
    }
  }
}