{
  "openapi": "3.1.1",
  "info": {
    "title": "Mira general counseling workflow API — client",
    "version": "2026-10-30",
    "description": "Existing counselor/client API contracts, not an OAuth or MCP server. Session credentials carry the user’s existing account permissions. Public docs do not authorize data access. Agent approval annotations are connector policy guidance, not additional backend enforcement."
  },
  "servers": [
    {
      "url": "/api",
      "description": "Same-origin API. Resolve against the verified documentation origin."
    }
  ],
  "security": [
    {
      "sessionBearer": []
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "operationId": "health",
        "summary": "Service health",
        "description": "No credentials needed.",
        "tags": [
          "health"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [],
        "x-mira-public": true,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/index.ts"
      }
    },
    "/auth/login": {
      "post": {
        "operationId": "login",
        "summary": "Sign in and obtain a session bearer token",
        "description": "Opaque token expires after 24 hours; no refresh-token or OAuth endpoint. Prefer a human-provided session held in a trusted connector, not model context.",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: LoginResult",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResult"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": true,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/index.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Login"
              }
            }
          }
        }
      }
    },
    "/auth/signup/config": {
      "get": {
        "operationId": "practiceSignupConfig",
        "summary": "Read public signup availability and verification configuration",
        "description": "Returns only availability, the public Turnstile site key and acknowledgment version, never provider secrets.",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: SignupConfig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupConfig"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [],
        "x-mira-public": true,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/signup.ts"
      }
    },
    "/auth/signup": {
      "post": {
        "operationId": "practiceSignupRequest",
        "summary": "Request a verification email for a new isolated practice",
        "description": "Human-operated signup. Requires Turnstile action practice_signup on the trusted app hostname, authority confirmation and privacy acknowledgment. Generic reply for eligible/existing/invited/suppressed/rate-limited email addresses. No workspace, account, password or session is created yet. Replacing a signup invalidates earlier links. 3 requests/email and 5/IP/15 minutes, 10/IP/day; globally capped at 250/day.",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: SignupRequestResult",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupRequestResult"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [],
        "x-mira-public": true,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/signup.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PracticeSignup"
              }
            }
          }
        }
      }
    },
    "/auth/signup/complete": {
      "post": {
        "operationId": "practiceSignupComplete",
        "summary": "Verify an email capability and create its isolated practice",
        "description": "Human-operated, single-use 24-hour email capability plus a new password. Creates a fresh workspace and fixed owner/clinical admin account scoped only to that practice, then signs in. Cannot choose role, workspace, or join an existing practice. Existing account/invitation emails must use sign-in/invitation flows instead. Booking remains unpublished and optional notifications off. Never put signup capabilities or passwords into model context.",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: SignupResult",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignupResult"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [],
        "x-mira-public": true,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/signup.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteSignup"
              }
            }
          }
        }
      }
    },
    "/auth/forgot-password": {
      "post": {
        "operationId": "passwordResetRequest",
        "summary": "Request a private password reset email",
        "description": "Always returns the same generic response for unknown, disabled, rate-limited or email-disabled accounts. No token in response. Email is limited to three requests/address and twenty/IP per 15 minutes. Requires configured, enabled workspace email.",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": true,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/password-reset.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordResetRequest"
              }
            }
          }
        }
      }
    },
    "/auth/reset-password": {
      "post": {
        "operationId": "passwordReset",
        "summary": "Choose a new password with a reset capability",
        "description": "Human-controlled, single-use reset token from email fragment; expires in 30 minutes. Revokes all browser sessions, agent tokens and other reset links. Never log tokens or passwords.",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": true,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/password-reset.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordReset"
              }
            }
          }
        }
      }
    },
    "/auth/me": {
      "get": {
        "operationId": "identity",
        "summary": "Verify current identity and workspace",
        "description": "",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Identity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Identity"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/index.ts"
      }
    },
    "/auth/token": {
      "post": {
        "operationId": "sessionToken",
        "summary": "Export the current session token",
        "description": "Human-operated Settings → Mira token reveal/copy. Returns the current session, not a new or refreshed token. Cookie requests require an approved Origin. Sign out to revoke; never log the response or include it in model context.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: SessionToken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionToken"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/index.ts"
      }
    },
    "/auth/agent-tokens": {
      "get": {
        "operationId": "agentTokensList",
        "summary": "List your named agent tokens",
        "description": "Browser/login session required, not an agent token. Lists only your token metadata; never returns secrets or hashes. Includes expired tokens.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: AgentTokenList",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentTokenList"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/index.ts"
      },
      "post": {
        "operationId": "agentTokensCreate",
        "summary": "Create a named agent token",
        "description": "Human-operated browser/login session required. Secret is returned once. Default expiry 30 days, allowed 1–90 days. Maximum 50 tokens including expired ones; delete unused tokens. Store as MIRA_TOKEN in the connector secret store. Does not affect browser sessions.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success: AgentTokenCreated; 201 means created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentTokenCreated"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/index.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentTokenCreate"
              }
            }
          }
        }
      }
    },
    "/auth/agent-tokens/{id}": {
      "delete": {
        "operationId": "agentTokensDelete",
        "summary": "Delete your agent token",
        "description": "Human-operated browser/login session required. Immediately revokes only this owned token, without signing you out. Foreign or already deleted IDs return 404.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/index.ts"
      }
    },
    "/auth/logout": {
      "post": {
        "operationId": "logout",
        "summary": "Revoke the current session",
        "description": "Revokes the supplied token only.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/index.ts"
      }
    },
    "/auth/password": {
      "post": {
        "operationId": "passwordChange",
        "summary": "Change your account password",
        "description": "Client: invalidates all client sessions, response also contains sign_in_again:true. Counselor: invalidates other sessions, retains current one. Password entry should remain human-controlled.",
        "tags": [
          "auth"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/index.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordChange"
              }
            }
          }
        }
      }
    },
    "/auth/client/activate": {
      "post": {
        "operationId": "clientActivate",
        "summary": "Activate an invitation",
        "description": "24-hour, single-use invitation token, NOT a session bearer token.",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": true,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/accounts.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Activation"
              }
            }
          }
        }
      }
    },
    "/client/messages": {
      "get": {
        "operationId": "clientMessagesList",
        "summary": "Read portal conversation",
        "description": "Stored conversation, distinct from temporary meeting chat. Latest 200 messages returned in chronological order. Sending is externally visible; 30 per user per minute. No message edit/delete route.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Messages",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Messages"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/collaboration.ts",
        "x-mira-list-limit": 200
      },
      "post": {
        "operationId": "clientMessagesCreate",
        "summary": "Send a portal message",
        "description": "Stored conversation, distinct from temporary meeting chat. Latest 200 messages returned in chronological order. Sending is externally visible; 30 per user per minute. No message edit/delete route.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success: Ok; 201 means created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/collaboration.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Message"
              }
            }
          }
        }
      }
    },
    "/client/documents": {
      "get": {
        "operationId": "clientDocumentsList",
        "summary": "List shared documents",
        "description": "Two-phase upload: initialize metadata, then PUT original bytes to /documents/{id}/file. UUID upload_id enables safe initialization retries. PDF max 10 MiB, 1–100 pages, unencrypted/readable. Client cannot request a signature. Listing returns current consent_text/version. Upload limit 10/user/minute.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Documents",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Documents"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/collaboration.ts",
        "x-mira-list-limit": 1000
      },
      "post": {
        "operationId": "clientDocumentsCreate",
        "summary": "Initialize a PDF upload",
        "description": "Two-phase upload: initialize metadata, then PUT original bytes to /documents/{id}/file. UUID upload_id enables safe initialization retries. PDF max 10 MiB, 1–100 pages, unencrypted/readable. Client cannot request a signature. Listing returns current consent_text/version. Upload limit 10/user/minute.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: DocumentResult; 201 means created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentResult"
                }
              }
            }
          },
          "201": {
            "description": "Success: DocumentResult; 201 means created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentResult"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "same-upload-id-and-file",
        "x-mira-source": "worker/collaboration.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentCreate"
              }
            }
          }
        }
      }
    },
    "/documents/{id}": {
      "get": {
        "operationId": "documentsRead",
        "summary": "Read permitted document metadata",
        "description": "Client: only their own documents; cannot read another uploader’s pending upload or revoked document.",
        "tags": [
          "documents"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: DocumentResult",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentResult"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/collaboration.ts"
      },
      "delete": {
        "operationId": "documentsDelete",
        "summary": "Revoke or discard a document",
        "description": "Counselor: revoke their client document. Client: discard only own pending upload (status uploading). Not permanent blob erasure.",
        "tags": [
          "documents"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          },
          {
            "name": "version",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "description": "Current version from a fresh read; optimistic concurrency token.",
            "required": true,
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/collaboration.ts"
      }
    },
    "/documents/{id}/file": {
      "get": {
        "operationId": "documentsDownload",
        "summary": "Download original or signed PDF",
        "description": "Only shared/signed status. Signed copy requires signed_key. Raw bytes, not JSON; access is audited.",
        "tags": [
          "documents"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          },
          {
            "name": "copy",
            "schema": {
              "type": "string",
              "enum": [
                "original",
                "signed"
              ]
            },
            "description": "Defaults to original; signed selects acknowledged copy.",
            "required": false,
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Success: Record",
            "content": {
              "application/pdf": {
                "schema": {
                  "contentMediaType": "application/pdf"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/collaboration.ts"
      },
      "put": {
        "operationId": "documentsUpload",
        "summary": "Upload the exact initialized PDF bytes",
        "description": "Only original uploader. SHA-256 and exact byte count must match initialization. Finishing the upload shares it with the other party. Do not base64 or multipart encode.",
        "tags": [
          "documents"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: DocumentResult",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentResult"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "same-file-and-document-id",
        "x-mira-source": "worker/collaboration.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/pdf": {
              "schema": {
                "contentMediaType": "application/pdf"
              }
            }
          }
        }
      }
    },
    "/documents/{id}/events": {
      "get": {
        "operationId": "documentEvents",
        "summary": "Read permitted document audit events and acknowledgment",
        "description": "Only a document this user may access. Includes actor metadata and signature attribution.",
        "tags": [
          "documents"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: DocumentEvents",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentEvents"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/collaboration.ts"
      }
    },
    "/client/documents/{id}/sign": {
      "post": {
        "operationId": "clientDocumentSign",
        "summary": "Acknowledge a reviewed document",
        "description": "Requires current version/hash and exact current consent_version. Human must review original PDF, enter own name/password and consent. An agent must not fabricate consent or acknowledge on its own. 5 attempts/user/minute; simple typed-name acknowledgment, not a certificate signature.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: DocumentResult",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DocumentResult"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/collaboration.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DocumentSign"
              }
            }
          }
        }
      }
    },
    "/client/dashboard": {
      "get": {
        "operationId": "clientDashboard",
        "summary": "Read own appointments and public booking profile",
        "description": "Maximum 500 bookings, newest first. Not counselor notes or private workflow history.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Dashboard",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Dashboard"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/accounts.ts",
        "x-mira-list-limit": 500
      }
    },
    "/client/book": {
      "post": {
        "operationId": "clientBookingCreate",
        "summary": "Book an available appointment for yourself",
        "description": "Derives identity/contact from authenticated account. Requires enabled public booking profile, chosen available slot and genuine contact consent. Cannot supply another client_id. Public booking response meeting_url is a secret invitation.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "201": {
            "description": "Success: Booked; 201 means created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Booked"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/accounts.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClientBook"
              }
            }
          }
        }
      }
    },
    "/client/bookings/{id}/cancel": {
      "post": {
        "operationId": "clientBookingCancel",
        "summary": "Cancel own scheduled appointment",
        "description": "Cancellation before notice deadline only (defaults 120 minutes). Affects only this appointment, not recurring series. Closes its invitation.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/accounts.ts"
      }
    },
    "/client/bookings/{id}/meeting": {
      "post": {
        "operationId": "clientBookingMeeting",
        "summary": "Get own appointment meeting invitation",
        "description": "Scheduled appointment and non-ended meeting required. Does not join media. Do not log the returned invitation.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: GuestLink",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GuestLink"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": false,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/accounts.ts"
      }
    },
    "/client/tasks": {
      "get": {
        "operationId": "clientTasksList",
        "summary": "List own client-visible tasks",
        "description": "Maximum 1000. No private tasks or underlying counselor notes.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Tasks",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tasks"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/collaboration.ts",
        "x-mira-list-limit": 1000
      }
    },
    "/client/tasks/{id}/complete": {
      "post": {
        "operationId": "clientTaskComplete",
        "summary": "Complete own pending client-visible task",
        "description": "Current version required. No client create/edit/delete task route.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/collaboration.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Version"
              }
            }
          }
        }
      }
    },
    "/client/email-preferences": {
      "get": {
        "operationId": "clientEmailRead",
        "summary": "Read reminder email preference",
        "description": "Enabling requires actual permission and consent_confirmed=true. Bound to current contact email; mismatched account email blocks client opt-in. Disabling needs no consent flag.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: EmailPermissionResult",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailPermissionResult"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/email.ts"
      },
      "put": {
        "operationId": "clientEmailUpdate",
        "summary": "Set reminder email permission",
        "description": "Enabling requires actual permission and consent_confirmed=true. Bound to current contact email; mismatched account email blocks client opt-in. Disabling needs no consent flag.",
        "tags": [
          "client"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/email.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailPermission"
              }
            }
          }
        }
      }
    },
    "/onboarding": {
      "get": {
        "operationId": "onboardingRead",
        "summary": "Read/update your setup checklist",
        "description": "Per-account checklist, not verification or authorization.",
        "tags": [
          "onboarding"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: OnboardingResult",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OnboardingResult"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/onboarding.ts"
      },
      "put": {
        "operationId": "onboardingUpdate",
        "summary": "Read/update your setup checklist",
        "description": "Per-account checklist, not verification or authorization.",
        "tags": [
          "onboarding"
        ],
        "security": [
          {
            "sessionBearer": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/onboarding.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Onboarding"
              }
            }
          }
        }
      }
    },
    "/meetings/{id}/join": {
      "post": {
        "operationId": "meetingJoin",
        "summary": "Obtain short-lived WebRTC signaling configuration",
        "description": "Counselor can use bearer alone for own room; this may create the booking session. Client/anonymous needs the invitation token in body, even with client bearer. Ticket expires in two minutes. Use stable per-tab UUID peer_id; joining checks two-person capacity. No media capture via REST.",
        "tags": [
          "meetings"
        ],
        "security": [
          {},
          {
            "sessionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: MeetingConfig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeetingConfig"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/meetings.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MeetingJoin"
              }
            }
          }
        }
      }
    },
    "/meetings/{id}/socket": {
      "get": {
        "operationId": "meetingSocket",
        "summary": "Upgrade a ticket-authenticated signaling WebSocket",
        "description": "NOT session bearer authentication. Upgrade: websocket; Sec-WebSocket-Protocol: mira, auth.<ticket>. Ticket came from meetingJoin. Real WebRTC browser transport required; no generic JSON GET. See meeting protocol guide.",
        "tags": [
          "meetings"
        ],
        "security": [
          {
            "meetingTicket": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "101": {
            "description": "WebSocket protocol upgrade"
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [
          "counselor",
          "client"
        ],
        "x-mira-public": false,
        "x-mira-human-approval": true,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/meetings.ts"
      }
    },
    "/auth/wechat/config": {
      "get": {
        "operationId": "wechatConfig",
        "summary": "Check WeChat login availability",
        "description": "Public.",
        "tags": [
          "auth"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: WeChatConfig",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WeChatConfig"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [],
        "x-mira-public": true,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/wechat.ts"
      }
    },
    "/public/{slug}": {
      "get": {
        "operationId": "publicProfile",
        "summary": "Read enabled public booking profile",
        "description": "Does not verify an email or confer account access.",
        "tags": [
          "public"
        ],
        "security": [],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: PublicProfile",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicProfile"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [],
        "x-mira-public": true,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/public-booking.ts"
      }
    },
    "/public/{slug}/slots": {
      "get": {
        "operationId": "publicSlots",
        "summary": "Read availability for a published consultation type",
        "description": "Date in profile timezone and published today/last_date window.",
        "tags": [
          "public"
        ],
        "security": [],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          },
          {
            "name": "type",
            "schema": {
              "type": "string"
            },
            "description": "Published type ID.",
            "required": true,
            "in": "query"
          },
          {
            "name": "date",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "Local YYYY-MM-DD.",
            "required": true,
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Success: Slots",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Slots"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [],
        "x-mira-public": true,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/public-booking.ts"
      }
    },
    "/public/{slug}/next": {
      "get": {
        "operationId": "publicNext",
        "summary": "Find next available appointment date",
        "description": "Searches up to 60 days per call. If none, use searched_until to choose another permitted window, bounded by last_date.",
        "tags": [
          "public"
        ],
        "security": [],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          },
          {
            "name": "type",
            "schema": {
              "type": "string"
            },
            "description": "Published type ID.",
            "required": true,
            "in": "query"
          },
          {
            "name": "from",
            "schema": {
              "type": "string",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "description": "Optional local YYYY-MM-DD; default today.",
            "required": false,
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Success: NextSlots",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextSlots"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [],
        "x-mira-public": true,
        "x-mira-human-approval": false,
        "x-mira-retry": "bounded-read",
        "x-mira-source": "worker/public-booking.ts"
      }
    },
    "/public/{slug}/book": {
      "post": {
        "operationId": "publicBookingCreate",
        "summary": "Book as a public visitor",
        "description": "No email verification; contact consent required. Authenticated client agents should use clientBookingCreate instead. 20 bookings/IP/counselor/hour. Meeting invitation returned. email_updates opts into generic appointment confirmations/changes/cancellations when workspace email is enabled, not reminders. Never claim delivery from the booking response.",
        "tags": [
          "public"
        ],
        "security": [],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "201": {
            "description": "Success: Booked; 201 means created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Booked"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [],
        "x-mira-public": true,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/public-booking.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicBook"
              }
            }
          }
        }
      }
    },
    "/public-bookings/{id}/cancel": {
      "post": {
        "operationId": "publicBookingCancel",
        "summary": "Cancel with appointment invitation capability",
        "description": "id is MEETING ID, not booking ID. Body token from meeting_url fragment. Scheduled status and notice deadline enforced.",
        "tags": [
          "public-bookings"
        ],
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "ID from an authorized API response; never guess identifiers."
          }
        ],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [],
        "x-mira-public": true,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/public-booking.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Token"
              }
            }
          }
        }
      }
    },
    "/email/unsubscribe": {
      "post": {
        "operationId": "emailUnsubscribe",
        "summary": "Disable reminders using signed preference capability",
        "description": "Token from preference link, not session/meeting token. Does not cancel bookings.",
        "tags": [
          "email"
        ],
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success: Ok",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ok"
                }
              }
            }
          },
          "400": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Failure; inspect {error}. Status semantics and safe retry rules are in the agent guide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-mira-roles": [],
        "x-mira-public": true,
        "x-mira-human-approval": true,
        "x-mira-retry": "reconcile-before-retry",
        "x-mira-source": "worker/email.ts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Unsubscribe"
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "sessionBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "opaque session token",
        "description": "24-hour session from login, never a JWT/API key. No refresh endpoint."
      },
      "meetingTicket": {
        "type": "apiKey",
        "in": "header",
        "name": "Sec-WebSocket-Protocol",
        "description": "mira, auth.<two-minute ticket>, with WebSocket Upgrade; not a session bearer."
      }
    },
    "schemas": {
      "AgentTokenCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "expires_in_days": {
            "default": 30,
            "type": "integer",
            "minimum": 1,
            "maximum": 90
          }
        },
        "required": [
          "name"
        ]
      },
      "PasswordResetRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          }
        },
        "required": [
          "email"
        ]
      },
      "PasswordReset": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 32,
            "maxLength": 128
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 256
          }
        },
        "required": [
          "token",
          "password"
        ]
      },
      "PracticeSignup": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "practice_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "timezone": {
            "type": "string",
            "maxLength": 80
          },
          "privacy_acknowledged": {
            "type": "boolean",
            "const": true
          },
          "authority_confirmed": {
            "type": "boolean",
            "const": true
          },
          "consent_version": {
            "type": "string",
            "const": "mira-practice-signup-v1"
          },
          "turnstile_token": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2048
          },
          "website": {
            "default": "",
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "name",
          "practice_name",
          "email",
          "timezone",
          "privacy_acknowledged",
          "authority_confirmed",
          "consent_version",
          "turnstile_token"
        ],
        "additionalProperties": false
      },
      "CompleteSignup": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 32,
            "maxLength": 128
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 256
          }
        },
        "required": [
          "token",
          "password"
        ],
        "additionalProperties": false
      },
      "Login": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "email",
          "password"
        ]
      },
      "Activation": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 32,
            "maxLength": 128
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 256
          }
        },
        "required": [
          "token",
          "password"
        ]
      },
      "PasswordChange": {
        "type": "object",
        "properties": {
          "current": {
            "type": "string",
            "maxLength": 256
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 256
          }
        },
        "required": [
          "current",
          "password"
        ]
      },
      "ClientCreate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254,
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "archived"
            ]
          }
        },
        "required": [
          "name",
          "email",
          "phone",
          "counselor_id",
          "status"
        ]
      },
      "ClientUpdate": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254,
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "phone": {
            "type": "string",
            "maxLength": 40
          },
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "archived"
            ]
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "name",
          "email",
          "phone",
          "counselor_id",
          "status",
          "version"
        ]
      },
      "BookingCreate": {
        "type": "object",
        "properties": {
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "location": {
            "type": "string",
            "maxLength": 500
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "completed",
              "canceled",
              "no_show"
            ]
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "consultation_type_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "client_id",
          "counselor_id",
          "starts_at",
          "ends_at",
          "location",
          "status"
        ]
      },
      "BookingUpdate": {
        "type": "object",
        "properties": {
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "location": {
            "type": "string",
            "maxLength": 500
          },
          "status": {
            "type": "string",
            "enum": [
              "scheduled",
              "completed",
              "canceled",
              "no_show"
            ]
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "consultation_type_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "client_id",
          "counselor_id",
          "starts_at",
          "ends_at",
          "location",
          "status",
          "version"
        ]
      },
      "SessionCreate": {
        "type": "object",
        "properties": {
          "booking_id": {
            "type": "string",
            "minLength": 1
          },
          "title": {
            "default": "",
            "type": "string",
            "maxLength": 120
          }
        },
        "required": [
          "booking_id"
        ]
      },
      "SessionUpdate": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 120
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "completed"
            ]
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "title",
          "status",
          "version"
        ]
      },
      "NoteCreate": {
        "type": "object",
        "properties": {
          "title": {
            "default": "",
            "type": "string",
            "maxLength": 120
          },
          "content": {
            "type": "string",
            "maxLength": 12000
          }
        },
        "required": [
          "content"
        ]
      },
      "NoteUpdate": {
        "type": "object",
        "properties": {
          "title": {
            "default": "",
            "type": "string",
            "maxLength": 120
          },
          "content": {
            "type": "string",
            "maxLength": 12000
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "content",
          "version"
        ]
      },
      "Version": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "version"
        ]
      },
      "SessionTask": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "due_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "note_id": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "client_visible": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "title",
          "due_at"
        ]
      },
      "FollowupBooking": {
        "type": "object",
        "properties": {
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "consultation_type_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "location": {
            "default": "",
            "type": "string",
            "maxLength": 500
          },
          "recurrence": {
            "default": null,
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "frequency": {
                    "type": "string",
                    "enum": [
                      "daily",
                      "weekly",
                      "monthly"
                    ]
                  },
                  "interval": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12
                  },
                  "count": {
                    "type": "integer",
                    "minimum": 2,
                    "maximum": 12
                  }
                },
                "required": [
                  "frequency",
                  "interval",
                  "count"
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "starts_at",
          "ends_at"
        ]
      },
      "BookingSettings": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "slug": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{2,63}$"
          },
          "display_name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "bio": {
            "default": "",
            "type": "string",
            "maxLength": 1000
          },
          "timezone": {
            "type": "string",
            "maxLength": 80
          },
          "enabled": {
            "type": "boolean"
          },
          "slot_step": {
            "type": "integer",
            "minimum": 5,
            "maximum": 60
          },
          "min_notice_minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 20160
          },
          "max_ahead_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "max_daily": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "meeting_early_minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1440
          },
          "meeting_late_minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1440
          },
          "pipeline_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "counselor_id",
          "slug",
          "display_name",
          "timezone",
          "enabled",
          "slot_step",
          "min_notice_minutes",
          "max_ahead_days",
          "max_daily",
          "meeting_early_minutes",
          "meeting_late_minutes"
        ]
      },
      "Ids": {
        "type": "object",
        "properties": {
          "ids": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "ids"
        ]
      },
      "Message": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          }
        },
        "required": [
          "content"
        ]
      },
      "ClientBook": {
        "type": "object",
        "properties": {
          "type_id": {
            "type": "string",
            "minLength": 1
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "contact_consent": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "type_id",
          "starts_at",
          "contact_consent"
        ]
      },
      "PublicBook": {
        "type": "object",
        "properties": {
          "type_id": {
            "type": "string",
            "minLength": 1
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "phone": {
            "default": "",
            "type": "string",
            "maxLength": 40
          },
          "contact_consent": {
            "type": "boolean",
            "const": true
          },
          "email_updates": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "type_id",
          "starts_at",
          "name",
          "email",
          "contact_consent"
        ]
      },
      "EmailPermission": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "booking_updates": {
            "type": "boolean"
          },
          "portal_updates": {
            "type": "boolean"
          },
          "consent_confirmed": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ]
      },
      "ReminderPreferences": {
        "type": "object",
        "properties": {
          "client_minutes": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10080
            }
          },
          "counselor_minutes": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 10080
            }
          },
          "counselor_enabled": {
            "type": "boolean"
          },
          "booking_updates": {
            "type": "boolean"
          },
          "portal_updates": {
            "type": "boolean"
          }
        },
        "required": [
          "client_minutes",
          "counselor_minutes",
          "counselor_enabled"
        ]
      },
      "Reminder": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "audience": {
            "type": "string",
            "enum": [
              "client",
              "counselor"
            ]
          },
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "due_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "label",
          "audience",
          "due_at"
        ]
      },
      "SendInvitation": {
        "type": "object",
        "properties": {
          "send_email": {
            "default": false,
            "type": "boolean"
          }
        }
      },
      "Onboarding": {
        "type": "object",
        "properties": {
          "step": {
            "type": "string",
            "enum": [
              "security",
              "privacy",
              "profile",
              "availability",
              "team",
              "test-booking",
              "portal",
              "landing-dismissed"
            ]
          },
          "completed": {
            "type": "boolean"
          }
        },
        "required": [
          "step",
          "completed"
        ]
      },
      "DocumentCreate": {
        "type": "object",
        "properties": {
          "upload_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 150
          },
          "bytes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 10485760
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "require_signature": {
            "default": false,
            "type": "boolean"
          },
          "cloud_consent": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "title",
          "filename",
          "bytes",
          "sha256",
          "cloud_consent"
        ]
      },
      "DocumentUpdate": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "require_signature": {
            "type": "boolean"
          }
        },
        "required": [
          "version",
          "require_signature"
        ]
      },
      "DocumentSign": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "original_sha256": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "consent": {
            "type": "boolean",
            "const": true
          },
          "consent_version": {
            "type": "string",
            "const": "mira-electronic-consent-v1"
          }
        },
        "required": [
          "version",
          "original_sha256",
          "name",
          "password",
          "consent",
          "consent_version"
        ]
      },
      "MeetingJoin": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "maxLength": 128
          },
          "peer_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        }
      },
      "Token": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 32,
            "maxLength": 128
          }
        },
        "required": [
          "token"
        ]
      },
      "Unsubscribe": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "minLength": 20,
            "maxLength": 2000
          }
        },
        "required": [
          "token"
        ]
      },
      "RecordingCreate": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "consent_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "duration_ms": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 7200000
          },
          "parts": {
            "minItems": 1,
            "maxItems": 60,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 59
                },
                "offset_ms": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "duration_ms": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 120000
                },
                "bytes": {
                  "type": "integer",
                  "minimum": 44,
                  "maximum": 8000000
                }
              },
              "required": [
                "index",
                "offset_ms",
                "duration_ms",
                "bytes"
              ]
            }
          },
          "cloud_consent": {
            "type": "boolean",
            "const": true
          },
          "retain_audio": {
            "default": false,
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "started_at",
          "consent_at",
          "duration_ms",
          "parts",
          "cloud_consent"
        ]
      },
      "Transcribe": {
        "type": "object",
        "properties": {
          "cloud_consent": {
            "type": "boolean",
            "const": true
          },
          "provider": {
            "type": "string"
          }
        },
        "required": [
          "cloud_consent",
          "provider"
        ]
      },
      "Analysis": {
        "type": "object",
        "properties": {
          "recording_id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "cloud_consent": {
            "type": "boolean",
            "const": true
          },
          "provider": {
            "type": "string"
          }
        },
        "required": [
          "recording_id",
          "cloud_consent",
          "provider"
        ]
      },
      "ActionUpdate": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "approved",
              "done",
              "dismissed"
            ]
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "status",
          "version"
        ]
      },
      "WeChatCode": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 5,
            "maxLength": 1024
          }
        },
        "required": [
          "code"
        ]
      },
      "WeChatLink": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 5,
            "maxLength": 1024
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "code",
          "password"
        ]
      },
      "WeChatUnlink": {
        "type": "object",
        "properties": {
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "password"
        ]
      },
      "ConsultationTypesCreate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "duration_minutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 240
          },
          "buffer_before": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 120
          },
          "buffer_after": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 120
          },
          "description": {
            "default": "",
            "type": "string",
            "maxLength": 1000
          },
          "fee_cents": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "default": "USD",
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "status": {
            "default": "active",
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          }
        },
        "required": [
          "counselor_id",
          "name",
          "duration_minutes"
        ]
      },
      "ConsultationTypesUpdate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "duration_minutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 240
          },
          "buffer_before": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 120
          },
          "buffer_after": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 120
          },
          "description": {
            "default": "",
            "type": "string",
            "maxLength": 1000
          },
          "fee_cents": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "default": "USD",
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "status": {
            "default": "active",
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          }
        },
        "required": [
          "counselor_id",
          "version",
          "name",
          "duration_minutes"
        ]
      },
      "AvailabilityRulesCreate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "consultation_type_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "weekday": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6
          },
          "opens_at": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          },
          "closes_at": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          }
        },
        "required": [
          "counselor_id",
          "weekday",
          "opens_at",
          "closes_at"
        ]
      },
      "AvailabilityRulesUpdate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "consultation_type_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "weekday": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6
          },
          "opens_at": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          },
          "closes_at": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          }
        },
        "required": [
          "counselor_id",
          "version",
          "weekday",
          "opens_at",
          "closes_at"
        ]
      },
      "DateOverridesCreate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "day": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "is_closed": {
            "type": "boolean"
          },
          "opens_at": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
              },
              {
                "type": "null"
              }
            ]
          },
          "closes_at": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "counselor_id",
          "day",
          "is_closed"
        ]
      },
      "DateOverridesUpdate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "day": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "is_closed": {
            "type": "boolean"
          },
          "opens_at": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
              },
              {
                "type": "null"
              }
            ]
          },
          "closes_at": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "counselor_id",
          "version",
          "day",
          "is_closed"
        ]
      },
      "BlockedTimesCreate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "label": {
            "default": "",
            "type": "string",
            "maxLength": 120
          }
        },
        "required": [
          "counselor_id",
          "starts_at",
          "ends_at"
        ]
      },
      "BlockedTimesUpdate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "label": {
            "default": "",
            "type": "string",
            "maxLength": 120
          }
        },
        "required": [
          "counselor_id",
          "version",
          "starts_at",
          "ends_at"
        ]
      },
      "CrmPipelinesCreate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "status": {
            "default": "active",
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "booking_stage_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "session_stage_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "counselor_id",
          "name"
        ]
      },
      "CrmPipelinesUpdate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "status": {
            "default": "active",
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "booking_stage_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "session_stage_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "counselor_id",
          "version",
          "name"
        ]
      },
      "CrmStagesCreate": {
        "type": "object",
        "properties": {
          "pipeline_id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "probability": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "is_won": {
            "default": false,
            "type": "boolean"
          },
          "is_lost": {
            "default": false,
            "type": "boolean"
          },
          "status": {
            "default": "active",
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "pipeline_id",
          "name",
          "position",
          "probability"
        ]
      },
      "CrmStagesUpdate": {
        "type": "object",
        "properties": {
          "pipeline_id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "probability": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "is_won": {
            "default": false,
            "type": "boolean"
          },
          "is_lost": {
            "default": false,
            "type": "boolean"
          },
          "status": {
            "default": "active",
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "pipeline_id",
          "name",
          "position",
          "probability",
          "version"
        ]
      },
      "CrmOpportunitiesCreate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "pipeline_id": {
            "type": "string",
            "minLength": 1
          },
          "stage_id": {
            "type": "string",
            "minLength": 1
          },
          "consultation_type_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "value_cents": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "currency": {
            "default": "USD",
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "source": {
            "default": "manual",
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          }
        },
        "required": [
          "counselor_id",
          "client_id",
          "pipeline_id",
          "stage_id",
          "title"
        ]
      },
      "CrmOpportunitiesUpdate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "pipeline_id": {
            "type": "string",
            "minLength": 1
          },
          "stage_id": {
            "type": "string",
            "minLength": 1
          },
          "consultation_type_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "value_cents": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "currency": {
            "default": "USD",
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "source": {
            "default": "manual",
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          }
        },
        "required": [
          "counselor_id",
          "version",
          "client_id",
          "pipeline_id",
          "stage_id",
          "title"
        ]
      },
      "CrmActivitiesCreate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "opportunity_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "default": "note",
            "type": "string",
            "enum": [
              "note",
              "call",
              "email",
              "meeting",
              "message"
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "content": {
            "default": "",
            "type": "string",
            "maxLength": 5000
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "counselor_id",
          "client_id",
          "title",
          "occurred_at"
        ]
      },
      "CrmActivitiesUpdate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "opportunity_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "default": "note",
            "type": "string",
            "enum": [
              "note",
              "call",
              "email",
              "meeting",
              "message"
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "content": {
            "default": "",
            "type": "string",
            "maxLength": 5000
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "counselor_id",
          "version",
          "client_id",
          "title",
          "occurred_at"
        ]
      },
      "CrmFollowupsCreate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "opportunity_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "due_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "status": {
            "default": "pending",
            "type": "string",
            "enum": [
              "pending",
              "done",
              "dismissed"
            ]
          },
          "client_visible": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "number",
                "const": 0
              },
              {
                "type": "number",
                "const": 1
              }
            ]
          }
        },
        "required": [
          "counselor_id",
          "client_id",
          "title",
          "due_at"
        ]
      },
      "CrmFollowupsUpdate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "opportunity_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "due_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "status": {
            "default": "pending",
            "type": "string",
            "enum": [
              "pending",
              "done",
              "dismissed"
            ]
          },
          "client_visible": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "number",
                "const": 0
              },
              {
                "type": "number",
                "const": 1
              }
            ]
          }
        },
        "required": [
          "counselor_id",
          "version",
          "client_id",
          "title",
          "due_at"
        ]
      },
      "CrmTagsCreate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "color": {
            "default": "#c7ee82",
            "type": "string",
            "pattern": "^#[a-f0-9]{6}$"
          }
        },
        "required": [
          "counselor_id",
          "name"
        ]
      },
      "CrmTagsUpdate": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "color": {
            "default": "#c7ee82",
            "type": "string",
            "pattern": "^#[a-f0-9]{6}$"
          }
        },
        "required": [
          "counselor_id",
          "version",
          "name"
        ]
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": true
      },
      "Ok": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true,
            "type": "boolean"
          }
        },
        "required": [
          "ok"
        ],
        "additionalProperties": true
      },
      "User": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "counselor",
              "receptionist",
              "supervisor",
              "client"
            ]
          },
          "timezone": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "supervised_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "practice_owner": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "workspace_id",
          "name",
          "email",
          "role",
          "timezone"
        ],
        "additionalProperties": true
      },
      "LoginResult": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "Secret opaque 24-hour session credential. Never log or include in prompts."
          },
          "user": {
            "$ref": "#/components/schemas/User"
          }
        },
        "required": [
          "token",
          "user"
        ],
        "additionalProperties": true
      },
      "SignupConfig": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "turnstile_site_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "consent_version": {
            "type": "string"
          }
        },
        "required": [
          "enabled",
          "turnstile_site_key",
          "consent_version"
        ],
        "additionalProperties": true
      },
      "SignupRequestResult": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true,
            "type": "boolean"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "message"
        ],
        "additionalProperties": true
      },
      "SignupResult": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "Secret session credential after verified signup. Never log."
          },
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "workspace": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": true
          },
          "practice_owner": {
            "const": true,
            "type": "boolean"
          }
        },
        "required": [
          "token",
          "user",
          "workspace",
          "practice_owner"
        ],
        "additionalProperties": true
      },
      "SessionToken": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "Secret current session credential. Store outside model context."
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "token",
          "expires_at"
        ],
        "additionalProperties": true
      },
      "AgentToken": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "created_at",
          "expires_at",
          "last_used_at"
        ],
        "additionalProperties": true
      },
      "AgentTokenList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentToken"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "AgentTokenCreated": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "description": "Secret shown only in this creation response; stored hashed on the server. Never log."
          },
          "item": {
            "$ref": "#/components/schemas/AgentToken"
          }
        },
        "required": [
          "token",
          "item"
        ],
        "additionalProperties": true
      },
      "Identity": {
        "type": "object",
        "properties": {
          "user": {
            "$ref": "#/components/schemas/User"
          },
          "workspace": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": true
          }
        },
        "required": [
          "user",
          "workspace"
        ],
        "additionalProperties": true
      },
      "Client": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "counselor_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "status": {
            "enum": [
              "active",
              "paused",
              "archived"
            ]
          },
          "version": {
            "type": "integer"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "Booking": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "counselor_id": {
            "type": "string"
          },
          "starts_at": {
            "type": "string"
          },
          "ends_at": {
            "type": "string"
          },
          "status": {
            "enum": [
              "scheduled",
              "completed",
              "canceled",
              "no_show"
            ]
          },
          "location": {
            "type": "string"
          },
          "consultation_type_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "version": {
            "type": "integer"
          },
          "series_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "Counselor": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "cal_username": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "Session": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "booking_id": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "counselor_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "completed"
            ]
          },
          "version": {
            "type": "integer"
          },
          "starts_at": {
            "type": "string"
          },
          "ends_at": {
            "type": "string"
          },
          "note_count": {
            "type": "integer"
          },
          "number": {
            "type": "integer"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "Note": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "source": {
            "enum": [
              "manual",
              "ai"
            ]
          },
          "review_status": {
            "enum": [
              "draft",
              "reviewed"
            ]
          },
          "author_name": {
            "type": "string"
          },
          "editor_name": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "Document": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "bytes": {
            "type": "integer"
          },
          "original_sha256": {
            "type": "string"
          },
          "signed_sha256": {
            "type": [
              "string",
              "null"
            ]
          },
          "require_signature": {
            "type": [
              "integer",
              "boolean"
            ]
          },
          "status": {
            "enum": [
              "uploading",
              "shared",
              "signed",
              "revoked"
            ]
          },
          "version": {
            "type": "integer"
          },
          "uploader_id": {
            "type": "string"
          },
          "can_resume": {
            "type": "boolean"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "MessageRow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "sender_id": {
            "type": "string"
          },
          "sender_role": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "Task": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "due_at": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "done",
              "dismissed"
            ]
          },
          "version": {
            "type": "integer"
          },
          "client_visible": {
            "type": [
              "integer",
              "boolean"
            ]
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "Recording": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "started_at": {
            "type": "string"
          },
          "consent_at": {
            "type": "string"
          },
          "cloud_consent_at": {
            "type": "string"
          },
          "duration_ms": {
            "type": "integer"
          },
          "part_count": {
            "type": "integer"
          },
          "retain_audio": {
            "type": [
              "integer",
              "boolean"
            ]
          },
          "status": {
            "enum": [
              "uploading",
              "ready",
              "transcribed",
              "deleted"
            ]
          },
          "audio_deleted_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "transcript_key": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "RecordingPart": {
        "type": "object",
        "properties": {
          "part_index": {
            "type": "integer"
          },
          "offset_ms": {
            "type": "integer"
          },
          "duration_ms": {
            "type": "integer"
          },
          "bytes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "status": {
            "enum": [
              "pending",
              "uploading",
              "uploaded",
              "processing",
              "transcribed",
              "failed"
            ]
          }
        },
        "required": [
          "part_index",
          "offset_ms",
          "duration_ms",
          "status"
        ],
        "additionalProperties": true
      },
      "Action": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "session_id": {
            "type": "string"
          },
          "ai_run_id": {
            "type": "string"
          },
          "content": {
            "type": "string"
          },
          "status": {
            "enum": [
              "proposed",
              "approved",
              "done",
              "dismissed"
            ]
          },
          "version": {
            "type": "integer"
          },
          "reviewed_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "reviewed_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "ScheduledReminder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "audience": {
            "enum": [
              "client",
              "counselor"
            ]
          },
          "client_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "due_at": {
            "type": "integer",
            "description": "Unix epoch milliseconds."
          },
          "status": {
            "enum": [
              "pending",
              "canceled",
              "sent",
              "skipped",
              "failed",
              "expired"
            ]
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "EmailActivity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "event": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "enum": [
              "pending",
              "processing",
              "accepted",
              "failed",
              "skipped"
            ]
          },
          "delivery": {
            "type": [
              "string",
              "null"
            ]
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "created_at": {
            "type": "integer",
            "description": "Epoch milliseconds."
          },
          "accepted_at": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "InvitationStatus": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "client",
              "staff"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ]
          },
          "expires_at": {
            "type": [
              "integer",
              "null"
            ]
          },
          "status": {
            "enum": [
              "pending",
              "activated",
              "expired",
              "revoked"
            ]
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "PublicConsultation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "duration_minutes": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "fee_cents": {
            "type": [
              "integer",
              "null"
            ]
          },
          "currency": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "PublicBookingProfile": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "bio": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "max_ahead_days": {
            "type": "integer"
          },
          "min_notice_minutes": {
            "type": "integer"
          },
          "today": {
            "type": "string"
          },
          "last_date": {
            "type": "string"
          }
        },
        "required": [
          "slug",
          "display_name",
          "bio",
          "timezone",
          "max_ahead_days",
          "min_notice_minutes",
          "today",
          "last_date"
        ],
        "additionalProperties": true
      },
      "Slot": {
        "type": "object",
        "properties": {
          "starts_at": {
            "type": "string"
          },
          "ends_at": {
            "type": "string"
          },
          "label": {
            "type": "string"
          }
        },
        "required": [
          "starts_at",
          "ends_at",
          "label"
        ],
        "additionalProperties": true
      },
      "DashboardBooking": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "starts_at": {
            "type": "string"
          },
          "ends_at": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "series_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "counselor_name": {
            "type": "string"
          },
          "consultation": {
            "type": [
              "string",
              "null"
            ]
          },
          "meeting_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "ended_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "Record": {
        "type": "object",
        "additionalProperties": true,
        "description": "Resource row. Server-generated metadata may be added; do not send it back as an update."
      },
      "Records": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "Tasks": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Task"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "Messages": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageRow"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "Documents": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Document"
            }
          },
          "consent_text": {
            "type": "string"
          },
          "consent_version": {
            "type": "string"
          }
        },
        "required": [
          "items",
          "consent_text",
          "consent_version"
        ],
        "additionalProperties": true
      },
      "DocumentResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/Document"
          },
          "already_uploaded": {
            "type": "boolean"
          },
          "already_signed": {
            "type": "boolean"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "DocumentEvents": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          },
          "signature": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Record"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "signature"
        ],
        "additionalProperties": true
      },
      "Dashboard": {
        "type": "object",
        "properties": {
          "client": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              },
              "phone": {
                "type": "string"
              },
              "counselor_id": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "email",
              "phone",
              "counselor_id"
            ],
            "additionalProperties": true
          },
          "bookings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardBooking"
            }
          },
          "profile": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "display_name": {
                    "type": "string"
                  },
                  "timezone": {
                    "type": "string"
                  }
                },
                "required": [
                  "slug",
                  "display_name",
                  "timezone"
                ],
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "client",
          "bookings",
          "profile"
        ],
        "additionalProperties": true
      },
      "ClientHistory": {
        "type": "object",
        "properties": {
          "client": {
            "$ref": "#/components/schemas/Client"
          },
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Session"
            }
          },
          "bookings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Booking"
            }
          }
        },
        "required": [
          "client",
          "sessions",
          "bookings"
        ],
        "additionalProperties": true
      },
      "Journey": {
        "type": "object",
        "properties": {
          "opportunities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          },
          "activities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          },
          "followups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Task"
            }
          },
          "history": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          },
          "consultation_types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          }
        },
        "required": [
          "opportunities",
          "activities",
          "followups",
          "history",
          "tags",
          "consultation_types"
        ],
        "additionalProperties": true
      },
      "BookingSettingsResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/Record"
          },
          "public_url": {
            "type": "string"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "SeriesResult": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          },
          "series_id": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "items",
          "series_id"
        ],
        "additionalProperties": true
      },
      "AccountResult": {
        "type": "object",
        "properties": {
          "account": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  }
                },
                "required": [
                  "email",
                  "status"
                ],
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "account"
        ],
        "additionalProperties": true
      },
      "InvitationResult": {
        "type": "object",
        "properties": {
          "invitation_url": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "expires_in_hours": {
            "type": "integer"
          },
          "email_queued": {
            "type": "boolean"
          }
        },
        "required": [
          "invitation_url",
          "email",
          "expires_in_hours",
          "email_queued"
        ],
        "additionalProperties": true
      },
      "EmailPermissionResult": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "booking_updates": {
            "type": "boolean"
          },
          "portal_updates": {
            "type": "boolean"
          },
          "email": {
            "type": "string"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "enabled",
          "booking_updates",
          "portal_updates",
          "email",
          "updated_at"
        ],
        "additionalProperties": true
      },
      "ReminderPreferencesResult": {
        "type": "object",
        "properties": {
          "client_minutes": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "counselor_minutes": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "counselor_enabled": {
            "type": "boolean"
          },
          "booking_updates": {
            "type": "boolean"
          },
          "portal_updates": {
            "type": "boolean"
          },
          "sending_enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "client_minutes",
          "counselor_minutes",
          "counselor_enabled",
          "booking_updates",
          "portal_updates",
          "sending_enabled"
        ],
        "additionalProperties": true
      },
      "OnboardingResult": {
        "type": "object",
        "properties": {
          "completed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "completed"
        ],
        "additionalProperties": true
      },
      "CreatedId": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id"
        ],
        "additionalProperties": true
      },
      "MeetingLink": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "host_url": {
            "type": "string"
          },
          "guest_url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "host_url",
          "guest_url"
        ],
        "additionalProperties": true
      },
      "GuestLink": {
        "type": "object",
        "properties": {
          "guest_url": {
            "type": "string"
          }
        },
        "required": [
          "guest_url"
        ],
        "additionalProperties": true
      },
      "MeetingConfig": {
        "type": "object",
        "properties": {
          "room_id": {
            "type": "string"
          },
          "peer_id": {
            "type": "string"
          },
          "booking_id": {
            "type": "string"
          },
          "role": {
            "enum": [
              "host",
              "guest"
            ]
          },
          "session_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "host_name": {
            "type": "string"
          },
          "starts_at": {
            "type": "string"
          },
          "ticket": {
            "type": "string"
          },
          "ice_servers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          },
          "relay_configured": {
            "type": "boolean"
          }
        },
        "required": [
          "room_id",
          "peer_id",
          "booking_id",
          "role",
          "session_id",
          "host_name",
          "starts_at",
          "ticket",
          "ice_servers",
          "relay_configured"
        ],
        "additionalProperties": true
      },
      "PublicProfile": {
        "type": "object",
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/PublicBookingProfile"
          },
          "types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicConsultation"
            }
          },
          "weekly_hours": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "weekday": {
                  "type": "integer"
                },
                "opens_at": {
                  "type": "string"
                },
                "closes_at": {
                  "type": "string"
                },
                "consultation_type_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "weekday",
                "opens_at",
                "closes_at",
                "consultation_type_id"
              ],
              "additionalProperties": true
            }
          }
        },
        "required": [
          "profile",
          "types",
          "weekly_hours"
        ],
        "additionalProperties": true
      },
      "Slots": {
        "type": "object",
        "properties": {
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Slot"
            }
          },
          "timezone": {
            "type": "string"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "slots",
          "timezone",
          "reason"
        ],
        "additionalProperties": true
      },
      "NextSlots": {
        "type": "object",
        "properties": {
          "date": {
            "type": [
              "string",
              "null"
            ]
          },
          "slots": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Slot"
            }
          },
          "timezone": {
            "type": "string"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "searched_until": {
            "type": "string"
          }
        },
        "required": [
          "date",
          "slots",
          "timezone",
          "reason"
        ],
        "additionalProperties": true
      },
      "Booked": {
        "type": "object",
        "properties": {
          "booking_id": {
            "type": "string"
          },
          "starts_at": {
            "type": "string"
          },
          "ends_at": {
            "type": "string"
          },
          "consultation": {
            "type": "string"
          },
          "timezone": {
            "type": "string"
          },
          "meeting_url": {
            "type": "string"
          }
        },
        "required": [
          "booking_id",
          "starts_at",
          "ends_at",
          "consultation",
          "timezone",
          "meeting_url"
        ],
        "additionalProperties": true
      },
      "AudioConfig": {
        "type": "object",
        "properties": {
          "storage": {
            "type": "boolean"
          },
          "transcription": {
            "type": "boolean"
          },
          "ai": {
            "type": "boolean"
          },
          "transcription_provider": {
            "type": [
              "string",
              "null"
            ]
          },
          "ai_provider": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "storage",
          "transcription",
          "ai",
          "transcription_provider",
          "ai_provider"
        ],
        "additionalProperties": true
      },
      "RecordingResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/Recording"
          },
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RecordingPart"
            }
          }
        },
        "required": [
          "item",
          "parts"
        ],
        "additionalProperties": true
      },
      "Recordings": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Recording"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "Actions": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Action"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "Reminders": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduledReminder"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "Deliveries": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailActivity"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "Invitations": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvitationStatus"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "Transcript": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "start": {
                  "type": "number"
                },
                "end": {
                  "type": "number"
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "start",
                "end",
                "text"
              ],
              "additionalProperties": true
            }
          }
        },
        "required": [
          "text"
        ],
        "additionalProperties": true
      },
      "AnalysisResult": {
        "type": "object",
        "properties": {
          "ok": {
            "const": true
          },
          "run_id": {
            "type": "string"
          }
        },
        "required": [
          "ok",
          "run_id"
        ],
        "additionalProperties": true
      },
      "WeChatConfig": {
        "type": "object",
        "properties": {
          "configured": {
            "type": "boolean"
          }
        },
        "required": [
          "configured"
        ],
        "additionalProperties": true
      },
      "WeChatStatus": {
        "type": "object",
        "properties": {
          "configured": {
            "type": "boolean"
          },
          "linked": {
            "type": "boolean"
          },
          "linked_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "configured",
          "linked",
          "linked_at"
        ],
        "additionalProperties": true
      },
      "Metrics": {
        "type": "object",
        "additionalProperties": true,
        "description": "total, won, lost, open, conversion_rate, closed_win_rate, average_conversion_days, revenue_cents and weighted_pipeline_cents maps by currency, stages counts, due_followups."
      },
      "ClientResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/Client"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "ClientList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Client"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "BookingResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/Booking"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "BookingList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Booking"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "CounselorResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/Counselor"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "CounselorList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Counselor"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "SessionResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/Session"
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Note"
            }
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "SessionList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Session"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "NoteResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/Note"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "NoteList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Note"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "RecordResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/Record"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "RecordList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Record"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "ConsultationTypesRow": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "duration_minutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 240
          },
          "buffer_before": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 120
          },
          "buffer_after": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 120
          },
          "description": {
            "default": "",
            "type": "string",
            "maxLength": 1000
          },
          "fee_cents": {
            "default": null,
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "default": "USD",
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "status": {
            "default": "active",
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "workspace_id",
          "version"
        ],
        "additionalProperties": true
      },
      "ConsultationTypesResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/ConsultationTypesRow"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "ConsultationTypesList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsultationTypesRow"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "AvailabilityRulesRow": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer"
          },
          "consultation_type_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "weekday": {
            "type": "integer",
            "minimum": 0,
            "maximum": 6
          },
          "opens_at": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          },
          "closes_at": {
            "type": "string",
            "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
          },
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "workspace_id",
          "version"
        ],
        "additionalProperties": true
      },
      "AvailabilityRulesResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/AvailabilityRulesRow"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "AvailabilityRulesList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AvailabilityRulesRow"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "DateOverridesRow": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer"
          },
          "day": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "is_closed": {
            "type": [
              "integer",
              "boolean"
            ],
            "description": "Database responses may encode booleans as 0/1."
          },
          "opens_at": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
              },
              {
                "type": "null"
              }
            ]
          },
          "closes_at": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "pattern": "^([01]\\d|2[0-3]):[0-5]\\d$"
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "workspace_id",
          "version"
        ],
        "additionalProperties": true
      },
      "DateOverridesResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/DateOverridesRow"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "DateOverridesList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DateOverridesRow"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "BlockedTimesRow": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer"
          },
          "starts_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "ends_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "label": {
            "default": "",
            "type": "string",
            "maxLength": 120
          },
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "workspace_id",
          "version"
        ],
        "additionalProperties": true
      },
      "BlockedTimesResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/BlockedTimesRow"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "BlockedTimesList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BlockedTimesRow"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "CrmPipelinesRow": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "status": {
            "default": "active",
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "booking_stage_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "session_stage_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "workspace_id",
          "version"
        ],
        "additionalProperties": true
      },
      "CrmPipelinesResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/CrmPipelinesRow"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "CrmPipelinesList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrmPipelinesRow"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "CrmStagesRow": {
        "type": "object",
        "properties": {
          "pipeline_id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "position": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "probability": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "is_won": {
            "type": [
              "integer",
              "boolean"
            ],
            "description": "Database responses may encode booleans as 0/1."
          },
          "is_lost": {
            "type": [
              "integer",
              "boolean"
            ],
            "description": "Database responses may encode booleans as 0/1."
          },
          "status": {
            "default": "active",
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "version": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "workspace_id",
          "version"
        ],
        "additionalProperties": true
      },
      "CrmStagesResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/CrmStagesRow"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "CrmStagesList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrmStagesRow"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "CrmOpportunitiesRow": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer"
          },
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "pipeline_id": {
            "type": "string",
            "minLength": 1
          },
          "stage_id": {
            "type": "string",
            "minLength": 1
          },
          "consultation_type_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "value_cents": {
            "default": 0,
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "currency": {
            "default": "USD",
            "type": "string",
            "pattern": "^[A-Z]{3}$"
          },
          "source": {
            "default": "manual",
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "workspace_id",
          "version"
        ],
        "additionalProperties": true
      },
      "CrmOpportunitiesResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/CrmOpportunitiesRow"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "CrmOpportunitiesList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrmOpportunitiesRow"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "CrmActivitiesRow": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer"
          },
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "opportunity_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "kind": {
            "default": "note",
            "type": "string",
            "enum": [
              "note",
              "call",
              "email",
              "meeting",
              "message"
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "content": {
            "default": "",
            "type": "string",
            "maxLength": 5000
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "workspace_id",
          "version"
        ],
        "additionalProperties": true
      },
      "CrmActivitiesResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/CrmActivitiesRow"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "CrmActivitiesList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrmActivitiesRow"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "CrmFollowupsRow": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer"
          },
          "client_id": {
            "type": "string",
            "minLength": 1
          },
          "opportunity_id": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "due_at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "status": {
            "default": "pending",
            "type": "string",
            "enum": [
              "pending",
              "done",
              "dismissed"
            ]
          },
          "client_visible": {
            "type": [
              "integer",
              "boolean"
            ],
            "description": "Database responses may encode booleans as 0/1."
          },
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "workspace_id",
          "version"
        ],
        "additionalProperties": true
      },
      "CrmFollowupsResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/CrmFollowupsRow"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "CrmFollowupsList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrmFollowupsRow"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      },
      "CrmTagsRow": {
        "type": "object",
        "properties": {
          "counselor_id": {
            "type": "string",
            "minLength": 1
          },
          "version": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "color": {
            "default": "#c7ee82",
            "type": "string",
            "pattern": "^#[a-f0-9]{6}$"
          },
          "id": {
            "type": "string"
          },
          "workspace_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "workspace_id",
          "version"
        ],
        "additionalProperties": true
      },
      "CrmTagsResult": {
        "type": "object",
        "properties": {
          "item": {
            "$ref": "#/components/schemas/CrmTagsRow"
          }
        },
        "required": [
          "item"
        ],
        "additionalProperties": true
      },
      "CrmTagsList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrmTagsRow"
            }
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": true
      }
    }
  },
  "externalDocs": {
    "url": "/agent-guide.md",
    "description": "Read workflows, safety boundaries and limitations before execution."
  }
}
