{
  "openapi": "3.1.0",
  "info": {
    "title": "Webmapper API",
    "version": "v1",
    "description": "Semantic web agent API — discover typed actions, call with customer-supplied CDP (Browserbase)."
  },
  "servers": [
    {
      "url": "https://www.webmapper.co"
    }
  ],
  "paths": {
    "/v1/health": {
      "get": {
        "summary": "Health check",
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/auth/signup": {
      "post": {
        "summary": "Create account and API key",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "password"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "format": "email"
                  },
                  "password": {
                    "type": "string",
                    "minLength": 8
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "API key issued"
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "summary": "Current account",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Account info"
          }
        }
      }
    },
    "/v1/apps": {
      "get": {
        "summary": "List public apps",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "App list"
          }
        }
      }
    },
    "/v1/apps/{app}": {
      "get": {
        "summary": "Discover app catalog",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Action catalog"
          }
        }
      }
    },
    "/v1/apps/{app}/call": {
      "post": {
        "summary": "Invoke an action",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "app",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "properties": {
                  "action": {
                    "type": "string"
                  },
                  "params": {
                    "type": "object"
                  },
                  "session": {
                    "type": "object",
                    "properties": {
                      "sessionId": {
                        "type": "string"
                      }
                    }
                  },
                  "browser": {
                    "type": "object",
                    "properties": {
                      "mode": {
                        "type": "string",
                        "enum": [
                          "cdp"
                        ]
                      },
                      "provider": {
                        "type": "string"
                      },
                      "cdpUrl": {
                        "type": "string",
                        "format": "uri"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Call result"
          },
          "429": {
            "description": "Quota or rate limit"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "wm_live_*"
      }
    }
  }
}
