{
  "openapi": "3.1.0",
  "info": {
    "title": "Sohan Soft Tech WhatsApp Manager",
    "version": "0.2.0",
    "description": "Source-derived current contract. Provider activation is pending. Versioned customer bearer routes are documented separately at /api/v1/openapi.json. Custom customer webhooks, media APIs and automation execution are not implemented."
  },
  "servers": [
    {
      "url": "https://wab.sohansoft.in"
    }
  ],
  "paths": {
    "/api/openapi.json": {
      "get": {
        "operationId": "get_openapi_json",
        "summary": "Download OpenAPI contract",
        "tags": [
          "openapi.json"
        ],
        "security": [],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/status": {
      "get": {
        "operationId": "get_status",
        "summary": "Read safe configuration status",
        "tags": [
          "status"
        ],
        "security": [],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/session": {
      "get": {
        "operationId": "get_session",
        "summary": "Read OTP identity or signup continuation",
        "tags": [
          "session"
        ],
        "security": [],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/send": {
      "post": {
        "operationId": "post_auth_send",
        "summary": "send OTP authentication",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "server/otp.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OTPPhone"
              }
            }
          }
        }
      }
    },
    "/api/auth/verify": {
      "post": {
        "operationId": "post_auth_verify",
        "summary": "verify OTP authentication",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "server/otp.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OTPCode"
              }
            }
          }
        }
      }
    },
    "/api/auth/resend": {
      "post": {
        "operationId": "post_auth_resend",
        "summary": "resend OTP authentication",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "server/otp.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/signup": {
      "post": {
        "operationId": "post_auth_signup",
        "summary": "signup OTP authentication",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "server/otp.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupInput"
              }
            }
          }
        }
      }
    },
    "/api/auth/logout": {
      "post": {
        "operationId": "post_auth_logout",
        "summary": "logout OTP authentication",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "server/otp.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/workspaces": {
      "get": {
        "operationId": "get_workspaces",
        "summary": "List memberships",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AnyObject"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_workspaces",
        "summary": "Create workspace",
        "tags": [
          "workspaces"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyInput"
              }
            }
          }
        }
      }
    },
    "/api/plans": {
      "get": {
        "operationId": "get_plans",
        "summary": "List published plans",
        "tags": [
          "plans"
        ],
        "security": [],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Plan"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/overview": {
      "get": {
        "operationId": "get_overview",
        "summary": "Read workspace aggregates",
        "tags": [
          "overview"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts": {
      "get": {
        "operationId": "get_contacts",
        "summary": "Search contacts",
        "tags": [
          "contacts"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "contacts.read",
        "description": "Customer API keys require contacts.read; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactPage"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_contacts",
        "summary": "Create contact",
        "tags": [
          "contacts"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "contacts.manage",
        "description": "Customer API keys require contacts.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactInput"
              }
            }
          }
        }
      }
    },
    "/api/contacts/{id}": {
      "patch": {
        "operationId": "patch_contacts_id_",
        "summary": "Update contact",
        "tags": [
          "contacts"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "contacts.manage",
        "description": "Customer API keys require contacts.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "updated": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactPatch"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "delete_contacts_id_",
        "summary": "Delete contact",
        "tags": [
          "contacts"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "contacts.manage",
        "description": "Customer API keys require contacts.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "deleted": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/contacts/{id}/consent": {
      "post": {
        "operationId": "post_contacts_id_consent",
        "summary": "Record consent",
        "tags": [
          "contacts"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "contacts.manage",
        "description": "Customer API keys require contacts.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactConsent"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentInput"
              }
            }
          }
        }
      }
    },
    "/api/contacts/export": {
      "get": {
        "operationId": "get_contacts_export",
        "summary": "Export contacts as safe CSV",
        "tags": [
          "contacts"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "contacts.read",
        "description": "Customer API keys require contacts.read; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "CSV, at most 10,000 matching records",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/accounts": {
      "get": {
        "operationId": "get_accounts",
        "summary": "List accounts",
        "tags": [
          "accounts"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WABAAccount"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/numbers": {
      "get": {
        "operationId": "get_numbers",
        "summary": "List numbers",
        "tags": [
          "numbers"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "numbers.read",
        "description": "Customer API keys require numbers.read; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/WhatsAppPhoneNumber"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/templates": {
      "get": {
        "operationId": "get_templates",
        "summary": "List templates",
        "tags": [
          "templates"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "templates.read",
        "description": "Customer API keys require templates.read; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Template"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_templates",
        "summary": "Submit a template to Meta",
        "tags": [
          "templates"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "templates.manage",
        "description": "Customer API keys require templates.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateInput"
              }
            }
          }
        }
      }
    },
    "/api/messages": {
      "get": {
        "operationId": "get_messages",
        "summary": "List messages",
        "tags": [
          "messages"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          },
          {
            "name": "conversationId",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Mandatory for employees; must be assigned to them."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "messages.read",
        "description": "Customer API keys require messages.read; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Message"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_messages",
        "summary": "Queue a compliant message",
        "tags": [
          "messages"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "messages.send",
        "description": "Customer API keys require messages.send; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "202": {
            "description": "Queued / request received",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageQueued"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessageInput"
              }
            }
          }
        }
      }
    },
    "/api/conversations": {
      "get": {
        "operationId": "get_conversations",
        "summary": "List conversations",
        "tags": [
          "conversations"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "conversations.read",
        "description": "Customer API keys require conversations.read; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Conversation"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns": {
      "get": {
        "operationId": "get_campaigns",
        "summary": "List campaigns",
        "tags": [
          "campaigns"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "campaigns.read",
        "description": "Customer API keys require campaigns.read; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Campaign"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_campaigns",
        "summary": "Create campaign draft",
        "tags": [
          "campaigns"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "campaigns.manage",
        "description": "Customer API keys require campaigns.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CampaignInput"
              }
            }
          }
        }
      }
    },
    "/api/billing": {
      "get": {
        "operationId": "get_billing",
        "summary": "List billing",
        "tags": [
          "billing"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "billing.read",
        "description": "Customer API keys require billing.read; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Invoice"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/usage": {
      "get": {
        "operationId": "get_usage",
        "summary": "List usage",
        "tags": [
          "usage"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "usage.read",
        "description": "Customer API keys require usage.read; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UsageLedger"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/subscriptions": {
      "get": {
        "operationId": "get_subscriptions",
        "summary": "List subscriptions",
        "tags": [
          "subscriptions"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "billing.read",
        "description": "Customer API keys require billing.read; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Subscription"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/payments": {
      "get": {
        "operationId": "get_payments",
        "summary": "List payments",
        "tags": [
          "payments"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Payment"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/notifications": {
      "get": {
        "operationId": "get_notifications",
        "summary": "List notifications",
        "tags": [
          "notifications"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Notification"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/support": {
      "get": {
        "operationId": "get_support",
        "summary": "List support",
        "tags": [
          "support"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/SupportTicket"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_support",
        "summary": "Create support request",
        "tags": [
          "support"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupportTicket"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupportInput"
              }
            }
          }
        }
      }
    },
    "/api/logs": {
      "get": {
        "operationId": "get_logs",
        "summary": "List logs",
        "tags": [
          "logs"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AuditLog"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/automation": {
      "get": {
        "operationId": "get_automation",
        "summary": "List automation",
        "tags": [
          "automation"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AnyObject"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/accounts/{id}/refresh": {
      "post": {
        "operationId": "post_accounts_id_refresh",
        "summary": "Refresh account health",
        "tags": [
          "accounts"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/accounts/{id}": {
      "delete": {
        "operationId": "delete_accounts_id_",
        "summary": "Disconnect local credential access",
        "tags": [
          "accounts"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/accounts/{id}/select-phone": {
      "post": {
        "operationId": "post_accounts_id_select_phone",
        "summary": "Select a discovered number",
        "tags": [
          "accounts"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelectPhone"
              }
            }
          }
        }
      }
    },
    "/api/numbers/{id}/register": {
      "post": {
        "operationId": "post_numbers_id_register",
        "summary": "Register a standard Cloud API phone",
        "tags": [
          "numbers"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterPhone"
              }
            }
          }
        }
      }
    },
    "/api/meta/start": {
      "post": {
        "operationId": "post_meta_start",
        "summary": "Start nonce-bound signup (activation gated)",
        "tags": [
          "meta"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/meta/complete": {
      "post": {
        "operationId": "post_meta_complete",
        "summary": "Complete validated asset grant (activation gated)",
        "tags": [
          "meta"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupCompletion"
              }
            }
          }
        }
      }
    },
    "/api/templates/sync": {
      "post": {
        "operationId": "post_templates_sync",
        "summary": "Synchronise templates",
        "tags": [
          "templates"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "templates.manage",
        "description": "Customer API keys require templates.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountId"
              }
            }
          }
        }
      }
    },
    "/api/conversations/{id}": {
      "patch": {
        "operationId": "patch_conversations_id_",
        "summary": "Update assigned conversation",
        "tags": [
          "conversations"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "conversations.manage",
        "description": "Customer API keys require conversations.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MutationCount"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationInput"
              }
            }
          }
        }
      }
    },
    "/api/conversations/{id}/notes": {
      "post": {
        "operationId": "post_conversations_id_notes",
        "summary": "Add internal note",
        "tags": [
          "conversations"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "conversations.manage",
        "description": "Customer API keys require conversations.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationNote"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteInput"
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/start": {
      "post": {
        "operationId": "post_campaigns_id_start",
        "summary": "start campaign",
        "tags": [
          "campaigns"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "campaigns.manage",
        "description": "Customer API keys require campaigns.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/pause": {
      "post": {
        "operationId": "post_campaigns_id_pause",
        "summary": "pause campaign",
        "tags": [
          "campaigns"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "campaigns.manage",
        "description": "Customer API keys require campaigns.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/resume": {
      "post": {
        "operationId": "post_campaigns_id_resume",
        "summary": "resume campaign",
        "tags": [
          "campaigns"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "campaigns.manage",
        "description": "Customer API keys require campaigns.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/campaigns/{id}/cancel": {
      "post": {
        "operationId": "post_campaigns_id_cancel",
        "summary": "cancel campaign",
        "tags": [
          "campaigns"
        ],
        "security": [
          {
            "CustomerKey": []
          },
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": false,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "campaigns.manage",
        "description": "Customer API keys require campaigns.manage; legacy read grants only supported .read operations. Cookie users require workspace membership and the operation permission.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/team": {
      "get": {
        "operationId": "get_team",
        "summary": "List team members",
        "tags": [
          "team"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AnyObject"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_team",
        "summary": "Add registered user",
        "tags": [
          "team"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TeamInput"
              }
            }
          }
        }
      }
    },
    "/api/api-keys": {
      "get": {
        "operationId": "get_api_keys",
        "summary": "List safe API key metadata",
        "tags": [
          "api-keys"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Offset page, 30 records where applicable; messages are newest 100 and accounts/keys unpaginated."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/KeyMetadata"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_api_keys",
        "summary": "Create API key once",
        "tags": [
          "api-keys"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyCreated"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyInput"
              }
            }
          }
        }
      }
    },
    "/api/api-keys/{id}": {
      "delete": {
        "operationId": "delete_api_keys_id_",
        "summary": "Revoke API key",
        "tags": [
          "api-keys"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MutationCount"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/api-keys/{id}/rotate": {
      "post": {
        "operationId": "post_api_keys_id_rotate",
        "summary": "Create replacement key and overlap window",
        "tags": [
          "api-keys"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyCreated"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotationInput"
              }
            }
          }
        }
      }
    },
    "/api/billing/checkout": {
      "post": {
        "operationId": "post_billing_checkout",
        "summary": "Create subscription payment order",
        "tags": [
          "billing"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutInput"
              }
            }
          }
        }
      }
    },
    "/api/deletion": {
      "post": {
        "operationId": "post_deletion",
        "summary": "Record verified deletion request",
        "tags": [
          "deletion"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "x-tenant-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Required for session auth; bearer derives tenant from key. A mismatched override is rejected."
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "202": {
            "description": "Queued / request received",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/wallet": {
      "get": {
        "operationId": "get_wallet",
        "summary": "Read own-business wallet",
        "tags": [
          "wallet"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "server/wallet.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/wallet/recharge": {
      "post": {
        "operationId": "post_wallet_recharge",
        "summary": "Create ₹200+ wallet recharge order",
        "tags": [
          "wallet"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "server/wallet.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RechargeInput"
              }
            }
          }
        }
      }
    },
    "/api/wallet/verify": {
      "post": {
        "operationId": "post_wallet_verify",
        "summary": "Verify captured recharge",
        "tags": [
          "wallet"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "server/wallet.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyPayment"
              }
            }
          }
        }
      }
    },
    "/api/webhooks/meta": {
      "get": {
        "operationId": "get_webhooks_meta",
        "summary": "Meta verification challenge",
        "tags": [
          "webhooks"
        ],
        "security": [],
        "parameters": [
          {
            "name": "hub.mode",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hub.verify_token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "hub.challenge",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Exact challenge",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_webhooks_meta",
        "summary": "Durably accept signed Meta event",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "MetaSignature": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Received"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/webhooks/razorpay": {
      "post": {
        "operationId": "post_webhooks_razorpay",
        "summary": "Accept signed Razorpay capture",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "RazorpaySignature": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Received"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/webhooks/wallet": {
      "post": {
        "operationId": "post_webhooks_wallet",
        "summary": "Accept signed Razorpay capture",
        "tags": [
          "webhooks"
        ],
        "security": [
          {
            "RazorpaySignature": []
          }
        ],
        "parameters": [],
        "x-source-file": "server/wallet.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Received"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/jobs": {
      "post": {
        "operationId": "post_jobs",
        "summary": "Drain bounded jobs (operator only)",
        "tags": [
          "jobs"
        ],
        "security": [
          {
            "SchedulerBearer": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/meta/data-deletion": {
      "post": {
        "operationId": "post_meta_data_deletion",
        "summary": "Record signed Meta deletion request",
        "tags": [
          "meta"
        ],
        "security": [],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "OTP session required unless the endpoint has a provider-specific signature or is public.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "required": [
                  "signed_request"
                ],
                "properties": {
                  "signed_request": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/overview": {
      "get": {
        "operationId": "get_admin_overview",
        "summary": "Platform overview",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/clients": {
      "get": {
        "operationId": "get_admin_clients",
        "summary": "Platform clients",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_admin_clients",
        "summary": "Manually create client",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyInput"
              }
            }
          }
        }
      }
    },
    "/api/admin/plans": {
      "get": {
        "operationId": "get_admin_plans",
        "summary": "Platform plans",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_admin_plans",
        "summary": "Create configurable plan",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Plan"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/subscriptions": {
      "get": {
        "operationId": "get_admin_subscriptions",
        "summary": "Platform subscriptions",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/billing": {
      "get": {
        "operationId": "get_admin_billing",
        "summary": "Platform billing",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/usage": {
      "get": {
        "operationId": "get_admin_usage",
        "summary": "Platform usage",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/campaigns": {
      "get": {
        "operationId": "get_admin_campaigns",
        "summary": "Platform campaigns",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/api-management": {
      "get": {
        "operationId": "get_admin_api_management",
        "summary": "Platform api-management",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/webhooks": {
      "get": {
        "operationId": "get_admin_webhooks",
        "summary": "Platform webhooks",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/logs": {
      "get": {
        "operationId": "get_admin_logs",
        "summary": "Platform logs",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/support": {
      "get": {
        "operationId": "get_admin_support",
        "summary": "Platform support",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/whatsapp-accounts": {
      "get": {
        "operationId": "get_admin_whatsapp_accounts",
        "summary": "Platform whatsapp-accounts",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnyObject"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/admin/clients/{id}": {
      "patch": {
        "operationId": "patch_admin_clients_id_",
        "summary": "Change client status",
        "tags": [
          "admin"
        ],
        "security": [
          {
            "Session": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Origin",
            "in": "header",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "Cookie mutations require the exact request origin."
          }
        ],
        "x-source-file": "app/api/[...path]/route.ts",
        "x-api-key-scope": "Not accepted",
        "description": "Restricted to the exact OTP-verified platform administrator.",
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tenant"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication failed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Permission denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "State or duplicate conflict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Unexpected internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Activation or configuration missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "CustomerKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "sst_…"
      },
      "Session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-sst_session"
      },
      "MetaSignature": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Hub-Signature-256"
      },
      "RazorpaySignature": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Razorpay-Signature"
      },
      "SchedulerBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "AnyObject": {
        "type": "object",
        "additionalProperties": true
      },
      "MutationCount": {
        "type": "object",
        "required": [
          "count"
        ],
        "properties": {
          "count": {
            "type": "integer"
          }
        }
      },
      "MessageQueued": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "Received": {
        "type": "object",
        "required": [
          "received"
        ],
        "properties": {
          "received": {
            "const": true
          }
        }
      },
      "Tenant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "companyName": {
            "type": "string"
          },
          "legalName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "contactPerson": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "email": {
            "type": "string"
          },
          "mobile": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "website": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "gstin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "resellerId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "companyName",
          "legalName",
          "contactPerson",
          "email",
          "mobile",
          "website",
          "address",
          "gstin",
          "status",
          "resellerId",
          "createdAt"
        ],
        "additionalProperties": true
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "company": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "customFields": {},
          "optedOut": {
            "type": "boolean"
          },
          "assignedTo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastInteraction": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "consents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactConsent"
            }
          }
        },
        "required": [
          "id",
          "tenantId",
          "name",
          "phone",
          "email",
          "company",
          "tags",
          "customFields",
          "optedOut",
          "assignedTo",
          "lastInteraction",
          "createdAt"
        ],
        "additionalProperties": true
      },
      "ContactConsent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "contactId": {
            "type": "string"
          },
          "purpose": {
            "type": "string"
          },
          "source": {
            "type": "string"
          },
          "granted": {
            "type": "boolean"
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenantId",
          "contactId",
          "purpose",
          "source",
          "granted",
          "recordedAt"
        ],
        "additionalProperties": true
      },
      "Conversation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "contactId": {
            "type": "string"
          },
          "phoneId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "assignedTo": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "unread": {
            "type": "integer"
          },
          "lastInboundAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "contact": {
            "$ref": "#/components/schemas/Contact"
          }
        },
        "required": [
          "id",
          "tenantId",
          "contactId",
          "phoneId",
          "status",
          "assignedTo",
          "unread",
          "lastInboundAt",
          "updatedAt"
        ],
        "additionalProperties": true
      },
      "ConversationNote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenantId",
          "conversationId",
          "userId",
          "body",
          "createdAt"
        ],
        "additionalProperties": true
      },
      "Message": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "phoneId": {
            "type": "string"
          },
          "contactId": {
            "type": "string"
          },
          "conversationId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "campaignId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "direction": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "category": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "payload": {},
          "status": {
            "type": "string"
          },
          "metaMessageId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "idempotencyKey": {
            "type": "string"
          },
          "errorCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "errorMessage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "sentAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "tenantId",
          "phoneId",
          "contactId",
          "conversationId",
          "campaignId",
          "direction",
          "type",
          "category",
          "payload",
          "status",
          "metaMessageId",
          "idempotencyKey",
          "errorCode",
          "errorMessage",
          "createdAt",
          "sentAt"
        ],
        "additionalProperties": true
      },
      "Template": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "metaId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "components": {},
          "rejectionReason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "syncedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenantId",
          "accountId",
          "metaId",
          "name",
          "language",
          "category",
          "status",
          "components",
          "rejectionReason",
          "syncedAt"
        ],
        "additionalProperties": true
      },
      "Campaign": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "phoneId": {
            "type": "string"
          },
          "templateId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "scheduledAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenantId",
          "name",
          "phoneId",
          "templateId",
          "status",
          "scheduledAt",
          "createdAt"
        ],
        "additionalProperties": true
      },
      "WhatsAppPhoneNumber": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "phoneNumberId": {
            "type": "string"
          },
          "displayNumber": {
            "type": "string"
          },
          "verifiedName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "quality": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string"
          },
          "registrationState": {
            "type": "string"
          },
          "registeredAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "registrationDeadline": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "syncedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenantId",
          "accountId",
          "phoneNumberId",
          "displayNumber",
          "verifiedName",
          "quality",
          "status",
          "registrationState",
          "registeredAt",
          "registrationDeadline",
          "syncedAt"
        ],
        "additionalProperties": true
      },
      "WABAAccount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "wabaId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "subscribed": {
            "type": "boolean"
          },
          "webhookVerifiedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "syncedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "selectedPhoneNumberId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "onboardingMode": {
            "type": "string"
          },
          "authorizedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "phones": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WhatsAppPhoneNumber"
            }
          }
        },
        "required": [
          "id",
          "tenantId",
          "wabaId",
          "name",
          "status",
          "subscribed",
          "webhookVerifiedAt",
          "syncedAt",
          "selectedPhoneNumberId",
          "onboardingMode",
          "authorizedAt"
        ],
        "additionalProperties": true
      },
      "Invoice": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "subtotalPaise": {
            "type": "integer"
          },
          "gstPaise": {
            "type": "integer"
          },
          "totalPaise": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenantId",
          "number",
          "subtotalPaise",
          "gstPaise",
          "totalPaise",
          "status",
          "createdAt"
        ],
        "additionalProperties": true
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "interval": {
            "type": "string"
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "razorpayId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "tenantId",
          "planId",
          "status",
          "interval",
          "expiresAt",
          "razorpayId"
        ],
        "additionalProperties": true
      },
      "UsageLedger": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "messageId": {
            "type": "string"
          },
          "phoneId": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "event": {
            "type": "string"
          },
          "servicePaise": {
            "type": "integer"
          },
          "metaPaise": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "ruleId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenantId",
          "messageId",
          "phoneId",
          "category",
          "event",
          "servicePaise",
          "metaPaise",
          "ruleId",
          "createdAt"
        ],
        "additionalProperties": true
      },
      "Notification": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "readAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenantId",
          "title",
          "body",
          "readAt",
          "createdAt"
        ],
        "additionalProperties": true
      },
      "SupportTicket": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenantId",
          "subject",
          "body",
          "status",
          "createdAt"
        ],
        "additionalProperties": true
      },
      "Plan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "monthlyPaise": {
            "type": "integer"
          },
          "annualPaise": {
            "type": "integer"
          },
          "numberLimit": {
            "type": "integer"
          },
          "memberLimit": {
            "type": "integer"
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "monthlyPaise",
          "annualPaise",
          "numberLimit",
          "memberLimit",
          "features",
          "active"
        ],
        "additionalProperties": true
      },
      "AuditLog": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "actorId": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "entityId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenantId",
          "actorId",
          "action",
          "entityId",
          "createdAt"
        ],
        "additionalProperties": true
      },
      "Payment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "tenantId": {
            "type": "string"
          },
          "invoiceId": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "interval": {
            "type": "string"
          },
          "razorpayOrderId": {
            "type": "string"
          },
          "razorpayPaymentId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "amountPaise": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "tenantId",
          "invoiceId",
          "planId",
          "interval",
          "razorpayOrderId",
          "razorpayPaymentId",
          "amountPaise",
          "status",
          "createdAt"
        ],
        "additionalProperties": true
      },
      "ContactPage": {
        "type": "object",
        "required": [
          "items",
          "total",
          "page"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Contact"
            }
          },
          "total": {
            "type": "integer"
          },
          "page": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "KeyMetadata": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "prefix": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdBy": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastUsedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "scheduledRevocationAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "rotatedFromId": {
            "type": [
              "string",
              "null"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "KeyCreated": {
        "type": "object",
        "required": [
          "key",
          "warning",
          "metadata"
        ],
        "properties": {
          "key": {
            "type": "string",
            "readOnly": true,
            "description": "Returned only by creation/rotation. Never retrievable from GET."
          },
          "warning": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/KeyMetadata"
          }
        }
      },
      "ContactInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "phone": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{6,14}$"
          },
          "email": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "not": {}
                  },
                  {
                    "type": "string",
                    "format": "email"
                  }
                ]
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "company": {
            "type": "string",
            "maxLength": 120
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 40
            },
            "maxItems": 30
          },
          "optedOut": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "phone"
        ],
        "additionalProperties": false
      },
      "ContactPatch": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "phone": {
            "type": "string",
            "pattern": "^\\+[1-9]\\d{6,14}$"
          },
          "email": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "not": {}
                  },
                  {
                    "type": "string",
                    "format": "email"
                  }
                ]
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "company": {
            "type": "string",
            "maxLength": 120
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 40
            },
            "maxItems": 30
          },
          "optedOut": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "CompanyInput": {
        "type": "object",
        "properties": {
          "companyName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 150
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "legalName": {
            "type": "string",
            "maxLength": 150
          },
          "mobile": {
            "type": "string",
            "maxLength": 20
          },
          "website": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "not": {}
                  },
                  {
                    "type": "string",
                    "format": "uri"
                  }
                ]
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "address": {
            "type": "string",
            "maxLength": 500
          },
          "gstin": {
            "type": "string",
            "maxLength": 15
          }
        },
        "required": [
          "companyName",
          "email"
        ],
        "additionalProperties": false
      },
      "MessageInput": {
        "type": "object",
        "properties": {
          "contactId": {
            "type": "string"
          },
          "phoneId": {
            "type": "string"
          },
          "templateId": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4096
          },
          "components": {
            "type": "array",
            "maxItems": 20
          },
          "idempotencyKey": {
            "type": "string",
            "minLength": 8,
            "maxLength": 120
          },
          "scheduledAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "contactId",
          "phoneId",
          "idempotencyKey"
        ],
        "additionalProperties": false,
        "description": "Requires text or templateId (server refinement); do not provide both. A successful enqueue is not delivery."
      },
      "ConsentInput": {
        "type": "object",
        "properties": {
          "purpose": {
            "type": "string",
            "enum": [
              "MARKETING",
              "MESSAGING"
            ]
          },
          "source": {
            "type": "string",
            "minLength": 3,
            "maxLength": 200
          },
          "granted": {
            "type": "boolean"
          }
        },
        "required": [
          "purpose",
          "source",
          "granted"
        ],
        "additionalProperties": false
      },
      "CampaignInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
          },
          "phoneId": {
            "type": "string"
          },
          "templateId": {
            "type": "string"
          },
          "contactIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "maxItems": 1000
          },
          "scheduledAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "name",
          "phoneId",
          "templateId",
          "contactIds"
        ],
        "additionalProperties": false
      },
      "TemplateInput": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "pattern": "^[a-z0-9_]+$"
          },
          "language": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "MARKETING",
              "UTILITY",
              "AUTHENTICATION"
            ]
          },
          "components": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {}
            },
            "minItems": 1
          }
        },
        "required": [
          "accountId",
          "name",
          "language",
          "category",
          "components"
        ],
        "additionalProperties": false
      },
      "ConversationInput": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "OPEN",
              "RESOLVED"
            ]
          },
          "assignedTo": {
            "type": "string"
          },
          "unread": {
            "type": "number",
            "const": 0
          }
        },
        "additionalProperties": false
      },
      "KeyInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 80
          },
          "description": {
            "type": "string",
            "maxLength": 300
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "contacts.read",
                "contacts.manage",
                "messages.read",
                "messages.send",
                "templates.read",
                "templates.manage",
                "conversations.read",
                "conversations.manage",
                "campaigns.read",
                "campaigns.manage",
                "numbers.read",
                "usage.read",
                "billing.read"
              ]
            },
            "minItems": 1,
            "maxItems": 14
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "name",
          "scopes"
        ],
        "additionalProperties": false
      },
      "RotationInput": {
        "type": "object",
        "properties": {
          "overlapSeconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 86400,
            "default": 0
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "SignupCompletion": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 5,
            "maxLength": 4096
          },
          "nonce": {
            "type": "string",
            "format": "uuid"
          },
          "wabaId": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "phoneNumberId": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "completionEvent": {
            "type": "string",
            "enum": [
              "FINISH",
              "FINISH_WHATSAPP_BUSINESS_APP_ONBOARDING"
            ],
            "default": "FINISH"
          }
        },
        "required": [
          "code",
          "nonce",
          "wabaId"
        ],
        "additionalProperties": false
      },
      "NoteInput": {
        "type": "object",
        "properties": {
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 3000
          }
        },
        "required": [
          "body"
        ],
        "additionalProperties": false
      },
      "SupportInput": {
        "type": "object",
        "properties": {
          "subject": {
            "type": "string",
            "minLength": 3,
            "maxLength": 150
          },
          "body": {
            "type": "string",
            "minLength": 10,
            "maxLength": 5000
          }
        },
        "required": [
          "subject",
          "body"
        ],
        "additionalProperties": false
      },
      "CheckoutInput": {
        "type": "object",
        "properties": {
          "planId": {
            "type": "string"
          },
          "interval": {
            "type": "string",
            "enum": [
              "MONTHLY",
              "ANNUAL"
            ]
          }
        },
        "required": [
          "planId",
          "interval"
        ],
        "additionalProperties": false
      },
      "RegisterPhone": {
        "type": "object",
        "properties": {
          "pin": {
            "type": "string",
            "pattern": "^\\d{6}$",
            "description": "Transient PIN: never returned, persisted or logged",
            "writeOnly": true
          }
        },
        "required": [
          "pin"
        ],
        "additionalProperties": false
      },
      "SelectPhone": {
        "type": "object",
        "properties": {
          "phoneNumberId": {
            "type": "string",
            "pattern": "^\\d+$"
          }
        },
        "required": [
          "phoneNumberId"
        ],
        "additionalProperties": false
      },
      "AccountId": {
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string"
          }
        },
        "required": [
          "accountId"
        ],
        "additionalProperties": false
      },
      "OTPPhone": {
        "type": "object",
        "properties": {
          "mobile": {
            "type": "string",
            "description": "Indian 10-digit number; optional +91 accepted"
          }
        },
        "required": [
          "mobile"
        ],
        "additionalProperties": false
      },
      "OTPCode": {
        "type": "object",
        "properties": {
          "otp": {
            "type": "string",
            "pattern": "^\\d{6}$"
          }
        },
        "required": [
          "otp"
        ],
        "additionalProperties": false
      },
      "SignupInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 120
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "companyName": {
            "type": "string",
            "minLength": 2,
            "maxLength": 150
          },
          "acceptTerms": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "name",
          "email",
          "companyName",
          "acceptTerms"
        ],
        "additionalProperties": false
      },
      "RechargeInput": {
        "type": "object",
        "properties": {
          "amountPaise": {
            "type": "integer",
            "minimum": 20000,
            "maximum": 10000000
          },
          "idempotencyKey": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "amountPaise",
          "idempotencyKey"
        ],
        "additionalProperties": false
      },
      "VerifyPayment": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string"
          },
          "paymentId": {
            "type": "string"
          },
          "signature": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "orderId",
          "paymentId",
          "signature"
        ],
        "additionalProperties": false
      },
      "TeamInput": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string",
            "enum": [
              "ADMIN",
              "EMPLOYEE"
            ]
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "messages.send",
                "contacts.manage",
                "conversations.manage",
                "campaigns.manage",
                "templates.manage"
              ]
            },
            "default": [
              "read"
            ]
          }
        },
        "required": [
          "email",
          "role"
        ],
        "additionalProperties": false
      }
    }
  }
}
