{
  "openapi": "3.1.0",
  "info": {
    "title": "CRAD public website integration API",
    "version": "1.0.0",
    "description": "Public HTTP contract. Deployment, external grants and provider readiness must be checked on the configured endpoint; this local package does not announce activation."
  },
  "servers": [
    {
      "url": "https://api.crad.ai",
      "description": "Official CRAD API. Each key requires explicit permissions; availability and booking readiness remain business-specific."
    }
  ],
  "paths": {
    "/v1/sites/{siteId}/catalog": {
      "get": {
        "operationId": "get_sites_by_siteId_catalog",
        "summary": "Published catalog and capabilities",
        "description": "Anonymous reads are supported. If Authorization supplies a credential-bound customer session, its bound credential must still be valid and include bookings:write:customer; a customers:write-only bound session is not sufficient.",
        "security": [],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Catalog"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/capabilities": {
      "get": {
        "operationId": "get_sites_by_siteId_capabilities",
        "summary": "Published capabilities",
        "description": "Anonymous reads are supported. If Authorization supplies a credential-bound customer session, its bound credential must still be valid and include bookings:write:customer; a customers:write-only bound session is not sufficient.",
        "security": [],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Capabilities"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/sessions": {
      "post": {
        "operationId": "post_sites_by_siteId_sessions",
        "summary": "Create anonymous visitor session",
        "description": "Create a visitor session for the approved integrationId. Browser visitors use no machine credential. Server BFFs may add X-CRAD-Integration-Key for the same site and integration; it must have at least one of customers:write or bookings:write:customer. The session remains bound to that exact credential and stops authorizing requests after its expiry or revocation; sending another key later does not rebind it. A customers:write-only key supports customer registration but does not grant booking-context reads or writes. A newly created session expires after 30 minutes. Successful phone verification gives 15 minutes of phone proof and refreshes session expiry to 30 minutes; use the returned expiry timestamps. After expiry or key rotation, a fresh same-phone, same-integration session can recover known locators without creating replacement operations or automatically confirming them.",
        "security": [],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for this site and integration; no browser Origin header. Requires at least one of customers:write or bookings:write:customer. The new session stays bound to this credential, including its expiry, revocation and booking permissions."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "integrationId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "integrationId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/verification/challenges": {
      "post": {
        "operationId": "post_sites_by_siteId_verification_challenges",
        "summary": "Request a WhatsApp verification code",
        "description": "An explicit customer action requests one code through the business's approved Authentication template. It does not opt the customer into reminders or override communication preferences. The same request UUID and original session never send another message. Unknown delivery permits code entry; requesting another code is a separate explicit action after resendAt and uses a new UUID. New issuance requires current sender, template, policy and abuse quota checks. Read capabilities.verification.available for issued-code checking and newChallengeAvailable for new issuance; neither proves delivery. No SMS fallback.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "phone": {
                    "type": "string",
                    "pattern": "^\\+[1-9][0-9]{7,14}$"
                  },
                  "language": {
                    "$ref": "#/components/schemas/Language"
                  }
                },
                "required": [
                  "phone",
                  "language"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Challenge"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/verification/verify": {
      "post": {
        "operationId": "post_sites_by_siteId_verification_verify",
        "summary": "Verify phone and upgrade the existing session",
        "description": "Repeated successful code verification does not renew proof expiry or rotate the bearer. A verified session cannot change its phone.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "challengeId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "code": {
                    "type": "string",
                    "pattern": "^[0-9]{6}$"
                  }
                },
                "required": [
                  "challengeId",
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Session"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/quotes": {
      "post": {
        "operationId": "post_sites_by_siteId_quotes",
        "summary": "Quote the selected service",
        "description": "If the customer session was created with a companion integration credential, that bound credential must still be valid and include bookings:write:customer. The permission also applies on read-only or replay branches, where present; a new header does not replace the credential bound to the session.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "serviceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "providerId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "includeRemoval": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "serviceId"
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/quotes/{quoteId}": {
      "get": {
        "operationId": "get_sites_by_siteId_quotes_by_quoteId",
        "summary": "Read saved quote including expired accepted summary",
        "description": "If the customer session was created with a companion integration credential, that bound credential must still be valid and include bookings:write:customer. The permission also applies on read-only or replay branches, where present; a new header does not replace the credential bound to the session.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "quoteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/availability": {
      "get": {
        "operationId": "get_sites_by_siteId_availability",
        "summary": "Find fresh quote availability",
        "description": "If the customer session was created with a companion integration credential, that bound credential must still be valid and include bookings:write:customer. The permission also applies on read-only or replay branches, where present; a new header does not replace the credential bound to the session.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "quoteId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "localDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Availability"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/booking-intents": {
      "post": {
        "operationId": "post_sites_by_siteId_booking_intents",
        "summary": "Persist immutable create command before committing",
        "description": "Requires current verified phone proof. Persist a request UUID before sending and use it as Idempotency-Key. Retain the returned intentId and operationId; the commit uses that returned operationId, not the intent-request UUID. Locators alone never authorize a booking. If the customer session was created with a companion integration credential, that bound credential must still be valid and include bookings:write:customer. The permission also applies on read-only or replay branches, where present; a new header does not replace the credential bound to the session.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateIntent"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Intent"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/booking-intents/{intentId}": {
      "get": {
        "operationId": "get_sites_by_siteId_booking_intents_by_intentId",
        "summary": "Recover saved intent with matching fresh proof",
        "description": "When returning a create intent, the response also retrieves its quote. A session bound to a companion credential therefore needs that credential to remain valid with bookings:write:customer for this branch. Saved action-intent retrieval does not add that booking scope check, but still requires current same-phone and same-integration proof.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "intentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Intent"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/bookings": {
      "post": {
        "operationId": "post_sites_by_siteId_bookings",
        "summary": "Commit saved create intent atomically",
        "description": "Receipt lookup precedes expiry/admission checks within one transaction. Replay returns HTTP 200. If the customer session was created with a companion integration credential, that bound credential must still be valid and include bookings:write:customer. The permission also applies on read-only or replay branches, where present; a new header does not replace the credential bound to the session.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "intentId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "intentId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Exact idempotent replay of the authoritative original receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "201": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/operations/{operationId}": {
      "get": {
        "operationId": "get_sites_by_siteId_operations_by_operationId",
        "summary": "Recover original receipt and current booking state",
        "description": "If the customer session was created with a companion integration credential, that bound credential must still be valid and include bookings:write:customer. The permission also applies on read-only or replay branches, where present; a new header does not replace the credential bound to the session.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Operation"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/bookings/{bookingId}": {
      "get": {
        "operationId": "get_sites_by_siteId_bookings_by_bookingId",
        "summary": "Read current booking",
        "description": "Read the authorized current booking and server-computed cancellation/reschedule availability with finite blocked reasons. Re-read after the projection expires; commands independently recheck authoritative state. This metadata is not part of historical operation receipts. If the customer session was created with a companion integration credential, that bound credential must still be valid and include bookings:write:customer. The permission also applies on read-only or replay branches, where present; a new header does not replace the credential bound to the session.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "bookingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/bookings/{bookingId}/availability": {
      "get": {
        "operationId": "get_sites_by_siteId_bookings_by_bookingId_availability",
        "summary": "Reschedule using original price and duration",
        "description": "If the customer session was created with a companion integration credential, that bound credential must still be valid and include bookings:write:customer. The permission also applies on read-only or replay branches, where present; a new header does not replace the credential bound to the session.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "bookingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "localDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Availability"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/bookings/{bookingId}/action-intents": {
      "post": {
        "operationId": "post_sites_by_siteId_bookings_by_bookingId_action_intents",
        "summary": "Persist immutable cancel/reschedule command",
        "description": "Saving a new action intent reads the current booking; a session bound to a companion credential needs bookings:write:customer. An exact saved action-intent replay skips that booking read, while still requiring the session credential to be valid and current same-phone, same-integration proof.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "bookingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActionIntent"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Intent"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/bookings/{bookingId}/cancel": {
      "post": {
        "operationId": "post_sites_by_siteId_bookings_by_bookingId_cancel",
        "summary": "Commit saved cancel command",
        "description": "If the customer session was created with a companion integration credential, that bound credential must still be valid and include bookings:write:customer. The permission also applies on read-only or replay branches, where present; a new header does not replace the credential bound to the session.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "bookingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "intentId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "intentId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/bookings/{bookingId}/reschedule": {
      "post": {
        "operationId": "post_sites_by_siteId_bookings_by_bookingId_reschedule",
        "summary": "Commit saved reschedule command",
        "description": "If the customer session was created with a companion integration credential, that bound credential must still be valid and include bookings:write:customer. The permission also applies on read-only or replay branches, where present; a new header does not replace the credential bound to the session.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "bookingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "intentId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "intentId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Receipt"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/customers": {
      "post": {
        "operationId": "post_sites_by_siteId_customers",
        "summary": "Register integration-origin customer with verified phone",
        "description": "Requires current verified customer phone proof for this site and integration. Registration creates or links an integration customer mapping. After migration 20261011141147 is deployed, a fresh registration for an active mapping saves the submitted language as the canonical preference for future messages; explain this before submission. The canonical name and private fields remain unchanged. Detached mappings and exact operation replays do not change the preference. Direct guest booking without registration retains an existing profile preference and captures its own booking language. Registration does not grant website account login or messaging consent. Supplying externalCustomerId requires X-CRAD-Integration-Key with customers:write for the same site and integration, and an account identity authorized by the backend. A session originally created with a companion credential also requires an explicit customers:write companion credential on this registration request, even when externalCustomerId is omitted; the stored session binding alone does not satisfy this requirement. The original bound credential must still be valid. Persist and reuse the same operation UUID and semantic request after uncertainty.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Backend only, with customers:write for the same site and integration. Required when externalCustomerId is supplied OR when the customer session was created with a companion credential. Do not omit this header merely because the session already stores its original credential binding; never send it from a browser."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "displayName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "language": {
                    "$ref": "#/components/schemas/Language"
                  },
                  "externalCustomerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  }
                },
                "required": [
                  "displayName",
                  "language"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Exact idempotent replay of the authoritative original receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResult"
                }
              }
            }
          },
          "201": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResult"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/customers/{customerId}": {
      "get": {
        "operationId": "get_integration_customers_by_customerId",
        "summary": "Read scoped integration customer",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Strong quoted version of the current customer projection, including a detached tombstone. Preserve the complete value for a later If-Match write.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[1-9][0-9]*\"$"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patch_integration_customers_by_customerId",
        "summary": "Explicitly update name or language",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            },
            "description": "Exact strong quoted version returned by the relevant resource; never weak or *. Customer: \"1\". Schedule: \"b1\"/\"b1:p2\". Block: \"v1\"."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "displayName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "language": {
                    "$ref": "#/components/schemas/Language"
                  }
                },
                "required": [],
                "minProperties": 1
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResult"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Strong quoted version of the returned customer projection. An exact replay may return the historical accepted projection; GET the customer before using a current version for another edit.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[1-9][0-9]*\"$"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/customers/{customerId}/detach": {
      "post": {
        "operationId": "post_integration_customers_by_customerId_detach",
        "summary": "Detach integration mapping without deleting appointments",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            },
            "description": "Exact strong quoted version returned by the relevant resource; never weak or *. Customer: \"1\". Schedule: \"b1\"/\"b1:p2\". Block: \"v1\"."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResult"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Strong quoted version of the returned customer projection. An exact replay may return the historical accepted projection; GET the customer before using a current version for another edit.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[1-9][0-9]*\"$"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/customers/{customerId}/phone-change": {
      "post": {
        "operationId": "post_integration_customers_by_customerId_phone_change",
        "summary": "Move mapping after new phone proof",
        "description": "Backend only, without an Origin header; requires customers:write. Move this integration customer mapping to the new phone's currently verified profile using newSessionToken for the same site and integration. This does not rewrite the old profile, move historical appointments, merge website accounts or grant messaging consent. Historic bookings retain their accepted phone identity. The backend must authorize the account whose mapping is being changed. Replay still requires current new-phone proof before looking up the operation. If that proof or session expires, obtain fresh proof for the same new phone and retry the original operation UUID, customerId and If-Match version with the replacement newSessionToken. The token may change; the verified phone and semantic request must not. A replay returns the original accepted customer projection unless the mapping is now detached; reread the customer for current state and the next write precondition.",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist and reuse the original UUID with the same customerId, original If-Match version and verified new phone. A refreshed newSessionToken for that same phone is allowed and is required after the previous proof expires; a different new phone conflicts with the original operation."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            },
            "description": "Exact strong quoted version returned by the relevant resource; never weak or *. Customer: \"1\". Schedule: \"b1\"/\"b1:p2\". Block: \"v1\"."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "newSessionToken": {
                    "type": "string",
                    "pattern": "^wbs_[a-f0-9]{64}$",
                    "description": "Current phone proof for the new phone at the same site and integration. Proof is checked even on replay. A fresh token proving that same phone can replace an expired token without changing the operation UUID or original If-Match version."
                  }
                },
                "required": [
                  "newSessionToken"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted mapping projection and replay status. A replay may carry the historical accepted projection; GET the customer before a new edit. Historical appointments keep their original identity.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerResult"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Strong quoted version of the returned customer projection. An exact replay may return the historical accepted projection; GET the customer before using a current version for another edit.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[1-9][0-9]*\"$"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/customer-snapshots": {
      "post": {
        "operationId": "post_integration_customer_snapshots",
        "summary": "Start consistent scoped contact snapshot",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "cursor": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "watermark": {
                      "type": "integer"
                    },
                    "expiresAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "cursor",
                    "watermark",
                    "expiresAt"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/customer-changes": {
      "get": {
        "operationId": "get_integration_customer_changes",
        "summary": "Page snapshot then poll changes from opaque cursor",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerPage"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/schedules/{resource}": {
      "get": {
        "operationId": "get_management_schedules_by_resource",
        "summary": "Read effective hours and version",
        "description": "Server only. The management key binds tenant/integration and explicit business/provider resources. Intake pause does not revoke management rights. A change preview binds the resource version and exact appointment impact; commit preserves existing appointments. Uncertain writes recover via the same key or /operations/{operationId}.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "business or allowed provider UUID"
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleState"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Strong quoted composite schedule version. Preserve the complete value for If-Match on the reviewed preview and commit.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"b[1-9][0-9]*(?::p[1-9][0-9]*)?\"$"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patch_management_schedules_by_resource",
        "summary": "Apply reviewed schedule preserving appointments",
        "description": "Server only. The management key binds tenant/integration and explicit business/provider resources. Intake pause does not revoke management rights. A change preview binds the resource version and exact appointment impact; commit preserves existing appointments. Uncertain writes recover via the same key or /operations/{operationId}.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "business or allowed provider UUID"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"b[1-9][0-9]*(?::p[1-9][0-9]*)?\"$"
            },
            "description": "Exact strong quoted version returned by the relevant resource; never weak or *. Customer: \"1\". Schedule: \"b1\"/\"b1:p2\". Block: \"v1\"."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewCommit"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduleResult"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/schedules/{resource}/change-previews": {
      "post": {
        "operationId": "post_management_schedules_by_resource_change_previews",
        "summary": "Preview schedule impact",
        "description": "Server only. The management key binds tenant/integration and explicit business/provider resources. Intake pause does not revoke management rights. A change preview binds the resource version and exact appointment impact; commit preserves existing appointments. Uncertain writes recover via the same key or /operations/{operationId}. For resource=business, use mode=override with a complete seven-day hours value. For a provider, use either that complete override or mode=inherit with hours omitted. The preview does not apply the change or cancel affected appointments. If its version, expiry or appointment impact changes before commit, obtain and review a new preview.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "business or allowed provider UUID"
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"b[1-9][0-9]*(?::p[1-9][0-9]*)?\"$"
            },
            "description": "Exact strong quoted version returned by the relevant resource; never weak or *. Customer: \"1\". Schedule: \"b1\"/\"b1:p2\". Block: \"v1\"."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleProposal"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SchedulePreview"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/block-change-previews": {
      "post": {
        "operationId": "post_management_block_change_previews",
        "summary": "Preview create/update/release block",
        "description": "Server only. The management key binds tenant/integration and explicit business/provider resources. Intake pause does not revoke management rights. A change preview binds the resource version and exact appointment impact; commit preserves existing appointments. Uncertain writes recover via the same key or /operations/{operationId}.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BlockProposal"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockPreview"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/blocks": {
      "get": {
        "operationId": "get_management_blocks",
        "summary": "Read scoped blocks over bounded range",
        "description": "Server only. The management key binds tenant/integration and explicit business/provider resources. Intake pause does not revoke management rights. A change preview binds the resource version and exact appointment impact; commit preserves existing appointments. Uncertain writes recover via the same key or /operations/{operationId}. Omit providerId to list business-wide blocks only; this requires the business-schedule resource grant. Supply an explicitly granted provider UUID to list only that provider's blocks, excluding business-wide blocks. For an effective provider calendar, fetch and combine both resource lists only when each resource is granted. Paginate each list independently; never carry a cursor between resources. This endpoint is not availability: use authoritative availability and final booking admission.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "providerId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Omit providerId to list business-wide blocks only; this requires the business-schedule resource grant. Supply an explicitly granted provider UUID to list only that provider's blocks, excluding business-wide blocks. For an effective provider calendar, fetch and combine both resource lists only when each resource is granted. Paginate each list independently; never carry a cursor between resources. This endpoint is not availability: use authoritative availability and final booking admission."
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockPage"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "post_management_blocks",
        "summary": "Create previewed block",
        "description": "Server only. The management key binds tenant/integration and explicit business/provider resources. Intake pause does not revoke management rights. A change preview binds the resource version and exact appointment impact; commit preserves existing appointments. Uncertain writes recover via the same key or /operations/{operationId}.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewCommit"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Exact idempotent replay of the authoritative original receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockResult"
                }
              }
            }
          },
          "201": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockResult"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/blocks/{blockId}": {
      "patch": {
        "operationId": "patch_management_blocks_by_blockId",
        "summary": "Update own previewed block",
        "description": "Server only. The management key binds tenant/integration and explicit business/provider resources. Intake pause does not revoke management rights. A change preview binds the resource version and exact appointment impact; commit preserves existing appointments. Uncertain writes recover via the same key or /operations/{operationId}.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "blockId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"v[1-9][0-9]*\"$"
            },
            "description": "Exact strong quoted version returned by the relevant resource; never weak or *. Customer: \"1\". Schedule: \"b1\"/\"b1:p2\". Block: \"v1\"."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewCommit"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockResult"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/blocks/{blockId}/release": {
      "post": {
        "operationId": "post_management_blocks_by_blockId_release",
        "summary": "Release own previewed block",
        "description": "Server only. The management key binds tenant/integration and explicit business/provider resources. Intake pause does not revoke management rights. A change preview binds the resource version and exact appointment impact; commit preserves existing appointments. Uncertain writes recover via the same key or /operations/{operationId}.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "blockId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reuse the identical UUID for an unknown result. Booking commit must use operationId returned by the persisted intent."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"v[1-9][0-9]*\"$"
            },
            "description": "Exact strong quoted version returned by the relevant resource; never weak or *. Customer: \"1\". Schedule: \"b1\"/\"b1:p2\". Block: \"v1\"."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreviewCommit"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BlockResult"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/operations/{operationId}": {
      "get": {
        "operationId": "get_management_operations_by_operationId",
        "summary": "Recover an accepted management receipt",
        "description": "Backend only. Recover the immutable accepted receipt using the original operationId and a currently valid management credential for the same integration. The original action and resource grants are rechecked, including any required blocks:write:any permission. A committed result proves the recorded operation; it does not include current schedule or block state. Reread the schedule or the authorized block listing before displaying current state or preparing another change. A not_found result alone does not prove that an in-flight write cannot still commit; retain the original operation identity when reconciling uncertainty.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The recorded accepted receipt with replayed=true, or status=not_found. No current resource projection is returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementOperation"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/intent-requests/{requestId}": {
      "get": {
        "summary": "Recover one known intent request after a lost POST response",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative result; notification acceptance is independent of booking success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntentRequest"
                }
              }
            }
          },
          "401": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "get_sites_by_siteId_intent_requests_by_requestId",
        "description": "When returning a create intent, the response also retrieves its quote. A session bound to a companion credential therefore needs that credential to remain valid with bookings:write:customer for this branch. Saved action-intent retrieval does not add that booking scope check, but still requires current same-phone and same-integration proof."
      }
    },
    "/v1/sites/{siteId}/intent-requests/{requestId}/abandon": {
      "post": {
        "summary": "Atomically close an unfinished request, preventing a late POST",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative result; notification acceptance is independent of booking success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AbandonedRequest"
                }
              }
            }
          },
          "401": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        },
        "operationId": "post_sites_by_siteId_intent_requests_by_requestId_abandon",
        "description": "When a saved intent exists, abandonment first checks its booking operation. A credential-bound session then requires bookings:write:customer. The no-intent branch does not add this scope check; current same-phone and same-integration proof and a valid bound credential are still required."
      }
    },
    "/v1/sites/{siteId}/bookings/{bookingId}/notifications": {
      "get": {
        "summary": "Read notification and consent state for this verified booking",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "bookingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative result; notification acceptance is independent of booking success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationState"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Strong quoted current communication-preference version, separate from the booking version. Use this complete value for If-Match when changing preferences.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"n[1-9][0-9]*\"$"
                }
              }
            }
          },
          "401": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "get_sites_by_siteId_bookings_by_bookingId_notifications",
        "description": "Read current notification and preference state for this booking with current proof of its accepted phone identity. Booking acceptance and notification delivery are separate: an unavailable, failed or unknown notification does not undo an accepted appointment. accepted means provider acceptance, not delivered or read by a person. unknown means delivery is uncertain and must not trigger another booking or an automatic resend. preferences.whatsapp is the booking preference; preferences.globallyBlocked describes the separate same-phone, same-business global withdrawal. If the customer session was created with a companion integration credential, that bound credential must still be valid and include bookings:write:customer. The permission also applies on read-only or replay branches, where present; a new header does not replace the credential bound to the session."
      }
    },
    "/v1/sites/{siteId}/bookings/{bookingId}/communication-preferences": {
      "patch": {
        "summary": "Change booking or business-wide WhatsApp permission",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "bookingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"n[1-9][0-9]*\"$"
            },
            "description": "Strong preference ETag returned by notifications. Separate from appointment version."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist and reuse this exact UUID and request after an unknown result. Do not create a fresh operation to retry."
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative result; notification acceptance is independent of booking success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationPreferenceResult"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Strong quoted version of returned current.preferences, including on replay. It is not the version of the historical preference receipt.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"n[1-9][0-9]*\"$"
                }
              }
            }
          },
          "401": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NotificationPreferences"
              }
            }
          }
        },
        "operationId": "patch_sites_by_siteId_bookings_by_bookingId_communication_preferences",
        "description": "Requires current proof of the booking's accepted phone identity, its current preference ETag and a persisted operation UUID. scope=booking changes this booking's preference; scope=all_whatsapp changes the same phone's global WhatsApp permission at this business. Booking-only opt-in does not remove a global withdrawal. Opt-in requires the current noticeVersion. Explicit global resubscription also requires expectedGlobalVersion from the displayed current preferences; after VERSION_CONFLICT, refresh and obtain fresh customer confirmation instead of silently replacing the version. Exact operation replay returns the original receipt plus current notification state: a historical receipt with whatsapp=true can coexist with current globallyBlocked=true after a later withdrawal. Render current state; replay must not re-enable consent. Preference changes do not change the appointment or guarantee delivery. If the customer session was created with a companion integration credential, that bound credential must still be valid and include bookings:write:customer. The permission also applies on read-only or replay branches, where present; a new header does not replace the credential bound to the session."
      }
    },
    "/v1/integration/bookings": {
      "get": {
        "summary": "List this integration’s current accepted booking lineages",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative result; notification acceptance is independent of booking success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingPage"
                }
              }
            }
          },
          "401": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "get_integration_bookings"
      }
    },
    "/v1/integration/customer-sync-checkpoints": {
      "post": {
        "operationId": "acknowledge_customer_sync_checkpoint",
        "summary": "Report durable application of an issued customer feed cursor",
        "description": "Backend-only consumer acknowledgement. Requires customer-changes:read. Send only after the external database transaction has durably applied the complete page and persisted this exact operation UUID/cursor. Initial or partial snapshot cursors cannot acknowledge the snapshot watermark. Read alone is not applied; caller-provided watermarks are rejected. Replay checks current authorization first, then recovers the original receipt before cursor expiry. Equal-position acknowledgements do not renew the last-applied timestamp.",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "cursor": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "cursor"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Consumer acknowledgement persisted or exact replay recovered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerSyncCheckpoint"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope or current integration access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Different request under same operation UUID, older checkpoint, or cursor not issued by a complete feed page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Never-accepted cursor expired or retention/epoch gap; bootstrap required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome uncertain; retry exact durable acknowledgement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/embed-policy": {
      "get": {
        "operationId": "getWebsiteEmbedPolicy",
        "summary": "Read current verified iframe parent origins",
        "description": "Anonymous read-only metadata for the document ingress. A missing, unavailable or empty policy denies framing while direct booking links remain usable. Approval requires server-verified domain proof, never an Origin header. This endpoint does not approve a domain or grant booking authority.",
        "security": [
          {}
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "responses": {
          "200": {
            "description": "Current verified exact origins only; no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebsiteEmbedPolicy"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration": {
      "get": {
        "operationId": "getIntegrationMetadata",
        "tags": [
          "Integration"
        ],
        "summary": "Read current installer identity, grants and bounded API limits",
        "description": "Server-only integration credential. Current authority is checked again after the tenant lock. No query tenant override, customer data or secrets; browser Origin is denied. Environment remains unknown without a trusted deployment attestation. Supported capabilities do not authorize operations or promise provider readiness.",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Current safe credential-derived metadata",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationMetadata"
                }
              }
            }
          },
          "401": {
            "description": "Missing/malformed integration credential",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Browser Origin, revoked/expired credential or current authority refused",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unsupported method/route",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unrecognized query parameters",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Bounded machine/site request quota",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Unavailable or uncertain server metadata",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/booking-snapshots": {
      "post": {
        "operationId": "post_integration_booking_snapshots",
        "summary": "Start a consistent snapshot of this integration's bookings",
        "description": "Backend only; no Origin header. Requires bookings:read:integration. Includes only accepted booking lineages of this tenant, site and integration. It never grants legacy or other-channel history. A customer-facing site must authorize its own account before forwarding data. Booking changes are independent of notification delivery. Snapshot covers all dates, at most 10000 bookings; initial snapshot expires after 30 minutes.",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "cursor": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "watermark": {
                      "type": "integer"
                    },
                    "expiresAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "cursor",
                    "watermark",
                    "expiresAt"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/booking-changes": {
      "get": {
        "operationId": "get_integration_booking_changes",
        "summary": "Read booking snapshot pages, then durable changes",
        "description": "Backend only; no Origin header. Requires bookings:read:integration. Includes only accepted booking lineages of this tenant, site and integration. It never grants legacy or other-channel history. A customer-facing site must authorize its own account before forwarding data. Booking changes are independent of notification delivery. Persist each complete page and its next cursor atomically. Snapshot cursors expire after 30 minutes; changes cursors expire after up to 30 days. An idle poll preserves the existing cursor and its expiry. HTTP 410 requires a new snapshot. Apply events by integration sequence, including external-reference changes at the same booking version. This is polling, not webhook delivery.",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingSyncPage"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/booking-sync-checkpoints": {
      "post": {
        "operationId": "acknowledge_booking_sync_checkpoint",
        "summary": "Acknowledge durable application of a booking page",
        "description": "Backend only; no Origin header. Requires bookings:read:integration. Includes only accepted booking lineages of this tenant, site and integration. It never grants legacy or other-channel history. A customer-facing site must authorize its own account before forwarding data. Booking changes are independent of notification delivery. Send only after durable local application, using a persisted UUID and issued next cursor. Partial snapshots cannot acknowledge their watermark. Retry the exact UUID after a lost response; current authorization is always rechecked. An acknowledgement is the consumer report, not proof of its database contents.",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "cursor": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "cursor"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Consumer acknowledgement persisted or exact replay recovered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerSyncCheckpoint"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope or current integration access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Different request under same operation UUID, older checkpoint, or cursor not issued by a complete feed page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Never-accepted cursor expired or retention/epoch gap; bootstrap required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome uncertain; retry exact durable acknowledgement",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/integration/customers/{customerId}/bookings": {
      "get": {
        "summary": "List this mapped customer's bookings from this integration",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative result; notification acceptance is independent of booking success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerBookingPage"
                }
              }
            }
          },
          "401": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Structured failure. Keep the same operation key if outcome is uncertain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "get_integration_customer_bookings",
        "description": "Backend only; no Origin header. Requires bookings:read:integration. Includes only accepted booking lineages of this tenant, site and integration. It never grants legacy or other-channel history. A customer-facing site must authorize its own account before forwarding data. Booking changes are independent of notification delivery. Additionally requires customers:read and an active same-integration mapping whose current profile and saved phone match the original booking lineage. A phone change does not move historical bookings to the new mapped identity. Range is at most 31 days per request, 100 rows per page. This returns current states, not a full change journal, and must not be used as an incremental synchronization cursor."
      }
    },
    "/v1/integration/customers/{customerId}/shared-fields": {
      "get": {
        "operationId": "get_integration_customer_shared_fields",
        "summary": "Read this mapped customer's explicitly shared fields",
        "description": "Backend only; rejects browser Origin. Requires an active exact same-integration customer_verified mapping with current unambiguous canonical phone and profile. Imported owner_reviewed identity does not authorize this resource. The external backend must authorize its own logged-in customer before forwarding a mapped customer ID. No internal notes, raw custom_data, unrelated profile or appointment payload is returned. Revocation blocks subsequent access but cannot erase previously stored remote copies. Requires customers:read and current owner per-field read/readwrite grants. Empty fields means nothing is currently shared. Projection ETag/hash describes current values; it is not a PATCH If-Match token. changeFeedSupported:false: read-on-demand reconciliation, not the existing retained customer feed.",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current explicitly permissioned projection; no additional booking authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedCustomerFields"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Quoted SHA-256 identifier of the current permitted shared-field projection. This is not a PATCH If-Match token: shared-field edits use grantRevision and each field expectedExists/expectedValue.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[a-f0-9]{64}\"$"
                }
              }
            }
          },
          "401": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patch_integration_customer_shared_fields",
        "summary": "Compare and set explicitly writable customer fields",
        "description": "Backend only; rejects browser Origin. Requires an active exact same-integration customer_verified mapping with current unambiguous canonical phone and profile. Imported owner_reviewed identity does not authorize this resource. The external backend must authorize its own logged-in customer before forwarding a mapped customer ID. No internal notes, raw custom_data, unrelated profile or appointment payload is returned. Revocation blocks subsequent access but cannot erase previously stored remote copies. Requires BOTH customers:read and customers:write plus each current readwrite field grant. grantRevision fences policy changes; expectedExists/expectedValue fence each edited field so unrelated edits merge. Missing and explicit JSON null differ. An unavailable stored value must be repaired through the CRAD owner editor before constructing a new CAS. Exact operation replay returns its immutable field-key receipt and currently permissioned values, never revoked historical values. Unknown outcomes require the exact same UUID and body; no client-selected profile or tenant.",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current explicitly permissioned projection; no additional booking authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SharedCustomerFieldsPatchResult"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Quoted SHA-256 identifier of the current permitted shared-field projection. This is not a PATCH If-Match token: shared-field edits use grantRevision and each field expectedExists/expectedValue.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[a-f0-9]{64}\"$"
                }
              }
            }
          },
          "401": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SharedCustomerFieldsPatch"
              }
            }
          }
        }
      }
    },
    "/v1/integration/customers/{customerId}/all-channel-bookings": {
      "get": {
        "operationId": "get_integration_customer_all_channel_bookings",
        "summary": "Read mapped customer history across channels with separate owner approval",
        "description": "Backend only; rejects browser Origin. Requires an active exact same-integration customer_verified mapping with current unambiguous canonical phone and profile. Imported owner_reviewed identity does not authorize this resource. The external backend must authorize its own logged-in customer before forwarding a mapped customer ID. No internal notes, raw custom_data, unrelated profile or appointment payload is returned. Revocation blocks subsequent access but cannot erase previously stored remote copies. Requires customers:read, bookings:read:integration and separate owner all-channel history approval. At most31days per request/100rows per page. History IDs are display-only; they confer no read/change/cancel/intent authority and are not WebsiteBookingReceipt IDs. Current states only, no all-channel change feed or appointment notes. Reconcile current authorization before using any stored projection.",
        "security": [
          {
            "IntegrationCredential": []
          },
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current explicitly permissioned projection; no additional booking authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerAllChannelHistory"
                }
              }
            }
          },
          "401": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Structured refusal. Preserve the exact operation UUID and payload after uncertainty. Current authorization is rechecked even for replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/customers/record": {
      "post": {
        "operationId": "post_management_customers_record",
        "summary": "Record or link a business contact without customer OTP",
        "description": "Server only. Requires an owner-issued Management credential with the explicit contacts:record permission. The site backend must authenticate and authorize its administrator; never expose this credential to a browser or use it as an anonymous customer form. The credential fixes one tenant/site/integration. Customer phone verification, public booking intake, bot state and customer sessions are not prerequisites. Atomically creates a new canonical contact and mapping, or links an unambiguous existing same-business contact. Existing names/languages/block state are preserved; a blocked contact, ambiguous canonical phone, external-ID rebinding or detached mapping is refused. A new mapping is owner_reviewed, not customer-verified; no customer session, booking, consent or message is created. An unchanged existing verified mapping keeps its assurance. businessCustomerId is the canonical contact ID; mappingId is the distinct identifier used as customerId by Integration Customer APIs. Save the original Idempotency-Key before sending. On uncertainty retry the same body/key or recover contact-operations/{operationId}; never issue a fresh command merely because its response was lost. receipt is immutable; current is reread and becomes null if the contact is unavailable or identity changed.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist a UUID before this command. Reuse it with the same input for recovery; a changed command conflicts."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ManagementContactCommand"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Linked existing contact, already linked identity, or exact accepted replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementContactResult"
                }
              }
            }
          },
          "201": {
            "description": "New contact and mapping committed atomically. No notification is sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementContactResult"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Identity conflict or changed idempotent command. No contact is merged or overwritten.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Result may be uncertain. Keep the original operation UUID and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/contact-operations/{operationId}": {
      "get": {
        "operationId": "get_management_contact_operations_by_operationId",
        "summary": "Recover a contact recording operation",
        "description": "Server only. Requires current Management contacts:record authority for the original integration. Returns the immutable accepted recording receipt and currently permitted contact projection; no phone proof is created. current is null with contact_unavailable when detached, blocked, deleted or moved to another phone/profile. A not_found result is not proof that an in-flight command cannot still commit; retain its original UUID and exact body. This operation is independent of the hours/blocks operation-recovery endpoint.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Known committed recording and current projection, or not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementContactOperation"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Identity conflict or changed idempotent command. No contact is merged or overwritten.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Result may be uncertain. Keep the original operation UUID and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management": {
      "get": {
        "operationId": "getManagementMetadata",
        "tags": [
          "Management"
        ],
        "summary": "Check a management key and its current grants without changing business data",
        "description": "Backend-only management credential; no query or tenant selector and no browser Origin. Supports a contact-only credential with no schedule resources. Rechecks current credential, integration and platform authority after the tenant lock; revoked/expired credentials are refused. Draft/paused public intake and unavailable WhatsApp do not block this administrative discovery. Capabilities identify installed contacts, schedules and blocks contracts; scopes/resources separately constrain permitted operations. Environment remains unknown and the result is neither full admin parity nor a delivery/readiness attestation. The read consumes the normal request quota and updates credential last-use telemetry, but creates no contact, booking, session or message. The optional limits.maxRemindersPerAppointment is disclosed only with current appointments:read scope and a valid business_manager appointment-resource grant. It is a read-only business ceiling, not selected offsets, remaining allowance, activation or a delivery guarantee; omission is not zero. Only CRAD super-admin can change that ceiling. Optional ownerSetup supplies coarse progress and a fixed CRAD owner continuation URL for the current credential’s business. Open it separately for the actual owner to sign in; refresh metadata on return. The URL grants no authority and performs no setup or activation. Pending setup can be saved before connecting WhatsApp. Enabling the bot requires the owner's explicit Enable bot or Save and enable bot action and a current readiness check. Plain Save and read-only recovery never activate it. No created provider is added to an existing key automatically. For credentials with appointments:read, this discovery view omits whatsapp-templates:read, whatsapp-templates:write, whatsapp-profile:read and whatsapp-profile:write to preserve calendar-client compatibility. Discover these grants through GET /v1/management/messaging-capabilities. Template/profile command authorization still uses the stored grants.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "X-CRAD-Capabilities",
            "in": "header",
            "required": false,
            "description": "Optional response capability negotiation. Only the exact case-sensitive value day-schedule-overrides requests capabilities.dayScheduleOverrides. If this header is absent or has any other value, including a comma-separated list, the response omits that field. Other values are ignored, not rejected. This header does not enable routes or grant scopes, resource access or booking permission.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current safe credential-derived metadata",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ManagementMetadata"
                }
              }
            }
          },
          "401": {
            "description": "Missing/malformed management credential or integration-audience key",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Browser Origin, revoked/expired credential or current authority refused",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unsupported method/route",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Unrecognized query parameters",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Bounded machine/site request quota",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Unavailable or uncertain server metadata",
            "headers": {
              "X-Request-Id": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/customers": {
      "get": {
        "operationId": "getBusinessCustomers",
        "summary": "List business customers",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Returns basic fields for canonical contacts, including unmapped/blocked contacts. Optional language/block filters and name/joined ordering use UUID tie breaks; this directory is not an immutable sync snapshot. The opaque cursor is bound to the integration and normalized filters/order, expires after 30 minutes and must not be reused with changed filters. Search names through POST /customers/search; do not put names or phone numbers in this query.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "language",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/Language"
            }
          },
          {
            "name": "isBlocked",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "name",
                "joined"
              ],
              "default": "name"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "x-crad-required-scopes": [
          "contacts:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerDirectory"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Cursor expired, retained history unavailable or effective projection epoch changed. Bootstrap again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/customers/search": {
      "post": {
        "operationId": "searchBusinessCustomers",
        "summary": "Search business customers",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. POST keeps nameContains out of URLs. Searches basic canonical contacts using a bounded case-insensitive substring and the same filters/order/cursor rules as GET /customers. No raw phone query, tenant selector or ungranted fields are returned.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "contacts:read"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCustomerQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerDirectory"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Cursor expired, retained history unavailable or effective projection epoch changed. Bootstrap again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds the bounded body size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/customers/lookup": {
      "post": {
        "operationId": "lookupBusinessCustomer",
        "summary": "Look up one exact business phone",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Accepts one exact +E.164 phone in the POST body. Returns customer:null when absent; ambiguous canonical phone identities are refused rather than merged. Does not create a customer, mapping, proof, session, booking or consent.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "contacts:read"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "phone": {
                    "type": "string",
                    "pattern": "^\\+[1-9][0-9]{7,14}$"
                  }
                },
                "required": [
                  "phone"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerLookup"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Operation, field value, identity or checkpoint conflict. No partial write.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds the bounded body size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/customers/{businessCustomerId}": {
      "get": {
        "operationId": "getBusinessCustomer",
        "summary": "Read a business customer",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Read the current canonical basic projection and ETag for a later basic/block command. businessCustomerId is a canonical contact UUID, distinct from an Integration customer mapping ID. Notes/custom fields require the separate granted fields route.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "businessCustomerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "contacts:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomer"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Quoted canonical cN version for the next basic/block If-Match precondition.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"c(0|[1-9][0-9]{0,18})\"$"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Canonical contact unavailable in this credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patchBusinessCustomer",
        "summary": "Edit business customer name/language",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Persist the exact request and its operation UUID. On an uncertain response retry that command or use its dedicated recovery route; a not_found result does not prove that an in-flight command cannot still commit. Receipts are immutable references, while current is reread under current authority and is null with contact_unavailable after deletion/reparent. Requires contacts:write in addition to contacts:read. Basic edits accept only displayName and language. Phone/identity changes, deletion, archive, notes/custom fields and consent are not part of this command. The If-Match version shares native/API revisions; stale edits return 412. An equal-value edit preserves the current revision.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "businessCustomerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist a UUID before sending. Retry only the same UUID and exact body after an uncertain outcome."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"c(0|[1-9][0-9]{0,18})\"$"
            },
            "description": "Quoted current canonical version from GET /management/customers/{businessCustomerId} or its ETag. Weak validators and * are refused."
          }
        ],
        "x-crad-required-scopes": [
          "contacts:read",
          "contacts:write"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCustomerBasicPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerCommandResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Canonical contact unavailable in this credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Operation, field value, identity or checkpoint conflict. No partial write.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Current canonical version or owner grant revision changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds the bounded body size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required operation UUID or version precondition is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/customers/{businessCustomerId}/block": {
      "post": {
        "operationId": "setBusinessCustomerBlock",
        "summary": "Set business customer blocking",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Persist the exact request and its operation UUID. On an uncertain response retry that command or use its dedicated recovery route; a not_found result does not prove that an in-flight command cannot still commit. Receipts are immutable references, while current is reread under current authority and is null with contact_unavailable after deletion/reparent. Requires the separate contacts:block scope and contacts:read. isBlocked is explicit state, not a toggle. Use the current canonical If-Match version. This changes neither communication consent nor customer proof and sends no message. It does not cancel existing appointments.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "businessCustomerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist a UUID before sending. Retry only the same UUID and exact body after an uncertain outcome."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"c(0|[1-9][0-9]{0,18})\"$"
            },
            "description": "Quoted current canonical version from GET /management/customers/{businessCustomerId} or its ETag. Weak validators and * are refused."
          }
        ],
        "x-crad-required-scopes": [
          "contacts:read",
          "contacts:block"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCustomerBlockPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerCommandResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Canonical contact unavailable in this credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Operation, field value, identity or checkpoint conflict. No partial write.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Current canonical version or owner grant revision changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds the bounded body size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required operation UUID or version precondition is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/customer-operations/{operationId}": {
      "get": {
        "operationId": "getBusinessCustomerOperation",
        "summary": "Recover a basic/block customer command",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Persist the exact request and its operation UUID. On an uncertain response retry that command or use its dedicated recovery route; a not_found result does not prove that an in-flight command cannot still commit. Receipts are immutable references, while current is reread under current authority and is null with contact_unavailable after deletion/reparent. Current contacts:read plus the original action scope (contacts:write, contacts:block or contacts:phone:write) is required. Recovery is bound to the original integration and operation UUID; equivalent current credential rotation may recover it. This route is independent from contact recording, field writes and schedule/block operation ledgers.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "contacts:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Canonical contact unavailable in this credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-crad-conditional-scopes": {
          "description": "Original basic action additionally requires contacts:write; original block action additionally requires contacts:block. A phone_correction action additionally requires contacts:phone:write."
        }
      }
    },
    "/v1/management/customers/{businessCustomerId}/fields": {
      "get": {
        "operationId": "getBusinessCustomerFields",
        "summary": "Read approved business customer fields",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Requires contacts:fields:read and contacts:read. Owner approval is separate from the existing customer-verified Integration grants. Only explicitly approved standard notes and eligible custom definition UUIDs are exposed, with current typed metadata and null/absence markers. Visibility/settings affect eligibility but do not grant approval. No generic email/notes/custom_data object is exposed.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "businessCustomerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "contacts:read",
          "contacts:fields:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerFields"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Canonical contact unavailable in this credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "patchBusinessCustomerFields",
        "summary": "Compare and set approved customer fields",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Persist the exact request and its operation UUID. On an uncertain response retry that command or use its dedicated recovery route; a not_found result does not prove that an in-flight command cannot still commit. Receipts are immutable references, while current is reread under current authority and is null with contact_unavailable after deletion/reparent. Requires contacts:fields:read, contacts:fields:write and contacts:read, plus current readwrite owner approval for every selector. Supply grantRevision from the current fields GET, expectedExists/expectedValue per key and one Idempotency-Key. No global If-Match is used or accepted. All changes apply atomically; a value conflict returns 409 and a policy revision mismatch 412. Current scopes/definition eligibility/grants are rechecked after lock waits and on replay.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "businessCustomerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist a UUID before sending. Retry only the same UUID and exact body after an uncertain outcome."
          }
        ],
        "x-crad-required-scopes": [
          "contacts:read",
          "contacts:fields:read",
          "contacts:fields:write"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCustomerFieldsPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerFieldResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Canonical contact unavailable in this credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Operation, field value, identity or checkpoint conflict. No partial write.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Current canonical version or owner grant revision changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds the bounded body size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required operation UUID or version precondition is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/customers/{businessCustomerId}/field-operations/{operationId}": {
      "get": {
        "operationId": "getBusinessCustomerFieldOperation",
        "summary": "Recover a granted-field command",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Persist the exact request and its operation UUID. On an uncertain response retry that command or use its dedicated recovery route; a not_found result does not prove that an in-flight command cannot still commit. Receipts are immutable references, while current is reread under current authority and is null with contact_unavailable after deletion/reparent. Requires current contacts:read, contacts:fields:read and contacts:fields:write, plus current eligible readwrite approval for all originally changed selectors before any receipt is exposed. Returned receipts contain selectors only, never historical values. Deletion/reparent preserves confirmed intent with current:null; grant/scope/definition withdrawal still refuses recovery.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "businessCustomerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "contacts:read",
          "contacts:fields:read",
          "contacts:fields:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerFieldOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Canonical contact unavailable in this credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/customer-snapshots": {
      "post": {
        "operationId": "startBusinessCustomerSnapshot",
        "summary": "Begin business customer sync membership",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Requires contacts:read and contacts:sync. Creates immutable membership IDs and a publication fence, capped at 10,000 contacts, 10 active memberships per integration and 10 snapshot requests/hour. Membership expires after 30 minutes. No profile values are retained; every page is hydrated under current authority. A commit newer than the fence may appear early and repeat in deltas, so this is current-state convergence, not point-in-time field-value history. Optional current contacts:fields:read adds only approved fields. Complete membership before applying/acknowledging its returned delta cursor.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "contacts:read",
          "contacts:sync"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerSnapshot"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Operation, field value, identity or checkpoint conflict. No partial write.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds the bounded body size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-crad-conditional-scopes": {
          "description": "Current contacts:fields:read adds only separately owner-approved/eligible fields; it is optional for basic-only sync."
        }
      }
    },
    "/v1/management/customer-changes": {
      "get": {
        "operationId": "getBusinessCustomerChanges",
        "summary": "Read current-state customer sync pages",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Requires contacts:read and contacts:sync. Consume the opaque cursor from snapshot bootstrap or the prior page, limit 1..100. Snapshot pages enumerate fixed membership with current values/tombstones; later changes pages return metadata signals with current permissioned hydration. Hidden-only signals are skipped but advance the cursor; event identity/order is stable while replayed current values may be newer. Scope/grant/eligible-definition changes invalidate the projection epoch and require bootstrap. Equivalent credential rotation may resume; fields:read reduction cannot replay prior sensitive projections. Delta cursors/history have a 30-day horizon, and idle reads do not extend a cursor expiry. A false hasMore does not replace later polling for native commits. Apply a complete issued page durably before acknowledgement.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "x-crad-required-scopes": [
          "contacts:read",
          "contacts:sync"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerSyncPage"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Cursor expired, retained history unavailable or effective projection epoch changed. Bootstrap again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-crad-conditional-scopes": {
          "description": "Current contacts:fields:read adds only separately owner-approved/eligible fields; it is optional for basic-only sync."
        }
      }
    },
    "/v1/management/customer-sync-checkpoints": {
      "post": {
        "operationId": "acknowledgeBusinessCustomerChanges",
        "summary": "Acknowledge durable business customer sync progress",
        "description": "Server only, with an owner-issued Management credential bound to one tenant/site/integration. The backend must authorize its administrator. Public intake, WhatsApp availability, customer phone verification and website customer mappings are not prerequisites. Existing contacts:record keys are not widened. Requires contacts:read and contacts:sync. Persist the complete issued page in your backend before sending its cursor and one Idempotency-Key. Initial/partial snapshot cursors are refused; progress cannot go backwards within an epoch. Exact operation/cursor replay recovers the immutable receipt after a lost response, even when the original cursor expires, with bootstrapRequired/currentProjectionEpoch describing current recovery. It never advances a new grant epoch using an old receipt. Revoked credentials still refuse recovery.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist a UUID before sending. Retry only the same UUID and exact body after an uncertain outcome."
          }
        ],
        "x-crad-required-scopes": [
          "contacts:read",
          "contacts:sync"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "cursor": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "cursor"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerCheckpoint"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Operation, field value, identity or checkpoint conflict. No partial write.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Cursor expired, retained history unavailable or effective projection epoch changed. Bootstrap again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds the bounded body size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request; no tenant/resource selector is accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required operation UUID or version precondition is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointments": {
      "get": {
        "operationId": "listBusinessAppointments",
        "summary": "List approved business appointments",
        "description": "Server only. Your backend authenticates its administrator and sends an owner-issued wbm_ key without an Origin header. Every call requires appointments:read plus the stated action scope and a CURRENT per-credential owner calendar grant. Scope issuance alone grants no appointment access. Provider grants never imply manager authority, unassigned access, customer data or notes. Public booking intake, customer OTP, bot/WhatsApp readiness and customer messaging consent are separate. List current authorized physical rows by increasing startAt/appointmentId. This is a current directory, not a fixed membership snapshot. Keep every filter and limit unchanged while using nextCursor; grant/query changes require restart. Default 100/max 200. Notes and joined customer basics need independent grants/scopes. An empty page is legitimate. ",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Inclusive range boundary by interval overlap."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "Exclusive end; after from and no more than 93 days later."
          },
          {
            "name": "providerId",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "const": "unassigned"
                }
              ]
            },
            "description": "Omitted: all current approved resources. unassigned: only unassigned appointments if explicitly approved. UUID: that approved provider."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/BusinessAppointmentStatus"
            }
          },
          {
            "name": "businessCustomerId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "appointments:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessAppointmentDirectory"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Action, quote, slot, operation, projection or checkpoint conflict. No partial command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Issued cursor expired, was cleaned up, predates retention, or belongs to a previous grant epoch. Start a new snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createBusinessAppointment",
        "summary": "Create a business appointment",
        "description": "Server only. Your backend authenticates its administrator and sends an owner-issued wbm_ key without an Origin header. Every call requires appointments:read plus the stated action scope and a CURRENT per-credential owner calendar grant. Scope issuance alone grants no appointment access. Provider grants never imply manager authority, unassigned access, customer data or notes. Public booking intake, customer OTP, bot/WhatsApp readiness and customer messaging consent are separate. Use the reviewed quoteVersion with identical customer/provider/service/removal choices and an available startAt. The operation UUID is durably bound to the exact request. Recovery uses the same UUID/body before any new quote or new intent. A confirmed command creates one physical appointment; an accepted replay returns the same receipt with current state. This administrative command needs no customer OTP. Recognizing or recording a contact does not establish phone proof or messaging consent; any supplied communicationPreferences must reflect the customer's actual choice. Appointment creation does not automatically send a customer confirmation. A separate staff confirmation flow must check receipt.action:create, receipt.status:CONFIRMED and receipt.notification.state:not_requested, plus the current authorized appointment still being CONFIRMED and matching the reviewed recipient, service and business-local time, appropriate messaging permission and one durable send event for that appointment. communicationPreferences and language are accepted only with bookingIntent:request; they record the actual booking choice and its update language, never blanket consent or a profile-language change. A staff-created appointment uses a separately selected approved template language and authorized messaging permission. PENDING is not final confirmation. A replay recovers the same booking and must not create a duplicate send. A command deliberately resolved as not_executed cannot execute later: the original body/UUID returns OPERATION_NOT_EXECUTED (409), and changed body/UUID reuse returns OPERATION_CONFLICT (409).",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Generate once for this intent. Reuse exactly with the unchanged body/If-Match during recovery; a different command must have a different UUID."
          }
        ],
        "x-crad-required-scopes": [
          "appointments:read",
          "appointments:create"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCalendarCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Exact accepted operation replay; receipt is unchanged and current is rehydrated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCalendarCommand"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "ETag": {
                "description": "Quoted current physical version when current state is present; omitted when unavailable.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"a(?:0|[1-9][0-9]{0,18})\"$"
                }
              }
            }
          },
          "201": {
            "description": "Created; exact replay returns 200.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCalendarCommand"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "ETag": {
                "description": "Quoted current physical version when current state is present; omitted when unavailable.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"a(?:0|[1-9][0-9]{0,18})\"$"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Action, quote, slot, operation, projection or checkpoint conflict. No partial command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Bounded request body exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required Idempotency-Key or quoted If-Match is absent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointment-resources": {
      "get": {
        "operationId": "getBusinessCalendarResources",
        "summary": "Read approved booking resources",
        "description": "Server only. Your backend authenticates its administrator and sends an owner-issued wbm_ key without an Origin header. Every call requires appointments:read plus the stated action scope and a CURRENT per-credential owner calendar grant. Scope issuance alone grants no appointment access. Provider grants never imply manager authority, unassigned access, customer data or notes. Public booking intake, customer OTP, bot/WhatsApp readiness and customer messaging consent are separate. Inspect the current calendar grant, permitted providers, eligible active services and booking modes before requesting a quote. The maximum is 200 providers and 200 services; RESOURCE_LIMIT refuses oversize instead of silently truncating. Current catalogue prices are major units. A provider being returned does not guarantee a slot or create permission.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "appointments:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCalendarResources"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Action, quote, slot, operation, projection or checkpoint conflict. No partial command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointment-quotes": {
      "post": {
        "operationId": "quoteBusinessAppointment",
        "summary": "Review appointment terms",
        "description": "Server only. Your backend authenticates its administrator and sends an owner-issued wbm_ key without an Origin header. Every call requires appointments:read plus the stated action scope and a CURRENT per-credential owner calendar grant. Scope issuance alone grants no appointment access. Provider grants never imply manager authority, unassigned access, customer data or notes. Public booking intake, customer OTP, bot/WhatsApp readiness and customer messaging consent are separate. Prepare a server-owned five-minute quote for an existing canonical businessCustomerId, permitted provider and optional service. Omitted provider/service normalize to null; withRemoval defaults false. Service-duration businesses require a compatible treatment/provider. Ordinary businesses keep optional-service/fallback-duration behavior. Creating or registering the business contact is a separate operation. This does not reserve a slot or send a message.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "appointments:read",
          "appointments:create"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCalendarQuoteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCalendarQuote"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Action, quote, slot, operation, projection or checkpoint conflict. No partial command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Bounded request body exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointment-availability": {
      "post": {
        "operationId": "getBusinessAppointmentAvailability",
        "summary": "Find available business appointment times",
        "description": "Server only. Your backend authenticates its administrator and sends an owner-issued wbm_ key without an Origin header. Every call requires appointments:read plus the stated action scope and a CURRENT per-credential owner calendar grant. Scope issuance alone grants no appointment access. Provider grants never imply manager authority, unassigned access, customer data or notes. Public booking intake, customer OTP, bot/WhatsApp readiness and customer messaging consent are separate. Return canonical start/end instants for the selected localDate in the business timezone, plus current quote terms. Use returned instants (including DST handling), never reinterpret the date in a browser timezone. Availability does not reserve capacity; create rechecks hours, blocks, resources, price and capacity atomically.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "appointments:read",
          "appointments:create"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCalendarAvailabilityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCalendarAvailability"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Action, quote, slot, operation, projection or checkpoint conflict. No partial command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Bounded request body exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointments/{appointmentId}": {
      "get": {
        "operationId": "getBusinessAppointment",
        "summary": "Read one current appointment",
        "description": "Server only. Your backend authenticates its administrator and sends an owner-issued wbm_ key without an Origin header. Every call requires appointments:read plus the stated action scope and a CURRENT per-credential owner calendar grant. Scope issuance alone grants no appointment access. Provider grants never imply manager authority, unassigned access, customer data or notes. Public booking intake, customer OTP, bot/WhatsApp readiness and customer messaging consent are separate. Read current authorized state and its quoted physical ETag. customer is null without independent contacts:read; notes is null without both appointments:notes:read and the owner notesRead grant. Null currency means no frozen currency. Missing/out-of-scope appointments return404.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "appointments:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessAppointment"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "ETag": {
                "description": "Quoted current physical version when current state is present; omitted when unavailable.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"a(?:0|[1-9][0-9]{0,18})\"$"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Appointment is absent or not visible under the current grant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointments/{appointmentId}/action-previews": {
      "post": {
        "operationId": "previewBusinessAppointmentAction",
        "summary": "Review an appointment action",
        "description": "Server only. Your backend authenticates its administrator and sends an owner-issued wbm_ key without an Origin header. Every call requires appointments:read plus the stated action scope and a CURRENT per-credential owner calendar grant. Scope issuance alone grants no appointment access. Provider grants never imply manager authority, unassigned access, customer data or notes. Public booking intake, customer OTP, bot/WhatsApp readiness and customer messaging consent are separate. Preview the exact cancellation, reschedule or propose_time action against the rendered If-Match. Approval with status:CONFIRMED goes directly to actions without previewVersion or notificationIntent; requesting an approval preview is unnecessary. Cancellation (including status:CANCELLED) and time-only reschedule require a five-minute preview plus explicit silent/request_notice. Rescheduling is manager-only and requires recognized accepted terms; it preserves provider/service/customer/duration/price, cancels the original physical row and creates a successor. Snapshot-null rescheduling and accepted-snapshot revival are unsupported. A preview sends nothing and reserves nothing. When applied to an approvalRequired PENDING request, status:CONFIRMED queues the booking confirmation (omit notificationIntent for this status), subject to booking consent, opt-outs and current sender/template checks. The website status-change handler must not enqueue a separate campaign, including on replay or delayed delivery. Cancellation declines the request and queues rejection. propose_time requires request_notice and previewVersion on apply, preserves PENDING and waits for customer agreement. A current unexpired offer blocks direct confirmation with PROPOSAL_AWAITS_CUSTOMER. Approval preserves the booking-scoped messaging choice and update language; it cannot supply missing consent or override language. Delivery is independent of booking success.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"a(?:0|[1-9][0-9]{0,18})\"$"
            },
            "description": "Quoted ETag of the physical appointment shown to the user. Never use websiteVersion, wildcard or weak ETags."
          }
        ],
        "x-crad-required-scopes": [
          "appointments:read"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCalendarActionPreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCalendarPreview"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Appointment is absent or not visible under the current grant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Action, quote, slot, operation, projection or checkpoint conflict. No partial command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Rendered physical appointment version no longer matches. Re-read and review; do not automatically substitute the newer version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Bounded request body exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required Idempotency-Key or quoted If-Match is absent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-crad-conditional-scopes": {
          "description": "status/mark_missed/undo require appointments:status; cancel or status:CANCELLED require appointments:cancel; reschedule requires appointments:reschedule and business_manager role ceiling."
        }
      }
    },
    "/v1/management/appointments/{appointmentId}/actions": {
      "post": {
        "operationId": "applyBusinessAppointmentAction",
        "summary": "Apply a reviewed appointment action",
        "description": "Server only. Your backend authenticates its administrator and sends an owner-issued wbm_ key without an Origin header. Every call requires appointments:read plus the stated action scope and a CURRENT per-credential owner calendar grant. Scope issuance alone grants no appointment access. Provider grants never imply manager authority, unassigned access, customer data or notes. Public booking intake, customer OTP, bot/WhatsApp readiness and customer messaging consent are separate. Submit the rendered If-Match and one durable operation UUID. Cancellation (including status:CANCELLED), reschedule and propose_time must include the matching previewVersion. Cancellation/reschedule require explicit silent or request_notice; propose_time requires request_notice. Approval with status:CONFIRMED, other ordinary statuses, mark_missed and undo must omit previewVersion. Approval needs no separate preview and must omit notificationIntent. Allowed status transitions are rechecked, not arbitrary enum assignment. mark_missed offers at most six seconds of server-bound conditional undo; undo uses the prior operation UUID and accepted version. Unknown command outcome: retain exact request and recover, never switch UUID. Notification intent is accepted separately from delivery; unknown delivery is never duplicated. Current state can differ from the immutable accepted receipt. When applied to an approvalRequired PENDING request, status:CONFIRMED queues the booking confirmation (omit notificationIntent for this status), subject to booking consent, opt-outs and current sender/template checks. The website status-change handler must not enqueue a separate campaign, including on replay or delayed delivery. Cancellation declines the request and queues rejection. propose_time requires request_notice and previewVersion on apply, preserves PENDING and waits for customer agreement. A current unexpired offer blocks direct confirmation with PROPOSAL_AWAITS_CUSTOMER. Approval preserves the booking-scoped messaging choice and update language; it cannot supply missing consent or override language. Delivery is independent of booking success.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"a(?:0|[1-9][0-9]{0,18})\"$"
            },
            "description": "Quoted ETag of the physical appointment shown to the user. Never use websiteVersion, wildcard or weak ETags."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Generate once for this intent. Reuse exactly with the unchanged body/If-Match during recovery; a different command must have a different UUID."
          }
        ],
        "x-crad-required-scopes": [
          "appointments:read"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCalendarActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCalendarCommand"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "ETag": {
                "description": "Quoted current physical version when current state is present; omitted when unavailable.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"a(?:0|[1-9][0-9]{0,18})\"$"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Appointment is absent or not visible under the current grant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Action, quote, slot, operation, projection or checkpoint conflict. No partial command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Rendered physical appointment version no longer matches. Re-read and review; do not automatically substitute the newer version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Bounded request body exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required Idempotency-Key or quoted If-Match is absent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-crad-conditional-scopes": {
          "description": "status/mark_missed/undo require appointments:status; cancel or status:CANCELLED require appointments:cancel; reschedule requires appointments:reschedule and business_manager role ceiling."
        }
      }
    },
    "/v1/management/appointment-operations/{operationId}": {
      "get": {
        "operationId": "getBusinessAppointmentOperation",
        "summary": "Recover an uncertain appointment command",
        "description": "Server only. Your backend authenticates its administrator and sends an owner-issued wbm_ key without an Origin header. Every call requires appointments:read plus the stated action scope and a CURRENT per-credential owner calendar grant. Scope issuance alone grants no appointment access. Provider grants never imply manager authority, unassigned access, customer data or notes. Public booking intake, customer OTP, bot/WhatsApp readiness and customer messaging consent are separate. Look up the original operation UUID for this integration. Current read authority and the accepted action scope are rechecked; a replacement key does not broaden them. not_found is not proof that an in-flight command cannot commit: retain and replay the original UUID/body, never create another booking to compensate. An accepted receipt is immutable; current may be newer, removed or inaccessible. Original-operation recovery needs no new staff approval, quote or preview. Exact accepted replay is resolved before fresh appointment-version or quote validation. A known in-progress refusal calls for waiting, not a new intent; a 412 or changed quote/preview requires current-fact review rather than silently replacing If-Match. notificationCurrent, when present, is the current delivery state, never a new send. A rejected create with outcome=not_executed is a durable canonical resolution: its original UUID can never execute later. Unlike not_found, that terminal receipt permits releasing a local pending-create hold. If a missing create receipt cannot safely be recovered, resolveBusinessAppointmentOperation deliberately fences the original UUID using its exact saved body.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "appointments:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCalendarOperation"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Action, quote, slot, operation, projection or checkpoint conflict. No partial command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-crad-conditional-scopes": {
          "description": "Recovery additionally requires the original action scope (appointments:create/status/cancel/reschedule) and current approval for its original resource. No generic read credential can recover another action authority."
        }
      }
    },
    "/v1/management/appointment-snapshots": {
      "post": {
        "operationId": "startBusinessAppointmentSnapshot",
        "summary": "Begin a scoped appointment synchronization",
        "description": "Server only. Your backend authenticates its administrator and sends an owner-issued wbm_ key without an Origin header. Every call requires appointments:read plus the stated action scope and a CURRENT per-credential owner calendar grant. Scope issuance alone grants no appointment access. Provider grants never imply manager authority, unassigned access, customer data or notes. Public booking intake, customer OTP, bot/WhatsApp readiness and customer messaging consent are separate. Create fixed physical membership IDs and a publication watermark for one positive range of at most 93 days and approved provider selection. Limit 10,000 members and 10 active snapshots per credential; snapshot expires after 30 minutes. No historical field values are retained: each page is hydrated under current authority and can contain newer values that later repeat in deltas. Complete membership before acknowledging the returned completed delta cursor. This stream and its cursors are separate from customer and website lineage feeds.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "appointments:read",
          "appointments:sync"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessAppointmentRange"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessAppointmentSnapshot"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Action, quote, slot, operation, projection or checkpoint conflict. No partial command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Bounded request body exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointment-changes": {
      "get": {
        "operationId": "getBusinessAppointmentChanges",
        "summary": "Read appointment membership or changes",
        "description": "Server only. Your backend authenticates its administrator and sends an owner-issued wbm_ key without an Origin header. Every call requires appointments:read plus the stated action scope and a CURRENT per-credential owner calendar grant. Scope issuance alone grants no appointment access. Provider grants never imply manager authority, unassigned access, customer data or notes. Public booking intake, customer OTP, bot/WhatsApp readiness and customer messaging consent are separate. Use only an issued cursor with the same credential and authority epoch. limit 1–100/default 50. Snapshot pages contain current physical rows or minimal removals. Delta events contain metadata signals plus current authorized state, never historical notes or private data. signalVersion describes the signal; current may be newer and wins over an older removal signal. current:null means remove that scoped local row, not proof of a global deletion. Provider/range departures disclose no new unauthorized state. Apply pages in order, deduplicate eventId and appointment/version, and advance even empty filtered pages. A grant change, cursor expiry or30-day retention floor requires a fresh snapshot. No joined customer/catalogue labels are replicated.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "x-crad-required-scopes": [
          "appointments:read",
          "appointments:sync"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessAppointmentSyncPage"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Action, quote, slot, operation, projection or checkpoint conflict. No partial command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Issued cursor expired, was cleaned up, predates retention, or belongs to a previous grant epoch. Start a new snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointment-checkpoints": {
      "post": {
        "operationId": "acknowledgeBusinessAppointmentCheckpoint",
        "summary": "Acknowledge an applied appointment checkpoint",
        "description": "Server only. Your backend authenticates its administrator and sends an owner-issued wbm_ key without an Origin header. Every call requires appointments:read plus the stated action scope and a CURRENT per-credential owner calendar grant. Scope issuance alone grants no appointment access. Provider grants never imply manager authority, unassigned access, customer data or notes. Public booking intake, customer OTP, bot/WhatsApp readiness and customer messaging consent are separate. Only acknowledge an issued completed delta cursor after atomically applying its pages and cursor in your store. Preserve the checkpoint operation UUID for an exact lost-ACK retry. Partial snapshots, invented cursors and backward progress are refused. Exact recovery preserves the receipt even after expiry/grant change/credential rotation, but bootstrapRequired signals that current synchronization must restart. It never returns historical appointment values or restores revoked authority. Permanent accepted receipts and removed-ID identity fences are not erased by journal cleanup.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Generate once for this intent. Reuse exactly with the unchanged body/If-Match during recovery; a different command must have a different UUID."
          }
        ],
        "x-crad-required-scopes": [
          "appointments:read",
          "appointments:sync"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "cursor": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "cursor"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessAppointmentCheckpoint"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Action, quote, slot, operation, projection or checkpoint conflict. No partial command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Issued cursor expired, was cleaned up, predates retention, or belongs to a previous grant epoch. Start a new snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Bounded request body exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required Idempotency-Key or quoted If-Match is absent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/booking-policy": {
      "get": {
        "operationId": "getBusinessBookingPolicy",
        "summary": "Read business booking rules",
        "description": "Development preview; this source contract alone does not assert deployment. Server only: your backend authenticates its administrator and uses an explicitly owner-issued wbm_ credential without Origin. Tenant comes from the current key. booking-policy:read is required; writes and operation recovery also require booking-policy:write. These scopes cover the whole business without a separate calendar or schedule resource grant. Existing keys gain no scopes. Installed capabilities bookingPolicyRead/bookingPolicyWrite advertise support, not authority; the separate duration-policy capability does not widen these R1 routes. Public intake, WhatsApp connection, customer OTP and messaging consent are separate. Existing appointments, prices, accepted snapshots and UTC instants are preserved; provider settings and published service selection are unchanged. Read current rules, opaque ETag and supported changed values. Existing out-of-menu legacy values remain readable; do not replace fields the user did not edit.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "booking-policy:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                },
                "description": "Do not cache policy, preview or acceptance."
              },
              "ETag": {
                "description": "Current settings physical version; absent on an accepted result whose current settings are unavailable.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessBookingPolicyState"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/tenant/owner-issued authority refused, revoked integration, platform suspension, or browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INVALID_SETTINGS, PREVIEW_EXPIRED, PREVIEW_MISMATCH, IMPACT_CHANGED, POLICY_IMPACT_TOO_LARGE or OPERATION_CONFLICT. Nothing is partially applied; review/refetch before a new intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed fields/precondition, unsupported changed value, INVALID_BOOKING_POLICY, INVALID_SCHEDULE or OVERNIGHT_SCHEDULE_UNSUPPORTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request limit or POLICY_PREVIEW_LIMIT (at most 20 outstanding previews per actor/tenant). The latter uses Retry-After: 300; accepted operation receipts are separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or OUTCOME_UNCERTAIN. Retain operation UUID, exact proposal, If-Match and previewId; recover before starting another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "applyBusinessBookingPolicy",
        "summary": "Apply reviewed business booking rules",
        "description": "Development preview; this source contract alone does not assert deployment. Server only: your backend authenticates its administrator and uses an explicitly owner-issued wbm_ credential without Origin. Tenant comes from the current key. booking-policy:read is required; writes and operation recovery also require booking-policy:write. These scopes cover the whole business without a separate calendar or schedule resource grant. Existing keys gain no scopes. Installed capabilities bookingPolicyRead/bookingPolicyWrite advertise support, not authority; the separate duration-policy capability does not widen these R1 routes. Public intake, WhatsApp connection, customer OTP and messaging consent are separate. Existing appointments, prices, accepted snapshots and UTC instants are preserved; provider settings and published service selection are unchanged. Submit the exact preview proposal and previewId with If-Match and Idempotency-Key. The server checks current authority, replays accepted exact requests before fresh admission, then checks current row identity/revision and unchanged impact. Expired preview or changed impact requires a new explicit review. No-op preserves version. Receipt is immutable; current is separately re-read and may differ after another edit. This endpoint never rewrites existing appointment durations or sends customer messages.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"bp:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:(?:0|[1-9][0-9]{0,18})\"$"
            },
            "description": "Exact quoted ETag returned by the policy read. Do not use weak/wildcard or calendar/schedule versions."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "One durable operation UUID. Reuse with the exact acknowledged version, previewId and proposal after uncertainty. Never silently create a replacement intent."
          }
        ],
        "x-crad-required-scopes": [
          "booking-policy:read",
          "booking-policy:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                },
                "description": "Do not cache policy, preview or acceptance."
              },
              "ETag": {
                "description": "Current settings physical version; absent on an accepted result whose current settings are unavailable.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessBookingPolicyResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/tenant/owner-issued authority refused, revoked integration, platform suspension, or browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INVALID_SETTINGS, PREVIEW_EXPIRED, PREVIEW_MISMATCH, IMPACT_CHANGED, POLICY_IMPACT_TOO_LARGE or OPERATION_CONFLICT. Nothing is partially applied; review/refetch before a new intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "POLICY_CHANGED: the settings row/revision changed. Keep the local draft, refresh and present a new preview for approval.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON request exceeds 8192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type must be application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed fields/precondition, unsupported changed value, INVALID_BOOKING_POLICY, INVALID_SCHEDULE or OVERNIGHT_SCHEDULE_UNSUPPORTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required If-Match or apply Idempotency-Key is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request limit or POLICY_PREVIEW_LIMIT (at most 20 outstanding previews per actor/tenant). The latter uses Retry-After: 300; accepted operation receipts are separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or OUTCOME_UNCERTAIN. Retain operation UUID, exact proposal, If-Match and previewId; recover before starting another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessBookingPolicyApplyRequest"
              }
            }
          }
        }
      }
    },
    "/v1/management/booking-policy/previews": {
      "post": {
        "operationId": "previewBusinessBookingPolicy",
        "summary": "Review the impact of changed booking rules",
        "description": "Development preview; this source contract alone does not assert deployment. Server only: your backend authenticates its administrator and uses an explicitly owner-issued wbm_ credential without Origin. Tenant comes from the current key. booking-policy:read is required; writes and operation recovery also require booking-policy:write. These scopes cover the whole business without a separate calendar or schedule resource grant. Existing keys gain no scopes. Installed capabilities bookingPolicyRead/bookingPolicyWrite advertise support, not authority; the separate duration-policy capability does not widen these R1 routes. Public intake, WhatsApp connection, customer OTP and messaging consent are separate. Existing appointments, prices, accepted snapshots and UTC instants are preserved; provider settings and published service selection are unchanged. Send a partial proposal with the policy ETag the administrator viewed. Show before/after and aggregate impact before saving. Preview expires after five minutes and is bound to this current credential, tenant, row version, exact proposal and impact. A maximum of 10000 relevant appointments is evaluated; there is no truncation. Preview does not save the settings or change bookings.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"bp:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:(?:0|[1-9][0-9]{0,18})\"$"
            },
            "description": "Exact quoted ETag returned by the policy read. Do not use weak/wildcard or calendar/schedule versions."
          }
        ],
        "x-crad-required-scopes": [
          "booking-policy:read",
          "booking-policy:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                },
                "description": "Do not cache policy, preview or acceptance."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessBookingPolicyPreview"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/tenant/owner-issued authority refused, revoked integration, platform suspension, or browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INVALID_SETTINGS, PREVIEW_EXPIRED, PREVIEW_MISMATCH, IMPACT_CHANGED, POLICY_IMPACT_TOO_LARGE or OPERATION_CONFLICT. Nothing is partially applied; review/refetch before a new intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "POLICY_CHANGED: the settings row/revision changed. Keep the local draft, refresh and present a new preview for approval.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON request exceeds 8192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type must be application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed fields/precondition, unsupported changed value, INVALID_BOOKING_POLICY, INVALID_SCHEDULE or OVERNIGHT_SCHEDULE_UNSUPPORTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required If-Match or apply Idempotency-Key is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request limit or POLICY_PREVIEW_LIMIT (at most 20 outstanding previews per actor/tenant). The latter uses Retry-After: 300; accepted operation receipts are separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or OUTCOME_UNCERTAIN. Retain operation UUID, exact proposal, If-Match and previewId; recover before starting another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessBookingPolicyPreviewRequest"
              }
            }
          }
        }
      }
    },
    "/v1/management/booking-policy-operations/{operationId}": {
      "get": {
        "operationId": "getBusinessBookingPolicyOperation",
        "summary": "Recover a booking rules operation",
        "description": "Development preview; this source contract alone does not assert deployment. Server only: your backend authenticates its administrator and uses an explicitly owner-issued wbm_ credential without Origin. Tenant comes from the current key. booking-policy:read is required; writes and operation recovery also require booking-policy:write. These scopes cover the whole business without a separate calendar or schedule resource grant. Existing keys gain no scopes. Installed capabilities bookingPolicyRead/bookingPolicyWrite advertise support, not authority; the separate duration-policy capability does not widen these R1 routes. Public intake, WhatsApp connection, customer OTP and messaging consent are separate. Existing appointments, prices, accepted snapshots and UTC instants are preserved; provider settings and published service selection are unchanged. Recover using the original operation UUID after a lost response. not_found does not prove a concurrent request will never commit: retain the same UUID/body when retrying. A current write-authorized key from the same integration can recover an accepted operation after key rotation; a fresh unaccepted preview stays bound to its original credential. Revoked/reduced authority cannot disclose a receipt. Native-user and Management operation namespaces are separate.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "booking-policy:read",
          "booking-policy:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                },
                "description": "Do not cache policy, preview or acceptance."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessBookingPolicyOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/tenant/owner-issued authority refused, revoked integration, platform suspension, or browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INVALID_SETTINGS, PREVIEW_EXPIRED, PREVIEW_MISMATCH, IMPACT_CHANGED, POLICY_IMPACT_TOO_LARGE or OPERATION_CONFLICT. Nothing is partially applied; review/refetch before a new intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed fields/precondition, unsupported changed value, INVALID_BOOKING_POLICY, INVALID_SCHEDULE or OVERNIGHT_SCHEDULE_UNSUPPORTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request limit or POLICY_PREVIEW_LIMIT (at most 20 outstanding previews per actor/tenant). The latter uses Retry-After: 300; accepted operation receipts are separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or OUTCOME_UNCERTAIN. Retain operation UUID, exact proposal, If-Match and previewId; recover before starting another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/customers/{businessCustomerId}/phone-corrections": {
      "post": {
        "operationId": "correctBusinessCustomerPhone",
        "summary": "Correct the number of an existing business customer",
        "description": "Server only. Requires current contacts:read and separately owner-issued contacts:phone:write; ordinary contacts:write does not authorize identity correction. The external administrator must explicitly confirm that this is the same person and review the old and new numbers. Read the current contact and submit its quoted cN version with a durable operation UUID and strict +E.164 newPhone. The shared native/API command preserves the canonical customer ID, name, notes, block state and appointment history. It does not merge contacts, verify a number, transfer verified history, change consent, open a WhatsApp send window or send any message. Numbers with bot-session or inbound conversation evidence, customer-verified mappings or protected booking identities require a separate identity review and are refused here; an unverified owner-reviewed mapping never becomes verified. An existing target is refused; duplicate old identities return CUSTOMER_IDENTITY_AMBIGUOUS without automatic selection or merging. Old-number STOP or a phone-only reminder restriction without a retained profile-level opt-out returns PHONE_IDENTITY_REVIEW_REQUIRED so messaging restrictions cannot silently disappear. A profile-level reminder opt-out stays on the same customer and continues to suppress reminders after correction; it is not itself a refusal. Neither number's stored preferences are rewritten. PHONE_SEND_IN_PROGRESS covers retained physical sends and outstanding frozen-recipient calendar notifications, including queued, unavailable and uncertain jobs. Do not drop or retarget an accepted notification to force correction; terminal notification history alone is not a refusal. After a known refusal, review the reason before another explicit attempt. A format-only no-op preserves the revision. For a lost response or other uncertain result, recover the original operation through GET /management/customer-operations/{operationId} or repeat its exact UUID, version and body; never replace it with a fresh intent automatically. The immutable receipt contains references only; current is reread under current authority and may be unavailable after deletion or reparenting. Website intake and WhatsApp connection state do not grant or revoke this administrative authority.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "businessCustomerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist a UUID before sending. Retry only the same UUID and exact body after an uncertain outcome."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"c(0|[1-9][0-9]{0,18})\"$"
            },
            "description": "Quoted current canonical version from GET /management/customers/{businessCustomerId} or its ETag. Weak validators and * are refused."
          }
        ],
        "x-crad-required-scopes": [
          "contacts:read",
          "contacts:phone:write"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCustomerPhoneCorrection"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerCommandResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, grant or authority denied; browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Canonical contact unavailable in this credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "This request is refused: PHONE_ALREADY_CONTACTED, CUSTOMER_PHONE_IN_USE, CUSTOMER_IDENTITY_AMBIGUOUS, PHONE_IDENTITY_REVIEW_REQUIRED or PHONE_SEND_IN_PROGRESS. These definite eligibility refusals do not accept this correction. OPERATION_CONFLICT means the UUID was already used with another request; its original correction may have committed. Recover that original operation before deciding what to do next. Do not bypass protected identity or notification restrictions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Current canonical version or owner grant revision changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds the bounded body size.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_PHONE or malformed/extra request fields. Only strict +E.164 newPhone is accepted; no tenant, force, merge, verification or consent flags.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required operation UUID or version precondition is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request/snapshot limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Storage unavailable or outcome uncertain. Retain the original UUID and exact command to reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/duration-policy": {
      "get": {
        "operationId": "getBusinessDurationPolicy",
        "summary": "Read business duration policy",
        "description": "Development preview; this source contract alone does not assert deployment. Server-only owner-issued Management credential, without Origin. Tenant comes from the current key. Existing keys gain no scopes. Installed support is separate from current scopes/resources. This creates no public-intake enrollment, customer phone proof, messaging consent or provider send. Management inputs never include native provider metadata/service-link editor fields. Requires booking-policy:read. Business settings are whole-business authority; no provider/calendar grant is needed. Existing R1 booking-policy routes retain keep-existing behavior. Read current supported edited values and retain the ETag.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "booking-policy:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                },
                "description": "Do not cache policy, preview or acceptance."
              },
              "ETag": {
                "description": "Exact quoted current resource version; absent if accepted current resource is unavailable.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDurationPolicyBusinessState"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/tenant/owner-issued authority refused, revoked integration, platform suspension, or browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no current resource belonging to the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PREVIEW_EXPIRED, PREVIEW_MISMATCH, IMPACT_CHANGED, INVALID_SETTINGS, OPERATION_CONFLICT or POLICY_IMPACT_TOO_LARGE. POLICY_REWRITE_TOO_LARGE means over 1,000 actual changes: nothing is saved, and keep_existing may still use the unchanged preview if otherwise current. No partial acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed fields/precondition, unsupported changed value, INVALID_BOOKING_POLICY, INVALID_SCHEDULE or OVERNIGHT_SCHEDULE_UNSUPPORTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request limit or POLICY_PREVIEW_LIMIT (at most 20 outstanding previews per actor/tenant). The latter uses Retry-After: 300; accepted operation receipts are separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Retain the original UUID and exact body/mode/If-Match; recover before creating another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "applyBusinessDurationPolicy",
        "summary": "Apply a reviewed business duration choice",
        "description": "Development preview; this source contract alone does not assert deployment. Server-only owner-issued Management credential, without Origin. Tenant comes from the current key. Existing keys gain no scopes. Installed support is separate from current scopes/resources. This creates no public-intake enrollment, customer phone proof, messaging consent or provider send. Management inputs never include native provider metadata/service-link editor fields. Submit exact previewId/proposal, original If-Match, explicit mode and one durable UUID Idempotency-Key. keep_existing saves policy and preserves every appointment. rewrite_eligible additionally requires booking-duration:rewrite and atomically changes at most 1,000 reviewed safe legacy future CONFIRMED/PENDING ends. Conflicts, protected snapshots/explicit provider overrides and unchanged ends remain untouched. Accepted starts stay fixed even when the new booking grid differs; this is not rescheduling. Current authority/version/impact is rechecked. No background continuation or customer notices. Receipt is immutable, current is independently read; exact accepted replay precedes fresh preview/version checks after current authorization. Business-wide rewrite includes only inherited-duration legacy candidates; explicit provider overrides are protected.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"(?:bp:[0-9a-f-]{36}:(?:0|[1-9][0-9]{0,18})|dp:[0-9a-f-]{36}:[0-9a-f]{64})\"$"
            },
            "description": "Exact quoted ETag from the selected duration-policy resource. Opaque; do not use schedule/calendar versions, wildcards or weak validators."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one operation UUID with exact resource/proposal/preview/version/mode. Replay after uncertainty with the same request; never silently substitute a new UUID."
          }
        ],
        "x-crad-required-scopes": [
          "booking-policy:read",
          "booking-policy:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                },
                "description": "Do not cache policy, preview or acceptance."
              },
              "ETag": {
                "description": "Exact quoted current resource version; absent if accepted current resource is unavailable.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDurationPolicyResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/tenant/owner-issued authority refused, revoked integration, platform suspension, or browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no current resource belonging to the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PREVIEW_EXPIRED, PREVIEW_MISMATCH, IMPACT_CHANGED, INVALID_SETTINGS, OPERATION_CONFLICT or POLICY_IMPACT_TOO_LARGE. POLICY_REWRITE_TOO_LARGE means over 1,000 actual changes: nothing is saved, and keep_existing may still use the unchanged preview if otherwise current. No partial acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "POLICY_CHANGED: current physical provider/business policy or inherited dependencies differ. Preserve the draft; read and explicitly review a new preview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON request exceeds 8192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type must be application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed fields/precondition, unsupported changed value, INVALID_BOOKING_POLICY, INVALID_SCHEDULE or OVERNIGHT_SCHEDULE_UNSUPPORTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required If-Match or apply Idempotency-Key is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request limit or POLICY_PREVIEW_LIMIT (at most 20 outstanding previews per actor/tenant). The latter uses Retry-After: 300; accepted operation receipts are separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Retain the original UUID and exact body/mode/If-Match; recover before creating another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessDurationPolicyApplyRequest"
              }
            }
          }
        },
        "x-crad-conditional-scopes": {
          "description": "Choosing rewrite_eligible additionally requires booking-duration:rewrite; keep_existing and preview do not."
        }
      }
    },
    "/v1/management/duration-policy/previews": {
      "post": {
        "operationId": "previewBusinessDurationPolicy",
        "summary": "Review a business duration choice",
        "description": "Development preview; this source contract alone does not assert deployment. Server-only owner-issued Management credential, without Origin. Tenant comes from the current key. Existing keys gain no scopes. Installed support is separate from current scopes/resources. This creates no public-intake enrollment, customer phone proof, messaging consent or provider send. Management inputs never include native provider metadata/service-link editor fields. Review before/after and aggregate impact with the exact quoted ETag. Preview lasts five minutes, is bound to the current credential/resource/version/proposal and exact impact, and saves nothing. At most20 retained previews per actor/tenant; impact over 1,0000 future noncancelled appointments or10000 future blocks is refused, never truncated. Mode is chosen at apply. Requires business booking-policy read/write; preview does not grant rewrite.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"(?:bp:[0-9a-f-]{36}:(?:0|[1-9][0-9]{0,18})|dp:[0-9a-f-]{36}:[0-9a-f]{64})\"$"
            },
            "description": "Exact quoted ETag from the selected duration-policy resource. Opaque; do not use schedule/calendar versions, wildcards or weak validators."
          }
        ],
        "x-crad-required-scopes": [
          "booking-policy:read",
          "booking-policy:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                },
                "description": "Do not cache policy, preview or acceptance."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDurationPolicyBusinessPreview"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/tenant/owner-issued authority refused, revoked integration, platform suspension, or browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no current resource belonging to the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PREVIEW_EXPIRED, PREVIEW_MISMATCH, IMPACT_CHANGED, INVALID_SETTINGS, OPERATION_CONFLICT or POLICY_IMPACT_TOO_LARGE. POLICY_REWRITE_TOO_LARGE means over 1,000 actual changes: nothing is saved, and keep_existing may still use the unchanged preview if otherwise current. No partial acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "POLICY_CHANGED: current physical provider/business policy or inherited dependencies differ. Preserve the draft; read and explicitly review a new preview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON request exceeds 8192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type must be application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed fields/precondition, unsupported changed value, INVALID_BOOKING_POLICY, INVALID_SCHEDULE or OVERNIGHT_SCHEDULE_UNSUPPORTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required If-Match or apply Idempotency-Key is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request limit or POLICY_PREVIEW_LIMIT (at most 20 outstanding previews per actor/tenant). The latter uses Retry-After: 300; accepted operation receipts are separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Retain the original UUID and exact body/mode/If-Match; recover before creating another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessDurationPolicyPreviewRequest"
              }
            }
          }
        }
      }
    },
    "/v1/management/duration-policy/providers/{providerId}": {
      "get": {
        "operationId": "getProviderDurationPolicy",
        "summary": "Read provider duration inheritance",
        "description": "Development preview; this source contract alone does not assert deployment. Server-only owner-issued Management credential, without Origin. Tenant comes from the current key. Existing keys gain no scopes. Installed support is separate from current scopes/resources. This creates no public-intake enrollment, customer phone proof, messaging consent or provider send. Management inputs never include native provider metadata/service-link editor fields. Requires provider-booking-policy:read and this exact current providerIds grant. Returns stored nullable override, current effective minutes/hours and parentPolicy from the same observation. Null means inheritance; equal explicit values remain overrides.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Exact provider UUID in the key current providerIds grant; businessSchedule/calendar grants do not substitute."
          }
        ],
        "x-crad-required-scopes": [
          "provider-booking-policy:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                },
                "description": "Do not cache policy, preview or acceptance."
              },
              "ETag": {
                "description": "Exact quoted current resource version; absent if accepted current resource is unavailable.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDurationPolicyProviderState"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/tenant/owner-issued authority refused, revoked integration, platform suspension, or browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no current resource belonging to the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PREVIEW_EXPIRED, PREVIEW_MISMATCH, IMPACT_CHANGED, INVALID_SETTINGS, OPERATION_CONFLICT or POLICY_IMPACT_TOO_LARGE. POLICY_REWRITE_TOO_LARGE means over 1,000 actual changes: nothing is saved, and keep_existing may still use the unchanged preview if otherwise current. No partial acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed fields/precondition, unsupported changed value, INVALID_BOOKING_POLICY, INVALID_SCHEDULE or OVERNIGHT_SCHEDULE_UNSUPPORTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request limit or POLICY_PREVIEW_LIMIT (at most 20 outstanding previews per actor/tenant). The latter uses Retry-After: 300; accepted operation receipts are separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Retain the original UUID and exact body/mode/If-Match; recover before creating another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "applyProviderDurationPolicy",
        "summary": "Apply a reviewed provider duration choice",
        "description": "Development preview; this source contract alone does not assert deployment. Server-only owner-issued Management credential, without Origin. Tenant comes from the current key. Existing keys gain no scopes. Installed support is separate from current scopes/resources. This creates no public-intake enrollment, customer phone proof, messaging consent or provider send. Management inputs never include native provider metadata/service-link editor fields. Submit exact previewId/proposal, original If-Match, explicit mode and one durable UUID Idempotency-Key. keep_existing saves policy and preserves every appointment. rewrite_eligible additionally requires booking-duration:rewrite and atomically changes at most 1,000 reviewed safe legacy future CONFIRMED/PENDING ends. Conflicts, protected snapshots/explicit provider overrides and unchanged ends remain untouched. Accepted starts stay fixed even when the new booking grid differs; this is not rescheduling. Current authority/version/impact is rechecked. No background continuation or customer notices. Receipt is immutable, current is independently read; exact accepted replay precedes fresh preview/version checks after current authorization. Requires provider-booking-policy read/write and this exact current providerIds grant. Only openingHours and slotDurationMinutes may be edited; parent business dependencies are version-bound.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Exact provider UUID in the key current providerIds grant; businessSchedule/calendar grants do not substitute."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"(?:bp:[0-9a-f-]{36}:(?:0|[1-9][0-9]{0,18})|dp:[0-9a-f-]{36}:[0-9a-f]{64})\"$"
            },
            "description": "Exact quoted ETag from the selected duration-policy resource. Opaque; do not use schedule/calendar versions, wildcards or weak validators."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one operation UUID with exact resource/proposal/preview/version/mode. Replay after uncertainty with the same request; never silently substitute a new UUID."
          }
        ],
        "x-crad-required-scopes": [
          "provider-booking-policy:read",
          "provider-booking-policy:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                },
                "description": "Do not cache policy, preview or acceptance."
              },
              "ETag": {
                "description": "Exact quoted current resource version; absent if accepted current resource is unavailable.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDurationPolicyResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/tenant/owner-issued authority refused, revoked integration, platform suspension, or browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no current resource belonging to the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PREVIEW_EXPIRED, PREVIEW_MISMATCH, IMPACT_CHANGED, INVALID_SETTINGS, OPERATION_CONFLICT or POLICY_IMPACT_TOO_LARGE. POLICY_REWRITE_TOO_LARGE means over 1,000 actual changes: nothing is saved, and keep_existing may still use the unchanged preview if otherwise current. No partial acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "POLICY_CHANGED: current physical provider/business policy or inherited dependencies differ. Preserve the draft; read and explicitly review a new preview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON request exceeds 8192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type must be application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed fields/precondition, unsupported changed value, INVALID_BOOKING_POLICY, INVALID_SCHEDULE or OVERNIGHT_SCHEDULE_UNSUPPORTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required If-Match or apply Idempotency-Key is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request limit or POLICY_PREVIEW_LIMIT (at most 20 outstanding previews per actor/tenant). The latter uses Retry-After: 300; accepted operation receipts are separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Retain the original UUID and exact body/mode/If-Match; recover before creating another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderDurationPolicyApplyRequest"
              }
            }
          }
        },
        "x-crad-conditional-scopes": {
          "description": "Choosing rewrite_eligible additionally requires booking-duration:rewrite; keep_existing and preview do not."
        }
      }
    },
    "/v1/management/duration-policy/providers/{providerId}/previews": {
      "post": {
        "operationId": "previewProviderDurationPolicy",
        "summary": "Review provider override or inheritance",
        "description": "Development preview; this source contract alone does not assert deployment. Server-only owner-issued Management credential, without Origin. Tenant comes from the current key. Existing keys gain no scopes. Installed support is separate from current scopes/resources. This creates no public-intake enrollment, customer phone proof, messaging consent or provider send. Management inputs never include native provider metadata/service-link editor fields. Review before/after and aggregate impact with the exact quoted ETag. Preview lasts five minutes, is bound to the current credential/resource/version/proposal and exact impact, and saves nothing. At most20 retained previews per actor/tenant; impact over 1,0000 future noncancelled appointments or10000 future blocks is refused, never truncated. Mode is chosen at apply. Requires provider-booking-policy read/write and this exact current providerIds grant. Null restores inheritance; preview captures the parent dependency.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Exact provider UUID in the key current providerIds grant; businessSchedule/calendar grants do not substitute."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"(?:bp:[0-9a-f-]{36}:(?:0|[1-9][0-9]{0,18})|dp:[0-9a-f-]{36}:[0-9a-f]{64})\"$"
            },
            "description": "Exact quoted ETag from the selected duration-policy resource. Opaque; do not use schedule/calendar versions, wildcards or weak validators."
          }
        ],
        "x-crad-required-scopes": [
          "provider-booking-policy:read",
          "provider-booking-policy:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                },
                "description": "Do not cache policy, preview or acceptance."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDurationPolicyProviderPreview"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/tenant/owner-issued authority refused, revoked integration, platform suspension, or browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no current resource belonging to the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PREVIEW_EXPIRED, PREVIEW_MISMATCH, IMPACT_CHANGED, INVALID_SETTINGS, OPERATION_CONFLICT or POLICY_IMPACT_TOO_LARGE. POLICY_REWRITE_TOO_LARGE means over 1,000 actual changes: nothing is saved, and keep_existing may still use the unchanged preview if otherwise current. No partial acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "POLICY_CHANGED: current physical provider/business policy or inherited dependencies differ. Preserve the draft; read and explicitly review a new preview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON request exceeds 8192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Content-Type must be application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed fields/precondition, unsupported changed value, INVALID_BOOKING_POLICY, INVALID_SCHEDULE or OVERNIGHT_SCHEDULE_UNSUPPORTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required If-Match or apply Idempotency-Key is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request limit or POLICY_PREVIEW_LIMIT (at most 20 outstanding previews per actor/tenant). The latter uses Retry-After: 300; accepted operation receipts are separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Retain the original UUID and exact body/mode/If-Match; recover before creating another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderDurationPolicyPreviewRequest"
              }
            }
          }
        }
      }
    },
    "/v1/management/duration-policy-operations/{operationId}": {
      "get": {
        "operationId": "getBusinessDurationPolicyOperation",
        "summary": "Recover the original duration policy operation",
        "description": "Development preview; this source contract alone does not assert deployment. Server-only owner-issued Management credential, without Origin. Tenant comes from the current key. Existing keys gain no scopes. Installed support is separate from current scopes/resources. This creates no public-intake enrollment, customer phone proof, messaging consent or provider send. Management inputs never include native provider metadata/service-link editor fields. Recover with the original UUID after an uncertain response. Current authority for the accepted business/provider resource and chosen mode is required, including providerIds and rewrite scope where relevant. A current write-authorized key in the same integration may recover after rotation. Unaccepted previews remain bound to their original credential. not_found is a current lookup result, not proof that an in-flight request can never commit; retain the same UUID/body on retry. Receipt/current are distinct; deleting a resource does not erase acceptance. Native and Management namespaces are separate.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                },
                "description": "Do not cache policy, preview or acceptance."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDurationPolicyOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/tenant/owner-issued authority refused, revoked integration, platform suspension, or browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "NOT_FOUND: no current resource belonging to the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PREVIEW_EXPIRED, PREVIEW_MISMATCH, IMPACT_CHANGED, INVALID_SETTINGS, OPERATION_CONFLICT or POLICY_IMPACT_TOO_LARGE. POLICY_REWRITE_TOO_LARGE means over 1,000 actual changes: nothing is saved, and keep_existing may still use the unchanged preview if otherwise current. No partial acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed fields/precondition, unsupported changed value, INVALID_BOOKING_POLICY, INVALID_SCHEDULE or OVERNIGHT_SCHEDULE_UNSUPPORTED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request limit or POLICY_PREVIEW_LIMIT (at most 20 outstanding previews per actor/tenant). The latter uses Retry-After: 300; accepted operation receipts are separate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Retain the original UUID and exact body/mode/If-Match; recover before creating another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-crad-conditional-scopes": {
          "description": "Requires both booking-policy:read and booking-policy:write, or both provider-booking-policy:read and provider-booking-policy:write. For an accepted receipt the pair must match its resource; provider receipts require the exact current providerIds grant. rewrite_eligible receipts additionally require booking-duration:rewrite."
        }
      }
    },
    "/v1/management/services": {
      "get": {
        "operationId": "getBusinessServiceCatalogue",
        "summary": "Read complete business service catalogue",
        "description": "Development preview; source support is not a deployment claim. Server-only owner-issued Management key, without Origin; tenant/integration come from the current credential. services:read reads the whole business catalogue; services:write additionally authorizes commands/recovery and requires read. Existing keys gain no scopes. Provider IDs, calendar grants and businessSchedule confer no catalogue authority. Installed serviceCatalogueRead/Write advertise support, not approval. Writes are silent: accepted physical appointments/snapshots, customer identity/proof and consent remain unchanged. No automatic public service selection, capability enrollment or provider send. No filters or query parameters. Read current service versions, exact catalogue order and configured creation capability.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "services:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current service/catalogue version where applicable; deleted current has no service ETag."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessServiceCatalogue"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/integration/tenant authority or browser Origin refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "SERVICE_NOT_FOUND: no current service in the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SERVICE_IN_USE (any appointment reference), SERVICE_ASSIGNMENT_REVIEW_REQUIRED (deleting a last explicit provider link would expand assignment), CATALOGUE_TOO_LARGE, PILOT_NOT_CONFIGURED, LEGACY_SERVICE_REQUIRES_LEGACY_EDITOR or OPERATION_CONFLICT. No partial acceptance; deactivate instead of deleting a referenced service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "SERVICE_CHANGED or CATALOGUE_CHANGED. Preserve the draft and refresh/review; do not overwrite with a guessed fresh version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE. Normal command body8KiB; exact reorder body64KiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON_REQUIRED when a body is supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_REQUEST, INVALID_PRECONDITION or INVALID_SERVICE_SETTINGS, including incomplete/duplicate reorder list or invalid final commercial values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing required Idempotency-Key or If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/site request limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Keep the original operation UUID, method, path, body and If-Match; recover before another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createBusinessService",
        "summary": "Create a business catalogue service",
        "description": "Development preview; source support is not a deployment claim. Server-only owner-issued Management key, without Origin; tenant/integration come from the current credential. services:read reads the whole business catalogue; services:write additionally authorizes commands/recovery and requires read. Existing keys gain no scopes. Provider IDs, calendar grants and businessSchedule confer no catalogue authority. Installed serviceCatalogueRead/Write advertise support, not approval. Writes are silent: accepted physical appointments/snapshots, customer identity/proof and consent remain unchanged. No automatic public service selection, capability enrollment or provider send. Persist exact mode/changes and UUID. Service identity/order are allocated under the tenant fence.201 first acceptance;200 exact accepted replay, even after later deletion.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID with the exact action/target/body/precondition before dispatch. Reuse only for the same intent."
          }
        ],
        "x-crad-required-scopes": [
          "services:read",
          "services:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current service/catalogue version where applicable; deleted current has no service ETag."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessServiceCatalogueResult"
                }
              }
            }
          },
          "201": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current service/catalogue version where applicable; deleted current has no service ETag."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessServiceCatalogueResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/integration/tenant authority or browser Origin refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "SERVICE_NOT_FOUND: no current service in the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SERVICE_IN_USE (any appointment reference), SERVICE_ASSIGNMENT_REVIEW_REQUIRED (deleting a last explicit provider link would expand assignment), CATALOGUE_TOO_LARGE, PILOT_NOT_CONFIGURED, LEGACY_SERVICE_REQUIRES_LEGACY_EDITOR or OPERATION_CONFLICT. No partial acceptance; deactivate instead of deleting a referenced service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "SERVICE_CHANGED or CATALOGUE_CHANGED. Preserve the draft and refresh/review; do not overwrite with a guessed fresh version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE. Normal command body8KiB; exact reorder body64KiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON_REQUIRED when a body is supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_REQUEST, INVALID_PRECONDITION or INVALID_SERVICE_SETTINGS, including incomplete/duplicate reorder list or invalid final commercial values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing required Idempotency-Key or If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/site request limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Keep the original operation UUID, method, path, body and If-Match; recover before another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessServiceCreateRequest"
              }
            }
          }
        }
      }
    },
    "/v1/management/services/reorder": {
      "post": {
        "operationId": "reorderBusinessServices",
        "summary": "Reorder complete business service catalogue",
        "description": "Development preview; source support is not a deployment claim. Server-only owner-issued Management key, without Origin; tenant/integration come from the current credential. services:read reads the whole business catalogue; services:write additionally authorizes commands/recovery and requires read. Existing keys gain no scopes. Provider IDs, calendar grants and businessSchedule confer no catalogue authority. Installed serviceCatalogueRead/Write advertise support, not approval. Writes are silent: accepted physical appointments/snapshots, customer identity/proof and consent remain unchanged. No automatic public service selection, capability enrollment or provider send. Submit every current service ID exactly once with the observed catalogue ETag. No query/filter selectors. This authenticated route alone allows a64KiB JSON body; other command bodies remain8KiB. Order/version are accepted atomically.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"scat:[0-9a-f]{64}\"$"
            },
            "description": "Exact quoted returned catalogue ETag. No wildcard or weak validators."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID with the exact action/target/body/precondition before dispatch. Reuse only for the same intent."
          }
        ],
        "x-crad-required-scopes": [
          "services:read",
          "services:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current service/catalogue version where applicable; deleted current has no service ETag."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessServiceCatalogueResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/integration/tenant authority or browser Origin refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "SERVICE_NOT_FOUND: no current service in the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SERVICE_IN_USE (any appointment reference), SERVICE_ASSIGNMENT_REVIEW_REQUIRED (deleting a last explicit provider link would expand assignment), CATALOGUE_TOO_LARGE, PILOT_NOT_CONFIGURED, LEGACY_SERVICE_REQUIRES_LEGACY_EDITOR or OPERATION_CONFLICT. No partial acceptance; deactivate instead of deleting a referenced service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "SERVICE_CHANGED or CATALOGUE_CHANGED. Preserve the draft and refresh/review; do not overwrite with a guessed fresh version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE. Normal command body8KiB; exact reorder body64KiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON_REQUIRED when a body is supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_REQUEST, INVALID_PRECONDITION or INVALID_SERVICE_SETTINGS, including incomplete/duplicate reorder list or invalid final commercial values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing required Idempotency-Key or If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/site request limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Keep the original operation UUID, method, path, body and If-Match; recover before another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessServiceReorderRequest"
              }
            }
          }
        }
      }
    },
    "/v1/management/services/{serviceId}": {
      "get": {
        "operationId": "getBusinessService",
        "summary": "Read one business catalogue service",
        "description": "Development preview; source support is not a deployment claim. Server-only owner-issued Management key, without Origin; tenant/integration come from the current credential. services:read reads the whole business catalogue; services:write additionally authorizes commands/recovery and requires read. Existing keys gain no scopes. Provider IDs, calendar grants and businessSchedule confer no catalogue authority. Installed serviceCatalogueRead/Write advertise support, not approval. Writes are silent: accepted physical appointments/snapshots, customer identity/proof and consent remain unchanged. No automatic public service selection, capability enrollment or provider send. Returns the current authorized item and service ETag from the same bounded complete catalogue. A catalogue over1000 returns CATALOGUE_TOO_LARGE.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "services:read"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current service/catalogue version where applicable; deleted current has no service ETag."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessService"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/integration/tenant authority or browser Origin refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "SERVICE_NOT_FOUND: no current service in the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SERVICE_IN_USE (any appointment reference), SERVICE_ASSIGNMENT_REVIEW_REQUIRED (deleting a last explicit provider link would expand assignment), CATALOGUE_TOO_LARGE, PILOT_NOT_CONFIGURED, LEGACY_SERVICE_REQUIRES_LEGACY_EDITOR or OPERATION_CONFLICT. No partial acceptance; deactivate instead of deleting a referenced service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "SERVICE_CHANGED or CATALOGUE_CHANGED. Preserve the draft and refresh/review; do not overwrite with a guessed fresh version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE. Normal command body8KiB; exact reorder body64KiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON_REQUIRED when a body is supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_REQUEST, INVALID_PRECONDITION or INVALID_SERVICE_SETTINGS, including incomplete/duplicate reorder list or invalid final commercial values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing required Idempotency-Key or If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/site request limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Keep the original operation UUID, method, path, body and If-Match; recover before another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateBusinessService",
        "summary": "Edit or deactivate a business catalogue service",
        "description": "Development preview; source support is not a deployment claim. Server-only owner-issued Management key, without Origin; tenant/integration come from the current credential. services:read reads the whole business catalogue; services:write additionally authorizes commands/recovery and requires read. Existing keys gain no scopes. Provider IDs, calendar grants and businessSchedule confer no catalogue authority. Installed serviceCatalogueRead/Write advertise support, not approval. Writes are silent: accepted physical appointments/snapshots, customer identity/proof and consent remain unchanged. No automatic public service selection, capability enrollment or provider send. Submit nonempty changes with the observed service ETag. Mode is derived from stored duration and cannot be changed in-place. Activity uses changes:{isActive:false}. Unedited legacy values remain unchanged.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"svc:[0-9a-f-]{36}:(0|[1-9][0-9]{0,18})\"$"
            },
            "description": "Exact quoted returned service ETag. No wildcard or weak validators."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID with the exact action/target/body/precondition before dispatch. Reuse only for the same intent."
          }
        ],
        "x-crad-required-scopes": [
          "services:read",
          "services:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current service/catalogue version where applicable; deleted current has no service ETag."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessServiceCatalogueResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/integration/tenant authority or browser Origin refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "SERVICE_NOT_FOUND: no current service in the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SERVICE_IN_USE (any appointment reference), SERVICE_ASSIGNMENT_REVIEW_REQUIRED (deleting a last explicit provider link would expand assignment), CATALOGUE_TOO_LARGE, PILOT_NOT_CONFIGURED, LEGACY_SERVICE_REQUIRES_LEGACY_EDITOR or OPERATION_CONFLICT. No partial acceptance; deactivate instead of deleting a referenced service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "SERVICE_CHANGED or CATALOGUE_CHANGED. Preserve the draft and refresh/review; do not overwrite with a guessed fresh version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE. Normal command body8KiB; exact reorder body64KiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON_REQUIRED when a body is supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_REQUEST, INVALID_PRECONDITION or INVALID_SERVICE_SETTINGS, including incomplete/duplicate reorder list or invalid final commercial values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing required Idempotency-Key or If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/site request limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Keep the original operation UUID, method, path, body and If-Match; recover before another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessServiceUpdateRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteBusinessService",
        "summary": "Delete an unreferenced business catalogue service",
        "description": "Development preview; source support is not a deployment claim. Server-only owner-issued Management key, without Origin; tenant/integration come from the current credential. services:read reads the whole business catalogue; services:write additionally authorizes commands/recovery and requires read. Existing keys gain no scopes. Provider IDs, calendar grants and businessSchedule confer no catalogue authority. Installed serviceCatalogueRead/Write advertise support, not approval. Writes are silent: accepted physical appointments/snapshots, customer identity/proof and consent remain unchanged. No automatic public service selection, capability enrollment or provider send. No body is necessary; an explicit empty JSON object is also accepted. Uses observed service ETag and UUID. Refuses appointment references and unsafe last provider-link expansion. Accepted deletion removes only that service public selection/image references with their independent versions; receipts remain recoverable.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "serviceId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"svc:[0-9a-f-]{36}:(0|[1-9][0-9]{0,18})\"$"
            },
            "description": "Exact quoted returned service ETag. No wildcard or weak validators."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID with the exact action/target/body/precondition before dispatch. Reuse only for the same intent."
          }
        ],
        "x-crad-required-scopes": [
          "services:read",
          "services:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current service/catalogue version where applicable; deleted current has no service ETag."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessServiceCatalogueResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/integration/tenant authority or browser Origin refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "SERVICE_NOT_FOUND: no current service in the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SERVICE_IN_USE (any appointment reference), SERVICE_ASSIGNMENT_REVIEW_REQUIRED (deleting a last explicit provider link would expand assignment), CATALOGUE_TOO_LARGE, PILOT_NOT_CONFIGURED, LEGACY_SERVICE_REQUIRES_LEGACY_EDITOR or OPERATION_CONFLICT. No partial acceptance; deactivate instead of deleting a referenced service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "SERVICE_CHANGED or CATALOGUE_CHANGED. Preserve the draft and refresh/review; do not overwrite with a guessed fresh version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE. Normal command body8KiB; exact reorder body64KiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON_REQUIRED when a body is supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_REQUEST, INVALID_PRECONDITION or INVALID_SERVICE_SETTINGS, including incomplete/duplicate reorder list or invalid final commercial values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing required Idempotency-Key or If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/site request limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Keep the original operation UUID, method, path, body and If-Match; recover before another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/service-operations/{operationId}": {
      "get": {
        "operationId": "getBusinessServiceOperation",
        "summary": "Recover a business catalogue operation",
        "description": "Development preview; source support is not a deployment claim. Server-only owner-issued Management key, without Origin; tenant/integration come from the current credential. services:read reads the whole business catalogue; services:write additionally authorizes commands/recovery and requires read. Existing keys gain no scopes. Provider IDs, calendar grants and businessSchedule confer no catalogue authority. Installed serviceCatalogueRead/Write advertise support, not approval. Writes are silent: accepted physical appointments/snapshots, customer identity/proof and consent remain unchanged. No automatic public service selection, capability enrollment or provider send. Check the original UUID after timeout or uncertain response. Current read+write authority and the same integration are required; an authorized rotated key can recover. Receipt stays immutable while current may be newer or null. not_found does not authorize a new UUID; retain and explicitly retry only the same request if still intended.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "services:read",
          "services:write"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current service/catalogue version where applicable; deleted current has no service ETag."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessServiceCatalogueOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/integration/tenant authority or browser Origin refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "SERVICE_NOT_FOUND: no current service in the credential tenant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "SERVICE_IN_USE (any appointment reference), SERVICE_ASSIGNMENT_REVIEW_REQUIRED (deleting a last explicit provider link would expand assignment), CATALOGUE_TOO_LARGE, PILOT_NOT_CONFIGURED, LEGACY_SERVICE_REQUIRES_LEGACY_EDITOR or OPERATION_CONFLICT. No partial acceptance; deactivate instead of deleting a referenced service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "SERVICE_CHANGED or CATALOGUE_CHANGED. Preserve the draft and refresh/review; do not overwrite with a guessed fresh version.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE. Normal command body8KiB; exact reorder body64KiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON_REQUIRED when a body is supplied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_REQUEST, INVALID_PRECONDITION or INVALID_SERVICE_SETTINGS, including incomplete/duplicate reorder list or invalid final commercial values.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing required Idempotency-Key or If-Match.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/site request limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "PERSISTENCE_FAILED or OUTCOME_UNCERTAIN. Keep the original operation UUID, method, path, body and If-Match; recover before another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/service-publication": {
      "get": {
        "operationId": "getBusinessServicePublication",
        "summary": "Read reviewed website service selection",
        "description": "Development preview; source support alone does not claim deployment. Backend-only owner-issued Management credential; no Origin or tenant/resource selector. website-content:read is explicit; replacement/recovery additionally require website-content:write, which requires read. services:* and provider/calendar/schedule grants do not confer this authority; existing keys stay unchanged. Installed publicContentRead/Write advertise support, not permission. These writes do not activate website intake, AI, Flow, WhatsApp or reminders, change accepted bookings/proof/consent, or send notifications. GET returns all options up to1,000 with truncated:false; more refuses CATALOGUE_TOO_LARGE. serviceIds contains the selected set, even if a later edit makes one ineligible.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "website-content:read"
        ],
        "responses": {
          "200": {
            "description": "Current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current resource version. Publication result with unavailable current omits ETag; recovery uses its body, not a fresh write precondition."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessPublicationState"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid current Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/access denied or Origin present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT, CATALOGUE_TOO_LARGE or current service eligibility/reference conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "VERSION_CONFLICT; refresh and review a new intent after resolving the original request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds8KiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid shape, URL, service IDs or exact precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Original If-Match or Idempotency-Key missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Quota; Retry-After applies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence/uncertain result; retain original request and recover.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "replaceBusinessServicePublication",
        "summary": "Replace reviewed website service selection",
        "description": "Development preview; source support alone does not claim deployment. Backend-only owner-issued Management credential; no Origin or tenant/resource selector. website-content:read is explicit; replacement/recovery additionally require website-content:write, which requires read. services:* and provider/calendar/schedule grants do not confer this authority; existing keys stay unchanged. Installed publicContentRead/Write advertise support, not permission. These writes do not activate website intake, AI, Flow, WhatsApp or reminders, change accepted bookings/proof/consent, or send notifications. Read GET first and use its exact quoted pub:N ETag (N is a nonnegative safe integer). Full replacement, no merge/force/wildcard. At most100 current eligible tenant service IDs; canonical selection order is not catalogue order.8KiB body limit. Unselection preserves accepted bookings; reactivating an already selected eligible service can restore visibility.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"pub:(0|[1-9][0-9]*)\"$"
            },
            "description": "Exact returned quoted pub:N; maximum N9007199254740991. No weak/wildcard ETag."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist the original UUID with the exact complete body and original If-Match before dispatch. Reuse only for that same intent."
          }
        ],
        "x-crad-required-scopes": [
          "website-content:read",
          "website-content:write"
        ],
        "responses": {
          "200": {
            "description": "Accepted/replayed immutable receipt plus current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current resource version. Publication result with unavailable current omits ETag; recovery uses its body, not a fresh write precondition."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessPublicationResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid current Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/access denied or Origin present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT, CATALOGUE_TOO_LARGE or current service eligibility/reference conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "VERSION_CONFLICT; refresh and review a new intent after resolving the original request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds8KiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid shape, URL, service IDs or exact precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Original If-Match or Idempotency-Key missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Quota; Retry-After applies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence/uncertain result; retain original request and recover.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessPublicationReplaceRequest"
              }
            }
          }
        }
      }
    },
    "/v1/management/service-publication/operations/{operationId}": {
      "get": {
        "operationId": "getBusinessServicePublicationOperation",
        "summary": "Recover an accepted service-publication operation",
        "description": "Development preview; source support alone does not claim deployment. Backend-only owner-issued Management credential; no Origin or tenant/resource selector. website-content:read is explicit; replacement/recovery additionally require website-content:write, which requires read. services:* and provider/calendar/schedule grants do not confer this authority; existing keys stay unchanged. Installed publicContentRead/Write advertise support, not permission. These writes do not activate website intake, AI, Flow, WhatsApp or reminders, change accepted bookings/proof/consent, or send notifications. Read-only lookup of the original UUID. Current read+write scope and the same integration/resource namespace are required; a rotated authorized key can recover. An accepted receipt is immutable while current state is fresh. If later current catalogue exceeds1,000, retain the accepted receipt with current:null and currentUnavailableReason:catalogue_too_large. This is not a failed or missing accepted command.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "website-content:read",
          "website-content:write"
        ],
        "responses": {
          "200": {
            "description": "Committed receipt or genuinely absent authorized operation.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessPublicationOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid current Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/access denied or Origin present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT, CATALOGUE_TOO_LARGE or current service eligibility/reference conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "VERSION_CONFLICT; refresh and review a new intent after resolving the original request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds8KiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid shape, URL, service IDs or exact precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Original If-Match or Idempotency-Key missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Quota; Retry-After applies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence/uncertain result; retain original request and recover.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/public-presentation": {
      "get": {
        "operationId": "getBusinessPublicPresentation",
        "summary": "Read explicitly public business presentation",
        "description": "Development preview; source support alone does not claim deployment. Backend-only owner-issued Management credential; no Origin or tenant/resource selector. website-content:read is explicit; replacement/recovery additionally require website-content:write, which requires read. services:* and provider/calendar/schedule grants do not confer this authority; existing keys stay unchanged. Installed publicContentRead/Write advertise support, not permission. These writes do not activate website intake, AI, Flow, WhatsApp or reminders, change accepted bookings/proof/consent, or send notifications. GET returns only explicitly saved public fields. Empty/null values are deliberate initial content.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "website-content:read"
        ],
        "responses": {
          "200": {
            "description": "Current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current resource version. Publication result with unavailable current omits ETag; recovery uses its body, not a fresh write precondition."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessPresentationState"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid current Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/access denied or Origin present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT, CATALOGUE_TOO_LARGE or current service eligibility/reference conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "VERSION_CONFLICT; refresh and review a new intent after resolving the original request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds1MiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid shape, URL, service IDs or exact precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Original If-Match or Idempotency-Key missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Quota; Retry-After applies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence/uncertain result; retain original request and recover.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "replaceBusinessPublicPresentation",
        "summary": "Replace explicitly public business presentation",
        "description": "Development preview; source support alone does not claim deployment. Backend-only owner-issued Management credential; no Origin or tenant/resource selector. website-content:read is explicit; replacement/recovery additionally require website-content:write, which requires read. services:* and provider/calendar/schedule grants do not confer this authority; existing keys stay unchanged. Installed publicContentRead/Write advertise support, not permission. These writes do not activate website intake, AI, Flow, WhatsApp or reminders, change accepted bookings/proof/consent, or send notifications. Read GET first and use its exact quoted pres:N ETag (N is a nonnegative safe integer). Full replacement, no merge/force/wildcard. Supply all location/contact/URL/image fields; at most100 unique service images belonging to current tenant services.1MiB body limit, URL metadata only. Canonical URL validation is authoritative.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"pres:(0|[1-9][0-9]*)\"$"
            },
            "description": "Exact returned quoted pres:N; maximum N9007199254740991. No weak/wildcard ETag."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist the original UUID with the exact complete body and original If-Match before dispatch. Reuse only for that same intent."
          }
        ],
        "x-crad-required-scopes": [
          "website-content:read",
          "website-content:write"
        ],
        "responses": {
          "200": {
            "description": "Accepted/replayed immutable receipt plus current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current resource version. Publication result with unavailable current omits ETag; recovery uses its body, not a fresh write precondition."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessPresentationResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid current Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/access denied or Origin present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT, CATALOGUE_TOO_LARGE or current service eligibility/reference conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "VERSION_CONFLICT; refresh and review a new intent after resolving the original request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds1MiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid shape, URL, service IDs or exact precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Original If-Match or Idempotency-Key missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Quota; Retry-After applies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence/uncertain result; retain original request and recover.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessPresentationReplaceRequest"
              }
            }
          }
        }
      }
    },
    "/v1/management/public-presentation/operations/{operationId}": {
      "get": {
        "operationId": "getBusinessPublicPresentationOperation",
        "summary": "Recover an accepted public-presentation operation",
        "description": "Development preview; source support alone does not claim deployment. Backend-only owner-issued Management credential; no Origin or tenant/resource selector. website-content:read is explicit; replacement/recovery additionally require website-content:write, which requires read. services:* and provider/calendar/schedule grants do not confer this authority; existing keys stay unchanged. Installed publicContentRead/Write advertise support, not permission. These writes do not activate website intake, AI, Flow, WhatsApp or reminders, change accepted bookings/proof/consent, or send notifications. Read-only lookup of the original UUID. Current read+write scope and the same integration/resource namespace are required; a rotated authorized key can recover. An accepted receipt is immutable while current state is fresh. Service deletion can clean current image references and bump its version without rewriting the accepted receipt.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "website-content:read",
          "website-content:write"
        ],
        "responses": {
          "200": {
            "description": "Committed receipt or genuinely absent authorized operation.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessPresentationOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid current Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope/access denied or Origin present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT, CATALOGUE_TOO_LARGE or current service eligibility/reference conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "VERSION_CONFLICT; refresh and review a new intent after resolving the original request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds1MiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON content type required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid shape, URL, service IDs or exact precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Original If-Match or Idempotency-Key missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Quota; Retry-After applies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence/uncertain result; retain original request and recover.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/providers": {
      "get": {
        "operationId": "listBusinessProviders",
        "summary": "List explicitly granted existing providers",
        "description": "Development preview; source support alone does not claim deployment. Backend-only owner-issued Management credential, without Origin. Tenant/integration derive from the current key. Explicit providers:read and nonempty current providerIds authorize only selected existing providers, including inactive; updates/recovery also require providers:write, which requires read. Existing credentials gain no scopes. Calendar, policy, catalogue and businessSchedule permissions confer no provider-management authority. Installed providersRead/Write advertise support only. No query/filter authority. Provider phone is ordinary contact information, not customer proof, consent, sender connection or login. No appointment rows, accepted terms, lineage, reminder/notice intent or user/login fields change, and no messages or platform activation occur. Returns a complete bounded list, at most1,000 providers; PROVIDER_LIST_TOO_LARGE refuses a larger result. Inactive providers remain readable for administration. No cursor or implied all-business authority.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "providers:read"
        ],
        "responses": {
          "200": {
            "description": "Current authorized provider state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessProviderList"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_REQUIRED, ACCESS_REVOKED, current provider grant denied or server-only Origin refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method on this resource. Provider-record creation/deletion are unavailable; creating a login for an existing provider uses the separate login-operations route and explicit provider-logins:write.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PROVIDER_LIST_TOO_LARGE or OPERATION_CONFLICT; no partial update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid shape, unsupported field, UUID, query selector, exact assignment or precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or uncertain outcome; retain the original exact request and recover before another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/providers/{providerId}": {
      "get": {
        "operationId": "getBusinessProvider",
        "summary": "Read an existing provider and displayed version",
        "description": "Development preview; source support alone does not claim deployment. Backend-only owner-issued Management credential, without Origin. Tenant/integration derive from the current key. Explicit providers:read and nonempty current providerIds authorize only selected existing providers, including inactive; updates/recovery also require providers:write, which requires read. Existing credentials gain no scopes. Calendar, policy, catalogue and businessSchedule permissions confer no provider-management authority. Installed providersRead/Write advertise support only. No query/filter authority. Provider phone is ordinary contact information, not customer proof, consent, sender connection or login. No appointment rows, accepted terms, lineage, reminder/notice intent or user/login fields change, and no messages or platform activation occur. Read before an edit. version binds current provider metadata, exact assignment links and relevant enabled managed-booking activity facts. activityEffects indicate only the actual target toggle effect, without other provider identities.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "An existing provider in the key’s current explicit providerIds grant."
          }
        ],
        "x-crad-required-scopes": [
          "providers:read"
        ],
        "responses": {
          "200": {
            "description": "Current authorized provider state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Exact quoted current provider version. A mutation with current:null omits ETag; receipt.acceptedVersion is historical acceptance, not a fresh precondition."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessProviderState"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_REQUIRED, ACCESS_REVOKED, current provider grant denied or server-only Origin refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Authorized provider genuinely absent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method on this resource. Provider-record creation/deletion are unavailable; creating a login for an existing provider uses the separate login-operations route and explicit provider-logins:write.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PROVIDER_LIST_TOO_LARGE or OPERATION_CONFLICT; no partial update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid shape, unsupported field, UUID, query selector, exact assignment or precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or uncertain outcome; retain the original exact request and recover before another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateBusinessProvider",
        "summary": "Update existing provider metadata, activity or service assignment",
        "description": "Development preview; source support alone does not claim deployment. Backend-only owner-issued Management credential, without Origin. Tenant/integration derive from the current key. Explicit providers:read and nonempty current providerIds authorize only selected existing providers, including inactive; updates/recovery also require providers:write, which requires read. Existing credentials gain no scopes. Calendar, policy, catalogue and businessSchedule permissions confer no provider-management authority. Installed providersRead/Write advertise support only. No query/filter authority. Provider phone is ordinary contact information, not customer proof, consent, sender connection or login. No appointment rows, accepted terms, lineage, reminder/notice intent or user/login fields change, and no messages or platform activation occur. Supply only edited changes, preserving original exact text/body for replay. Names supply all he/ar/en keys and at least one nonblank value. Supplied assignment is complete: all means zero links and all currently eligible services plus future additions; selected accepts1–1,000 distinct current tenant service IDs, including inactive. Retained links keep custom price/duration overrides; new pairs use existing defaults. services:read is separately required for full catalogue labels. Review non-none activityEffects before confirming an activity toggle; managed single-provider readiness may change, while legacy booking rules remain. PATCH alone accepts64KiB JSON. Exact accepted replay precedes fresh CAS after current authority; PROVIDER_CHANGED412 preserves the unaccepted draft for refresh/review.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "An existing provider in the key’s current explicit providerIds grant."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"prv:[a-f0-9-]{36}:[a-f0-9]{64}\"$"
            },
            "description": "Exact quoted version from the displayed detail/current state. No weak/wildcard ETag or hidden fresh-version preflight."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist this original UUID with target, exact changes and observed If-Match before dispatch. Retry only the same request."
          }
        ],
        "x-crad-required-scopes": [
          "providers:read",
          "providers:write"
        ],
        "responses": {
          "200": {
            "description": "Current authorized provider state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Exact quoted current provider version. A mutation with current:null omits ETag; receipt.acceptedVersion is historical acceptance, not a fresh precondition."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessProviderResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_REQUIRED, ACCESS_REVOKED, current provider grant denied or server-only Origin refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Authorized provider genuinely absent before acceptance.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method on this resource. Provider-record creation/deletion are unavailable; creating a login for an existing provider uses the separate login-operations route and explicit provider-logins:write.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PROVIDER_LIST_TOO_LARGE or OPERATION_CONFLICT; no partial update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "PROVIDER_CHANGED; refresh and review only after resolving the original request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "PATCH JSON body exceeds64KiB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid shape, unsupported field, UUID, query selector, exact assignment or precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Original If-Match or Idempotency-Key missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or uncertain outcome; retain the original exact request and recover before another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessProviderUpdateRequest"
              }
            }
          }
        }
      }
    },
    "/v1/management/provider-operations/{operationId}": {
      "get": {
        "operationId": "getBusinessProviderOperation",
        "summary": "Recover the original provider update",
        "description": "Development preview; source support alone does not claim deployment. Backend-only owner-issued Management credential, without Origin. Tenant/integration derive from the current key. Explicit providers:read and nonempty current providerIds authorize only selected existing providers, including inactive; updates/recovery also require providers:write, which requires read. Existing credentials gain no scopes. Calendar, policy, catalogue and businessSchedule permissions confer no provider-management authority. Installed providersRead/Write advertise support only. No query/filter authority. Provider phone is ordinary contact information, not customer proof, consent, sender connection or login. No appointment rows, accepted terms, lineage, reminder/notice intent or user/login fields change, and no messages or platform activation occur. Read-only lookup after timeout or uncertain response. Fresh read/write scope, the same integration and original provider grant are required; an authorized replacement key may recover. Keep receipt immutable and current separate, possibly newer or null after genuine removal. Missing returns not_found only after fresh authority; retain the original UUID/body/version and explicitly retry that same intent if still intended. Lookup never changes or reauthorizes an operation.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The persisted original update UUID."
          }
        ],
        "x-crad-required-scopes": [
          "providers:read",
          "providers:write"
        ],
        "responses": {
          "200": {
            "description": "Current authorized provider state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessProviderOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_REQUIRED, ACCESS_REVOKED, current provider grant denied or server-only Origin refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method on this resource. Provider-record creation/deletion are unavailable; creating a login for an existing provider uses the separate login-operations route and explicit provider-logins:write.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PROVIDER_LIST_TOO_LARGE or OPERATION_CONFLICT; no partial update.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid shape, unsupported field, UUID, query selector, exact assignment or precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or uncertain outcome; retain the original exact request and recover before another intent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/reports/overview": {
      "get": {
        "operationId": "getBusinessReportsOverview",
        "summary": "Read current whole-business overview counters",
        "description": "Development preview; source support alone does not establish deployment. Server-only owner-issued Management credential without Origin, requiring explicit reports:read. This deliberate whole-business grant is independent of providerIds, businessSchedule and calendar grants; old keys gain nothing. A dedicated report key uses empty providerIds and businessSchedule:false. Accepts no query parameters or request body: no tenant/provider filters, arbitrary asOf or date range. The server observes the current business-local day, Sunday-based week and tomorrow from one snapshot. Missing/null configured timezone follows the existing Asia/Jerusalem default; an invalid configured timezone refuses INVALID_SETTINGS. Counts use appointment start instants and exclude null status and CANCELLED; remainingToday additionally requires a strictly future start and PENDING, CONFIRMED or NOW. tomorrowFirstStartAt is the earliest counted start tomorrow. Returned period boundaries are authoritative, including DST. No customer details, money, monthly report, write, enrollment, notification or activation is included. Installed reportsOverviewRead is support metadata, not a grant. A retry reads a fresh observation; no operation UUID or If-Match is used.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "reports:read"
        ],
        "responses": {
          "200": {
            "description": "Current aggregate overview; not cached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessReportsOverview"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_REQUIRED, ACCESS_REVOKED, FORBIDDEN or server-only Origin refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Only GET is supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INVALID_SETTINGS: configured business timezone is invalid; no partial counters are returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Any query parameter or request body is invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or temporary lock timeout; retry the read for a new observation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/providers/{providerId}/login-operations": {
      "post": {
        "operationId": "createBusinessProviderLogin",
        "summary": "Create and link a provider login",
        "description": "Development preview; source support is not production activation. Server-only Management credential without Origin, explicit provider-logins:write plus providers:read, and the existing provider in current providerIds. Tenant/integration derive from the key. This only creates a new CRAD login with fixed provider membership and links the selected existing, unlinked provider. No invitation message is sent. It does not create provider records, change an existing login/password, reuse an existing account by email, activate a provider/business/bot or alter appointments. One Auth user UUID is reserved before any Auth request. Ambiguous Auth or database outcomes retain that original operation. A 503 containing state:pending is not permission to start over. GET checks the recorded result without creating an account; explicit same-command POST may reconcile and finish it. reviewRequired means an owner/operator must inspect the unresolved state. After a server digest-key rotation, pending POST can return LOGIN_KEY_UNAVAILABLE; check-only recovery remains available. No automatic deletion or rollback of an uncertain account is claimed. A 422 with state:rejected is terminal: this operation cannot later link an account. Correct the credentials and submit a new operation after reading the current provider. A generic 422 Error or pending cause:auth_request_rejected is not the same result and does not permit replacing an unresolved command.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "providerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "An existing provider in the key’s current explicit providerIds grant."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"prv:[a-f0-9-]{36}:[a-f0-9]{64}\"$"
            },
            "description": "Exact quoted version from the displayed detail/current state. No weak/wildcard ETag or hidden fresh-version preflight."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist the original operation UUID and selected provider/version before sending. Check the original operation after uncertainty. An explicit retry must contain the same email, fullName and exact password; never persist the password in browser storage or retry queues."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProviderLoginRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted exact replay.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ProviderLoginResult"
                    },
                    {
                      "properties": {
                        "state": {
                          "const": "accepted"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "201": {
            "description": "New login linked and accepted receipt recorded atomically with provider membership.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ProviderLoginResult"
                    },
                    {
                      "properties": {
                        "state": {
                          "const": "accepted"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current permission/resource denied, revoked authority, or browser Origin refused. Old credentials gain no login permission.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Selected provider not found before reservation.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT for changed intent, or PROVIDER_ALREADY_LINKED before reservation. Never adopt or replace the linked account.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "PROVIDER_CHANGED: resolve the original operation before reviewing a new current version.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request exceeds the supported JSON body limit.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json required.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request Error, or a durable rejected result after an explicit no-create Auth refusal. Only state:rejected permits a new operation with corrected credentials; generic errors do not resolve an earlier uncertain operation.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ProviderLoginResult"
                        },
                        {
                          "properties": {
                            "state": {
                              "const": "rejected"
                            }
                          }
                        }
                      ]
                    }
                  ]
                }
              }
            }
          },
          "428": {
            "description": "Original Idempotency-Key or exact quoted If-Match is required.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Unresolved operation, key unavailable, or temporary persistence failure. Retain the original operation; no automatic resend.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "When supplied, wait this many seconds before a result check; not an instruction to create another account."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Error"
                    },
                    {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/ProviderLoginResult"
                        },
                        {
                          "properties": {
                            "state": {
                              "const": "pending"
                            }
                          }
                        }
                      ]
                    }
                  ]
                }
              }
            }
          }
        },
        "x-crad-required-scopes": [
          "providers:read",
          "provider-logins:write"
        ],
        "x-crad-conditional-scopes": {
          "description": "The selected provider UUID must also appear in the credential’s current explicit providerIds."
        }
      }
    },
    "/v1/management/provider-login-operations/{operationId}": {
      "get": {
        "operationId": "getBusinessProviderLoginOperation",
        "summary": "Check provider login creation",
        "description": "Development preview; source support is not production activation. Server-only Management credential without Origin, explicit provider-logins:write plus providers:read, and the existing provider in current providerIds. Tenant/integration derive from the key. This only creates a new CRAD login with fixed provider membership and links the selected existing, unlinked provider. No invitation message is sent. It does not create provider records, change an existing login/password, reuse an existing account by email, activate a provider/business/bot or alter appointments. Read-only operation lookup with current authority. It makes no Auth creation request and does not finalize a pending operation. not_found is not proof that an earlier delayed request cannot commit; retain the original UUID and do not start a second command. The receipt proves acceptance, not present-day account access after later changes.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized operation or not_found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProviderLoginOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current permission/resource denied, revoked authority, or browser Origin refused. Old credentials gain no login permission.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, identifier or provider login input.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary persistence failure; keep the original operation locator.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-crad-required-scopes": [
          "providers:read",
          "provider-logins:write"
        ],
        "x-crad-conditional-scopes": {
          "description": "The selected provider UUID must also appear in the credential’s current explicit providerIds."
        }
      }
    },
    "/v1/management/template-requests": {
      "get": {
        "operationId": "listBusinessTemplateRequests",
        "tags": [
          "Management"
        ],
        "summary": "List template requests",
        "description": "Backend-only owner-issued Management credential without Origin. Requires template-requests:read for this business; provider/calendar grants do not confer this authority. Calling the API does not expand the key's grants. Tenant and integration derive from the current key. Draft/paused website intake and disconnected WhatsApp do not block this administrative request. Lists requests created in CRAD or by authorized integrations, newest (createdAt, requestId) first. Default status is open. Filter status stays fixed across pages; status changes can change membership, so this list is not a snapshot or change feed. The cursor remains a valid anchor if that request is marked done. No author IDs, Meta credentials or platform fulfillment actions are exposed.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "done",
                "all"
              ],
              "default": "open"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The previous page’s nextCursor; omit on the first page."
          }
        ],
        "x-crad-required-scopes": [
          "template-requests:read"
        ],
        "responses": {
          "200": {
            "description": "Current authorized page.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessTemplateRequestList"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current key/integration/scope authority denied, platform suspension, or browser Origin refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid input, query or UUID. INVALID_CURSOR means the cursor request is absent from this business; restart listing.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota reached; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "When supplied, seconds to wait before checking again; not permission to create another command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary read or persistence failure. Retry this read after any supplied Retry-After; this operation does not submit a request.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "When supplied, seconds to wait before retrying this read."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createBusinessTemplateRequest",
        "tags": [
          "Management"
        ],
        "summary": "Request a WhatsApp template",
        "description": "Backend-only owner-issued Management credential without Origin. Requires template-requests:read and template-requests:write for this business; provider/calendar grants do not confer this authority. Calling the API does not expand the key's grants. Tenant and integration derive from the current key. Draft/paused website intake and disconnected WhatsApp do not block this administrative request. Creates an open request in the existing CRAD staff queue. This performs no Meta call, sends no message and grants no approval. Persist the original UUID and normalized input before sending. The request and immutable acceptance receipt commit together. Exact same-operation retry returns the original receipt and current request state; changed input with that UUID is refused. No If-Match is needed for this append-only creation. After a lost response, use the operation lookup; not_found does not prove a delayed request cannot commit. Only explicitly retry the same UUID and body. Platform staff alone can mark a request done. exampleText suggests wording only; a done request is not a Meta-approved template. Before sending, select an APPROVED, supported variant in the sending catalogue for the intended language.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Original client-generated operation UUID; persist with the input and reuse for lookup or explicit exact retry."
          }
        ],
        "x-crad-required-scopes": [
          "template-requests:read",
          "template-requests:write"
        ],
        "responses": {
          "200": {
            "description": "Exact replay of an accepted request.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessTemplateRequestResult"
                }
              }
            }
          },
          "201": {
            "description": "Request and receipt recorded.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessTemplateRequestResult"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current key/integration/scope authority denied, platform suspension, or browser Origin refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "TEMPLATE_REQUEST_OPERATION_REUSED: this operation UUID is already bound to different normalized input.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds 8,192 bytes.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json is required.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request body or Idempotency-Key UUID.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota reached; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "When supplied, seconds to wait before checking again; not permission to create another command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary persistence failure or uncertain write. Retain the original operation UUID and input; check its result before an explicit retry.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "When supplied, seconds to wait before checking again; not permission to create another command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessTemplateRequestInput"
              }
            }
          }
        }
      }
    },
    "/v1/management/template-requests/{requestId}": {
      "get": {
        "operationId": "getBusinessTemplateRequest",
        "tags": [
          "Management"
        ],
        "summary": "Read a template request",
        "description": "Backend-only owner-issued Management credential without Origin. Requires template-requests:read for this business; provider/calendar grants do not confer this authority. Calling the API does not expand the key's grants. Tenant and integration derive from the current key. Draft/paused website intake and disconnected WhatsApp do not block this administrative request. Read the current request, including when staff marked it done. This status describes CRAD handling, not Meta template approval or delivery readiness. The request may originate in the native panel or another authorized integration for this business.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "template-requests:read"
        ],
        "responses": {
          "200": {
            "description": "Current request.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessTemplateRequest"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current key/integration/scope authority denied, platform suspension, or browser Origin refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "REQUEST_NOT_FOUND for this business.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid requestId UUID or unsupported query/body.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota reached; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "When supplied, seconds to wait before checking again; not permission to create another command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary read or persistence failure. Retry this read after any supplied Retry-After; this operation does not submit a request.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "When supplied, seconds to wait before retrying this read."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/template-request-operations/{operationId}": {
      "get": {
        "operationId": "getBusinessTemplateRequestOperation",
        "tags": [
          "Management"
        ],
        "summary": "Check template request submission",
        "description": "Backend-only owner-issued Management credential without Origin. Requires template-requests:read and template-requests:write for this business; provider/calendar grants do not confer this authority. Calling the API does not expand the key's grants. Tenant and integration derive from the current key. Draft/paused website intake and disconnected WhatsApp do not block this administrative request. Read-only lookup of this integration’s original operation. Requires current read and write scopes; an authorized replacement credential for the same integration can recover it. It creates nothing and never resubmits. The receipt preserves the originally accepted open request; current may now be done or removed. A removed current request returns request_not_found without erasing the receipt. not_found does not cancel an earlier delayed request. Keep the exact original operation and input for explicit retry.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "template-requests:read",
          "template-requests:write"
        ],
        "responses": {
          "200": {
            "description": "Accepted receipt/current state, or not_found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BusinessTemplateRequestResult"
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "const": "not_found"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current key/integration/scope authority denied, platform suspension, or browser Origin refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid operationId UUID or unsupported query/body.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota reached; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "When supplied, seconds to wait before checking again; not permission to create another command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary result-check failure. Keep the original operation UUID and input. Retry this read after any supplied Retry-After; checking never creates or resubmits a request.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "When supplied, seconds to wait before checking again; not permission to create another command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations/availability": {
      "get": {
        "operationId": "getBusinessConversationAvailability",
        "tags": [
          "Management"
        ],
        "summary": "Check conversation availability",
        "description": "Development preview. Backend-only Management credential; requests with Origin are refused. Explicit conversations:read/write access covers the whole business and is not limited by selected providers. Existing keys gain no new scopes. Tenant and integration derive from the authenticated key. Both existing DB inbox enablement and server tenant allowlisting are required; this API does not activate them. Website intake and bot activity do not control these administrative reads and commands. Returns enabled=false for an authorized credential when either inbox gate is off. enabled=true does not establish a WhatsApp connection, a live service window, sending permission or provider delivery.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read"
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationAvailability"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, integration or business authority denied; browser Origin refused; INBOX_DISABLED when a required inbox gate is off.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, duplicate/unknown query parameter, UUID, page size or cursor. Unknown body fields are refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary read failure; retry this read after any Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations": {
      "get": {
        "operationId": "listBusinessConversations",
        "tags": [
          "Management"
        ],
        "summary": "List business conversations",
        "description": "Development preview. Backend-only Management credential; requests with Origin are refused. Explicit conversations:read/write access covers the whole business and is not limited by selected providers. Existing keys gain no new scopes. Tenant and integration derive from the authenticated key. Both existing DB inbox enablement and server tenant allowlisting are required; this API does not activate them. Website intake and bot activity do not control these administrative reads and commands. Search by customer name or phone and filter the retained inbox. window_open selects verified live 24-hour customer windows; it is not a guarantee that sending is allowed. This read does not mark messages read. Pages are current-state keyset pages, not a snapshot or sync feed. Keep search/filter and credential integration unchanged. Treat nextCursor as opaque, omit it on the first page and stop when null. On INVALID_CURSOR restart the same query; do not modify a cursor. Concurrent activity may change page membership.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read"
        ],
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 160
            },
            "description": "Optional name/phone search; surrounding whitespace is trimmed."
          },
          {
            "name": "filter",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "unread",
                "human",
                "window_open"
              ],
              "default": "all"
            },
            "description": "Choose one inbox filter."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 40
            },
            "description": "Maximum page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "description": "Opaque nextCursor from this same query; omit initially."
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationList"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, integration or business authority denied; browser Origin refused; INBOX_DISABLED when a required inbox gate is off.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, duplicate/unknown query parameter, UUID, page size or cursor. Unknown body fields are refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary read failure; retry this read after any Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations/{conversationId}": {
      "get": {
        "operationId": "getBusinessConversation",
        "tags": [
          "Management"
        ],
        "summary": "Read a conversation",
        "description": "Development preview. Backend-only Management credential; requests with Origin are refused. Explicit conversations:read/write access covers the whole business and is not limited by selected providers. Existing keys gain no new scopes. Tenant and integration derive from the authenticated key. Both existing DB inbox enablement and server tenant allowlisting are required; this API does not activate them. Website intake and bot activity do not control these administrative reads and commands. Reads only retained CRAD messages; this is not a full WhatsApp-history import. Saved messages remain readable when the WhatsApp connection is unavailable. connection reflects current CRAD-side permission and serviceWindow reflects a verified live customer arrival; neither causes a send. Reading does not mark messages read. nextAppointment is withheld unless the current key also has appointments:read and an appropriate calendar grant. Pages are current-state keyset pages, not a snapshot or sync feed. Keep search/filter and credential integration unchanged. Treat nextCursor as opaque, omit it on the first page and stop when null. On INVALID_CURSOR restart the same query; do not modify a cursor. Concurrent activity may change page membership. Retained message content can include interactive_id and reply_to_id for incoming button correlation; neither field alone proves customer identity or order approval.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read"
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "CRAD identifier returned by the corresponding authorized API."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 40
            },
            "description": "Maximum page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "description": "Opaque nextCursor from this same query; omit initially."
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cv(?:0|[1-9][0-9]*)\"$"
                },
                "description": "Current conversation control version. Omitted when the current conversation is unavailable or the operation is not found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationThread"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, integration or business authority denied; browser Origin refused; INBOX_DISABLED when a required inbox gate is off.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "CONVERSATION_NOT_FOUND: no accessible current thread for this identifier.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, duplicate/unknown query parameter, UUID, page size or cursor. Unknown body fields are refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary read failure; retry this read after any Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations/by-customer/{customerId}": {
      "get": {
        "operationId": "getBusinessConversationByCustomer",
        "tags": [
          "Management"
        ],
        "summary": "Read a customer conversation",
        "description": "Development preview. Backend-only Management credential; requests with Origin are refused. Explicit conversations:read/write access covers the whole business and is not limited by selected providers. Existing keys gain no new scopes. Tenant and integration derive from the authenticated key. Both existing DB inbox enablement and server tenant allowlisting are required; this API does not activate them. Website intake and bot activity do not control these administrative reads and commands. Use the canonical CRAD customer ID. This lookup does not create a conversation. Reads only retained CRAD messages; this is not a full WhatsApp-history import. Saved messages remain readable when the WhatsApp connection is unavailable. connection reflects current CRAD-side permission and serviceWindow reflects a verified live customer arrival; neither causes a send. Reading does not mark messages read. nextAppointment is withheld unless the current key also has appointments:read and an appropriate calendar grant. Pages are current-state keyset pages, not a snapshot or sync feed. Keep search/filter and credential integration unchanged. Treat nextCursor as opaque, omit it on the first page and stop when null. On INVALID_CURSOR restart the same query; do not modify a cursor. Concurrent activity may change page membership.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read"
        ],
        "parameters": [
          {
            "name": "customerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "CRAD identifier returned by the corresponding authorized API."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 40
            },
            "description": "Maximum page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "description": "Opaque nextCursor from this same query; omit initially."
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cv(?:0|[1-9][0-9]*)\"$"
                },
                "description": "Current conversation control version. Omitted when the current conversation is unavailable or the operation is not found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationThread"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, integration or business authority denied; browser Origin refused; INBOX_DISABLED when a required inbox gate is off.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "CONVERSATION_NOT_FOUND: no accessible current thread for this identifier.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, duplicate/unknown query parameter, UUID, page size or cursor. Unknown body fields are refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary read failure; retry this read after any Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations/{conversationId}/messages/search": {
      "get": {
        "operationId": "searchBusinessConversationMessages",
        "tags": [
          "Management"
        ],
        "summary": "Search retained messages",
        "description": "Development preview. Backend-only Management credential; requests with Origin are refused. Explicit conversations:read/write access covers the whole business and is not limited by selected providers. Existing keys gain no new scopes. Tenant and integration derive from the authenticated key. Both existing DB inbox enablement and server tenant allowlisting are required; this API does not activate them. Website intake and bot activity do not control these administrative reads and commands. Search retained message text within this conversation, newest first. This read does not mark messages read. A cursor is also bound to the conversation’s stored WhatsApp binding; after that stored binding changes restart the query. Disconnecting the current account alone does not block this retained search. Pages are current-state keyset pages, not a snapshot or sync feed. Keep search/filter and credential integration unchanged. Treat nextCursor as opaque, omit it on the first page and stop when null. On INVALID_CURSOR restart the same query; do not modify a cursor. Concurrent activity may change page membership. Retained message content can include interactive_id and reply_to_id for incoming button correlation; neither field alone proves customer identity or order approval.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read"
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "CRAD identifier returned by the corresponding authorized API."
          },
          {
            "name": "search",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 200
            },
            "description": "Required search text; at least two characters after trimming surrounding whitespace."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 40,
              "default": 40
            },
            "description": "Maximum page size."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "description": "Opaque nextCursor from this same query; omit initially."
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationSearch"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, integration or business authority denied; browser Origin refused; INBOX_DISABLED when a required inbox gate is off.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "CONVERSATION_NOT_FOUND: no accessible current thread for this identifier.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, duplicate/unknown query parameter, UUID, page size or cursor. Unknown body fields are refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary read failure; retry this read after any Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations/open-contact": {
      "post": {
        "operationId": "openBusinessConversation",
        "tags": [
          "Management"
        ],
        "summary": "Open a conversation for a customer",
        "description": "Development preview. Backend-only Management credential; requests with Origin are refused. Explicit conversations:read/write access covers the whole business and is not limited by selected providers. Existing keys gain no new scopes. Tenant and integration derive from the authenticated key. Both existing DB inbox enablement and server tenant allowlisting are required; this API does not activate them. Website intake and bot activity do not control these administrative reads and commands. Finds or creates the retained inbox thread for an existing canonical customer. It does not contact the customer, open the 24-hour window, verify their number or transfer control to a human. It requires a usable current WhatsApp binding and an unambiguous valid contact phone. Before submitting, persist one Idempotency-Key UUID, the exact body, path and any If-Match. After a lost or uncertain response, GET /v1/management/conversation-operations/{operationId}; checking never repeats the write. If committed, use the immutable receipt and current separately. If not_found, offer explicit retry using that same command identity; do not generate another UUID automatically. A changed canonical request under the same UUID returns OPERATION_CONFLICT. Receipts survive message retention and remain recoverable with a rotated key for the same integration and current read/write scopes.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:write"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Original client-generated operation UUID, retained for recovery and explicit retry."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessConversationOpenInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted command receipt and current projection; replay is identified explicitly.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cv(?:0|[1-9][0-9]*)\"$"
                },
                "description": "Current conversation control version. Omitted when the current conversation is unavailable or the operation is not found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, integration or business authority denied; browser Origin refused; INBOX_DISABLED when a required inbox gate is off.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "CONTACT_NOT_FOUND: no current authorized canonical customer.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "CONTACT_PHONE_INVALID, CONTACT_PHONE_AMBIGUOUS, CONNECTION_UNVERIFIED, CONNECTION_CHANGED or OPERATION_CONFLICT. Correct the identified context; do not silently change an uncertain command.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, duplicate/unknown query parameter, UUID, page size or cursor. Unknown body fields are refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing Idempotency-Key, or missing If-Match for a control change.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be uncertain. Preserve the original command and use read-only operation recovery before any explicit retry.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations/{conversationId}/read": {
      "post": {
        "operationId": "markBusinessConversationRead",
        "tags": [
          "Management"
        ],
        "summary": "Mark observed customer messages read",
        "description": "Development preview. Backend-only Management credential; requests with Origin are refused. Explicit conversations:read/write access covers the whole business and is not limited by selected providers. Existing keys gain no new scopes. Tenant and integration derive from the authenticated key. Both existing DB inbox enablement and server tenant allowlisting are required; this API does not activate them. Website intake and bot activity do not control these administrative reads and commands. Pass the CRAD message ID of the latest verified live incoming customer message actually displayed to this user, with non-null liveReceivedAt. Outgoing messages and imported-only messages without a verified live arrival are refused. Advances the shared business inbox read frontier monotonically; later incoming messages remain unread. This updates CRAD read state only and does not send a WhatsApp read receipt. Before submitting, persist one Idempotency-Key UUID, the exact body, path and any If-Match. After a lost or uncertain response, GET /v1/management/conversation-operations/{operationId}; checking never repeats the write. If committed, use the immutable receipt and current separately. If not_found, offer explicit retry using that same command identity; do not generate another UUID automatically. A changed canonical request under the same UUID returns OPERATION_CONFLICT. Receipts survive message retention and remain recoverable with a rotated key for the same integration and current read/write scopes.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:write"
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "CRAD identifier returned by the corresponding authorized API."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Original client-generated operation UUID, retained for recovery and explicit retry."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessConversationReadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted command receipt and current projection; replay is identified explicitly.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cv(?:0|[1-9][0-9]*)\"$"
                },
                "description": "Current conversation control version. Omitted when the current conversation is unavailable or the operation is not found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, integration or business authority denied; browser Origin refused; INBOX_DISABLED when a required inbox gate is off.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "CONVERSATION_NOT_FOUND or MESSAGE_NOT_FOUND, including a message outside this thread or not a retained verified live incoming message.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT: UUID already belongs to a different canonical command.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, duplicate/unknown query parameter, UUID, page size or cursor. Unknown body fields are refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing Idempotency-Key, or missing If-Match for a control change.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be uncertain. Preserve the original command and use read-only operation recovery before any explicit retry.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations/{conversationId}/control": {
      "patch": {
        "operationId": "setBusinessConversationControl",
        "tags": [
          "Management"
        ],
        "summary": "Transfer conversation control",
        "description": "Development preview. Backend-only Management credential; requests with Origin are refused. Explicit conversations:read/write access covers the whole business and is not limited by selected providers. Existing keys gain no new scopes. Tenant and integration derive from the authenticated key. Both existing DB inbox enablement and server tenant allowlisting are required; this API does not activate them. Website intake and bot activity do not control these administrative reads and commands. Read the current conversation version first and submit it quoted in If-Match, for example \"cv0\". human pauses bot handling of this conversation; bot restores its control subject to existing global bot/channel rules. Neither mode sends a message or opens the customer service window. Existing bot/send leases and unresolved-send safeguards remain effective. A same-mode command may leave the control version unchanged. Before submitting, persist one Idempotency-Key UUID, the exact body, path and any If-Match. After a lost or uncertain response, GET /v1/management/conversation-operations/{operationId}; checking never repeats the write. If committed, use the immutable receipt and current separately. If not_found, offer explicit retry using that same command identity; do not generate another UUID automatically. A changed canonical request under the same UUID returns OPERATION_CONFLICT. Receipts survive message retention and remain recoverable with a rotated key for the same integration and current read/write scopes.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:write"
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "CRAD identifier returned by the corresponding authorized API."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Original client-generated operation UUID, retained for recovery and explicit retry."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"cv(?:0|[1-9][0-9]*)\"$"
            },
            "description": "Quoted current version from the conversation response/ETag. Preserve it for recovery of this command."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessConversationControlInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted command receipt and current projection; replay is identified explicitly.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cv(?:0|[1-9][0-9]*)\"$"
                },
                "description": "Current conversation control version. Omitted when the current conversation is unavailable or the operation is not found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, integration or business authority denied; browser Origin refused; INBOX_DISABLED when a required inbox gate is off.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "CONVERSATION_NOT_FOUND: no accessible current thread for this identifier.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "BOT_BUSY, SEND_BUSY, SEND_REVIEW_REQUIRED or OPERATION_CONFLICT. Do not bypass ongoing work or automatically resend an unresolved message.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "CONTROL_CHANGED: stale If-Match. Refresh current state and ask the user to review a new action; do not overwrite newer control.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, duplicate/unknown query parameter, UUID, page size or cursor. Unknown body fields are refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing Idempotency-Key, or missing If-Match for a control change.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be uncertain. Preserve the original command and use read-only operation recovery before any explicit retry.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversation-operations/{operationId}": {
      "get": {
        "operationId": "getBusinessConversationOperation",
        "tags": [
          "Management"
        ],
        "summary": "Recover a conversation command",
        "description": "Development preview. Backend-only Management credential; requests with Origin are refused. Explicit conversations:read/write access covers the whole business and is not limited by selected providers. Existing keys gain no new scopes. Tenant and integration derive from the authenticated key. Both existing DB inbox enablement and server tenant allowlisting are required; this API does not activate them. Website intake and bot activity do not control these administrative reads and commands. Requires current conversations:read and conversations:write for the original integration. Does not repeat open-contact, mark-read or control.  Before submitting, persist one Idempotency-Key UUID, the exact body, path and any If-Match. After a lost or uncertain response, GET /v1/management/conversation-operations/{operationId}; checking never repeats the write. If committed, use the immutable receipt and current separately. If not_found, offer explicit retry using that same command identity; do not generate another UUID automatically. A changed canonical request under the same UUID returns OPERATION_CONFLICT. Receipts survive message retention and remain recoverable with a rotated key for the same integration and current read/write scopes.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:write"
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "CRAD identifier returned by the corresponding authorized API."
          }
        ],
        "responses": {
          "200": {
            "description": "Read-only operation outcome.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cv(?:0|[1-9][0-9]*)\"$"
                },
                "description": "Current conversation control version. Omitted when the current conversation is unavailable or the operation is not found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, integration or business authority denied; browser Origin refused; INBOX_DISABLED when a required inbox gate is off.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, duplicate/unknown query parameter, UUID, page size or cursor. Unknown body fields are refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded; honor Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary read failure; retry this read after any Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer",
                  "minimum": 1
                },
                "description": "If present, wait this many seconds before the next read/check. This does not authorize a new command."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations/{conversationId}/templates": {
      "get": {
        "operationId": "listBusinessConversationTemplates",
        "tags": [
          "Management"
        ],
        "summary": "List available conversation templates",
        "description": "Development preview. Backend-only Management key. Tenant and integration come from the credential, never from the body. Explicit conversations:read and conversations:send and the existing Inbox gates are required. Installed capability flags do not grant authority. Lists supported approved templates under the current account binding and marketing opt-out. Template browsing does not take control or send. Approved Authentication COPY_CODE templates accept exactly one 1–15 character ASCII alphanumeric code, copied unchanged to body and copy button. The integrating application generates, stores, expires and verifies that code and limits attempts. This is distinct from CRAD booking-session phone verification. No otpType or codeExpirationMinutes field is exposed. Approved UTILITY templates with exactly two QUICK_REPLY buttons expose quickReplyButtons in catalogue order. Supply the two distinct opaque quickReplyPayloads in that order; the rendered body, including fixed text and substitutions, must fit 1024 Unicode code points. Other button layouts, named parameters and dynamic headers remain unsupported. Preserve button metadata and payloads through idempotent recovery; changed labels/layout near dispatch are refused.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:send"
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationTemplates"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current authority or scope denied, browser Origin refused, or inbox not enabled.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Conversation, retained message or usable media not found. Expired or foreign upload handles cannot be sent.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection, consent, control ownership or service window prevents this command; OPERATION_CONFLICT means the same UUID was used with different input. Unknown prior sends require review, never automatic redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid or ambiguous input, unsupported query parameter, UUID or body field.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or send quota exceeded. Honor Retry-After when present.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Provider templates or media are temporarily unavailable.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be uncertain. Keep the original request identity and use the read-only recovery endpoint; do not create a fresh send.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations/{conversationId}/messages": {
      "post": {
        "operationId": "sendBusinessConversationMessage",
        "tags": [
          "Management"
        ],
        "summary": "Send a conversation message",
        "description": "Development preview. Backend-only Management key. Tenant and integration come from the credential, never from the body. Explicit whole-business permissions and both existing inbox gates are required. Installed capability flags do not grant authority. Requires human control and its current version. Send text or an uploaded file only within the live 24-hour customer window; otherwise use an applicable approved template. Current connection, customer block/consent, template and marketing rules still apply. Persist the UUID, body and original If-Match before calling. After a lost response, GET conversation-sends/{operationId}. pending/unknown or any accepted receipt must never be resent with a fresh UUID. accepted is provider acceptance, not delivered/read. Approved Authentication COPY_CODE templates accept exactly one 1–15 character ASCII alphanumeric code, copied unchanged to body and copy button. The integrating application generates, stores, expires and verifies that code and limits attempts. This is distinct from CRAD booking-session phone verification. No otpType or codeExpirationMinutes field is exposed. Approved UTILITY templates with exactly two QUICK_REPLY buttons expose quickReplyButtons in catalogue order. Supply the two distinct opaque quickReplyPayloads in that order; the rendered body, including fixed text and substitutions, must fit 1024 Unicode code points. Other button layouts, named parameters and dynamic headers remain unsupported. Preserve button metadata and payloads through idempotent recovery; changed labels/layout near dispatch are refused.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:send"
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Save one UUID before dispatch. Keep it for lookup and any exact retry; a different UUID denotes a different operation."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"cv(?:0|[1-9][0-9]*)\"$"
            },
            "description": "The quoted control ETag from this conversation, for example \"cv3\". Preserve the original value during recovery."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessConversationSendInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationSendResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current authority or scope denied, browser Origin refused, or inbox not enabled.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Conversation, retained message or usable media not found. Expired or foreign upload handles cannot be sent.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection, consent, control ownership or service window prevents this command; OPERATION_CONFLICT means the same UUID was used with different input. Unknown prior sends require review, never automatic redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Control version changed. Do not silently update If-Match on the original command.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request or file exceeds the supported size.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type, unsupported media or mismatch between declared MIME and file content.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid or ambiguous input, unsupported query parameter, UUID or body field.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing required Idempotency-Key or If-Match.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or send quota exceeded. Honor Retry-After when present.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be uncertain. Keep the original request identity and use the read-only recovery endpoint; do not create a fresh send.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversation-sends/{operationId}": {
      "get": {
        "operationId": "getBusinessConversationSend",
        "tags": [
          "Management"
        ],
        "summary": "Check the original send outcome",
        "description": "Development preview. Backend-only Management key. Tenant and integration come from the credential, never from the body. Current authority for the original principal is required. Pure recovery remains available while sending is disabled or the connection/window is unavailable. Installed capability flags do not grant authority. Pure lookup: does not call Meta to send and does not retry the command. Receipts survive transcript retention. Only not_found permits an explicit retry of the exact original command; concurrent attempts still share one identity. If the original body is lost, do not reconstruct a retry. Current authorization is still required after key rotation.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:send"
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationSendOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current authority or scope denied, browser Origin refused, or inbox not enabled.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Conversation, retained message or usable media not found. Expired or foreign upload handles cannot be sent.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection, consent, control ownership or service window prevents this command; OPERATION_CONFLICT means the same UUID was used with different input. Unknown prior sends require review, never automatic redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid or ambiguous input, unsupported query parameter, UUID or body field.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or send quota exceeded. Honor Retry-After when present.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Provider templates or media are temporarily unavailable.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be uncertain. Keep the original request identity and use the read-only recovery endpoint; do not create a fresh send.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations/{conversationId}/uploads": {
      "post": {
        "operationId": "uploadBusinessConversationMedia",
        "tags": [
          "Management"
        ],
        "summary": "Upload a conversation attachment",
        "description": "Development preview. Backend-only same-business/integration conversation upload. One file, optional externalActorRef and optional purpose=template_header. Ordinary attachments retain the human-control and live customer-window requirements. template_header permits only JPEG/PNG and may upload the asset outside the window for a later approved IMAGE-header template; sending still rechecks consent/connection/approval. Save UUID, purpose and original bytes. current.mediaId is a conversation-bound send identity, not the resumable management uploadId. Unknown attempts are not automatically re-uploaded.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:send"
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Save one UUID before dispatch. Keep it for lookup and any exact retry; a different UUID denotes a different operation."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/BusinessConversationUploadInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationUploadResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current authority or scope denied, browser Origin refused, or inbox not enabled.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Conversation, retained message or usable media not found. Expired or foreign upload handles cannot be sent.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection, consent, control ownership or service window prevents this command; OPERATION_CONFLICT means the same UUID was used with different input. Unknown prior sends require review, never automatic redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request or file exceeds the supported size.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type, unsupported media or mismatch between declared MIME and file content.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid or ambiguous input, unsupported query parameter, UUID or body field.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing required Idempotency-Key or If-Match.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or send quota exceeded. Honor Retry-After when present.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be uncertain. Keep the original request identity and use the read-only recovery endpoint; do not create a fresh send.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversation-uploads/{operationId}": {
      "get": {
        "operationId": "getBusinessConversationUpload",
        "tags": [
          "Management"
        ],
        "summary": "Check the original upload outcome",
        "description": "Development preview. Backend-only Management key. Tenant and integration come from the credential, never from the body. Current authority for the original principal is required. Pure recovery remains available while sending is disabled or the connection/window is unavailable. Installed capability flags do not grant authority. Pure lookup: never uploads or sends. ready supplies the bound CRAD mediaId until expiry. pending/unknown must not trigger an automatic new upload. A retained receipt does not extend the uploaded file lifetime. Exact retry after not_found uses the same UUID, bytes and metadata.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:send"
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationUploadOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current authority or scope denied, browser Origin refused, or inbox not enabled.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Conversation, retained message or usable media not found. Expired or foreign upload handles cannot be sent.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection, consent, control ownership or service window prevents this command; OPERATION_CONFLICT means the same UUID was used with different input. Unknown prior sends require review, never automatic redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid or ambiguous input, unsupported query parameter, UUID or body field.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or send quota exceeded. Honor Retry-After when present.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Provider templates or media are temporarily unavailable.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be uncertain. Keep the original request identity and use the read-only recovery endpoint; do not create a fresh send.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations/{conversationId}/messages/{messageId}/media": {
      "get": {
        "operationId": "getBusinessConversationMessageMedia",
        "tags": [
          "Management"
        ],
        "summary": "Download a conversation attachment",
        "description": "Development preview. Backend-only Management key. Tenant and integration come from the credential, never from the body. Explicit whole-business permissions and both existing inbox gates are required. Installed capability flags do not grant authority. Authenticated byte response for one retained message belonging to this conversation. No public or signed media URL is returned, and provider IDs are never accepted. Your backend must authorize its own user before proxying the bytes. Preserve Content-Type and no-store; do not parse successful media as JSON. Errors are JSON. Connection binding and permission are checked again after provider download.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:media:read"
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authenticated media bytes; never JSON. Content-Type identifies the verified format. Downloaded WebP stickers are supported within the existing 500 KiB limit.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "Content-Disposition": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "Content-Security-Policy": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/png": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/aac": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/amr": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/mpeg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "audio/ogg": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/mp4": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "video/3gpp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/msword": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/vnd.ms-excel": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/vnd.ms-powerpoint": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "application/vnd.openxmlformats-officedocument.presentationml.presentation": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current authority or scope denied, browser Origin refused, or inbox not enabled.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Conversation, retained message or usable media not found. Expired or foreign upload handles cannot be sent.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection, consent, control ownership or service window prevents this command; OPERATION_CONFLICT means the same UUID was used with different input. Unknown prior sends require review, never automatic redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid or ambiguous input, unsupported query parameter, UUID or body field.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or send quota exceeded. Honor Retry-After when present.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Provider templates or media are temporarily unavailable.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be uncertain. Keep the original request identity and use the read-only recovery endpoint; do not create a fresh send.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/conversations/{conversationId}/messages/{messageId}/review": {
      "post": {
        "operationId": "reviewBusinessConversationSend",
        "tags": [
          "Management"
        ],
        "summary": "Acknowledge an uncertain send",
        "description": "Development preview. Backend-only Management key. Tenant and integration come from the credential, never from the body. Explicit whole-business permissions and both existing inbox gates are required. Installed capability flags do not grant authority. Use a message ID or unresolved attempt ID returned for this conversation. Explicitly acknowledges uncertainty; it does not confirm delivery, cancel a provider send, resend or switch control. A later provider callback may settle the original attempt. Preserve the review operation UUID and recover through GET conversation-operations/{operationId}. Requires write authority, separately from send permission.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:write"
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Save one UUID before dispatch. Keep it for lookup and any exact retry; a different UUID denotes a different operation."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessConversationReviewInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessConversationResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current authority or scope denied, browser Origin refused, or inbox not enabled.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Conversation, retained message or usable media not found. Expired or foreign upload handles cannot be sent.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection, consent, control ownership or service window prevents this command; OPERATION_CONFLICT means the same UUID was used with different input. Unknown prior sends require review, never automatic redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request or file exceeds the supported size.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Content-Type, unsupported media or mismatch between declared MIME and file content.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid or ambiguous input, unsupported query parameter, UUID or body field.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing required Idempotency-Key or If-Match.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or send quota exceeded. Honor Retry-After when present.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be uncertain. Keep the original request identity and use the read-only recovery endpoint; do not create a fresh send.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/website-intake-policy": {
      "get": {
        "operationId": "getBusinessWebsiteIntakePolicy",
        "summary": "Read website intake policy",
        "description": "Local development candidate, not deployment acceptance. Backend-only owner-issued Management credential; no Origin, tenant selector or provider/calendar inference. Capabilities describe installed support, not this credential's authority. Existing credentials gain no permission automatically. Read website booking configuration and saved activation blockers. This is whole-business state, shared across website integrations; bot/WhatsApp switches remain separate. Reading does not enable booking. A runtime or compatibility observation is not a live provider check.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "website-intake:read"
        ],
        "responses": {
          "200": {
            "description": "Current state or original acceptance and current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current version, e.g. \"wi0\". Preserve the full header for a new reviewed write; never replace an uncertain command's original version. Not returned for not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessWebsiteIntakeState"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, scope or current authority refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route or resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Policy readiness, invalid persisted settings or changed original operation. Re-read readiness for WEBSITE_NOT_READY, WEBSITE_CONSENT_NOT_READY or NOTIFICATIONS_NOT_READY; use paused for USE_PAUSE_INSTEAD; supply at least one nonblank localized display name for DISPLAY_NAME_REQUIRED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "OUTCOME_UNCERTAIN or PERSISTENCE_FAILED: retain and check the original operation, never assume no change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateBusinessWebsiteIntakePolicy",
        "summary": "Update website intake policy",
        "description": "Local development candidate, not deployment acceptance. Backend-only owner-issued Management credential; no Origin, tenant selector or provider/calendar inference. Capabilities describe installed support, not this credential's authority. Existing credentials gain no permission automatically. Edit only localized displayName, defaultLanguage and status. displayName replaces the language map. Explicit enabling may enroll website booking after the existing runtime, consent, publication and booking-policy checks pass. Use paused rather than draft after enrollment. This command preserves accepted bookings, bot state and the global allBookingsPaused switch. It cannot configure deployment or bypass activation prerequisites. Save one operation UUID, the exact body and the original quoted If-Match before PATCH. After uncertainty, use this policy's operations/{operationId}. Check is read-only; not_found does not cancel a delayed request. Retry only the same original command. Never substitute a new version or UUID for an uncertain write. receipt.state remains the original accepted snapshot; current can reflect later native or API edits.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Saved UUID for this exact original command."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"wi(0|[1-9][0-9]*)\"$"
            },
            "description": "Complete quoted ETag returned by this policy."
          }
        ],
        "x-crad-required-scopes": [
          "website-intake:read",
          "website-intake:write"
        ],
        "responses": {
          "200": {
            "description": "Current state or original acceptance and current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current version, e.g. \"wi0\". Preserve the full header for a new reviewed write; never replace an uncertain command's original version. Not returned for not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessWebsiteIntakeResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, scope or current authority refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route or resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Policy readiness, invalid persisted settings or changed original operation. Re-read readiness for WEBSITE_NOT_READY, WEBSITE_CONSENT_NOT_READY or NOTIFICATIONS_NOT_READY; use paused for USE_PAUSE_INSTEAD; supply at least one nonblank localized display name for DISPLAY_NAME_REQUIRED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "VERSION_CONFLICT: no new write was applied; refresh and review before a new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body is larger than 8192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Send application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required Idempotency-Key or If-Match is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "OUTCOME_UNCERTAIN or PERSISTENCE_FAILED: retain and check the original operation, never assume no change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessWebsiteIntakeInput"
              }
            }
          }
        }
      }
    },
    "/v1/management/website-intake-policy/operations/{operationId}": {
      "get": {
        "operationId": "getBusinessWebsiteIntakePolicyOperation",
        "summary": "Recover website intake policy change",
        "description": "Local development candidate, not deployment acceptance. Backend-only owner-issued Management credential; no Origin, tenant selector or provider/calendar inference. Capabilities describe installed support, not this credential's authority. Existing credentials gain no permission automatically. Save one operation UUID, the exact body and the original quoted If-Match before PATCH. After uncertainty, use this policy's operations/{operationId}. Check is read-only; not_found does not cancel a delayed request. Retry only the same original command. Never substitute a new version or UUID for an uncertain write. receipt.state remains the original accepted snapshot; current can reflect later native or API edits. Current write authority is rechecked, including after rotation to another key of the same integration. Another integration cannot read this receipt.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "website-intake:read",
          "website-intake:write"
        ],
        "responses": {
          "200": {
            "description": "Current state or original acceptance and current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current version, e.g. \"wi0\". Preserve the full header for a new reviewed write; never replace an uncertain command's original version. Not returned for not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessWebsiteIntakeOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, scope or current authority refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route or resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Policy readiness, invalid persisted settings or changed original operation. Re-read readiness for WEBSITE_NOT_READY, WEBSITE_CONSENT_NOT_READY or NOTIFICATIONS_NOT_READY; use paused for USE_PAUSE_INSTEAD; supply at least one nonblank localized display name for DISPLAY_NAME_REQUIRED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "OUTCOME_UNCERTAIN or PERSISTENCE_FAILED: retain and check the original operation, never assume no change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/website-notification-policy": {
      "get": {
        "operationId": "getBusinessWebsiteNotificationPolicy",
        "summary": "Read customer notification policy",
        "description": "Local development candidate, not deployment acceptance. Backend-only owner-issued Management credential; no Origin, tenant selector or provider/calendar inference. Capabilities describe installed support, not this credential's authority. Existing credentials gain no permission automatically. Read the business policy for WhatsApp booking confirmation, change, cancellation and reminder messages. ready is saved template/binding evidence, not a live provider probe or delivery guarantee. Customer consent, sender readiness, platform rules and job deadlines still apply.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "website-notifications:read"
        ],
        "responses": {
          "200": {
            "description": "Current state or original acceptance and current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current version, e.g. \"wn0\". Preserve the full header for a new reviewed write; never replace an uncertain command's original version. Not returned for not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessWebsiteNotificationState"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, scope or current authority refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route or resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Policy readiness, invalid persisted settings or changed original operation. Re-read readiness for WEBSITE_NOT_READY, WEBSITE_CONSENT_NOT_READY or NOTIFICATIONS_NOT_READY; use paused for USE_PAUSE_INSTEAD; supply at least one nonblank localized display name for DISPLAY_NAME_REQUIRED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "OUTCOME_UNCERTAIN or PERSISTENCE_FAILED: retain and check the original operation, never assume no change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateBusinessWebsiteNotificationPolicy",
        "summary": "Update customer notification policy",
        "description": "Local development candidate, not deployment acceptance. Backend-only owner-issued Management credential; no Origin, tenant selector or provider/calendar inference. Capabilities describe installed support, not this credential's authority. Existing credentials gain no permission automatically. Replace enabled, purposes and dailyLimit. Enabling requires supported current Cloud credentials and at least one ready language for each selected purpose. Every accepted save latches the existing website notification-consent authority, even enabled:false, but never grants customer consent or reverses STOP. Disabled policy blocks new dispatch at preflight; it does not recall started sends. Eligible pending jobs may resume after re-enabling within their original deadlines. No message is sent by this command. Save one operation UUID, the exact body and the original quoted If-Match before PATCH. After uncertainty, use this policy's operations/{operationId}. Check is read-only; not_found does not cancel a delayed request. Retry only the same original command. Never substitute a new version or UUID for an uncertain write. receipt.state remains the original accepted snapshot; current can reflect later native or API edits.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Saved UUID for this exact original command."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"wn(0|[1-9][0-9]*)\"$"
            },
            "description": "Complete quoted ETag returned by this policy."
          }
        ],
        "x-crad-required-scopes": [
          "website-notifications:read",
          "website-notifications:write"
        ],
        "responses": {
          "200": {
            "description": "Current state or original acceptance and current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current version, e.g. \"wn0\". Preserve the full header for a new reviewed write; never replace an uncertain command's original version. Not returned for not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessWebsiteNotificationResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, scope or current authority refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route or resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Policy readiness, invalid persisted settings or changed original operation. Re-read readiness for WEBSITE_NOT_READY, WEBSITE_CONSENT_NOT_READY or NOTIFICATIONS_NOT_READY; use paused for USE_PAUSE_INSTEAD; supply at least one nonblank localized display name for DISPLAY_NAME_REQUIRED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "VERSION_CONFLICT: no new write was applied; refresh and review before a new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body is larger than 8192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Send application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required Idempotency-Key or If-Match is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "OUTCOME_UNCERTAIN or PERSISTENCE_FAILED: retain and check the original operation, never assume no change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessWebsiteNotificationInput"
              }
            }
          }
        }
      }
    },
    "/v1/management/website-notification-policy/operations/{operationId}": {
      "get": {
        "operationId": "getBusinessWebsiteNotificationPolicyOperation",
        "summary": "Recover customer notification policy change",
        "description": "Local development candidate, not deployment acceptance. Backend-only owner-issued Management credential; no Origin, tenant selector or provider/calendar inference. Capabilities describe installed support, not this credential's authority. Existing credentials gain no permission automatically. Save one operation UUID, the exact body and the original quoted If-Match before PATCH. After uncertainty, use this policy's operations/{operationId}. Check is read-only; not_found does not cancel a delayed request. Retry only the same original command. Never substitute a new version or UUID for an uncertain write. receipt.state remains the original accepted snapshot; current can reflect later native or API edits. Current write authority is rechecked, including after rotation to another key of the same integration. Another integration cannot read this receipt.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "website-notifications:read",
          "website-notifications:write"
        ],
        "responses": {
          "200": {
            "description": "Current state or original acceptance and current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current version, e.g. \"wn0\". Preserve the full header for a new reviewed write; never replace an uncertain command's original version. Not returned for not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessWebsiteNotificationOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, scope or current authority refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route or resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Policy readiness, invalid persisted settings or changed original operation. Re-read readiness for WEBSITE_NOT_READY, WEBSITE_CONSENT_NOT_READY or NOTIFICATIONS_NOT_READY; use paused for USE_PAUSE_INSTEAD; supply at least one nonblank localized display name for DISPLAY_NAME_REQUIRED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "OUTCOME_UNCERTAIN or PERSISTENCE_FAILED: retain and check the original operation, never assume no change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/owner-alert-policy": {
      "get": {
        "operationId": "getBusinessOwnerAlertPolicy",
        "summary": "Read owner booking alert policy",
        "description": "Local development candidate, not deployment acceptance. Backend-only owner-issued Management credential; no Origin, tenant selector or provider/calendar inference. Capabilities describe installed support, not this credential's authority. Existing credentials gain no permission automatically. Read the business-wide opt-in for website booking events and a bounded aggregate count of current owners' registered devices. No personal device identifiers, endpoints or tokens are returned. This policy is separate from connection/disconnection alerts.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "owner-alerts:read"
        ],
        "responses": {
          "200": {
            "description": "Current state or original acceptance and current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current version, e.g. \"wa0\". Preserve the full header for a new reviewed write; never replace an uncertain command's original version. Not returned for not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessOwnerAlertState"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, scope or current authority refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route or resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Policy readiness, invalid persisted settings or changed original operation. Re-read readiness for WEBSITE_NOT_READY, WEBSITE_CONSENT_NOT_READY or NOTIFICATIONS_NOT_READY; use paused for USE_PAUSE_INSTEAD; supply at least one nonblank localized display name for DISPLAY_NAME_REQUIRED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "OUTCOME_UNCERTAIN or PERSISTENCE_FAILED: retain and check the original operation, never assume no change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateBusinessOwnerAlertPolicy",
        "summary": "Update owner booking alert policy",
        "description": "Local development candidate, not deployment acceptance. Backend-only owner-issued Management credential; no Origin, tenant selector or provider/calendar inference. Capabilities describe installed support, not this credential's authority. Existing credentials gain no permission automatically. Replace enabled for website booking-created/changed/cancelled alerts to current owners' already-subscribed devices. Disabling suppresses queued owner-alert jobs; enabling does not re-create suppressed jobs. Browser permission and personal device subscription stay explicit in CRAD. This command neither subscribes a device nor sends a push. Save one operation UUID, the exact body and the original quoted If-Match before PATCH. After uncertainty, use this policy's operations/{operationId}. Check is read-only; not_found does not cancel a delayed request. Retry only the same original command. Never substitute a new version or UUID for an uncertain write. receipt.state remains the original accepted snapshot; current can reflect later native or API edits.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Saved UUID for this exact original command."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"wa(0|[1-9][0-9]*)\"$"
            },
            "description": "Complete quoted ETag returned by this policy."
          }
        ],
        "x-crad-required-scopes": [
          "owner-alerts:read",
          "owner-alerts:write"
        ],
        "responses": {
          "200": {
            "description": "Current state or original acceptance and current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current version, e.g. \"wa0\". Preserve the full header for a new reviewed write; never replace an uncertain command's original version. Not returned for not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessOwnerAlertResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, scope or current authority refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route or resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Policy readiness, invalid persisted settings or changed original operation. Re-read readiness for WEBSITE_NOT_READY, WEBSITE_CONSENT_NOT_READY or NOTIFICATIONS_NOT_READY; use paused for USE_PAUSE_INSTEAD; supply at least one nonblank localized display name for DISPLAY_NAME_REQUIRED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "VERSION_CONFLICT: no new write was applied; refresh and review before a new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body is larger than 8192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Send application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required Idempotency-Key or If-Match is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "OUTCOME_UNCERTAIN or PERSISTENCE_FAILED: retain and check the original operation, never assume no change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessOwnerAlertInput"
              }
            }
          }
        }
      }
    },
    "/v1/management/owner-alert-policy/operations/{operationId}": {
      "get": {
        "operationId": "getBusinessOwnerAlertPolicyOperation",
        "summary": "Recover owner booking alert policy change",
        "description": "Local development candidate, not deployment acceptance. Backend-only owner-issued Management credential; no Origin, tenant selector or provider/calendar inference. Capabilities describe installed support, not this credential's authority. Existing credentials gain no permission automatically. Save one operation UUID, the exact body and the original quoted If-Match before PATCH. After uncertainty, use this policy's operations/{operationId}. Check is read-only; not_found does not cancel a delayed request. Retry only the same original command. Never substitute a new version or UUID for an uncertain write. receipt.state remains the original accepted snapshot; current can reflect later native or API edits. Current write authority is rechecked, including after rotation to another key of the same integration. Another integration cannot read this receipt.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "owner-alerts:read",
          "owner-alerts:write"
        ],
        "responses": {
          "200": {
            "description": "Current state or original acceptance and current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Quoted current version, e.g. \"wa0\". Preserve the full header for a new reviewed write; never replace an uncertain command's original version. Not returned for not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessOwnerAlertOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, scope or current authority refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route or resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Policy readiness, invalid persisted settings or changed original operation. Re-read readiness for WEBSITE_NOT_READY, WEBSITE_CONSENT_NOT_READY or NOTIFICATIONS_NOT_READY; use paused for USE_PAUSE_INSTEAD; supply at least one nonblank localized display name for DISPLAY_NAME_REQUIRED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "OUTCOME_UNCERTAIN or PERSISTENCE_FAILED: retain and check the original operation, never assume no change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/website-intake-policy/health": {
      "get": {
        "operationId": "getBusinessWebsiteIntakeHealth",
        "summary": "Read website intake health",
        "description": "Local development candidate, not deployment acceptance. Backend-only owner-issued Management credential; no Origin, tenant selector or provider/calendar inference. Capabilities describe installed support, not this credential's authority. Existing credentials gain no permission automatically. Read bounded compatibility and saved runtime/consent readiness. Each sample is limited to 1000; inspect truncated. This does not repair data, enable a channel, inspect a live provider or prove unsampled records are valid.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "website-intake:read"
        ],
        "responses": {
          "200": {
            "description": "Current state or original acceptance and current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessWebsiteIntakeHealth"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, scope or current authority refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route or resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Policy readiness, invalid persisted settings or changed original operation. Re-read readiness for WEBSITE_NOT_READY, WEBSITE_CONSENT_NOT_READY or NOTIFICATIONS_NOT_READY; use paused for USE_PAUSE_INSTEAD; supply at least one nonblank localized display name for DISPLAY_NAME_REQUIRED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "OUTCOME_UNCERTAIN or PERSISTENCE_FAILED: retain and check the original operation, never assume no change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/owner-alert-policy/metrics": {
      "get": {
        "operationId": "getBusinessOwnerAlertMetrics",
        "summary": "Read owner booking-alert metrics",
        "description": "Local development candidate, not deployment acceptance. Backend-only owner-issued Management credential; no Origin, tenant selector or provider/calendar inference. Capabilities describe installed support, not this credential's authority. Existing credentials gain no permission automatically. Read a bounded sample of owner-alert job states and unresolved unknown ages. Respect sampleLimit and truncated; these are not full historical totals. accepted is provider acceptance, not device delivery. This read does not retry jobs or subscribe devices.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "owner-alerts:read"
        ],
        "responses": {
          "200": {
            "description": "Current state or original acceptance and current state.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessOwnerAlertMetrics"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, scope or current authority refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route or resource.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Policy readiness, invalid persisted settings or changed original operation. Re-read readiness for WEBSITE_NOT_READY, WEBSITE_CONSENT_NOT_READY or NOTIFICATIONS_NOT_READY; use paused for USE_PAUSE_INSTEAD; supply at least one nonblank localized display name for DISPLAY_NAME_REQUIRED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "OUTCOME_UNCERTAIN or PERSISTENCE_FAILED: retain and check the original operation, never assume no change.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/whatsapp-connection": {
      "get": {
        "operationId": "getBusinessWhatsappConnection",
        "summary": "Read saved WhatsApp connection",
        "description": "Backend-only owner-issued Management credential, without Origin or tenant selectors. Whole-business authority; provider/calendar selections do not narrow it. Check the current key’s WhatsApp connection grants in GET /v1/management/messaging-capabilities. Reads retained state, lifecycle, health facts and current action availability without contacting Meta. Display the observation timestamp and botActive separately. A healthy observation does not prove message delivery. New connection, renewal and permissions remain an explicit owner continuation in CRAD. Requires whatsapp-connection:read. Check current availability and allowed actions for this business; an installed endpoint or scope grant does not establish connection readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "whatsapp-connection:read"
        ],
        "responses": {
          "200": {
            "description": "Current saved state; no Meta request.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"wc[a-f0-9]{64}\"$"
                },
                "description": "Quoted current connection version. Use this complete header for a new explicit check. An uncertain original command keeps its original If-Match. Absent on not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessWhatsappConnectionStatus"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current credential, scope or Origin refused. Saved reads and recovery do not require fresh-check enrollment or manual runtime configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, query, identifier or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "General credential/site request quota exceeded. Reading saved state or recovering an operation does not acquire the provider-check lease or consume the manual-check start budget.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Saved read unavailable: persistence, lock or installed-service failure. Retain the original operation locator and retry this read with a bounded delay; do not create a replacement check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/whatsapp-connection/health-checks": {
      "post": {
        "operationId": "checkBusinessWhatsappConnection",
        "summary": "Check WhatsApp connection health",
        "description": "Backend-only owner-issued Management credential, without Origin or tenant selectors. Whole-business authority; provider/calendar selections do not narrow it. Check the current key’s WhatsApp connection grants in GET /v1/management/messaging-capabilities. Performs one GET-only Meta observation and stores finite evidence. No send, OAuth, subscription POST, token renewal, bot activation or contact/history sync. An exact replay or lookup never repeats the provider call; pending becomes expired after the 60-second lease without a database write on lookup. A new deliberate check after cooldown needs a new UUID and fresh status, not automatic replay. Requires whatsapp-connection:read and whatsapp-connection:check. Check current availability and allowed actions for this business; an installed endpoint or scope grant does not establish connection readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reserve a fresh UUID for one explicit observation. Persist it with the exact request before sending."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"wc[a-f0-9]{64}\"$"
            },
            "description": "Original quoted ETag from the saved status. Preserve on exact replay."
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-connection:read",
          "whatsapp-connection:check"
        ],
        "responses": {
          "200": {
            "description": "Durable pending, committed or expired state. Only committed has accepted evidence.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"wc[a-f0-9]{64}\"$"
                },
                "description": "Quoted current connection version. Use this complete header for a new explicit check. An uncertain original command keeps its original If-Match. Absent on not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessWhatsappConnectionResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, current authority, scope or fresh-check enrollment refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "CONNECTION_CHANGED, CONNECTION_UNVERIFIED, CONNECTION_PAUSED, ATTEMPT_UNAVAILABLE, OPERATION_NOT_UNKNOWN, CONFIGURATION_CHANGED, LEGACY_CONNECTION_UNSUPPORTED or OPERATION_CONFLICT. Preserve original operation identity; use the current saved status to decide a new deliberate action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "VERSION_CONFLICT: the current connection or reconciliation target changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE: JSON body exceeds 8192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON_REQUIRED: send Content-Type: application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, query, identifier or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing original If-Match or Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared check lease, 60-second cooldown, five starts per 15 minutes, or general credential quota. Inspect saved retryAt when available; do not loop or change UUID to evade a limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "CONFIGURATION_MISSING, OUTCOME_UNCERTAIN or PERSISTENCE_FAILED. Retain the operation UUID and exact request; lookup is read-only and does not require fresh-check runtime configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessWhatsappConnectionCheckInput"
              }
            }
          }
        }
      }
    },
    "/v1/management/whatsapp-connection/subscription-reconciliations": {
      "post": {
        "operationId": "reconcileBusinessWhatsappSubscription",
        "summary": "Reconcile an uncertain subscription",
        "description": "Backend-only owner-issued Management credential, without Origin or tenant selectors. Whole-business authority; provider/calendar selections do not narrow it. Check the current key’s WhatsApp connection grants in GET /v1/management/messaging-capabilities. Use exactly the non-null reconciliationAttemptId returned by saved status and its ETag. Only the latest verified same-generation UNKNOWN subscribe intent, whose original actor still has onboarding authority, is eligible. All four GET-only Meta checks must pass before saved UNKNOWN can become succeeded. Never sends another subscribe request, replenishes attempts or advances setup. Contacts/history, connection and renewal remain owner actions. Requires whatsapp-connection:read and whatsapp-connection:check. Check current availability and allowed actions for this business; an installed endpoint or scope grant does not establish connection readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Reserve a fresh UUID for one explicit observation. Persist it with the exact request before sending."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"wc[a-f0-9]{64}\"$"
            },
            "description": "Original quoted ETag from the saved status. Preserve on exact replay."
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-connection:read",
          "whatsapp-connection:check"
        ],
        "responses": {
          "200": {
            "description": "Durable pending, committed or expired state. Only committed has accepted evidence.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"wc[a-f0-9]{64}\"$"
                },
                "description": "Quoted current connection version. Use this complete header for a new explicit check. An uncertain original command keeps its original If-Match. Absent on not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessWhatsappConnectionResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Origin, current authority, scope or fresh-check enrollment refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "CONNECTION_CHANGED, CONNECTION_UNVERIFIED, CONNECTION_PAUSED, ATTEMPT_UNAVAILABLE, OPERATION_NOT_UNKNOWN, CONFIGURATION_CHANGED, LEGACY_CONNECTION_UNSUPPORTED or OPERATION_CONFLICT. Preserve original operation identity; use the current saved status to decide a new deliberate action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "VERSION_CONFLICT: the current connection or reconciliation target changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "REQUEST_TOO_LARGE: JSON body exceeds 8192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "JSON_REQUIRED: send Content-Type: application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, query, identifier or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Missing original If-Match or Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Shared check lease, 60-second cooldown, five starts per 15 minutes, or general credential quota. Inspect saved retryAt when available; do not loop or change UUID to evade a limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "CONFIGURATION_MISSING, OUTCOME_UNCERTAIN or PERSISTENCE_FAILED. Retain the operation UUID and exact request; lookup is read-only and does not require fresh-check runtime configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessWhatsappConnectionReconcileInput"
              }
            }
          }
        }
      }
    },
    "/v1/management/whatsapp-connection/operations/{operationId}": {
      "get": {
        "operationId": "getBusinessWhatsappConnectionOperation",
        "summary": "Read a connection-check result",
        "description": "Backend-only owner-issued Management credential, without Origin or tenant selectors. Whole-business authority; provider/calendar selections do not narrow it. Check the current key’s WhatsApp connection grants in GET /v1/management/messaging-capabilities. Pure authorized operation lookup: no Meta request or database write. Requires the original current integration authority and both scopes. Remains available when manual runtime configuration or connection binding changes. Only committed has immutable accepted evidence; pending/expired never dispatch. A missing result does not cancel a late request and does not authorize an automatic replacement UUID. Requires whatsapp-connection:read and whatsapp-connection:check. Check current availability and allowed actions for this business; an installed endpoint or scope grant does not establish connection readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "The original operation UUID, never a replacement command."
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-connection:read",
          "whatsapp-connection:check"
        ],
        "responses": {
          "200": {
            "description": "Original authorized operation state, or status:not_found. A missing lookup is not evidence that a concurrent request cannot still arrive.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"wc[a-f0-9]{64}\"$"
                },
                "description": "Quoted current connection version. Use this complete header for a new explicit check. An uncertain original command keeps its original If-Match. Absent on not_found."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/BusinessWhatsappConnectionResult"
                    },
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "status": {
                          "const": "not_found"
                        }
                      },
                      "required": [
                        "status"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current credential, scope or Origin refused. Saved reads and recovery do not require fresh-check enrollment or manual runtime configuration.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Unknown route.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, query, identifier or precondition syntax.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "General credential/site request quota exceeded. Reading saved state or recovering an operation does not acquire the provider-check lease or consume the manual-check start budget.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Saved read unavailable: persistence, lock or installed-service failure. Retain the original operation locator and retry this read with a bounded delay; do not create a replacement check.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/campaign-templates": {
      "get": {
        "operationId": "listBusinessCampaignTemplates",
        "summary": "List campaign templates",
        "description": "Backend-only owner-issued Management credential without Origin. Requires campaigns:read and a current campaign resource grant. Calendar/contact/provider permissions do not confer campaign authority. Every operation rechecks current authority. GET-only Meta catalogue read. This never creates or approves a template. Show supported, unsupported and complete explicitly.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "campaigns:read"
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCampaignTemplates"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection or reviewed template changed; refresh and review before a new action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, UUID, query, cursor or precondition format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Current template catalogue or persistence is unavailable. No send is implied. Recover any uncertain prior command separately.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/campaign-capacity": {
      "get": {
        "operationId": "getBusinessCampaignCapacity",
        "summary": "Read campaign sending capacity",
        "description": "Backend-only owner-issued Management credential without Origin. Requires campaigns:read and a current campaign resource grant. Calendar/contact/provider permissions do not confer campaign authority. Every operation rechecks current authority. The limit is shared across all business senders and providers. Reading capacity reserves nothing.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "campaigns:read"
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCampaignCapacity"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, UUID, query, cursor or precondition format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Reads may be retried; for an uncertain command, retain its UUID and exact request and read campaign-operations first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/campaign-audiences": {
      "post": {
        "operationId": "listBusinessCampaignAudience",
        "summary": "Find campaign recipients",
        "description": "Backend-only owner-issued Management credential without Origin. Requires campaigns:read and a current campaign resource grant. Calendar/contact/provider permissions do not confer campaign authority. Every operation rechecks current authority. Read-only appointment, contact or segment candidate page. Selecting an audience does not send or reserve recipients.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "campaigns:read"
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCampaignAudiencePage"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds 8,192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, UUID, query, cursor or precondition format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Reads may be retried; for an uncertain command, retain its UUID and exact request and read campaign-operations first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCampaignAudienceQuery"
              }
            }
          }
        }
      }
    },
    "/v1/management/campaign-previews": {
      "post": {
        "operationId": "previewBusinessCampaign",
        "summary": "Preview an exact campaign",
        "description": "Backend-only owner-issued Management credential without Origin. Requires campaigns:read and a current campaign resource grant. Calendar/contact/provider permissions do not confer campaign authority. Every operation rechecks current authority. Review exact selected recipients, exclusions and every outgoing language/template component. There is no saved campaign, reservation or command receipt yet. For a one-person notice, select that person's profileId and verify one matching recipient with no skipped recipients. BODY parameters are shared text values, including a text URL; a dynamic URL button or document attachment is not supported by this campaign format.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [],
        "x-crad-required-scopes": [
          "campaigns:read"
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cp[a-f0-9]{64}\"$"
                },
                "description": "Strong current version. Keep the original If-Match with an uncertain command; only a new deliberate command uses a fresh current version."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCampaignPreview"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection or reviewed template changed; refresh and review before a new action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds 65,536 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, UUID, query, cursor or precondition format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Current template catalogue or persistence is unavailable. No send is implied. Recover any uncertain prior command separately.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCampaignDraft"
              }
            }
          }
        }
      }
    },
    "/v1/management/campaigns": {
      "get": {
        "operationId": "listBusinessCampaigns",
        "summary": "List campaign history",
        "description": "Backend-only owner-issued Management credential without Origin. Requires campaigns:read and a current campaign resource grant. Calendar/contact/provider permissions do not confer campaign authority. Every operation rechecks current authority. Omitted providerId means all currently authorized campaigns, not an unassigned-only filter.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "providerId",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "sending",
                "done"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 4096,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "description": "Use the prior nextCursor with the same query. Omit on the first page; an invalid cursor requires restarting the read."
          }
        ],
        "x-crad-required-scopes": [
          "campaigns:read"
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCampaignList"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, UUID, query, cursor or precondition format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Reads may be retried; for an uncertain command, retain its UUID and exact request and read campaign-operations first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createBusinessCampaign",
        "summary": "Confirm and start a campaign",
        "description": "Backend-only owner-issued Management credential without Origin. Requires campaigns:read and campaigns:send and a current campaign resource grant. Calendar/contact/provider permissions do not confer campaign authority. Every operation rechecks current authority. Explicit confirm:true accepts the exact reviewed draft and starts it through the existing scheduler. It is not an unsent saved draft. Current audience/consent, binding, template and business quota are checked; a new preview is needed on material drift. Meta changes after the last external check cannot be transactionally locked.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID together with the exact request before dispatch. Use the original UUID for recovery or explicit exact retry."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"cp[a-f0-9]{64}\"$"
            },
            "description": "Quoted ETag returned by the exact reviewed preview."
          }
        ],
        "x-crad-required-scopes": [
          "campaigns:read",
          "campaigns:send"
        ],
        "responses": {
          "200": {
            "description": "Accepted intent and current state; not a delivery guarantee.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cc(0|[1-9][0-9]*)\"$"
                },
                "description": "Strong current version. Keep the original If-Match with an uncertain command; only a new deliberate command uses a fresh current version."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCampaignResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "An operation UUID was reused with different input, another campaign is open, business capacity is exhausted, or no recipients remain. Read the returned code; never replace an uncertain command automatically.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Reviewed audience/template facts or control version changed. Recover an uncertain original command first; obtain a new preview/state only for a new deliberate action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds 65,536 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, UUID, query, cursor or precondition format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Idempotency-Key and If-Match are required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Reads may be retried; for an uncertain command, retain its UUID and exact request and read campaign-operations first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCampaignCreate"
              }
            }
          }
        }
      }
    },
    "/v1/management/campaigns/{campaignId}": {
      "get": {
        "operationId": "getBusinessCampaign",
        "summary": "Read a campaign",
        "description": "Backend-only owner-issued Management credential without Origin. Requires campaigns:read and a current campaign resource grant. Calendar/contact/provider permissions do not confer campaign authority. Every operation rechecks current authority. Read current progress/control state without settling, resuming or sending. legacy_body identifies retained historical confirmation, not a fabricated complete template approval.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "campaigns:read"
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cc(0|[1-9][0-9]*)\"$"
                },
                "description": "Strong current version. Keep the original If-Match with an uncertain command; only a new deliberate command uses a fresh current version."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCampaignState"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Campaign or resource is not available under the current grant. A missing operation lookup returns 200 with status:not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, UUID, query, cursor or precondition format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Reads may be retried; for an uncertain command, retain its UUID and exact request and read campaign-operations first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/campaigns/{campaignId}/recipients": {
      "get": {
        "operationId": "listBusinessCampaignRecipients",
        "summary": "Read campaign recipient outcomes",
        "description": "Backend-only owner-issued Management credential without Origin. Requires campaigns:read and a current campaign resource grant. Calendar/contact/provider permissions do not confer campaign authority. Every operation rechecks current authority. Campaign-purpose names, numbers and history only. sent records provider acceptance; unknown is never a retryable definite failure.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "sending",
                "sent",
                "failed",
                "unknown"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 4096,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "description": "Use the prior nextCursor with the same query. Omit on the first page; an invalid cursor requires restarting the read."
          }
        ],
        "x-crad-required-scopes": [
          "campaigns:read"
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCampaignRecipientPage"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Campaign or resource is not available under the current grant. A missing operation lookup returns 200 with status:not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, UUID, query, cursor or precondition format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Reads may be retried; for an uncertain command, retain its UUID and exact request and read campaign-operations first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/campaigns/{campaignId}/continuations": {
      "post": {
        "operationId": "continueBusinessCampaign",
        "summary": "Continue a paused campaign",
        "description": "Backend-only owner-issued Management credential without Origin. Requires campaigns:read and campaigns:send and a current campaign resource grant. Calendar/contact/provider permissions do not confer campaign authority. Every operation rechecks current authority. Accepts one explicit continuation and schedules remaining work. Current connection/authority/consent guards still apply. Historical campaigns retain their declared body-only confirmation.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID together with the exact request before dispatch. Use the original UUID for recovery or explicit exact retry."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"cc(0|[1-9][0-9]*)\"$"
            },
            "description": "Quoted current campaign control ETag; historical campaigns may start at cc0."
          }
        ],
        "x-crad-required-scopes": [
          "campaigns:read",
          "campaigns:send"
        ],
        "responses": {
          "200": {
            "description": "Accepted intent and current state; not a delivery guarantee.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cc(0|[1-9][0-9]*)\"$"
                },
                "description": "Strong current version. Keep the original If-Match with an uncertain command; only a new deliberate command uses a fresh current version."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCampaignResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Campaign or resource is not available under the current grant. A missing operation lookup returns 200 with status:not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "An operation UUID was reused with different input, another campaign is open, business capacity is exhausted, or no recipients remain. Read the returned code; never replace an uncertain command automatically.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Reviewed audience/template facts or control version changed. Recover an uncertain original command first; obtain a new preview/state only for a new deliberate action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds 8,192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, UUID, query, cursor or precondition format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Idempotency-Key and If-Match are required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Reads may be retried; for an uncertain command, retain its UUID and exact request and read campaign-operations first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCampaignControl"
              }
            }
          }
        }
      }
    },
    "/v1/management/campaigns/{campaignId}/retries": {
      "post": {
        "operationId": "retryBusinessCampaign",
        "summary": "Retry eligible campaign failures",
        "description": "Backend-only owner-issued Management credential without Origin. Requires campaigns:read and campaigns:send and a current campaign resource grant. Calendar/contact/provider permissions do not confer campaign authority. Every operation rechecks current authority. Only eligible definite failures return to pending; UNKNOWN, permanent failures and current opt-outs are excluded. Business capacity and current authority are rechecked. Historical campaigns retain their declared body-only confirmation.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID together with the exact request before dispatch. Use the original UUID for recovery or explicit exact retry."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"cc(0|[1-9][0-9]*)\"$"
            },
            "description": "Quoted current campaign control ETag; historical campaigns may start at cc0."
          }
        ],
        "x-crad-required-scopes": [
          "campaigns:read",
          "campaigns:send"
        ],
        "responses": {
          "200": {
            "description": "Accepted intent and current state; not a delivery guarantee.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cc(0|[1-9][0-9]*)\"$"
                },
                "description": "Strong current version. Keep the original If-Match with an uncertain command; only a new deliberate command uses a fresh current version."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCampaignResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Campaign or resource is not available under the current grant. A missing operation lookup returns 200 with status:not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "An operation UUID was reused with different input, another campaign is open, business capacity is exhausted, or no recipients remain. Read the returned code; never replace an uncertain command automatically.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Reviewed audience/template facts or control version changed. Recover an uncertain original command first; obtain a new preview/state only for a new deliberate action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds 8,192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, UUID, query, cursor or precondition format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Idempotency-Key and If-Match are required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Reads may be retried; for an uncertain command, retain its UUID and exact request and read campaign-operations first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCampaignControl"
              }
            }
          }
        }
      }
    },
    "/v1/management/campaigns/{campaignId}/stop": {
      "post": {
        "operationId": "stopBusinessCampaign",
        "summary": "Stop a campaign",
        "description": "Backend-only owner-issued Management credential without Origin. Requires campaigns:read and campaigns:send and a current campaign resource grant. Calendar/contact/provider permissions do not confer campaign authority. Every operation rechecks current authority. Stops not-yet-dispatched work; an already attempted request cannot be recalled.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "campaignId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID together with the exact request before dispatch. Use the original UUID for recovery or explicit exact retry."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"cc(0|[1-9][0-9]*)\"$"
            },
            "description": "Quoted current campaign control ETag; historical campaigns may start at cc0."
          }
        ],
        "x-crad-required-scopes": [
          "campaigns:read",
          "campaigns:send"
        ],
        "responses": {
          "200": {
            "description": "Accepted intent and current state; not a delivery guarantee.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cc(0|[1-9][0-9]*)\"$"
                },
                "description": "Strong current version. Keep the original If-Match with an uncertain command; only a new deliberate command uses a fresh current version."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCampaignResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Campaign or resource is not available under the current grant. A missing operation lookup returns 200 with status:not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "An operation UUID was reused with different input, another campaign is open, business capacity is exhausted, or no recipients remain. Read the returned code; never replace an uncertain command automatically.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Reviewed audience/template facts or control version changed. Recover an uncertain original command first; obtain a new preview/state only for a new deliberate action.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON body exceeds 8,192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, UUID, query, cursor or precondition format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Idempotency-Key and If-Match are required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Reads may be retried; for an uncertain command, retain its UUID and exact request and read campaign-operations first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCampaignControl"
              }
            }
          }
        }
      }
    },
    "/v1/management/campaign-operations/{operationId}": {
      "get": {
        "operationId": "getBusinessCampaignOperation",
        "summary": "Recover a campaign command",
        "description": "Backend-only owner-issued Management credential without Origin. Requires campaigns:read and campaigns:send and a current campaign resource grant. Calendar/contact/provider permissions do not confer campaign authority. Every operation rechecks current authority. Pure retained receipt lookup: never creates, settles, resumes, retries or dispatches. A rotated authorized key of the same integration may recover the command. status:not_found is not proof that an earlier in-flight request cannot still commit; an explicit retry must preserve the entire original command.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "campaigns:read",
          "campaigns:send"
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string",
                  "pattern": "^\"cc(0|[1-9][0-9]*)\"$"
                },
                "description": "Strong current version. Keep the original If-Match with an uncertain command; only a new deliberate command uses a fresh current version."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCampaignLookup"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current integration/key/scope/resource authority denied, including a browser Origin. Old keys gain no campaign authority.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Campaign or resource is not available under the current grant. A missing operation lookup returns 200 with status:not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid request, UUID, query, cursor or precondition format.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Reads may be retried; for an uncertain command, retain its UUID and exact request and read campaign-operations first.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointment-reminder-policy": {
      "get": {
        "operationId": "getBusinessReminderPolicy",
        "summary": "Read appointment reminder policy",
        "description": "Read whole-business saved policy and readiness. Platform ceiling and engine mode remain read-only. Backend only. Application scopes: reminder-policy:read. No provider transport is invoked.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "reminder-policy:read"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful read or accepted command. Acceptance is not message delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessReminderPolicyState"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Quoted current policy and capability version. Omitted for status:not_found operation recovery.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"rp(0|[1-9][0-9]*)c(0|[1-9][0-9]*)\"$"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid backend credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current key, integration, operation scope or resource access denied. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, query, identifier or precondition. Enabling preferences requires REENABLE_ACKNOWLEDGEMENT_REQUIRED to be satisfied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine quota reached; respect Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or dependencies unavailable. Recover uncertain writes before deciding to retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateBusinessReminderPolicy",
        "summary": "Apply a reviewed reminder policy",
        "description": "Confirm exact draft, scope and preview fingerprint. new_bookings does not revive old snapshots; existing_future explicitly updates eligible future bookings while preserving consumed accepted/unknown slots. Backend only. Application scopes: reminder-policy:read, reminder-policy:write. No provider transport is invoked.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "reminder-policy:read",
          "reminder-policy:write"
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"rp(0|[1-9][0-9]*)c(0|[1-9][0-9]*)\"$"
            },
            "description": "Quoted policy AND capability revision from GET. Preserve the preview revisions for the command."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist a UUID and exact request before sending. Uncertain recovery and explicit exact retry retain this identity."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful read or accepted command. Acceptance is not message delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessReminderPolicyResult"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Quoted current policy and capability version. Omitted for status:not_found operation recovery.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"rp(0|[1-9][0-9]*)c(0|[1-9][0-9]*)\"$"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid backend credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current key, integration, operation scope or resource access denied. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT: recover original UUID; never change its request. ROLLOUT_NOT_READY: current engine does not accept a new change. Retain unresolved prior operations. INVALID_SETTINGS: the reviewed offsets exceed the current reminder ceiling; read the policy and choose a valid draft.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "POLICY_CHANGED, CAPABILITY_CHANGED, PREVIEW_CHANGED or RECIPIENT_CHANGED. Resolve uncertainty first; a new deliberate action needs current state and review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON exceeds 8,192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Send Content-Type: application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, query, identifier or precondition. Enabling preferences requires REENABLE_ACKNOWLEDGEMENT_REQUIRED to be satisfied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required If-Match or command Idempotency-Key is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine quota reached; respect Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or dependencies unavailable. Recover uncertain writes before deciding to retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessReminderPolicyApply"
              }
            }
          }
        }
      }
    },
    "/v1/management/appointment-reminder-policy/previews": {
      "post": {
        "operationId": "previewBusinessReminderPolicy",
        "summary": "Preview reminder policy impact",
        "description": "Pure read: no settings seed, enrollment, reconciliation or message. Aggregate counts omit appointment samples. Do not send Idempotency-Key on preview. Backend only. Application scopes: reminder-policy:read. No provider transport is invoked.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "reminder-policy:read"
        ],
        "parameters": [
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"rp(0|[1-9][0-9]*)c(0|[1-9][0-9]*)\"$"
            },
            "description": "Quoted policy AND capability revision from GET. Preserve the preview revisions for the command."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful read or accepted command. Acceptance is not message delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessReminderPolicyPreview"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Quoted current policy and capability version. Omitted for status:not_found operation recovery.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"rp(0|[1-9][0-9]*)c(0|[1-9][0-9]*)\"$"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid backend credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current key, integration, operation scope or resource access denied. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INVALID_SETTINGS: the requested offsets exceed the current reminder ceiling. Read the policy and choose a valid draft.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "POLICY_CHANGED, CAPABILITY_CHANGED, PREVIEW_CHANGED or RECIPIENT_CHANGED. Resolve uncertainty first; a new deliberate action needs current state and review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON exceeds 8,192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Send Content-Type: application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, query, identifier or precondition. Enabling preferences requires REENABLE_ACKNOWLEDGEMENT_REQUIRED to be satisfied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required If-Match or command Idempotency-Key is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine quota reached; respect Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or dependencies unavailable. Recover uncertain writes before deciding to retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessReminderPolicyPreviewInput"
              }
            }
          }
        }
      }
    },
    "/v1/management/appointment-reminder-policy/operations/{operationId}": {
      "get": {
        "operationId": "getBusinessReminderPolicyOperation",
        "summary": "Recover a reminder policy change",
        "description": "Pure same-integration recovery. A rotated currently authorized key may recover. not_found does not cancel an in-flight command; keep the entire original request for deliberate retry. Backend only. Application scopes: reminder-policy:read, reminder-policy:write. No provider transport is invoked.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "reminder-policy:read",
          "reminder-policy:write"
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful read or accepted command. Acceptance is not message delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessReminderPolicyLookup"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Quoted current policy and capability version. Omitted for status:not_found operation recovery.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"rp(0|[1-9][0-9]*)c(0|[1-9][0-9]*)\"$"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid backend credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current key, integration, operation scope or resource access denied. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The contact or physical appointment is unavailable under the current authority. Pure missing-operation lookup returns 200 with status:not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT: this UUID belongs to the other reminder command kind. Use the original policy or recipient operation endpoint and preserve the original UUID; do not create a replacement command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, query, identifier or precondition. Enabling preferences requires REENABLE_ACKNOWLEDGEMENT_REQUIRED to be satisfied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine quota reached; respect Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or dependencies unavailable. Recover uncertain writes before deciding to retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/customers/{profileId}/reminder-preference": {
      "get": {
        "operationId": "getBusinessReminderRecipient",
        "summary": "Read a customer reminder preference",
        "description": "Read an existing same-business contact, its canonical phone and shared phone preference. It is not global WhatsApp or marketing consent. Backend only. Application scopes: reminder-recipients:read. No provider transport is invoked.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "reminder-recipients:read"
        ],
        "parameters": [
          {
            "name": "profileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful read or accepted command. Acceptance is not message delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessReminderRecipientState"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Quoted current recipient version. Omitted when current state is unavailable or an operation is not found.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"rr[a-f0-9]{64}\"$"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid backend credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current key, integration, operation scope or resource access denied. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The contact or physical appointment is unavailable under the current authority. Pure missing-operation lookup returns 200 with status:not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, query, identifier or precondition. Enabling preferences requires REENABLE_ACKNOWLEDGEMENT_REQUIRED to be satisfied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine quota reached; respect Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or dependencies unavailable. Recover uncertain writes before deciding to retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateBusinessReminderRecipient",
        "summary": "Update a customer reminder preference",
        "description": "Pin the reviewed contact phone and revision. Re-enable only after the operator confirms that this customer explicitly asked to receive this business's reminders again. This can clear matching legacy reminder opt-outs but never clears global STOP, booking-purpose consent or blocking. Backend only. Application scopes: reminder-recipients:read, reminder-recipients:write. No provider transport is invoked.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "reminder-recipients:read",
          "reminder-recipients:write"
        ],
        "parameters": [
          {
            "name": "profileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"rr[a-f0-9]{64}\"$"
            },
            "description": "Quoted contact/phone/preference version from GET. Also retain expectedRecipient in the body."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist a UUID and exact request before sending. Uncertain recovery and explicit exact retry retain this identity."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful read or accepted command. Acceptance is not message delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessReminderRecipientResult"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Quoted current recipient version. Omitted when current state is unavailable or an operation is not found.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"rr[a-f0-9]{64}\"$"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid backend credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current key, integration, operation scope or resource access denied. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The contact or physical appointment is unavailable under the current authority. Pure missing-operation lookup returns 200 with status:not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT: recover original UUID; never change its request. ROLLOUT_NOT_READY: current engine does not accept a new change. Retain unresolved prior operations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "POLICY_CHANGED, CAPABILITY_CHANGED, PREVIEW_CHANGED or RECIPIENT_CHANGED. Resolve uncertainty first; a new deliberate action needs current state and review.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON exceeds 8,192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Send Content-Type: application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, query, identifier or precondition. Enabling preferences requires REENABLE_ACKNOWLEDGEMENT_REQUIRED to be satisfied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required If-Match or command Idempotency-Key is missing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine quota reached; respect Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or dependencies unavailable. Recover uncertain writes before deciding to retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessReminderRecipientChanges"
              }
            }
          }
        }
      }
    },
    "/v1/management/reminder-recipient-operations/{operationId}": {
      "get": {
        "operationId": "getBusinessReminderRecipientOperation",
        "summary": "Recover a reminder preference change",
        "description": "Pure original-command recovery independent of the contact current phone or existence. Original receipt remains distinct from nullable current state. Never replace an uncertain UUID. Backend only. Application scopes: reminder-recipients:read, reminder-recipients:write. No provider transport is invoked.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "reminder-recipients:read",
          "reminder-recipients:write"
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful read or accepted command. Acceptance is not message delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessReminderRecipientLookup"
                }
              }
            },
            "headers": {
              "ETag": {
                "description": "Quoted current recipient version. Omitted when current state is unavailable or an operation is not found.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"rr[a-f0-9]{64}\"$"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid backend credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current key, integration, operation scope or resource access denied. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The contact or physical appointment is unavailable under the current authority. Pure missing-operation lookup returns 200 with status:not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT: this UUID belongs to the other reminder command kind. Use the original policy or recipient operation endpoint and preserve the original UUID; do not create a replacement command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, query, identifier or precondition. Enabling preferences requires REENABLE_ACKNOWLEDGEMENT_REQUIRED to be satisfied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine quota reached; respect Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or dependencies unavailable. Recover uncertain writes before deciding to retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointment-reminder-states": {
      "post": {
        "operationId": "getBusinessAppointmentReminderStates",
        "summary": "Read appointment reminder timelines",
        "description": "Bounded batch read for 1–200 distinct physical appointment IDs under current calendar resources. Every ID must be available; no partial success. Excludes provider message IDs, phones, attempts and payloads. No retry or dispatch authority. Backend only. Application scopes: reminder-delivery:read, appointments:read. No provider transport is invoked.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "reminder-delivery:read",
          "appointments:read"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful read or accepted command. Acceptance is not message delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessReminderAppointmentStates"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid backend credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current key, integration, operation scope or resource access denied. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The contact or physical appointment is unavailable under the current authority. Pure missing-operation lookup returns 200 with status:not_found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "JSON exceeds 8,192 bytes.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Send Content-Type: application/json.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid body, query, identifier or precondition. Enabling preferences requires REENABLE_ACKNOWLEDGEMENT_REQUIRED to be satisfied.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine quota reached; respect Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or dependencies unavailable. Recover uncertain writes before deciding to retry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessReminderAppointmentQuery"
              }
            }
          }
        }
      }
    },
    "/v1/management/service-snapshots": {
      "post": {
        "operationId": "startBusinessServiceSnapshot",
        "summary": "Begin service synchronization",
        "description": "Whole-business service catalogue, including inactive services and advisory publication/delete state. Capture membership and watermark atomically. Paginate through the changes endpoint using the returned cursor. Do not assume historical field values or use resource ETags as event sequences.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "services:read",
          "services:sync"
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDirectorySnapshot"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current tenant, integration, scope or resource access refused. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Authority projection changed, incomplete cursor, stale checkpoint or conflicting operation. Rebootstrap when required; never discard the original uncertain ACK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds this operation’s byte limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed request, cursor, query or precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or snapshot limit reached; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Read operations can retry; retain an uncertain checkpoint’s original operation UUID and exact cursor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/service-changes": {
      "get": {
        "operationId": "readBusinessServiceChanges",
        "summary": "Read service membership or changes",
        "description": "Whole-business service catalogue, including inactive services and advisory publication/delete state. Consume nextCursor on every page, even empty filtered pages. Hydrated current values may be newer than the signal and appear repeatedly. Apply before acknowledging; restart on projection or retention invalidation.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "services:read",
          "services:sync"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessServiceSyncPage"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current tenant, integration, scope or resource access refused. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Authority projection changed, incomplete cursor, stale checkpoint or conflicting operation. Rebootstrap when required; never discard the original uncertain ACK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Cursor, membership or retained change history expired; restart bootstrap or a fresh customer query.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed request, cursor, query or precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or snapshot limit reached; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Read operations can retry; retain an uncertain checkpoint’s original operation UUID and exact cursor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/service-checkpoints": {
      "post": {
        "operationId": "acknowledgeBusinessServiceSync",
        "summary": "Acknowledge applied service changes",
        "description": "Whole-business service catalogue, including inactive services and advisory publication/delete state. Persist data, cursor and pending ACK in your own transaction first. Send the exact server-issued complete cursor with one operation UUID. Retain and repeat that identical request after an uncertain response. Receipt is historical; currentProjectionEpoch/bootstrapRequired describes current authority.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "services:read",
          "services:sync"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "cursor": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "cursor"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDirectoryCheckpoint"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current tenant, integration, scope or resource access refused. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Authority projection changed, incomplete cursor, stale checkpoint or conflicting operation. Rebootstrap when required; never discard the original uncertain ACK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Cursor, membership or retained change history expired; restart bootstrap or a fresh customer query.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds this operation’s byte limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed request, cursor, query or precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Checkpoint requires Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or snapshot limit reached; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Read operations can retry; retain an uncertain checkpoint’s original operation UUID and exact cursor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/provider-snapshots": {
      "post": {
        "operationId": "startBusinessProviderSnapshot",
        "summary": "Begin provider synchronization",
        "description": "Only current explicitly selected provider IDs, including inactive providers. Calendar grants or businessSchedule do not widen this selection. Provider working hours/duration policy are separate APIs. Capture membership and watermark atomically. Paginate through the changes endpoint using the returned cursor. Do not assume historical field values or use resource ETags as event sequences.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "providers:read",
          "providers:sync"
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {},
                "required": []
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDirectorySnapshot"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current tenant, integration, scope or resource access refused. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Authority projection changed, incomplete cursor, stale checkpoint or conflicting operation. Rebootstrap when required; never discard the original uncertain ACK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds this operation’s byte limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed request, cursor, query or precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or snapshot limit reached; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Read operations can retry; retain an uncertain checkpoint’s original operation UUID and exact cursor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/provider-changes": {
      "get": {
        "operationId": "readBusinessProviderChanges",
        "summary": "Read provider membership or changes",
        "description": "Only current explicitly selected provider IDs, including inactive providers. Calendar grants or businessSchedule do not widen this selection. Provider working hours/duration policy are separate APIs. Consume nextCursor on every page, even empty filtered pages. Hydrated current values may be newer than the signal and appear repeatedly. Apply before acknowledging; restart on projection or retention invalidation.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "providers:read",
          "providers:sync"
        ],
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessProviderSyncPage"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current tenant, integration, scope or resource access refused. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Authority projection changed, incomplete cursor, stale checkpoint or conflicting operation. Rebootstrap when required; never discard the original uncertain ACK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Cursor, membership or retained change history expired; restart bootstrap or a fresh customer query.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed request, cursor, query or precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or snapshot limit reached; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Read operations can retry; retain an uncertain checkpoint’s original operation UUID and exact cursor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/provider-checkpoints": {
      "post": {
        "operationId": "acknowledgeBusinessProviderSync",
        "summary": "Acknowledge applied provider changes",
        "description": "Only current explicitly selected provider IDs, including inactive providers. Calendar grants or businessSchedule do not widen this selection. Provider working hours/duration policy are separate APIs. Persist data, cursor and pending ACK in your own transaction first. Send the exact server-issued complete cursor with one operation UUID. Retain and repeat that identical request after an uncertain response. Receipt is historical; currentProjectionEpoch/bootstrapRequired describes current authority.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "providers:read",
          "providers:sync"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "cursor": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "cursor"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessDirectoryCheckpoint"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current tenant, integration, scope or resource access refused. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Authority projection changed, incomplete cursor, stale checkpoint or conflicting operation. Rebootstrap when required; never discard the original uncertain ACK.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Cursor, membership or retained change history expired; restart bootstrap or a fresh customer query.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds this operation’s byte limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed request, cursor, query or precondition.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Checkpoint requires Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or snapshot limit reached; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Read operations can retry; retain an uncertain checkpoint’s original operation UUID and exact cursor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/customer-segments/query": {
      "post": {
        "operationId": "queryBusinessCustomerSegments",
        "summary": "Filter customers and count segment options",
        "description": "Server-only whole-business Contacts query under explicit contacts:segments:read plus contacts:read. Includes blocked contacts when requested. This grant reveals visit-derived membership and email-search matches, not raw appointment history or email values. It does not grant messaging or marketing consent. Name order compares the first 128 Unicode characters of the lowercase saved name using server C collation, then UUID, keeping pagination tokens bounded for legacy long names. joined orders newest signups first, then UUID. lastAppointment orders the latest appointment start across all statuses (including cancelled/future) descending, missing dates last, then the same name/UUID key. One current observation per response; pagination is not a frozen snapshot.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "contacts:read",
          "contacts:segments:read"
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCustomerSegmentsQuery"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerSegmentsResult"
                }
              }
            }
          },
          "401": {
            "description": "Missing, invalid or expired server Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current tenant, integration, scope or resource access refused. Browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported method.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds this operation’s byte limit.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "application/json required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid query or INVALID_CURSOR (including tampering or expiry): restart the query. CUSTOMER_SEGMENT_LIMIT_EXCEEDED: more than 20,000 contacts; no partial totals are returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request or snapshot limit reached; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporary failure. Read operations can retry; retain an uncertain checkpoint’s original operation UUID and exact cursor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/reports/monthly": {
      "get": {
        "operationId": "getBusinessReportsMonthly",
        "summary": "Read a complete whole-business monthly operational report",
        "description": "Development preview; source support alone does not establish deployment. Server-only Management credential without Origin and explicit reports:read, independent of providerIds/businessSchedule/calendar grants. Optional month=YYYY-MM selects a complete business-local month; omitted month follows the server current business month. The half-open UTC boundaries account for DST. One database observation includes every matching appointment, without the calendar page or PostgREST row limit. Reschedules are counted at their current start; cancellations and missed appointments remain separate. Accepted booking snapshots preserve historical names, removal and prices; legacy rows fall back to their stored appointment price with unknown currency. Only COMPLETED appointments contribute service value, grouped by currency, never summed across currencies; this is not cash received or payment reporting. No customer details, writes, enrollment or notifications. reportsMonthlyRead denotes installed support, not a scope grant. No ETag/operation UUID; retry reads a fresh observation. Counts describe physical appointment records: a replacement reschedule retains a CANCELLED predecessor and creates a successor. Both count in their respective start month; cancelled includes replacement predecessors, while only a completed successor adds service value.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "month",
            "in": "query",
            "required": false,
            "description": "Business-local calendar month. Omit to use current month in the configured business timezone.",
            "schema": {
              "type": "string",
              "pattern": "^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])$"
            }
          }
        ],
        "x-crad-required-scopes": [
          "reports:read"
        ],
        "responses": {
          "200": {
            "description": "Complete monthly aggregates; no-store, no customer details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessReportsMonthly"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid current Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_REQUIRED, ACCESS_REVOKED, FORBIDDEN or server-only Origin refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Only GET is supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "INVALID_SETTINGS: configured business timezone is invalid; no partial counters are returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid or repeated month, unknown query parameters, or a request body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or temporary lock timeout; retry the read for a new observation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointments/{appointmentId}/proposal-availability": {
      "get": {
        "operationId": "getBusinessAppointmentProposalAvailability",
        "summary": "Read alternative times for a pending request",
        "description": "Server only. Requires appointments:read, appointments:reschedule and a current business_manager calendar grant for this appointment/provider. Read one local day using the frozen duration and grid. Pin the physical version to the displayed request. Advisory read reserves nothing. Propose through action-previews and actions, with If-Match, previewVersion on apply, durable Idempotency-Key and request_notice. Original stays PENDING until customer acceptance; a declined alternative leaves the original pending.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "localDate",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "x-crad-required-scopes": [
          "appointments:read",
          "appointments:reschedule"
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessAppointmentProposalAvailability"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "ETag": {
                "description": "Quoted current physical version when current state is present; omitted when unavailable.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"a(?:0|[1-9][0-9]{0,18})\"$"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Appointment is absent or not visible under the current grant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/sites/{siteId}/bookings/{bookingId}/proposal-response": {
      "post": {
        "operationId": "post_sites_by_siteId_bookings_by_bookingId_proposal_response",
        "summary": "Accept or decline a clinic-proposed time",
        "description": "Requires the verified customer session owning this booking and its still-authorized bound integration with bookings:write:customer. Retain exact Idempotency-Key/body across uncertainty. Current proposal is bound to phone, appointment version and expiry. Acceptance atomically rechecks capacity and creates one confirmed successor preserving terms. Occupied alternative or decline preserves original pending request. Exact replay survives lineage movement; a changed choice with the same UUID conflicts. Contact-only customer changes do not block responding to an offered alternative.",
        "security": [
          {
            "CustomerSession": []
          }
        ],
        "parameters": [
          {
            "name": "siteId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "bookingId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "One durable response UUID. Reuse exact UUID/body until outcome is known."
          },
          {
            "name": "X-CRAD-Integration-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:wbi|wbm)_[a-f0-9]{64}$"
            },
            "description": "Optional companion backend credential for the same integration, server requests only; never send from a browser. Required to bind an externalCustomerId on registration."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BookingProposalResponse"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success. A booking receipt is independent of notification delivery.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BookingProposalResponseResult"
                }
              }
            }
          },
          "401": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit; honor Retry-After.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Outcome may be unknown. Keep operation key and reconcile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointments/{appointmentId}/lineage": {
      "get": {
        "operationId": "getBusinessAppointmentLineage",
        "summary": "Read the authorized current replacement lineage",
        "description": "Server only, with fresh appointments:read and the current owner calendar grant. Resolves explicit committed CRAD replacement and accepted time-proposal receipts only; never matches a customer, phone or time. Every existing node must remain in the granted tenant/provider scope. Traversal is bounded to 32 nodes per direction. Missing or unauthorized nodes return APPOINTMENT_NOT_FOUND; cycles, ambiguous links or excessive depth fail closed. A 404 or failed read is NOT proof of cancellation and MUST NOT release a booking hold or disclose local notes. Use rootAppointmentId to associate immutable local booking details, and current status/startAt to assess the current booking. Ordinary appointment reads and operation receipts retain their original physical identity. No messages or writes. current.cancellationFinal is true only when the current appointment is CANCELLED and canonical snapshot/approval rules prohibit restoration; a cancelled predecessor or restorable legacy cancellation is not final. This is intrinsic state, not permission-dependent allowedActions. Retain immutable create receipts/private notes after ending a hold. Before resolving an uncertain create, read its original appointment operation UUID; not_found is not proof of failure and never permits replacement with a new UUID.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "appointmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "appointments:read"
        ],
        "responses": {
          "200": {
            "description": "Fresh authorized lineage. No customer details or private notes.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessAppointmentLineage"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Appointment is absent or not visible under the current grant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/appointment-operations/{operationId}/resolve": {
      "post": {
        "operationId": "resolveBusinessAppointmentOperation",
        "summary": "Resolve and fence an uncertain appointment create",
        "description": "Server only. Requires appointments:read and appointments:create plus the CURRENT per-credential calendar grant. Send the original operation UUID in the path and exactly the saved POST /appointments body. This is a deliberate state-changing recovery operation, not a status read and not a create retry: under the same tenant booking lock as creation, CRAD returns the committed original receipt and current authorized lineage OR durably records nonexecution and prevents every late original create from executing. The terminal record survives credential rotation within the same integration and has no time-based expiry. An altered original body is OPERATION_CONFLICT (409). The late original create is OPERATION_NOT_EXECUTED (409). GET appointment-operations exposes the same terminal rejected receipt. Preserve the original UUID and body until a valid canonical outcome is received; not_found, timeout, 409 quote-changed, 503, or revoked authority alone do not permit a new operation. A lost resolution response is recovered using GET or the same resolve request. No booking or customer message is created by resolution. Existing receipt, replacement lineage, provider grants and permissions are rechecked; inaccessible or broken lineage fails closed. SQL lock/statement budgets are 1/3 seconds; OUTCOME_UNCERTAIN (503) preserves the local hold. SQL must be deployed before the dependent function; this draft contract does not claim live activation.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Canonical committed receipt with current lineage, or durable rejected/not_executed create receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCalendarCreateResolution"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Contains no-store. Do not cache appointments, grants or receipts.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid Management bearer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Current scope, calendar grant or authority denied; a browser Origin is refused.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Current calendar grant cannot access the command provider or committed appointment lineage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Action, quote, slot, operation, projection or checkpoint conflict. No partial command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Malformed or unsupported request, including caller-supplied authority or price.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Machine request, directory cursor or snapshot limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence unavailable or outcome uncertain. Retain the original UUID/body and recover it before any new operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessCalendarCreate"
              }
            }
          }
        },
        "x-crad-required-scopes": [
          "appointments:read",
          "appointments:create"
        ]
      }
    },
    "/v1/management/schedules/{resource}/dates": {
      "get": {
        "operationId": "listBusinessScheduleDates",
        "summary": "Read effective hours for up to 93 local dates",
        "description": "Server-only, one local date in the clinic timezone. Business resources require booking-policy:read (and :write for preview/apply); provider resources require provider-booking-policy:read/:write and the explicitly granted provider. Precedence: provider date override, explicit provider weekly hours, business date override, business weekly hours. Existing explicit blocks always subtract from the effective hours. A null dayHours proposal removes this resource/date override and restores inheritance. Does not change recurring hours, move/cancel appointments or send messages. The preview binds the exact hours version and existing-appointment impact; stale/expired previews must be reviewed again. Keep the original Idempotency-Key, body and If-Match after an uncertain response. Recover through management operations or replay the same command; never replace the operation ID. Calendar hours are display data, not a booking offer: use canonical availability and final admission.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "required": true,
            "schema": {
              "oneOf": [
                {
                  "const": "business"
                },
                {
                  "type": "string",
                  "format": "uuid"
                }
              ]
            },
            "description": "business or an explicitly granted provider UUID"
          },
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated result. Existing appointments are preserved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DateSchedulePage"
                }
              }
            }
          },
          "401": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Transient/uncertain result; retain the original command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/schedules/{resource}/dates/{date}": {
      "get": {
        "operationId": "getBusinessScheduleDate",
        "summary": "Read effective hours and version for one date",
        "description": "Server-only, one local date in the clinic timezone. Business resources require booking-policy:read (and :write for preview/apply); provider resources require provider-booking-policy:read/:write and the explicitly granted provider. Precedence: provider date override, explicit provider weekly hours, business date override, business weekly hours. Existing explicit blocks always subtract from the effective hours. A null dayHours proposal removes this resource/date override and restores inheritance. Does not change recurring hours, move/cancel appointments or send messages. The preview binds the exact hours version and existing-appointment impact; stale/expired previews must be reviewed again. Keep the original Idempotency-Key, body and If-Match after an uncertain response. Recover through management operations or replay the same command; never replace the operation ID. Calendar hours are display data, not a booking offer: use canonical availability and final admission.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "required": true,
            "schema": {
              "oneOf": [
                {
                  "const": "business"
                },
                {
                  "type": "string",
                  "format": "uuid"
                }
              ]
            },
            "description": "business or an explicitly granted provider UUID"
          },
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated result. Existing appointments are preserved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DateScheduleState"
                }
              }
            }
          },
          "401": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Transient/uncertain result; retain the original command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "applyBusinessScheduleDate",
        "summary": "Apply one reviewed date-only hours change",
        "description": "Server-only, one local date in the clinic timezone. Business resources require booking-policy:read (and :write for preview/apply); provider resources require provider-booking-policy:read/:write and the explicitly granted provider. Precedence: provider date override, explicit provider weekly hours, business date override, business weekly hours. Existing explicit blocks always subtract from the effective hours. A null dayHours proposal removes this resource/date override and restores inheritance. Does not change recurring hours, move/cancel appointments or send messages. The preview binds the exact hours version and existing-appointment impact; stale/expired previews must be reviewed again. Keep the original Idempotency-Key, body and If-Match after an uncertain response. Recover through management operations or replay the same command; never replace the operation ID. Calendar hours are display data, not a booking offer: use canonical availability and final admission.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "required": true,
            "schema": {
              "oneOf": [
                {
                  "const": "business"
                },
                {
                  "type": "string",
                  "format": "uuid"
                }
              ]
            },
            "description": "business or an explicitly granted provider UUID"
          },
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"ds:[a-f0-9]{64}\"$"
            },
            "description": "Exact strong quoted date version returned by the date read."
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID before sending and reuse it until the result is resolved."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DateScheduleApply"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validated result. Existing appointments are preserved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DateScheduleResult"
                }
              }
            }
          },
          "401": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Transient/uncertain result; retain the original command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/schedules/{resource}/dates/{date}/change-previews": {
      "post": {
        "operationId": "previewBusinessScheduleDate",
        "summary": "Review a date-only hours change or reset",
        "description": "Server-only, one local date in the clinic timezone. Business resources require booking-policy:read (and :write for preview/apply); provider resources require provider-booking-policy:read/:write and the explicitly granted provider. Precedence: provider date override, explicit provider weekly hours, business date override, business weekly hours. Existing explicit blocks always subtract from the effective hours. A null dayHours proposal removes this resource/date override and restores inheritance. Does not change recurring hours, move/cancel appointments or send messages. The preview binds the exact hours version and existing-appointment impact; stale/expired previews must be reviewed again. Keep the original Idempotency-Key, body and If-Match after an uncertain response. Recover through management operations or replay the same command; never replace the operation ID. Calendar hours are display data, not a booking offer: use canonical availability and final admission.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "required": true,
            "schema": {
              "oneOf": [
                {
                  "const": "business"
                },
                {
                  "type": "string",
                  "format": "uuid"
                }
              ]
            },
            "description": "business or an explicitly granted provider UUID"
          },
          {
            "name": "date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"ds:[a-f0-9]{64}\"$"
            },
            "description": "Exact strong quoted date version returned by the date read."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DateScheduleProposal"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validated result. Existing appointments are preserved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DateSchedulePreview"
                }
              }
            }
          },
          "401": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Structured refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Transient/uncertain result; retain the original command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/messaging-webhook": {
      "get": {
        "operationId": "getMessagingWebhook",
        "summary": "Read messaging webhook configuration",
        "description": "Server-only Management credential; requests with Origin are refused. The credential fixes one business/site/integration. No appointment permissions, active booking site or booking bot are required. CRAD must approve the exact HTTPS callback URL before configuration. Runtime installation, URL approval, registration, enabled state and actual delivery are separate checks. If-Match is forbidden. Returns supported:true for installed support and the currently approved/registered URL without the secret. No query or request body is accepted.",
        "tags": [
          "Management"
        ],
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingWebhookState"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: invalid or unavailable credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_REQUIRED, SERVER_CREDENTIAL_REQUIRED or FORBIDDEN. Configuration requires the exact URL previously approved by CRAD.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ROUTE_UNAVAILABLE or NOT_FOUND. Unknown event IDs are not disclosed across integrations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_REQUEST. Malformed/extra input, forbidden If-Match, invalid query, or a retry that is not currently eligible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limited; respect Retry-After when present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or timeout failure. A write outcome may be uncertain; preserve and retry the exact original command identity.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "setMessagingWebhook",
        "summary": "Register, rotate or pause messaging webhooks",
        "description": "Server-only Management credential; requests with Origin are refused. The credential fixes one business/site/integration. No appointment permissions, active booking site or booking bot are required. CRAD must approve the exact HTTPS callback URL before configuration. Runtime installation, URL approval, registration, enabled state and actual delivery are separate checks. If-Match is forbidden. Requires conversations:read and conversations:write. Supply all three fields for enablement, pause or secret rotation. This never approves a new destination. enabled:false stops new capture and delivery; queued unexpired events remain available after resuming. Registration binds delivery to this credential: revocation, expiry or lost authority stops sending until a currently authorized credential registers again. A repeated exact operation returns the original receipt and fresh current state without rotating again. Use the same UUID/body after an uncertain result. A later callback URL approval disables delivery until the newly approved URL is registered. Committed new events schedule an immediate internal dispatch wake. Durable capture survives wake failure; scheduled maintenance is the fallback, with bounded continuation and fairness between incoming messages and delivery statuses. Delivery remains asynchronous, at least once and potentially out of order; no latency SLA is implied.",
        "tags": [
          "Management"
        ],
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:write"
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID and the exact request before submission. Retry that same command after an uncertain response; a changed command requires a new UUID."
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingWebhookSetResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: invalid or unavailable credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_REQUIRED, SERVER_CREDENTIAL_REQUIRED or FORBIDDEN. Configuration requires the exact URL previously approved by CRAD.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ROUTE_UNAVAILABLE or NOT_FOUND. Unknown event IDs are not disclosed across integrations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT: the UUID was reused with different canonical input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_REQUEST. Malformed/extra input, forbidden If-Match, invalid query, or a retry that is not currently eligible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "PRECONDITION_REQUIRED: missing Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limited; respect Retry-After when present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or timeout failure. A write outcome may be uncertain; preserve and retry the exact original command identity.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagingWebhookInput"
              }
            }
          }
        },
        "callbacks": {
          "messagingEvent": {
            "{$request.body#/callbackUrl}": {
              "post": {
                "summary": "CRAD posts a retained live message or delivery status",
                "description": "HTTPS POST to the approved registered destination. No redirects are followed. Verify v1=HMAC-SHA256(signingSecret, timestamp + \".\" + exactRawBody), using the literal 64-character secret string. Reject stale timestamps according to a bounded tolerance such as five minutes. Compare signatures in constant time and require X-CRAD-Webhook-Id to equal the signed eventId. Acknowledge 2xx only after durable deduplication/storage; a valid duplicate is also acknowledged. Transient failures receive bounded retry/backoff, with at most eight attempts per round. Permanent refusal or exhausted attempts stays failed until an explicit eligible retry. Source retention can expire unsent events. Do not interpret the callback as a booking event.",
                "parameters": [
                  {
                    "name": "X-CRAD-Webhook-Id",
                    "in": "header",
                    "required": true,
                    "schema": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  {
                    "name": "X-CRAD-Webhook-Timestamp",
                    "in": "header",
                    "required": true,
                    "schema": {
                      "type": "string",
                      "pattern": "^[0-9]+$"
                    },
                    "description": "Unix seconds, included verbatim in the signature input."
                  },
                  {
                    "name": "X-CRAD-Webhook-Signature",
                    "in": "header",
                    "required": true,
                    "schema": {
                      "type": "string",
                      "pattern": "^v1=[a-f0-9]{64}$"
                    }
                  }
                ],
                "requestBody": {
                  "required": true,
                  "content": {
                    "application/json": {
                      "schema": {
                        "$ref": "#/components/schemas/MessagingWebhookEvent"
                      }
                    }
                  }
                },
                "responses": {
                  "2XX": {
                    "description": "Receiver durably stored or recognized this eventId. Response content is ignored."
                  },
                  "default": {
                    "description": "Not acknowledged; retry eligibility depends on status, attempt count and retention."
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/messaging-webhook/deliveries": {
      "get": {
        "operationId": "listMessagingWebhookDeliveries",
        "summary": "Inspect messaging webhook delivery attempts",
        "description": "Server-only Management credential; requests with Origin are refused. The credential fixes one business/site/integration. No appointment permissions, active booking site or booking bot are required. CRAD must approve the exact HTTPS callback URL before configuration. Runtime installation, URL approval, registration, enabled state and actual delivery are separate checks. If-Match is forbidden. Returns bounded delivery metadata, oldest first. Defaults to failed events and limit 50. No cursor is available. more:true means additional matching records exist beyond the selected limit. Expired event content cannot be recovered or retried.",
        "tags": [
          "Management"
        ],
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read"
        ],
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "pending",
                "leased",
                "delivered",
                "failed",
                "expired"
              ],
              "default": "failed"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingWebhookDeliveryList"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: invalid or unavailable credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_REQUIRED, SERVER_CREDENTIAL_REQUIRED or FORBIDDEN. Configuration requires the exact URL previously approved by CRAD.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ROUTE_UNAVAILABLE or NOT_FOUND. Unknown event IDs are not disclosed across integrations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_REQUEST. Malformed/extra input, forbidden If-Match, invalid query, or a retry that is not currently eligible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limited; respect Retry-After when present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or timeout failure. A write outcome may be uncertain; preserve and retry the exact original command identity.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/messaging-webhook/deliveries/{eventId}/retry": {
      "post": {
        "operationId": "retryMessagingWebhookDelivery",
        "summary": "Retry a failed messaging webhook event",
        "description": "Server-only Management credential; requests with Origin are refused. The credential fixes one business/site/integration. No appointment permissions, active booking site or booking bot are required. CRAD must approve the exact HTTPS callback URL before configuration. Runtime installation, URL approval, registration, enabled state and actual delivery are separate checks. If-Match is forbidden. Requires conversations:read and conversations:write. Accepts an empty JSON object. The event must belong to this integration, remain unexpired, be failed, and have an enabled subscription. Requeues the same eventId and immutable body for up to eight additional attempts; does not resend a WhatsApp message. attempts is cumulative. Exact replay returns the prior receipt and current state; use the original UUID/body after uncertainty.",
        "tags": [
          "Management"
        ],
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "conversations:read",
          "conversations:write"
        ],
        "parameters": [
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID and the exact request before submission. Retry that same command after an uncertain response; a changed command requires a new UUID."
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized result.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingWebhookRetryResult"
                }
              }
            }
          },
          "401": {
            "description": "UNAUTHENTICATED: invalid or unavailable credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "SCOPE_REQUIRED, SERVER_CREDENTIAL_REQUIRED or FORBIDDEN. Configuration requires the exact URL previously approved by CRAD.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "ROUTE_UNAVAILABLE or NOT_FOUND. Unknown event IDs are not disclosed across integrations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "METHOD_NOT_ALLOWED.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "OPERATION_CONFLICT: the UUID was reused with different canonical input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Structured error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "INVALID_REQUEST. Malformed/extra input, forbidden If-Match, invalid query, or a retry that is not currently eligible.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "PRECONDITION_REQUIRED: missing Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limited; respect Retry-After when present.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Persistence or timeout failure. A write outcome may be uncertain; preserve and retry the exact original command identity.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MessagingWebhookRetryInput"
              }
            }
          }
        }
      }
    },
    "/v1/management/messaging-capabilities": {
      "get": {
        "operationId": "getMessagingCapabilities",
        "tags": [
          "Management"
        ],
        "summary": "Discover messaging support, key grants and saved readiness",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. No provider call, connection change, grant expansion or appointment setup. Treat readiness_unknown/null as unverified. Installed support, provider support, current key grants and saved readiness are separate. For credentials with appointments:read, use this endpoint to discover whatsapp-templates:read, whatsapp-templates:write, whatsapp-profile:read and whatsapp-profile:write; those names are omitted from the calendar-compatible GET /v1/management view. Discovery does not authorize sending or certify a live provider check.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [],
        "responses": {
          "200": {
            "description": "Current authorized discovery. Installed support, current key grants and saved readiness are separate; unknown readiness is not authorization to send.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessagingCapabilities"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/v1/management/whatsapp-templates": {
      "get": {
        "operationId": "listBusinessWhatsappTemplates",
        "tags": [
          "Management"
        ],
        "summary": "List this business's API-managed WhatsApp templates",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. Lists retained tenant-owned resources for the bound WABA, not every provider template and not the sending catalogue. Requires whatsapp-templates:read. Current connection and provider prerequisites are checked separately; a stored grant does not establish readiness. On successful reads, status and providerStatus reflect a fresh Meta observation, providerCheckedAt dates it, and submissionStatus preserves the stored submission state. When Meta has no matching resource, providerStatus is null and status is the stored state of a template that never reached Meta (LOCAL_PENDING, LOCAL_REJECTED, LOCAL_UNKNOWN), DELETED for a deleted one, or UNKNOWN for a stored Meta ID that Meta no longer lists; unavailable or incomplete provider reads return 503 PROVIDER_UNAVAILABLE. This observation neither reconciles operations nor certifies approval of an attempted local definition. Use the approved sending catalogue for current message content. List pagination stays scoped to this business; no client per-template refresh loop is needed.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-templates:read"
        ],
        "responses": {
          "200": {
            "description": "Authorized template resource(s) with current provider status, observation time and separate stored submission status. No template mutation or operation reconciliation.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsappOwnedTemplateList"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource or usable same-purpose current-binding image not found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ]
      },
      "post": {
        "operationId": "createBusinessWhatsappTemplate",
        "tags": [
          "Management"
        ],
        "summary": "Submit a new business-owned WhatsApp template",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. Uses a tenant-prefixed provider name. Meta independently determines eligibility/category/review. At most ten new local template operation reservations per business per minute. Keep the original request for recovery. Requires whatsapp-templates:read and whatsapp-templates:write. Current connection and provider prerequisites are checked separately; a stored grant does not establish readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-templates:read",
          "whatsapp-templates:write"
        ],
        "responses": {
          "200": {
            "description": "Current authorized template or operation result. Inspect operation state and providerStatus where returned; acceptance is separate from Meta approval and message delivery.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsappTemplateOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource or usable same-purpose current-binding image not found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported content type, MIME or file signature.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required Idempotency-Key or If-Match is missing.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID with the complete original request before dispatch. Reuse it for exact replay and recovery."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WhatsappTemplateDefinition"
              }
            }
          }
        }
      }
    },
    "/v1/management/whatsapp-templates/{templateId}": {
      "get": {
        "operationId": "getBusinessWhatsappTemplate",
        "tags": [
          "Management"
        ],
        "summary": "Read an owned template with current provider status",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. Use the local id and returned ETag for changes. providerStatus is an explicit provider observation; null does not establish approval. Requires whatsapp-templates:read. Current connection and provider prerequisites are checked separately; a stored grant does not establish readiness. On successful reads, status and providerStatus reflect a fresh Meta observation, providerCheckedAt dates it, and submissionStatus preserves the stored submission state. When Meta has no matching resource, providerStatus is null and status is the stored state of a template that never reached Meta (LOCAL_PENDING, LOCAL_REJECTED, LOCAL_UNKNOWN), DELETED for a deleted one, or UNKNOWN for a stored Meta ID that Meta no longer lists; unavailable or incomplete provider reads return 503 PROVIDER_UNAVAILABLE. This observation neither reconciles operations nor certifies approval of an attempted local definition. Use the approved sending catalogue for current message content. List pagination stays scoped to this business; no client per-template refresh loop is needed.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-templates:read"
        ],
        "responses": {
          "200": {
            "description": "Authorized template resource(s) with current provider status, observation time and separate stored submission status. No template mutation or operation reconciliation.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Strong quoted resource version for If-Match."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsappOwnedTemplateRead"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource or usable same-purpose current-binding image not found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "patch": {
        "operationId": "updateBusinessWhatsappTemplate",
        "tags": [
          "Management"
        ],
        "summary": "Submit an owned WhatsApp template edit",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. Full replacement definition; name, language and category must stay unchanged. Editing eligibility/rate limits remain provider-controlled. Shared starters and arbitrary provider IDs are excluded. Requires whatsapp-templates:read and whatsapp-templates:write. Current connection and provider prerequisites are checked separately; a stored grant does not establish readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-templates:read",
          "whatsapp-templates:write"
        ],
        "responses": {
          "200": {
            "description": "Current authorized template or operation result. Inspect operation state and providerStatus where returned; acceptance is separate from Meta approval and message delivery.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsappTemplateOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource or usable same-purpose current-binding image not found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "If-Match refers to a stale profile digest or local template revision; fetch the current resource and review a new intended change.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported content type, MIME or file signature.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required Idempotency-Key or If-Match is missing.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID with the complete original request before dispatch. Reuse it for exact replay and recovery."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            },
            "description": "Use the quoted ETag returned by the resource GET; this is not the operation UUID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WhatsappTemplateDefinition"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteBusinessWhatsappTemplate",
        "tags": [
          "Management"
        ],
        "summary": "Delete one API-owned WhatsApp template variant",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. No body. Deletes the owned provider ID plus its stored provider name; not a WABA-wide name selector and not all businesses' templates. Requires whatsapp-templates:read and whatsapp-templates:write. Current connection and provider prerequisites are checked separately; a stored grant does not establish readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-templates:read",
          "whatsapp-templates:write"
        ],
        "responses": {
          "200": {
            "description": "Current authorized template or operation result. Inspect operation state and providerStatus where returned; acceptance is separate from Meta approval and message delivery.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsappTemplateOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource or usable same-purpose current-binding image not found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "If-Match refers to a stale profile digest or local template revision; fetch the current resource and review a new intended change.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required Idempotency-Key or If-Match is missing.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "templateId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID with the complete original request before dispatch. Reuse it for exact replay and recovery."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"[1-9][0-9]*\"$"
            },
            "description": "Use the quoted ETag returned by the resource GET; this is not the operation UUID."
          }
        ]
      }
    },
    "/v1/management/whatsapp-templates/operations/{operationId}": {
      "get": {
        "operationId": "getBusinessWhatsappTemplateOperation",
        "tags": [
          "Management"
        ],
        "summary": "Recover a template operation without provider writes",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. Pure authorized receipt lookup. pending/unknown/not_found never authorizes a fresh provider mutation. Requires whatsapp-templates:read and whatsapp-templates:write. Current connection and provider prerequisites are checked separately; a stored grant does not establish readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-templates:read",
          "whatsapp-templates:write"
        ],
        "responses": {
          "200": {
            "description": "Current authorized template or operation result. Inspect operation state and providerStatus where returned; acceptance is separate from Meta approval and message delivery.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/WhatsappTemplateOperation"
                    },
                    {
                      "$ref": "#/components/schemas/WhatsappOperationNotFound"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource or usable same-purpose current-binding image not found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/management/whatsapp-templates/operations/{operationId}/reconcile": {
      "post": {
        "operationId": "reconcileBusinessWhatsappTemplateOperation",
        "tags": [
          "Management"
        ],
        "summary": "Reconcile an uncertain template operation through provider reads",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. Bodyless. Checks the fixed saved WABA/name/language; no create/edit/delete is retried. A mismatch remains unknown. Requires whatsapp-templates:read and whatsapp-templates:write. Current connection and provider prerequisites are checked separately; a stored grant does not establish readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-templates:read",
          "whatsapp-templates:write"
        ],
        "responses": {
          "200": {
            "description": "Current authorized template or operation result. Inspect operation state and providerStatus where returned; acceptance is separate from Meta approval and message delivery.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsappTemplateOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource or usable same-purpose current-binding image not found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/management/whatsapp-profile": {
      "get": {
        "operationId": "getBusinessWhatsappProfile",
        "tags": [
          "Management"
        ],
        "summary": "Read the bound WhatsApp business profile",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. Reads provider profile and returns a wp-prefixed digest ETag. The profile picture is distinct from a message-template header. Requires whatsapp-profile:read. Current connection and provider prerequisites are checked separately; a stored grant does not establish readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-profile:read"
        ],
        "responses": {
          "200": {
            "description": "Current authorized profile or operation result. Inspect the operation state; this endpoint does not send a customer message.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              },
              "ETag": {
                "schema": {
                  "type": "string"
                },
                "description": "Strong quoted resource version for If-Match."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsappProfileRead"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Provider profile is unavailable or malformed.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateBusinessWhatsappProfile",
        "tags": [
          "Management"
        ],
        "summary": "Update selected WhatsApp business-profile fields",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. Omitted fields remain unchanged. Use GET ETag and one operation UUID. At most one unresolved profile write per current connection. Meta writes are not automatically retried. Requires whatsapp-profile:read and whatsapp-profile:write. Current connection and provider prerequisites are checked separately; a stored grant does not establish readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-profile:read",
          "whatsapp-profile:write"
        ],
        "responses": {
          "200": {
            "description": "Current authorized profile or operation result. Inspect the operation state; this endpoint does not send a customer message.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsappProfileOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource or usable same-purpose current-binding image not found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "description": "If-Match refers to a stale profile digest or local template revision; fetch the current resource and review a new intended change.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported content type, MIME or file signature.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required Idempotency-Key or If-Match is missing.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Provider profile is unavailable or malformed.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID with the complete original request before dispatch. Reuse it for exact replay and recovery."
          },
          {
            "name": "If-Match",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^\"wp[a-f0-9]{64}\"$"
            },
            "description": "Use the quoted ETag returned by the resource GET; this is not the operation UUID."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WhatsappProfilePatch"
              }
            }
          }
        }
      }
    },
    "/v1/management/whatsapp-profile/operations/{operationId}": {
      "get": {
        "operationId": "getBusinessWhatsappProfileOperation",
        "tags": [
          "Management"
        ],
        "summary": "Recover the original profile-write receipt",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. Lookup only; no provider write. Save and preserve its requestHash and original request. Requires whatsapp-profile:read and whatsapp-profile:write. Current connection and provider prerequisites are checked separately; a stored grant does not establish readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-profile:read",
          "whatsapp-profile:write"
        ],
        "responses": {
          "200": {
            "description": "Current authorized profile or operation result. Inspect the operation state; this endpoint does not send a customer message.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/WhatsappProfileOperation"
                    },
                    {
                      "$ref": "#/components/schemas/WhatsappOperationNotFound"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource or usable same-purpose current-binding image not found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/management/whatsapp-profile/operations/{operationId}/reconcile": {
      "post": {
        "operationId": "reconcileBusinessWhatsappProfileOperation",
        "tags": [
          "Management"
        ],
        "summary": "Check text-only unknown profile writes using a provider read",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. Bodyless. A matching text-only patch settles committed; mismatch stays unknown. Unknown photo writes require native owner/super-admin review and cannot be proven by comparing a URL with an upload handle. A reviewed receipt is terminal and is returned without provider I/O. This API key cannot acknowledge or review its own uncertain write. Requires whatsapp-profile:read and whatsapp-profile:write. Current connection and provider prerequisites are checked separately; a stored grant does not establish readiness.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [
          "whatsapp-profile:read",
          "whatsapp-profile:write"
        ],
        "responses": {
          "200": {
            "description": "Current authorized profile or operation result. Inspect the operation state; this endpoint does not send a customer message.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsappProfileOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource or usable same-purpose current-binding image not found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Provider profile is unavailable or malformed.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/management/whatsapp-images": {
      "post": {
        "operationId": "uploadBusinessWhatsappImage",
        "tags": [
          "Management"
        ],
        "summary": "Upload a purpose-bound image for template creation or profile photo",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. Multipart file plus required purpose. template_header requires whatsapp-templates:read and whatsapp-templates:write; business_profile requires whatsapp-profile:read and whatsapp-profile:write. Returns a private-handle-free internal uploadId for the matching management write. This does not send a message and is distinct from conversation uploads.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [],
        "responses": {
          "200": {
            "description": "Current authorized image or operation result. A ready upload is purpose-bound, not a message send or template approval.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhatsappImageOperation"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request/file exceeds CRAD size limits.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported content type, MIME or file signature.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "Required Idempotency-Key or If-Match is missing.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Persist one UUID with the complete original request before dispatch. Reuse it for exact replay and recovery."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/WhatsappImageUploadInput"
              }
            }
          }
        },
        "x-crad-conditional-scopes": {
          "description": "For saved purpose template_header, require whatsapp-templates:read and whatsapp-templates:write. For saved purpose business_profile, require whatsapp-profile:read and whatsapp-profile:write. The purpose-specific write grant is checked against the original upload, not a caller-selected substitute."
        }
      }
    },
    "/v1/management/whatsapp-images/operations/{operationId}": {
      "get": {
        "operationId": "getBusinessWhatsappImageOperation",
        "tags": [
          "Management"
        ],
        "summary": "Recover the original resumable-image receipt",
        "description": "Backend-only Management credential; no Origin header or caller-selected business/phone/WABA/token. Requires the current write scope for the receipt's saved purpose and the same integration. No provider request or raw handle disclosure; ready is not usable after expiry or binding changes.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "x-crad-required-scopes": [],
        "responses": {
          "200": {
            "description": "Current authorized image or operation result. A ready upload is purpose-bound, not a message send or template approval.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/WhatsappImageOperation"
                    },
                    {
                      "$ref": "#/components/schemas/WhatsappOperationNotFound"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid server credential.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Scope, credential, integration or business authority denied; browser Origin is refused.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Owned resource or usable same-purpose current-binding image not found.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Unsupported HTTP method.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Connection changed/blocked, conflicting operation UUID, unresolved write, expired claim or owner review required. No automatic provider redispatch.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid/unknown field, unsupported selector/query, UUID, precondition or template shape.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Credential/request or local template rate limit; honor Retry-After when supplied.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Configuration, provider or persistence unavailable; retain original operation identity because outcome may be uncertain.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-conditional-scopes": {
          "description": "For saved purpose template_header, require whatsapp-templates:read and whatsapp-templates:write. For saved purpose business_profile, require whatsapp-profile:read and whatsapp-profile:write. The purpose-specific write grant is checked against the original upload, not a caller-selected substitute."
        }
      }
    },
    "/v1/management/customers/{businessCustomerId}/appointment-overview": {
      "get": {
        "operationId": "getBusinessCustomerAppointmentOverview",
        "summary": "Read recent and upcoming appointments for one customer",
        "description": "Read a customer card using one server-side Management request. Send the canonical businessCustomerId and a credential with appointments:read and a current owner calendar grant. Each requested section includes only visible appointments. An unknown customer or one with no visible matches returns empty sections. An explicit provider outside the grant is refused. The same asOf separates recent appointments (endAt <= asOf, newest start first) from ongoing and future PENDING, CONFIRMED and NOW appointments (endAt > asOf, earliest start first). Ties use appointmentId in the same direction. recentStatus filters only recent. Zero omits that section. Send at least one positive limit and each parameter at most once. Localized names include available he/ar/en values or are null. The service label prefers the saved appointment terms, then the current authorized catalogue. A clinic decision is pending only when status is PENDING and approvalRequired is true. To page older recent appointments in place, opt in on the first request with includeRecentCursor=true. Read recent.nextCursor and send it as recentCursor with a positive recentLimit. The continuation keeps the original asOf, customer, calendar grant and filters. Rows reflect current data. For history by date, list appointments by businessCustomerId and date range.",
        "security": [
          {
            "ManagementCredential": []
          }
        ],
        "parameters": [
          {
            "name": "businessCustomerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "recentLimit",
            "in": "query",
            "required": false,
            "description": "Ended appointments to return. On a regular overview, 0 omits recent. Request 1–20 with includeRecentCursor=true or recentCursor. Each continuation can choose a different page size.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 20,
              "default": 4
            }
          },
          {
            "name": "upcomingLimit",
            "in": "query",
            "required": false,
            "description": "Ongoing or future active appointments to return. Defaults to 1 for an initial overview and 0 with recentCursor. Only 0 is permitted on continuation.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 20
            }
          },
          {
            "name": "recentStatus",
            "in": "query",
            "required": false,
            "description": "One exact uppercase calendar status. Set COMPLETED for a list of completed treatments.",
            "schema": {
              "$ref": "#/components/schemas/BusinessAppointmentStatus"
            }
          },
          {
            "name": "providerId",
            "in": "query",
            "required": false,
            "schema": {
              "oneOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "const": "unassigned"
                }
              ]
            },
            "description": "Omitted: all current approved resources. unassigned: only unassigned appointments if explicitly approved. UUID: that approved provider."
          },
          {
            "name": "includeRecentCursor",
            "in": "query",
            "required": false,
            "description": "Defaults to false on an initial overview. Set true to receive recent.nextCursor when older matches exist. A continuation already opts in. An explicit false conflicts with recentCursor.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "recentCursor",
            "in": "query",
            "required": false,
            "description": "Opaque recent.nextCursor from the previous page. Reuse the same credential and customer path. Send just this cursor and the desired recentLimit. The server restores the original recentStatus, providerId and cutoff and omits upcoming. Explicit providerId or recentStatus, positive upcomingLimit or false includeRecentCursor are invalid. The chain expires 30 minutes after the first page.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-crad-required-scopes": [
          "appointments:read"
        ],
        "responses": {
          "200": {
            "description": "Requested sections from the same server cutoff.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessCustomerAppointmentOverview"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Keep this customer-specific response private to the current request.",
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid Management credential.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing appointment scope or calendar grant, a requested provider outside that grant, or a browser Origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "PROJECTION_CHANGED. Calendar grant revision changed. Restart from the first page under the current grant.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "CURSOR_EXPIRED. The cursor expired, is unknown or belongs to a different customer or credential. Restart from the first page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Invalid customer UUID, duplicate or unknown query parameter, unsupported filter, invalid limit, both limits zero, or conflicting pagination parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request quota reached, or allocation of a pagination cursor exceeded the calendar capacity (SNAPSHOT_LIMIT). A plain overview allocates no cursor.",
            "headers": {
              "Retry-After": {
                "description": "Retry delay in seconds. SNAPSHOT_LIMIT returns 1800. Other quota responses may return a different delay.",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Service temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "CustomerSession": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "wbs_<64hex>",
        "description": "Opaque short-lived customer session, upgraded by CRAD phone proof; neither a website account nor a cookie grants this authority. A session created with a companion integration credential remains bound to that credential: every request rechecks its expiry and revocation. Omitting or replacing the companion header later does not rebind the session. Current phone proof is required where stated by the operation. After expiry, create a new session and explicitly verify the same phone and integration to recover a known request or booking; retain the original locators and never auto-confirm during recovery."
      },
      "IntegrationCredential": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "wbm_<64hex> or legacy wbi_<64hex>",
        "description": "Use the same server-only wbm_ API key as business management, with explicitly approved integration scopes; legacy wbi_ integration-only keys remain supported. No Origin request header. GET /v1/integration returns the integration-scoped view of the same credential/site/integration. Customer phone proof is still required for self-service."
      },
      "ManagementCredential": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "wbm_<64hex>",
        "description": "One server-only owner-issued wbm_ API key can carry both management and integration permissions. Additional permissions require an explicit owner-issued grant. GET /v1/management returns the management discovery view, which may be empty for a booking-only key. For credentials with appointments:read, this discovery view omits whatsapp-templates:read, whatsapp-templates:write, whatsapp-profile:read and whatsapp-profile:write to preserve calendar-client compatibility. Discover these grants through GET /v1/management/messaging-capabilities. Template/profile command authorization still uses the stored grants. Server-only owner-issued Management authority with explicit application permissions. Calling this API does not expand a credential's grants. contacts:read/write/block/sync/fields:read/fields:write are separate approvals for canonical business contacts; fields also require current typed owner grants. contacts:record remains contact recording/recovery only. These grants create no customer phone proof, booking authority, messaging consent or automatic synchronization. Hours/blocks retain their independent resource grants. booking-policy:read/write separately delegate whole-business booking settings, without schedule/provider grants; write requires read. They preserve existing appointments and create no duration-rewrite authority. Provider duration policy additionally requires explicit provider-booking-policy:read/write and exact current providerIds; booking-duration:rewrite is separately approved and does not itself grant policy read/write. Service catalogue requires explicit services:read/write, independent of provider/calendar/schedule resources; write requires read. These operations do not expand an existing credential's grants. Public presentation and reviewed service selection require explicit website-content:read/write; write requires read, independently from services:* and provider resources. Existing provider metadata/activity/assignment additionally requires providers:read/write and a nonempty explicit current providerIds grant; write requires read. This grants no provider creation, deletion, login, invitation or schedule authority. WhatsApp template/profile management requires separate whatsapp-templates:read, whatsapp-templates:write, whatsapp-profile:read and whatsapp-profile:write application scopes. Write requires its matching read scope. These grants require explicit owner approval; Meta OAuth permissions remain separate."
      }
    },
    "schemas": {
      "BusinessProviderVersion": {
        "type": "string",
        "pattern": "^prv:[a-f0-9-]{36}:[a-f0-9]{64}$",
        "description": "Opaque current provider aggregate version. Preserve exactly as returned; it can change after metadata, links, provider policy or relevant managed-booking readiness changes."
      },
      "BusinessProviderDisplayName": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "he": {
            "type": "string"
          },
          "ar": {
            "type": "string"
          },
          "en": {
            "type": "string"
          }
        },
        "required": [
          "he",
          "ar",
          "en"
        ]
      },
      "BusinessProviderNameInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "he": {
            "type": "string",
            "maxLength": 200
          },
          "ar": {
            "type": "string",
            "maxLength": 200
          },
          "en": {
            "type": "string",
            "maxLength": 200
          }
        },
        "required": [
          "he",
          "ar",
          "en"
        ],
        "description": "Complete supported localized name; at least one value must be nonblank. Supplied values are bounded by Unicode characters. Omission preserves the stored legacy name.",
        "anyOf": [
          {
            "properties": {
              "he": {
                "pattern": "\\S"
              }
            }
          },
          {
            "properties": {
              "ar": {
                "pattern": "\\S"
              }
            }
          },
          {
            "properties": {
              "en": {
                "pattern": "\\S"
              }
            }
          }
        ]
      },
      "BusinessProviderAssignment": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "mode": {
                "const": "all"
              },
              "serviceIds": {
                "type": "array",
                "minItems": 0,
                "maxItems": 0,
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            },
            "required": [
              "mode",
              "serviceIds"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "mode": {
                "const": "selected"
              },
              "serviceIds": {
                "type": "array",
                "minItems": 1,
                "maxItems": 1000,
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            },
            "required": [
              "mode",
              "serviceIds"
            ]
          }
        ]
      },
      "BusinessProviderState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "providerId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "$ref": "#/components/schemas/BusinessProviderVersion"
          },
          "name": {
            "$ref": "#/components/schemas/BusinessProviderDisplayName"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Ordinary provider contact text; no customer phone proof, consent, sender connection or login authority."
          },
          "color": {
            "type": "string",
            "description": "Stored custom color text, including legacy values."
          },
          "isActive": {
            "type": "boolean"
          },
          "hasLinkedUser": {
            "type": "boolean",
            "description": "Only a linkage indicator. No user identity, login credentials or user-management permission."
          },
          "assignment": {
            "$ref": "#/components/schemas/BusinessProviderAssignment"
          },
          "activityEffects": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "activate": {
                "enum": [
                  "none",
                  "managed_booking_unavailable",
                  "managed_booking_restored"
                ]
              },
              "deactivate": {
                "enum": [
                  "none",
                  "managed_booking_unavailable",
                  "managed_booking_restored"
                ]
              }
            },
            "required": [
              "activate",
              "deactivate"
            ]
          }
        },
        "required": [
          "providerId",
          "version",
          "name",
          "email",
          "phone",
          "color",
          "isActive",
          "hasLinkedUser",
          "assignment",
          "activityEffects"
        ]
      },
      "BusinessProviderList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/BusinessProviderState"
            },
            "description": "Complete current explicitly granted existing providers, including inactive rows. No pagination or silent truncation."
          }
        },
        "required": [
          "items"
        ]
      },
      "BusinessProviderChanges": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "$ref": "#/components/schemas/BusinessProviderNameInput"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 320
          },
          "color": {
            "type": "string",
            "maxLength": 320
          },
          "isActive": {
            "type": "boolean"
          },
          "assignment": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "mode": {
                    "const": "all"
                  }
                },
                "required": [
                  "mode"
                ]
              },
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "mode": {
                    "const": "selected"
                  },
                  "serviceIds": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 1000,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                },
                "required": [
                  "mode",
                  "serviceIds"
                ]
              }
            ]
          }
        },
        "required": [],
        "minProperties": 1,
        "description": "Only supplied fields change. Email/phone trim spaces and empty becomes null. Assignment, when supplied, is a complete explicit replacement. Existing legacy text is preserved when omitted. Name requires at least one nonblank value. No schedule, duration, avatar, user, password or invitation fields."
      },
      "BusinessProviderUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "changes": {
            "$ref": "#/components/schemas/BusinessProviderChanges"
          }
        },
        "required": [
          "changes"
        ]
      },
      "BusinessProviderReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "providerId": {
            "type": "string",
            "format": "uuid"
          },
          "acceptedVersion": {
            "$ref": "#/components/schemas/BusinessProviderVersion"
          },
          "changed": {
            "type": "boolean"
          },
          "before": {
            "$ref": "#/components/schemas/BusinessProviderState"
          },
          "after": {
            "$ref": "#/components/schemas/BusinessProviderState"
          },
          "existingAppointmentsPreserved": {
            "const": true
          }
        },
        "required": [
          "operationId",
          "providerId",
          "acceptedVersion",
          "changed",
          "before",
          "after",
          "existingAppointmentsPreserved"
        ]
      },
      "BusinessProviderResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessProviderReceipt"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessProviderState"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "enum": [
              null,
              "provider_not_found"
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "oneOf": [
          {
            "properties": {
              "current": {
                "type": "null"
              },
              "currentUnavailableReason": {
                "const": "provider_not_found"
              }
            }
          },
          {
            "properties": {
              "current": {
                "$ref": "#/components/schemas/BusinessProviderState"
              },
              "currentUnavailableReason": {
                "type": "null"
              }
            }
          }
        ],
        "description": "Immutable accepted receipt plus fresh authorized current state. acceptedVersion equals receipt.after.version; all states identify the receipt provider. A newer current version does not change acceptance. Current null means the authorized original provider is genuinely removed, never revoked access."
      },
      "BusinessProviderOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessProviderReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessProviderState"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currentUnavailableReason": {
                "enum": [
                  null,
                  "provider_not_found"
                ]
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "currentUnavailableReason",
              "replayed"
            ],
            "oneOf": [
              {
                "properties": {
                  "current": {
                    "type": "null"
                  },
                  "currentUnavailableReason": {
                    "const": "provider_not_found"
                  }
                }
              },
              {
                "properties": {
                  "current": {
                    "$ref": "#/components/schemas/BusinessProviderState"
                  },
                  "currentUnavailableReason": {
                    "type": "null"
                  }
                }
              }
            ],
            "description": "Immutable accepted receipt plus fresh authorized current state. acceptedVersion equals receipt.after.version; all states identify the receipt provider. A newer current version does not change acceptance. Current null means the authorized original provider is genuinely removed, never revoked access."
          }
        ]
      },
      "Error": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "code": {
                "type": "string"
              },
              "requestId": {
                "type": "string",
                "format": "uuid"
              },
              "retryAfter": {
                "type": "integer",
                "minimum": 1
              }
            },
            "required": [
              "code",
              "requestId"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "Text": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "he": {
            "type": "string"
          },
          "ar": {
            "type": "string"
          },
          "en": {
            "type": "string"
          }
        }
      },
      "Language": {
        "type": "string",
        "enum": [
          "he",
          "ar",
          "en"
        ]
      },
      "Verification": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "available": {
            "type": "boolean",
            "description": "The configured code verifier can validate an issued code. This stays available when the WhatsApp sender disconnects; it does not assert provider delivery or permission to issue another code."
          },
          "newChallengeAvailable": {
            "type": "boolean",
            "description": "Optional current advice for new verification through the business's WhatsApp Authentication template. False does not invalidate an already issued code, verified proof or exact challenge replay. The send action explicitly requests this code only; it does not change reminder consent. Meta approval, sender binding, policy and abuse quotas are checked before dispatch. No SMS fallback."
          },
          "channel": {
            "const": "whatsapp"
          },
          "mode": {
            "enum": [
              "disabled",
              "sandbox",
              "live"
            ]
          },
          "languages": {
            "type": "array",
            "maxItems": 3,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/Language"
            },
            "description": "Optional current languages configured for new WhatsApp verification codes. Use the visitor's selected language only when included; never silently switch to another language. An empty array prevents new issuance. This field does not invalidate checking an existing code. Older v1 responses may omit it; the server remains authoritative."
          }
        },
        "required": [
          "available",
          "channel",
          "mode"
        ]
      },
      "Capabilities": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "contractVersion": {
            "const": 1
          },
          "siteId": {
            "type": "string",
            "format": "uuid"
          },
          "integrationId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "recoveryIntegrationId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional default hosted integration for existing appointment management and known-request recovery. May identify a paused hosted integration; never use it to admit a new booking. Explicit integration IDs retain priority and every session/proof remains bound to its exact integration."
          },
          "businessName": {
            "$ref": "#/components/schemas/Text"
          },
          "defaultLanguage": {
            "$ref": "#/components/schemas/Language"
          },
          "bookingPolicy": {
            "enum": [
              "legacy_fixed_slot_v1",
              "service_duration_v1"
            ]
          },
          "bookingHorizonDays": {
            "type": "integer"
          },
          "providerSelection": {
            "type": "boolean"
          },
          "removal": {
            "type": "boolean"
          },
          "timezone": {
            "type": "string"
          },
          "minCancellationNoticeMinutes": {
            "type": "integer"
          },
          "bookingEnabled": {
            "type": "boolean",
            "description": "New intake readiness for the authenticated session's integration, or site-wide readiness through at least one enabled integration for an anonymous catalog. An anonymous integrationId is the default hosted integration and may be null for an API-only site; supply the known headless integration ID when creating its session. This flag does not reserve a slot or prevent management of accepted bookings."
          },
          "verification": {
            "$ref": "#/components/schemas/Verification"
          },
          "communicationNoticeVersion": {
            "type": "string"
          },
          "configRevision": {
            "type": "string"
          },
          "catalogRevision": {
            "type": "string"
          },
          "businessDetails": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "location": {
                "$ref": "#/components/schemas/Text"
              },
              "contactPhone": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^\\+[1-9][0-9]{7,14}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "websiteUrl": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uri",
                    "pattern": "^https://"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "imageUrl": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uri",
                    "pattern": "^https://"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "location",
              "contactPhone",
              "websiteUrl",
              "imageUrl"
            ]
          },
          "features": {
            "$ref": "#/components/schemas/WebsiteFeatures"
          },
          "languages": {
            "type": "array",
            "minItems": 1,
            "maxItems": 3,
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/Language"
            },
            "description": "Optional additive v1 supported contract languages. Default language alone does not enumerate support."
          },
          "customerFields": {
            "type": "array",
            "minItems": 2,
            "maxItems": 2,
            "items": {
              "$ref": "#/components/schemas/CustomerField"
            },
            "allOf": [
              {
                "contains": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "const": "customerName"
                    }
                  },
                  "required": [
                    "key"
                  ]
                },
                "minContains": 1,
                "maxContains": 1
              },
              {
                "contains": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "const": "phone"
                    }
                  },
                  "required": [
                    "key"
                  ]
                },
                "minContains": 1,
                "maxContains": 1
              }
            ],
            "description": "Optional additive v1 fixed required fields and localized labels. Absence in an older v1 response is unknown discovery, not permission for unsupported fields."
          },
          "approvalRequired": {
            "type": "boolean",
            "description": "New customer bookings await clinic approval. Show Send request and request-received copy. Omission in older v1 means unknown; always honor the committed receipt status."
          },
          "customerAppointmentChanges": {
            "enum": [
              "self_service",
              "contact_business"
            ],
            "description": "Current customer change/cancel policy. In contact_business mode direct customers to capabilities.businessDetails.contactPhone; owners can still manage appointments and customers can respond to explicit alternative-time offers."
          }
        },
        "required": [
          "contractVersion",
          "siteId",
          "integrationId",
          "businessName",
          "defaultLanguage",
          "bookingPolicy",
          "bookingHorizonDays",
          "providerSelection",
          "removal",
          "timezone",
          "minCancellationNoticeMinutes",
          "bookingEnabled",
          "verification",
          "communicationNoticeVersion"
        ]
      },
      "Service": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "$ref": "#/components/schemas/Text"
          },
          "description": {
            "$ref": "#/components/schemas/Text"
          },
          "priceMinor": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Exact price in minor units. Null means no final price: consult priceRangeMinor when present, otherwise the price is decided during the visit. Zero is an explicit free price."
          },
          "currency": {
            "const": "ILS"
          },
          "providerIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "imageUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri",
                "pattern": "^https://"
              },
              {
                "type": "null"
              }
            ]
          },
          "durationMinutes": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "priceRangeMinor": {
            "$ref": "#/components/schemas/MinorPriceRange"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "priceMinor",
          "currency",
          "providerIds"
        ],
        "allOf": [
          {
            "if": {
              "required": [
                "priceRangeMinor"
              ],
              "properties": {
                "priceRangeMinor": {
                  "type": "object"
                }
              }
            },
            "then": {
              "properties": {
                "priceMinor": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "Provider": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "$ref": "#/components/schemas/Text"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "Catalog": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "capabilities": {
            "$ref": "#/components/schemas/Capabilities"
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Service"
            }
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Provider"
            }
          }
        },
        "required": [
          "capabilities",
          "services",
          "providers"
        ]
      },
      "Session": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sessionToken": {
            "type": "string",
            "pattern": "^wbs_[a-f0-9]{64}$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "Current session expiry. It is separate from phone-proof expiry; successful verification refreshes this to 30 minutes from verification."
          },
          "verified": {
            "type": "boolean"
          },
          "verificationExpiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "description": "Current phone-proof expiry, or null before verification. Successful verification sets this to 15 minutes from verification. A still-valid session can therefore lack current proof."
          }
        },
        "required": [
          "sessionToken",
          "expiresAt",
          "verified",
          "verificationExpiresAt"
        ]
      },
      "Challenge": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "challengeId": {
            "type": "string",
            "format": "uuid"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "resendAt": {
            "type": "string",
            "format": "date-time"
          },
          "deliveryState": {
            "enum": [
              "accepted",
              "unknown"
            ]
          }
        },
        "required": [
          "challengeId",
          "expiresAt",
          "resendAt",
          "deliveryState"
        ]
      },
      "Snapshot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "const": 1
          },
          "policy": {
            "enum": [
              "legacy_fixed_slot_v1",
              "service_duration_v1"
            ]
          },
          "serviceId": {
            "type": "string",
            "format": "uuid"
          },
          "serviceName": {
            "$ref": "#/components/schemas/Text"
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "durationMinutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440
          },
          "slotIntervalMinutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440
          },
          "totalPriceMinor": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Frozen exact total in minor units. Null remains non-final; priceRangeMinor may carry frozen range bounds. Never turn the range minimum into an agreed total."
          },
          "currency": {
            "const": "ILS"
          },
          "includeRemoval": {
            "type": "boolean"
          },
          "baseDurationMinutes": {
            "type": "integer"
          },
          "removalDurationMinutes": {
            "type": "integer"
          },
          "basePriceMinor": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Null means the price will be decided later; zero remains an explicit free price."
          },
          "removalPriceMinor": {
            "type": "integer"
          },
          "priceRangeMinor": {
            "$ref": "#/components/schemas/MinorPriceRange"
          }
        },
        "required": [
          "version",
          "policy",
          "serviceId",
          "serviceName",
          "providerId",
          "durationMinutes",
          "slotIntervalMinutes",
          "totalPriceMinor",
          "currency",
          "includeRemoval",
          "baseDurationMinutes",
          "removalDurationMinutes",
          "basePriceMinor",
          "removalPriceMinor"
        ],
        "allOf": [
          {
            "if": {
              "required": [
                "priceRangeMinor"
              ],
              "properties": {
                "priceRangeMinor": {
                  "type": "object"
                }
              }
            },
            "then": {
              "properties": {
                "totalPriceMinor": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "Quote": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "quoteId": {
            "type": "string",
            "format": "uuid"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "snapshot": {
            "$ref": "#/components/schemas/Snapshot"
          }
        },
        "required": [
          "quoteId",
          "expiresAt",
          "snapshot"
        ]
      },
      "Availability": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "quoteId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "localDate": {
            "type": "string",
            "format": "date"
          },
          "timezone": {
            "type": "string"
          },
          "slots": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "startAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "endAt": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "startAt",
                "endAt"
              ]
            }
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "validUntil": {
            "type": "string",
            "format": "date-time"
          },
          "policyRevision": {
            "type": "string"
          },
          "scheduleRevision": {
            "type": "string"
          },
          "configRevision": {
            "type": "string"
          },
          "catalogRevision": {
            "type": "string"
          },
          "dayState": {
            "type": "string",
            "enum": [
              "available",
              "closed",
              "full",
              "outside_booking_window",
              "no_suitable_times",
              "unknown"
            ],
            "description": "Authoritative current day reason; optional during rolling v1. Do not derive a closed or full reason from an empty slots array."
          }
        },
        "required": [
          "quoteId",
          "localDate",
          "timezone",
          "slots"
        ]
      },
      "Preferences": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "whatsapp": {
            "type": "boolean"
          },
          "noticeVersion": {
            "const": "website-transactional-whatsapp-v1"
          }
        },
        "required": [
          "whatsapp",
          "noticeVersion"
        ]
      },
      "CreateIntent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "kind": {
            "const": "create"
          },
          "quoteId": {
            "type": "string",
            "format": "uuid"
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "customerName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "communicationPreferences": {
            "$ref": "#/components/schemas/Preferences"
          },
          "externalReference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$",
            "description": "Optional immutable backend-issued booking mapping, unique within its original site and integration. Requires a current companion integration credential with bookings:write:customer and current customer phone proof. Exact case; no whitespace. Never an authorization or customer identity key."
          }
        },
        "required": [
          "kind",
          "quoteId",
          "startAt",
          "customerName",
          "language",
          "communicationPreferences"
        ]
      },
      "ActionIntent": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "cancel"
              },
              "expectedVersion": {
                "type": "integer",
                "minimum": 1
              }
            },
            "required": [
              "kind",
              "expectedVersion"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "reschedule"
              },
              "expectedVersion": {
                "type": "integer",
                "minimum": 1
              },
              "newStartAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "kind",
              "expectedVersion",
              "newStartAt"
            ]
          }
        ]
      },
      "Intent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "intentId": {
            "type": "string",
            "format": "uuid"
          },
          "locator": {
            "type": "string",
            "format": "uuid"
          },
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "enum": [
              "create",
              "reschedule",
              "cancel"
            ]
          },
          "bookingId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "summary": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CreateIntent"
              },
              {
                "$ref": "#/components/schemas/ActionIntent"
              }
            ]
          },
          "quote": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Quote"
              },
              {
                "type": "null"
              }
            ]
          },
          "requestId": {
            "type": "string",
            "format": "uuid",
            "description": "Original stable create/action-intent request locator for authoritative abandonment before replacing an uncommitted operation; optional during rolling v1."
          }
        },
        "required": [
          "intentId",
          "locator",
          "operationId",
          "kind",
          "bookingId",
          "expiresAt",
          "summary",
          "quote"
        ]
      },
      "Receipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "bookingId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "enum": [
              "pending",
              "confirmed",
              "cancelled",
              "completed",
              "missed",
              "now"
            ]
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          },
          "snapshot": {
            "$ref": "#/components/schemas/Snapshot"
          },
          "replayed": {
            "type": "boolean"
          },
          "allowedActions": {
            "$ref": "#/components/schemas/WebsiteAllowedActions"
          },
          "externalReference": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 120,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{0,119}$",
            "description": "Original immutable integration-scoped booking reference, retained across replacement/reschedule and key rotation. Null when no reference was provided; optional during rolling v1."
          },
          "approvalRequired": {
            "type": "boolean",
            "description": "Customer request requiring a clinic decision. Existing appointments and manually entered appointments are preserved."
          },
          "timeProposal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BookingTimeProposal"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "bookingId",
          "version",
          "status",
          "startAt",
          "endAt",
          "snapshot",
          "replayed"
        ]
      },
      "Operation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/Receipt"
              },
              "currentBooking": {
                "$ref": "#/components/schemas/Receipt"
              }
            },
            "required": [
              "status",
              "receipt",
              "currentBooking"
            ]
          }
        ]
      },
      "Customer": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "customerId",
          "externalCustomerId",
          "status",
          "version"
        ],
        "properties": {
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "externalCustomerId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "enum": [
              "active",
              "detached"
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "displayName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "language": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Language"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "type": "string",
            "pattern": "^\\+[1-9][0-9]{7,14}$"
          },
          "fieldSources": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "source": {
                  "type": "string"
                },
                "version": {
                  "type": "integer"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "source",
                "version",
                "updated_at"
              ]
            }
          },
          "identityAssurance": {
            "enum": [
              "customer_verified",
              "owner_reviewed"
            ],
            "description": "owner_reviewed means an owner-approved administrative or historical contact record, never customer authentication or phone proof."
          },
          "displayNameUnavailableReason": {
            "enum": [
              "not_set",
              "blank",
              "too_long",
              "unsupported_characters"
            ],
            "description": "Present only when the active displayName is unavailable (null). Canonical CRAD text is preserved, not truncated or cleared. Do not echo null as a source-field deletion."
          }
        },
        "allOf": [
          {
            "if": {
              "required": [
                "displayNameUnavailableReason"
              ]
            },
            "then": {
              "required": [
                "displayName"
              ],
              "properties": {
                "status": {
                  "const": "active"
                },
                "displayName": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "CustomerResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "customer": {
            "$ref": "#/components/schemas/Customer"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "customer",
          "replayed"
        ]
      },
      "CustomerEvent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "type": "integer"
          },
          "type": {
            "enum": [
              "upsert",
              "detached"
            ]
          },
          "customer": {
            "$ref": "#/components/schemas/Customer"
          },
          "source": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "eventId",
          "sequence",
          "type",
          "customer",
          "source",
          "createdAt"
        ]
      },
      "CustomerPage": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "snapshot"
              },
              "customers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Customer"
                }
              },
              "nextCursor": {
                "type": "string",
                "format": "uuid"
              },
              "hasMore": {
                "type": "boolean"
              },
              "watermark": {
                "type": "integer"
              }
            },
            "required": [
              "kind",
              "customers",
              "nextCursor",
              "hasMore",
              "watermark"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "changes"
              },
              "events": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CustomerEvent"
                }
              },
              "nextCursor": {
                "type": "string",
                "format": "uuid"
              },
              "hasMore": {
                "type": "boolean"
              },
              "watermark": {
                "type": "integer"
              }
            },
            "required": [
              "kind",
              "events",
              "nextCursor",
              "hasMore",
              "watermark"
            ]
          }
        ]
      },
      "WeeklyHours": {
        "type": "object",
        "properties": {
          "sunday": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "open": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "close": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "breaks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "start": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    },
                    "end": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    }
                  },
                  "required": [
                    "start",
                    "end"
                  ]
                },
                "maxItems": 10
              }
            },
            "required": [
              "enabled"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "enabled": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "open",
                    "close"
                  ]
                }
              }
            ]
          },
          "monday": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "open": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "close": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "breaks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "start": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    },
                    "end": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    }
                  },
                  "required": [
                    "start",
                    "end"
                  ]
                },
                "maxItems": 10
              }
            },
            "required": [
              "enabled"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "enabled": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "open",
                    "close"
                  ]
                }
              }
            ]
          },
          "tuesday": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "open": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "close": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "breaks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "start": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    },
                    "end": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    }
                  },
                  "required": [
                    "start",
                    "end"
                  ]
                },
                "maxItems": 10
              }
            },
            "required": [
              "enabled"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "enabled": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "open",
                    "close"
                  ]
                }
              }
            ]
          },
          "wednesday": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "open": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "close": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "breaks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "start": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    },
                    "end": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    }
                  },
                  "required": [
                    "start",
                    "end"
                  ]
                },
                "maxItems": 10
              }
            },
            "required": [
              "enabled"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "enabled": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "open",
                    "close"
                  ]
                }
              }
            ]
          },
          "thursday": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "open": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "close": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "breaks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "start": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    },
                    "end": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    }
                  },
                  "required": [
                    "start",
                    "end"
                  ]
                },
                "maxItems": 10
              }
            },
            "required": [
              "enabled"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "enabled": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "open",
                    "close"
                  ]
                }
              }
            ]
          },
          "friday": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "open": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "close": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "breaks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "start": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    },
                    "end": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    }
                  },
                  "required": [
                    "start",
                    "end"
                  ]
                },
                "maxItems": 10
              }
            },
            "required": [
              "enabled"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "enabled": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "open",
                    "close"
                  ]
                }
              }
            ]
          },
          "saturday": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "open": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "close": {
                "type": "string",
                "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
              },
              "breaks": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "start": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    },
                    "end": {
                      "type": "string",
                      "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                    }
                  },
                  "required": [
                    "start",
                    "end"
                  ]
                },
                "maxItems": 10
              }
            },
            "required": [
              "enabled"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "enabled": {
                      "const": true
                    }
                  }
                },
                "then": {
                  "required": [
                    "open",
                    "close"
                  ]
                }
              }
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "sunday",
          "monday",
          "tuesday",
          "wednesday",
          "thursday",
          "friday",
          "saturday"
        ]
      },
      "ScheduleProposal": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "enum": [
              "inherit",
              "override"
            ],
            "description": "override replaces the complete weekly schedule. inherit removes a provider override so business hours apply; it is not valid for resource=business."
          },
          "hours": {
            "$ref": "#/components/schemas/WeeklyHours",
            "description": "Required for override, forbidden for inherit. Supply the complete seven-day week, not a partial patch."
          }
        },
        "required": [
          "mode"
        ],
        "description": "A complete weekly-hours proposal. Override requires hours with all seven days. Inherit is valid only for a provider resource and must omit hours; the business resource cannot inherit. Times are local to the business timezone; overnight intervals are unsupported.",
        "allOf": [
          {
            "if": {
              "properties": {
                "mode": {
                  "const": "override"
                }
              },
              "required": [
                "mode"
              ]
            },
            "then": {
              "required": [
                "hours"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "hours"
                ]
              }
            }
          }
        ]
      },
      "PreviewCommit": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "previewId"
        ]
      },
      "IntentRequest": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "const": "found"
              },
              "intent": {
                "$ref": "#/components/schemas/Intent"
              }
            },
            "required": [
              "status",
              "intent"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "enum": [
                  "not_found",
                  "abandoned"
                ]
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          }
        ]
      },
      "AbandonedRequest": {
        "type": "object",
        "properties": {
          "status": {
            "const": "abandoned"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "status",
          "requestId"
        ],
        "additionalProperties": false
      },
      "Notification": {
        "type": "object",
        "description": "One logical notification. A booking can have multiple reminder entries with different offsetMinutes. The default is one reminder approximately two hours before the appointment; businesses explicitly enabled for configurable reminders may schedule up to their authorized limit of three. Confirmation, change and cancellation entries do not consume that reminder allowance. A changed appointment start has a separate allowance; returning to a previously used start does not replay an already attempted reminder. Availability depends on the deployed scheduler and the business configuration. Customer booking and communication-preference requests cannot change the business reminder limit or offsets. Businesses explicitly choose a 24-hour reminder (1440 minutes) through owner preview/apply; this is not a global default. Pending requests do not receive confirmed-appointment reminders. Proposal/rejection use separate approved templates and current opt-in.",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "purpose": {
            "enum": [
              "confirmation",
              "change",
              "cancellation",
              "reminder",
              "proposal",
              "rejection"
            ]
          },
          "channel": {
            "const": "whatsapp"
          },
          "state": {
            "enum": [
              "not_requested",
              "unavailable",
              "scheduled",
              "queued",
              "accepted",
              "delivered",
              "failed",
              "unknown",
              "suppressed",
              "expired"
            ],
            "description": "accepted is provider acceptance, not delivery. unknown is an uncertain send outcome and is not an instruction to resend. Notification failure does not undo an accepted appointment."
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "dueAt": {
            "type": "string",
            "format": "date-time"
          },
          "offsetMinutes": {
            "type": "integer",
            "minimum": 60,
            "maximum": 10080,
            "multipleOf": 60,
            "description": "Reminder lead time in elapsed minutes, for example 1440, 480 or 60. Optional for compatibility with legacy projections; it does not indicate a customer-service messaging window."
          },
          "scheduledAt": {
            "type": "string",
            "format": "date-time",
            "description": "Same instant as dueAt for configurable reminder entries. Legacy projections may omit this additive field."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "purpose",
          "channel",
          "state",
          "reason",
          "dueAt",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "NotificationState": {
        "type": "object",
        "properties": {
          "bookingId": {
            "type": "string",
            "format": "uuid"
          },
          "bookingVersion": {
            "type": "integer",
            "minimum": 1
          },
          "preferences": {
            "type": "object",
            "properties": {
              "version": {
                "type": "integer",
                "minimum": 1
              },
              "whatsapp": {
                "type": "boolean"
              },
              "globallyBlocked": {
                "type": "boolean"
              },
              "globalVersion": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "noticeVersion": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "version",
              "whatsapp",
              "globallyBlocked",
              "globalVersion",
              "noticeVersion"
            ],
            "additionalProperties": false
          },
          "notifications": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Notification"
            }
          }
        },
        "required": [
          "bookingId",
          "bookingVersion",
          "preferences",
          "notifications"
        ],
        "additionalProperties": false
      },
      "NotificationPreferences": {
        "type": "object",
        "properties": {
          "whatsapp": {
            "type": "boolean",
            "description": "The explicit customer choice. A booking-only true value does not undo an existing global withdrawal."
          },
          "scope": {
            "enum": [
              "booking",
              "all_whatsapp"
            ],
            "description": "booking changes this booking only. all_whatsapp changes global WhatsApp permission for the same phone at this business; it is not limited to this integration or booking."
          },
          "noticeVersion": {
            "const": "website-transactional-whatsapp-v1"
          },
          "expectedGlobalVersion": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Required only for all_whatsapp=true. Copy the current preferences.globalVersion shown to the customer; a stale value requires refresh and fresh confirmation, not an automatic retry with a newer version."
          }
        },
        "required": [
          "whatsapp",
          "scope"
        ],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "whatsapp": {
                  "const": true
                }
              },
              "required": [
                "whatsapp"
              ]
            },
            "then": {
              "required": [
                "noticeVersion"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "whatsapp": {
                  "const": true
                },
                "scope": {
                  "const": "all_whatsapp"
                }
              },
              "required": [
                "whatsapp",
                "scope"
              ]
            },
            "then": {
              "required": [
                "expectedGlobalVersion"
              ]
            },
            "else": {
              "not": {
                "required": [
                  "expectedGlobalVersion"
                ]
              }
            }
          }
        ]
      },
      "NotificationPreferenceReceipt": {
        "type": "object",
        "properties": {
          "bookingId": {
            "type": "string",
            "format": "uuid"
          },
          "preferencesVersion": {
            "type": "integer",
            "minimum": 1
          },
          "whatsapp": {
            "type": "boolean"
          },
          "scope": {
            "enum": [
              "booking",
              "all_whatsapp"
            ]
          }
        },
        "required": [
          "bookingId",
          "preferencesVersion",
          "whatsapp",
          "scope"
        ],
        "additionalProperties": false
      },
      "NotificationPreferenceResult": {
        "type": "object",
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/NotificationPreferenceReceipt",
            "description": "Immutable result of the original accepted preference operation. On replay it may differ from current consent after a later change."
          },
          "current": {
            "$ref": "#/components/schemas/NotificationState",
            "description": "Current authorized notification and consent state. Use this for display after either a new operation or a replay."
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "replayed"
        ],
        "additionalProperties": false
      },
      "ScheduleState": {
        "type": "object",
        "properties": {
          "resourceId": {
            "type": "string"
          },
          "version": {
            "type": "string",
            "pattern": "^b[1-9][0-9]*(?::p[1-9][0-9]*)?$"
          },
          "timezone": {
            "type": "string"
          },
          "mode": {
            "enum": [
              "inherit",
              "override"
            ]
          },
          "hours": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WeeklyHours"
              },
              {
                "type": "null"
              }
            ]
          },
          "effectiveHours": {
            "$ref": "#/components/schemas/WeeklyHours"
          }
        },
        "required": [
          "resourceId",
          "version",
          "timezone",
          "mode",
          "hours",
          "effectiveHours"
        ],
        "additionalProperties": false
      },
      "AppointmentImpact": {
        "type": "object",
        "properties": {
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "string",
            "format": "date-time"
          },
          "startTime": {
            "type": "string",
            "format": "date-time"
          },
          "endTime": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "appointmentId",
          "version",
          "startTime",
          "endTime"
        ],
        "additionalProperties": false
      },
      "SchedulePreview": {
        "type": "object",
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedVersion": {
            "type": "string"
          },
          "affectedAppointments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppointmentImpact"
            }
          },
          "affectedCount": {
            "type": "integer",
            "minimum": 0
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "existingAppointmentsPreserved": {
            "const": true
          }
        },
        "required": [
          "previewId",
          "expectedVersion",
          "affectedAppointments",
          "affectedCount",
          "expiresAt",
          "existingAppointmentsPreserved"
        ],
        "additionalProperties": false
      },
      "ScheduleReceipt": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "schedule": {
            "$ref": "#/components/schemas/ScheduleState",
            "description": "Schedule immediately after this operation was accepted. A replay or management recovery can return this historical state after later changes."
          },
          "preservedAppointmentCount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "operationId",
          "schedule",
          "preservedAppointmentCount"
        ],
        "additionalProperties": false
      },
      "ScheduleResult": {
        "type": "object",
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/ScheduleReceipt"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "replayed"
        ],
        "additionalProperties": false
      },
      "BlockProposal": {
        "description": "Choose exactly one action. Create and update require either localDate or both explicit-offset startAt and endAt, never both forms. Update and release require the current blockId and expectedVersion. Update replaces the period and reason; omitting reason clears its previous value. An optional providerId on update/release must match the existing resource. Release accepts no period or reason. Interval bounds, current versions, resource grants and appointment impacts are checked by the server.",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "create"
              },
              "providerId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "startAt": {
                "type": "string",
                "format": "date-time"
              },
              "endAt": {
                "type": "string",
                "format": "date-time"
              },
              "localDate": {
                "type": "string",
                "format": "date"
              },
              "reason": {
                "type": "string",
                "maxLength": 250
              }
            },
            "required": [
              "action"
            ],
            "additionalProperties": false,
            "oneOf": [
              {
                "required": [
                  "localDate"
                ],
                "not": {
                  "anyOf": [
                    {
                      "required": [
                        "startAt"
                      ]
                    },
                    {
                      "required": [
                        "endAt"
                      ]
                    }
                  ]
                }
              },
              {
                "required": [
                  "startAt",
                  "endAt"
                ],
                "not": {
                  "required": [
                    "localDate"
                  ]
                }
              }
            ]
          },
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "update"
              },
              "providerId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "blockId": {
                "type": "string",
                "format": "uuid"
              },
              "expectedVersion": {
                "type": "integer",
                "minimum": 1
              },
              "startAt": {
                "type": "string",
                "format": "date-time"
              },
              "endAt": {
                "type": "string",
                "format": "date-time"
              },
              "localDate": {
                "type": "string",
                "format": "date"
              },
              "reason": {
                "type": "string",
                "maxLength": 250
              }
            },
            "required": [
              "action",
              "blockId",
              "expectedVersion"
            ],
            "additionalProperties": false,
            "oneOf": [
              {
                "required": [
                  "localDate"
                ],
                "not": {
                  "anyOf": [
                    {
                      "required": [
                        "startAt"
                      ]
                    },
                    {
                      "required": [
                        "endAt"
                      ]
                    }
                  ]
                }
              },
              {
                "required": [
                  "startAt",
                  "endAt"
                ],
                "not": {
                  "required": [
                    "localDate"
                  ]
                }
              }
            ]
          },
          {
            "type": "object",
            "properties": {
              "action": {
                "type": "string",
                "const": "release"
              },
              "providerId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "blockId": {
                "type": "string",
                "format": "uuid"
              },
              "expectedVersion": {
                "type": "integer",
                "minimum": 1
              }
            },
            "required": [
              "action",
              "blockId",
              "expectedVersion"
            ],
            "additionalProperties": false
          }
        ]
      },
      "NormalizedBlockProposal": {
        "type": "object",
        "properties": {
          "action": {
            "enum": [
              "create",
              "update",
              "release"
            ]
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "blockId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "expectedVersion": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "startAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "endAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "requiresAnyBlockGrant": {
            "type": "boolean"
          }
        },
        "required": [
          "action",
          "providerId",
          "blockId",
          "expectedVersion",
          "startAt",
          "endAt",
          "reason",
          "requiresAnyBlockGrant"
        ],
        "additionalProperties": false
      },
      "BlockPreview": {
        "type": "object",
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          },
          "proposal": {
            "$ref": "#/components/schemas/NormalizedBlockProposal"
          },
          "affectedAppointments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppointmentImpact"
            }
          },
          "affectedCount": {
            "type": "integer",
            "minimum": 0
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "existingAppointmentsPreserved": {
            "const": true
          }
        },
        "required": [
          "previewId",
          "proposal",
          "affectedAppointments",
          "affectedCount",
          "expiresAt",
          "existingAppointmentsPreserved"
        ],
        "additionalProperties": false
      },
      "BlockReceipt": {
        "type": "object",
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "blockId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "released": {
            "type": "boolean"
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          },
          "preservedAppointmentCount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "operationId",
          "blockId",
          "version",
          "released",
          "providerId",
          "startAt",
          "endAt",
          "preservedAppointmentCount"
        ],
        "additionalProperties": false
      },
      "BlockResult": {
        "type": "object",
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BlockReceipt"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "replayed"
        ],
        "additionalProperties": false
      },
      "Block": {
        "type": "object",
        "properties": {
          "blockId": {
            "type": "string",
            "format": "uuid"
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          },
          "ownedByIntegration": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "blockId",
          "providerId",
          "version",
          "startAt",
          "endAt",
          "ownedByIntegration",
          "reason"
        ],
        "additionalProperties": false
      },
      "BlockPage": {
        "type": "object",
        "properties": {
          "blocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Block"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "blocks",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "ManagementOperation": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/ScheduleReceipt"
                  },
                  {
                    "$ref": "#/components/schemas/BlockReceipt"
                  }
                ]
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "replayed"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/DateScheduleReceipt"
              },
              "current": {
                "$ref": "#/components/schemas/DateScheduleState"
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "replayed"
            ]
          }
        ],
        "description": "Recovery of an immutable accepted management receipt, not current resource state. Use the schedule read or block listing for a fresh projection."
      },
      "BookingPage": {
        "type": "object",
        "properties": {
          "bookings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Receipt"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "bookings",
          "nextCursor"
        ],
        "additionalProperties": false
      },
      "CustomerSyncCheckpoint": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "checkpoint": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "cursor": {
                "type": "string",
                "format": "uuid"
              },
              "sequence": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "appliedAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "cursor",
              "sequence",
              "appliedAt"
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "checkpoint",
          "replayed"
        ]
      },
      "WebsiteFeatures": {
        "type": "object",
        "additionalProperties": false,
        "description": "Supported API contracts, not authorization or tenant activation. Missing flags in an older additive-v1 response mean unknown. Current credentials and business configuration are still checked for every action.",
        "properties": {
          "bookingActionAvailability": {
            "type": "boolean"
          },
          "customerChangesFeed": {
            "type": "boolean"
          },
          "customerSyncCheckpoints": {
            "type": "boolean"
          },
          "managementSchedules": {
            "type": "boolean"
          },
          "managementBlocks": {
            "type": "boolean"
          },
          "externalWebhooks": {
            "type": "boolean"
          },
          "payments": {
            "type": "boolean"
          },
          "temporaryHolds": {
            "type": "boolean"
          },
          "groupBookings": {
            "type": "boolean"
          },
          "overnightHours": {
            "type": "boolean"
          },
          "dateSpecificOpening": {
            "type": "boolean"
          },
          "bookingChangesFeed": {
            "type": "boolean",
            "description": "Supports durable polling of this integration's bookings; still requires its explicit read scope."
          },
          "customerBookingHistory": {
            "type": "boolean",
            "description": "History limited to mapped customer and same integration, not every business channel."
          },
          "sharedCustomerFields": {
            "type": "boolean",
            "description": "Installed support for explicitly shared fields on an active customer-verified mapping. Access still requires the appropriate integration scopes and current owner grants for each field. This does not imply sharing every field, deployed readiness or a shared-field change feed."
          },
          "allChannelCustomerHistory": {
            "type": "boolean",
            "description": "Installed support for read-only all-channel history of one active customer-verified mapping, with separate owner approval and customer/booking read scopes. It is not whole-business calendar access, a change feed or authority to modify the returned history records."
          },
          "sharedCustomerFieldsChangeFeed": {
            "type": "boolean",
            "description": "False means shared values require current authorized reads and are not copied into the retained basic customer feed."
          }
        },
        "required": [
          "bookingActionAvailability",
          "customerChangesFeed",
          "customerSyncCheckpoints",
          "managementSchedules",
          "managementBlocks",
          "externalWebhooks",
          "payments",
          "temporaryHolds",
          "groupBookings",
          "overnightHours",
          "dateSpecificOpening"
        ]
      },
      "WebsiteActionDecision": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "allowed": {
                "const": true
              },
              "reason": {
                "type": "null"
              }
            },
            "required": [
              "allowed",
              "reason"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "allowed": {
                "const": false
              },
              "reason": {
                "enum": [
                  "BOOKING_NOT_CHANGEABLE",
                  "CANCELLATION_NOTICE_REQUIRED",
                  "REMINDER_IN_PROGRESS",
                  "CUSTOMER_UNAVAILABLE",
                  "PROVIDER_UNAVAILABLE",
                  "INVALID_SETTINGS",
                  "CONTACT_BUSINESS_REQUIRED"
                ]
              }
            },
            "required": [
              "allowed",
              "reason"
            ]
          }
        ]
      },
      "WebsiteAllowedActions": {
        "type": "object",
        "additionalProperties": false,
        "description": "Fresh authorized GET projection, valid for at most thirty seconds and capped by proof expiry or the cancellation cutoff. Advisory only: a write rechecks current policy, status and locks. Immutable commit/replay receipts omit it. Site intake pause or service unpublication does not itself block an accepted booking.",
        "properties": {
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "validUntil": {
            "type": "string",
            "format": "date-time"
          },
          "cancel": {
            "$ref": "#/components/schemas/WebsiteActionDecision"
          },
          "reschedule": {
            "$ref": "#/components/schemas/WebsiteActionDecision"
          },
          "contactPhoneNumber": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+[1-9][0-9]{6,14}$",
            "description": "Business contact guidance in contact_business mode; null for self-service. Separate from the WhatsApp sending identity."
          }
        },
        "required": [
          "computedAt",
          "validUntil",
          "cancel",
          "reschedule"
        ]
      },
      "WebsiteEmbedPolicy": {
        "type": "object",
        "additionalProperties": false,
        "description": "Public framing metadata only: current explicitly verified site origins. No domain challenge, owner information or credential is public.",
        "properties": {
          "siteId": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "minimum": 0
          },
          "origins": {
            "type": "array",
            "maxItems": 20,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uri",
              "pattern": "^https://(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"
            }
          }
        },
        "required": [
          "siteId",
          "revision",
          "origins"
        ]
      },
      "CustomerField": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "key": {
                "const": "customerName"
              },
              "type": {
                "const": "text"
              },
              "stage": {
                "const": "booking"
              },
              "required": {
                "const": true
              },
              "minLength": {
                "const": 1
              },
              "maxLength": {
                "const": 100
              },
              "label": {
                "$ref": "#/components/schemas/Text"
              }
            },
            "required": [
              "key",
              "type",
              "stage",
              "required",
              "minLength",
              "maxLength",
              "label"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "key": {
                "const": "phone"
              },
              "type": {
                "const": "phone"
              },
              "stage": {
                "const": "verification"
              },
              "required": {
                "const": true
              },
              "minLength": {
                "const": 9
              },
              "maxLength": {
                "const": 16
              },
              "format": {
                "const": "e164"
              },
              "verificationRequired": {
                "const": true
              },
              "label": {
                "$ref": "#/components/schemas/Text"
              }
            },
            "required": [
              "key",
              "type",
              "stage",
              "required",
              "minLength",
              "maxLength",
              "format",
              "verificationRequired",
              "label"
            ]
          }
        ],
        "description": "First-release customer fields. Phone is entered for WhatsApp verification, not accepted as a booking identity override; names are nonblank and trimmed. No custom scripts or arbitrary fields."
      },
      "IntegrationMetadata": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "contractVersion": {
            "const": 1
          },
          "environment": {
            "const": "unknown",
            "description": "No trusted environment attestation is configured. Not a sandbox/production readiness or provider claim."
          },
          "credentialId": {
            "type": "string",
            "format": "uuid"
          },
          "audience": {
            "const": "integration"
          },
          "siteId": {
            "type": "string",
            "format": "uuid"
          },
          "siteStatus": {
            "enum": [
              "draft",
              "enabled",
              "paused"
            ]
          },
          "siteVersion": {
            "type": "integer",
            "minimum": 1
          },
          "integrationId": {
            "type": "string",
            "format": "uuid"
          },
          "integrationKind": {
            "enum": [
              "hosted",
              "embed",
              "headless"
            ]
          },
          "integrationStatus": {
            "enum": [
              "draft",
              "enabled",
              "paused"
            ]
          },
          "integrationVersion": {
            "type": "integer",
            "minimum": 1
          },
          "scopes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5,
            "uniqueItems": true,
            "items": {
              "enum": [
                "bookings:write:customer",
                "bookings:read:integration",
                "customers:read",
                "customers:write",
                "customer-changes:read"
              ]
            }
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Credential expiration time; null means no expiration date. Update older timestamp-only clients before installing a no-expiry credential. Revocation and current authorization still apply."
          },
          "resources": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "providerIds": {
                "type": "array",
                "maxItems": 0,
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "businessSchedule": {
                "const": false
              }
            },
            "required": [
              "providerIds",
              "businessSchedule"
            ]
          },
          "limits": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "credentialRequestsPerMinute": {
                "const": 120,
                "description": "Machine integration endpoints only; separate customer session and operation budgets still apply."
              },
              "siteRequestsPerMinute": {
                "const": 2000,
                "description": "Shared site ceiling for customer and machine endpoints; not a remaining balance."
              },
              "integrationSnapshotsPerHour": {
                "const": 10
              },
              "customerChangesPageSizeMax": {
                "const": 100
              },
              "integrationBookingsPageSizeMax": {
                "const": 100
              },
              "integrationBookingsRangeDaysMax": {
                "const": 31
              }
            },
            "required": [
              "credentialRequestsPerMinute",
              "siteRequestsPerMinute",
              "integrationSnapshotsPerHour",
              "customerChangesPageSizeMax",
              "integrationBookingsPageSizeMax",
              "integrationBookingsRangeDaysMax"
            ]
          },
          "capabilities": {
            "$ref": "#/components/schemas/WebsiteFeatures",
            "description": "Supported installed contracts, separate from current scopes, status and live readiness. Management support does not give this integration credential a management grant."
          }
        },
        "required": [
          "contractVersion",
          "environment",
          "credentialId",
          "audience",
          "siteId",
          "siteStatus",
          "siteVersion",
          "integrationId",
          "integrationKind",
          "integrationStatus",
          "integrationVersion",
          "scopes",
          "expiresAt",
          "resources",
          "limits",
          "capabilities"
        ]
      },
      "CustomerBookingPage": {
        "type": "object",
        "properties": {
          "bookings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Receipt"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "customerId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "bookings",
          "nextCursor",
          "customerId"
        ],
        "additionalProperties": false
      },
      "BookingSyncEvent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "type": {
            "enum": [
              "created",
              "rescheduled",
              "cancelled",
              "status_changed",
              "reference_linked"
            ],
            "description": "status_changed includes approval and alternative-time proposal state changes (offered, replaced or declined). Apply booking.version, approvalRequired and timeProposal from the current receipt. A proposal is not a confirmed reschedule; only an accepted actual time change is rescheduled."
          },
          "booking": {
            "$ref": "#/components/schemas/Receipt"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "eventId",
          "sequence",
          "type",
          "booking",
          "createdAt"
        ]
      },
      "BookingSyncPage": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "snapshot"
              },
              "bookings": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "$ref": "#/components/schemas/Receipt"
                }
              },
              "nextCursor": {
                "type": "string",
                "format": "uuid"
              },
              "hasMore": {
                "type": "boolean"
              },
              "watermark": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "kind",
              "bookings",
              "nextCursor",
              "hasMore",
              "watermark"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "changes"
              },
              "events": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "$ref": "#/components/schemas/BookingSyncEvent"
                }
              },
              "nextCursor": {
                "type": "string",
                "format": "uuid"
              },
              "hasMore": {
                "type": "boolean"
              },
              "watermark": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "kind",
              "events",
              "nextCursor",
              "hasMore",
              "watermark"
            ]
          }
        ]
      },
      "SharedFieldValue": {
        "oneOf": [
          {
            "type": "string",
            "maxLength": 4096
          },
          {
            "type": "number",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          {
            "type": "boolean"
          },
          {
            "type": "null"
          },
          {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "maxLength": 120
            }
          }
        ]
      },
      "SharedField": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "fieldKey": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Unicode codepoint limit; control and prototype keys are refused."
          },
          "label": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "he": {
                "type": "string",
                "minLength": 0,
                "maxLength": 200
              },
              "ar": {
                "type": "string",
                "minLength": 0,
                "maxLength": 200
              },
              "en": {
                "type": "string",
                "minLength": 0,
                "maxLength": 200
              }
            },
            "required": []
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "textarea",
              "number",
              "date",
              "select",
              "phone",
              "email",
              "boolean",
              "checkbox",
              "multi_select",
              "multiselect"
            ]
          },
          "access": {
            "enum": [
              "read",
              "readwrite"
            ]
          },
          "exists": {
            "type": "boolean"
          },
          "value": {
            "$ref": "#/components/schemas/SharedFieldValue"
          },
          "valueUnavailableReason": {
            "enum": [
              null,
              "invalid_stored_value",
              "too_large"
            ]
          },
          "options": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "label": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "he": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 200
                    },
                    "ar": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 200
                    },
                    "en": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 200
                    }
                  },
                  "required": []
                }
              },
              "required": [
                "id",
                "label"
              ]
            }
          }
        },
        "required": [
          "fieldKey",
          "label",
          "type",
          "access",
          "exists",
          "value",
          "valueUnavailableReason",
          "options"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "exists": {
                  "const": false
                }
              },
              "required": [
                "exists"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "const": null
                },
                "valueUnavailableReason": {
                  "const": null
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "valueUnavailableReason": {
                  "enum": [
                    "invalid_stored_value",
                    "too_large"
                  ]
                }
              },
              "required": [
                "valueUnavailableReason"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "const": null
                },
                "exists": {
                  "const": true
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "enum": [
                    "number"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "enum": [
                    "boolean",
                    "checkbox"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "enum": [
                    "multi_select",
                    "multiselect"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "array",
                      "maxItems": 100,
                      "items": {
                        "type": "string",
                        "maxLength": 120
                      }
                    }
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "enum": [
                    "text",
                    "textarea",
                    "date",
                    "select",
                    "phone",
                    "email"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          }
        ]
      },
      "SharedCustomerFields": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "grantRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "projectionVersion": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "fields": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/SharedField"
            }
          },
          "changeFeedSupported": {
            "const": false
          }
        },
        "required": [
          "customerId",
          "grantRevision",
          "projectionVersion",
          "fields",
          "changeFeedSupported"
        ]
      },
      "SharedFieldChange": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "fieldKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "description": "Unicode codepoint limit; control and prototype keys are refused."
              },
              "expectedExists": {
                "type": "boolean"
              },
              "expectedValue": {
                "$ref": "#/components/schemas/SharedFieldValue"
              },
              "operation": {
                "const": "set"
              },
              "value": {
                "$ref": "#/components/schemas/SharedFieldValue"
              }
            },
            "required": [
              "fieldKey",
              "expectedExists",
              "expectedValue",
              "operation",
              "value"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "fieldKey": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100,
                "description": "Unicode codepoint limit; control and prototype keys are refused."
              },
              "expectedExists": {
                "type": "boolean"
              },
              "expectedValue": {
                "$ref": "#/components/schemas/SharedFieldValue"
              },
              "operation": {
                "const": "remove"
              }
            },
            "required": [
              "fieldKey",
              "expectedExists",
              "expectedValue",
              "operation"
            ]
          }
        ]
      },
      "SharedCustomerFieldsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "grantRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "changes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/SharedFieldChange"
            }
          }
        },
        "required": [
          "grantRevision",
          "changes"
        ]
      },
      "SharedCustomerFieldsPatchResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "customerId": {
                "type": "string",
                "format": "uuid"
              },
              "fieldKeys": {
                "type": "array",
                "minItems": 1,
                "maxItems": 50,
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100,
                  "description": "Unicode codepoint limit; control and prototype keys are refused."
                }
              }
            },
            "required": [
              "operationId",
              "customerId",
              "fieldKeys"
            ]
          },
          "current": {
            "$ref": "#/components/schemas/SharedCustomerFields"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "replayed"
        ]
      },
      "CustomerReadOnlyHistoryEntry": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "historyId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "enum": [
              "pending",
              "confirmed",
              "cancelled",
              "completed",
              "missed",
              "now"
            ]
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "enum": [
              "website",
              "other"
            ],
            "description": "Website lineage is known; other does not infer whether an appointment originated from WhatsApp or admin."
          },
          "readOnly": {
            "const": true
          }
        },
        "required": [
          "historyId",
          "status",
          "startAt",
          "endAt",
          "source",
          "readOnly"
        ]
      },
      "CustomerAllChannelHistory": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "grantRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "bookings": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/CustomerReadOnlyHistoryEntry"
            }
          },
          "nextCursor": {
            "oneOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "customerId",
          "grantRevision",
          "bookings",
          "nextCursor"
        ]
      },
      "ManagementRecordedContact": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "externalCustomerId",
          "status",
          "version",
          "businessCustomerId",
          "mappingId",
          "phone",
          "identityAssurance"
        ],
        "properties": {
          "externalCustomerId": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "const": "active"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "displayName": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "language": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Language"
              },
              {
                "type": "null"
              }
            ]
          },
          "phone": {
            "type": "string",
            "pattern": "^\\+[1-9][0-9]{7,14}$"
          },
          "fieldSources": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "source": {
                  "type": "string"
                },
                "version": {
                  "type": "integer"
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "source",
                "version",
                "updated_at"
              ]
            }
          },
          "identityAssurance": {
            "enum": [
              "customer_verified",
              "owner_reviewed"
            ],
            "description": "owner_reviewed is an administrative record, never phone proof or customer authentication. It grants no consent or history. Existing customer_verified assurance is preserved only for an unchanged identity."
          },
          "displayNameUnavailableReason": {
            "enum": [
              "not_set",
              "blank",
              "too_long",
              "unsupported_characters"
            ],
            "description": "Present only when the active displayName is unavailable (null). Canonical CRAD text is preserved, not truncated or cleared. Do not echo null as a source-field deletion."
          },
          "businessCustomerId": {
            "type": "string",
            "format": "uuid",
            "description": "Canonical business contact ID (profiles identity), distinct from the integration mappingId."
          },
          "mappingId": {
            "type": "string",
            "format": "uuid",
            "description": "Integration mapping ID, accepted as customerId by existing scoped Integration Customer APIs."
          }
        },
        "allOf": [
          {
            "if": {
              "required": [
                "displayNameUnavailableReason"
              ]
            },
            "then": {
              "required": [
                "displayName"
              ],
              "properties": {
                "status": {
                  "const": "active"
                },
                "displayName": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "ManagementContactReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "operationId",
          "businessCustomerId",
          "mappingId",
          "outcome",
          "recordedAt"
        ],
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "mappingId": {
            "type": "string",
            "format": "uuid"
          },
          "outcome": {
            "enum": [
              "created",
              "linked_existing",
              "already_linked"
            ]
          },
          "recordedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ManagementContactResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/ManagementContactReceipt"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ManagementRecordedContact"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "enum": [
              null,
              "contact_unavailable"
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        }
      },
      "ManagementContactOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status"
            ],
            "properties": {
              "status": {
                "const": "not_found"
              }
            }
          },
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "status",
              "receipt",
              "current",
              "currentUnavailableReason",
              "replayed"
            ],
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/ManagementContactReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/ManagementRecordedContact"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currentUnavailableReason": {
                "enum": [
                  null,
                  "contact_unavailable"
                ]
              },
              "replayed": {
                "type": "boolean"
              }
            }
          }
        ]
      },
      "ManagementContactCommand": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "externalCustomerId",
          "phone",
          "displayName",
          "language"
        ],
        "properties": {
          "externalCustomerId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120,
            "description": "Stable website-owned customer/account identifier. Namespaced by this integration; no leading/trailing whitespace. Never an authorization token."
          },
          "phone": {
            "type": "string",
            "pattern": "^\\+[1-9][0-9]{7,14}$"
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "language": {
            "$ref": "#/components/schemas/Language"
          }
        }
      },
      "ManagementMetadata": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "contractVersion": {
            "const": 1
          },
          "environment": {
            "const": "unknown",
            "description": "No trusted environment attestation is configured. Not a sandbox/production readiness or provider claim."
          },
          "credentialId": {
            "type": "string",
            "format": "uuid"
          },
          "audience": {
            "const": "management"
          },
          "siteId": {
            "type": "string",
            "format": "uuid"
          },
          "siteStatus": {
            "enum": [
              "draft",
              "enabled",
              "paused"
            ]
          },
          "siteVersion": {
            "type": "integer",
            "minimum": 1
          },
          "integrationId": {
            "type": "string",
            "format": "uuid"
          },
          "integrationKind": {
            "enum": [
              "hosted",
              "embed",
              "headless"
            ]
          },
          "integrationStatus": {
            "enum": [
              "draft",
              "enabled",
              "paused"
            ]
          },
          "integrationVersion": {
            "type": "integer",
            "minimum": 1
          },
          "scopes": {
            "type": "array",
            "minItems": 0,
            "maxItems": 61,
            "uniqueItems": true,
            "items": {
              "enum": [
                "hours:read",
                "hours:write",
                "blocks:read",
                "blocks:write",
                "blocks:write:any",
                "contacts:record",
                "contacts:read",
                "contacts:write",
                "contacts:block",
                "contacts:sync",
                "contacts:fields:read",
                "contacts:fields:write",
                "appointments:read",
                "appointments:create",
                "appointments:status",
                "appointments:cancel",
                "appointments:reschedule",
                "appointments:sync",
                "appointments:notes:read",
                "booking-policy:read",
                "booking-policy:write",
                "contacts:phone:write",
                "provider-booking-policy:read",
                "provider-booking-policy:write",
                "booking-duration:rewrite",
                "services:read",
                "services:write",
                "website-content:read",
                "website-content:write",
                "providers:read",
                "providers:write",
                "reports:read",
                "provider-logins:write",
                "template-requests:read",
                "template-requests:write",
                "conversations:read",
                "conversations:write",
                "conversations:send",
                "conversations:media:read",
                "website-intake:read",
                "website-intake:write",
                "website-notifications:read",
                "website-notifications:write",
                "owner-alerts:read",
                "owner-alerts:write",
                "whatsapp-connection:read",
                "whatsapp-connection:check",
                "campaigns:read",
                "campaigns:send",
                "reminder-policy:read",
                "reminder-policy:write",
                "reminder-recipients:read",
                "reminder-recipients:write",
                "reminder-delivery:read",
                "services:sync",
                "providers:sync",
                "contacts:segments:read",
                "whatsapp-templates:read",
                "whatsapp-templates:write",
                "whatsapp-profile:read",
                "whatsapp-profile:write"
              ]
            }
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Credential expiration time; null means no expiration date. Update older timestamp-only clients before installing a no-expiry credential. Revocation and current authorization still apply."
          },
          "resources": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "providerIds": {
                "type": "array",
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "description": "Current provider resource grant IDs, not a promise that a provider is active or presently bookable."
              },
              "businessSchedule": {
                "type": "boolean"
              },
              "appointments": {
                "$ref": "#/components/schemas/BusinessCalendarGrant"
              },
              "campaigns": {
                "$ref": "#/components/schemas/BusinessCampaignGrant"
              }
            },
            "required": [
              "providerIds",
              "businessSchedule"
            ]
          },
          "limits": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "credentialRequestsPerMinute": {
                "const": 120,
                "description": "Management request ceiling, not a remaining balance."
              },
              "siteRequestsPerMinute": {
                "const": 2000,
                "description": "Shared with other machine/customer requests to this site."
              },
              "maxRemindersPerAppointment": {
                "type": "integer",
                "minimum": 0,
                "maximum": 3,
                "readOnly": true,
                "description": "Current business reminder ceiling, returned only for current appointments:read scope and a valid business_manager appointment-resource grant when reminder settings exist. Omitted for other credentials, missing grants/settings or older producers; omission is unknown or undisclosed, never zero. Zero is an explicit ceiling of zero. This is not the configured schedule, remaining allowance, daily message quota, engine activation or delivery readiness. Raising the ceiling alone adds or revives no reminders; only CRAD super-admin can change it."
              }
            },
            "required": [
              "credentialRequestsPerMinute",
              "siteRequestsPerMinute"
            ]
          },
          "capabilities": {
            "type": "object",
            "additionalProperties": false,
            "description": "Installed management contracts, separate from this credential scope/resource/grant authority, readiness or full admin parity. Optional customer flags preserve compatibility with older metadata producers; missing means unknown/unsupported, never approval.",
            "properties": {
              "contactRecording": {
                "const": true
              },
              "schedules": {
                "const": true
              },
              "blocks": {
                "const": true
              },
              "customerDirectory": {
                "type": "boolean",
                "description": "Basic canonical directory/detail/lookup support."
              },
              "customerEditing": {
                "type": "boolean",
                "description": "Versioned name/language editing and exact command recovery support."
              },
              "customerBlocking": {
                "type": "boolean",
                "description": "Separately scoped block state commands."
              },
              "customerFields": {
                "type": "boolean",
                "description": "Independently owner-approved notes/custom field projection and per-key CAS support."
              },
              "customerSync": {
                "type": "boolean",
                "description": "Current-state canonical membership/metadata signal sync and durable acknowledgement support."
              },
              "syncWakeups": {
                "type": "boolean"
              },
              "appointmentDirectory": {
                "type": "boolean",
                "description": "Installed calendar contract support, not permission. Requires the relevant scope and a separately approved current per-credential calendar grant."
              },
              "appointmentResources": {
                "type": "boolean",
                "description": "Installed calendar contract support, not permission. Requires the relevant scope and a separately approved current per-credential calendar grant."
              },
              "appointmentCommands": {
                "type": "boolean",
                "description": "Installed calendar contract support, not permission. Requires the relevant scope and a separately approved current per-credential calendar grant."
              },
              "appointmentSync": {
                "type": "boolean",
                "description": "Installed calendar contract support, not permission. Requires the relevant scope and a separately approved current per-credential calendar grant."
              },
              "bookingPolicyRead": {
                "type": "boolean"
              },
              "bookingPolicyWrite": {
                "type": "boolean"
              },
              "bookingDurationRewrite": {
                "type": "boolean",
                "description": "Installed explicit duration-policy rewrite support only; requires current resource write authority and separate booking-duration:rewrite. R1 booking-policy routes still preserve all ends."
              },
              "customerPhoneCorrection": {
                "type": "boolean",
                "description": "Installed ordinary same-person phone correction. Requires its separate current scope; protected identity migration is not implied."
              },
              "providerBookingPolicyRead": {
                "type": "boolean",
                "description": "Installed provider duration/hour policy support only; requires provider-booking-policy:read and exact current providerIds. No general provider metadata access."
              },
              "providerBookingPolicyWrite": {
                "type": "boolean",
                "description": "Installed provider duration/hour policy support only; requires provider-booking-policy:write and exact current providerIds. No general provider metadata access."
              },
              "serviceCatalogueRead": {
                "type": "boolean",
                "description": "Installed whole-business service catalogue support only; separate explicit services:read/write authority required. No provider or calendar grant is implied."
              },
              "serviceCatalogueWrite": {
                "type": "boolean",
                "description": "Installed whole-business service catalogue support only; separate explicit services:read/write authority required. No provider or calendar grant is implied."
              },
              "publicContentRead": {
                "type": "boolean",
                "description": "Installed explicit public presentation/service-selection support only; current website-content:read/write scopes remain separate. No activation or messaging authority."
              },
              "publicContentWrite": {
                "type": "boolean",
                "description": "Installed explicit public presentation/service-selection support only; current website-content:read/write scopes remain separate. No activation or messaging authority."
              },
              "providersRead": {
                "type": "boolean",
                "description": "Installed existing-provider metadata/activity/assignment support only. Requires current providers:read/write and explicit providerIds; no creation, deletion, login, invitation or schedule authority."
              },
              "providersWrite": {
                "type": "boolean",
                "description": "Installed existing-provider metadata/activity/assignment support only. Requires current providers:read/write and explicit providerIds; no creation, deletion, login, invitation or schedule authority."
              },
              "reportsOverviewRead": {
                "type": "boolean",
                "description": "Installed current whole-business overview support only. Requires separately issued reports:read; not monthly reporting, money, provider/calendar authority or activation."
              },
              "providerLoginsWrite": {
                "type": "boolean",
                "description": "Installed bounded provider-login support only. The credential still needs provider-logins:write, providers:read and explicit selected provider IDs."
              },
              "ownerSetupContinuation": {
                "type": "boolean",
                "description": "Installed owner handoff/status support only. Does not grant machine writes, initial enrollment, owner identity or activation."
              },
              "templateRequestsRead": {
                "type": "boolean",
                "description": "Installed template-request support, not permission for this key or Meta approval."
              },
              "templateRequestsWrite": {
                "type": "boolean",
                "description": "Installed template-request support, not permission for this key or Meta approval."
              },
              "ownerSettingsContinuations": {
                "type": "boolean",
                "description": "Installed fixed owner-settings navigation support only. No delegated write, owner identity, device permission or current connection readiness is implied."
              },
              "conversationsRead": {
                "type": "boolean",
                "description": "Installed whole-business retained-conversation support only. Requires explicitly issued conversations:read/write, current integration authority and inbox enablement. Provider grants do not narrow this access; sending/media are separate capabilities."
              },
              "conversationsWrite": {
                "type": "boolean",
                "description": "Installed whole-business retained-conversation support only. Requires explicitly issued conversations:read/write, current integration authority and inbox enablement. Provider grants do not narrow this access; sending/media are separate capabilities."
              },
              "conversationsSend": {
                "type": "boolean",
                "description": "Installed delegated template browsing, send/upload and pure outcome recovery. Requires explicit conversations:send plus read, inbox enablement and live send conditions."
              },
              "conversationMediaRead": {
                "type": "boolean",
                "description": "Installed authenticated byte proxy. Requires explicit conversations:media:read plus read; old read keys do not gain binary access."
              },
              "websiteIntakeRead": {
                "type": "boolean",
                "description": "Installed support only; current explicit scope is still required."
              },
              "websiteIntakeWrite": {
                "type": "boolean",
                "description": "Installed support only; current explicit scope is still required."
              },
              "websiteNotificationsRead": {
                "type": "boolean",
                "description": "Installed support only; current explicit scope is still required."
              },
              "websiteNotificationsWrite": {
                "type": "boolean",
                "description": "Installed support only; current explicit scope is still required."
              },
              "ownerAlertsRead": {
                "type": "boolean",
                "description": "Installed support only; current explicit scope is still required."
              },
              "ownerAlertsWrite": {
                "type": "boolean",
                "description": "Installed support only; current explicit scope is still required."
              },
              "whatsappConnectionRead": {
                "type": "boolean",
                "description": "Installed connection observation support only. Requires explicit whole-business whatsapp-connection scopes; old keys gain nothing and provider/calendar selections do not narrow it. No OAuth, reconnection, provider writes or activation authority."
              },
              "whatsappConnectionCheck": {
                "type": "boolean",
                "description": "Installed connection observation support only. Requires explicit whole-business whatsapp-connection scopes; old keys gain nothing and provider/calendar selections do not narrow it. No OAuth, reconnection, provider writes or activation authority."
              },
              "campaignsRead": {
                "type": "boolean"
              },
              "campaignsSend": {
                "type": "boolean"
              },
              "reminderPolicyRead": {
                "type": "boolean"
              },
              "reminderPolicyWrite": {
                "type": "boolean"
              },
              "reminderRecipientsRead": {
                "type": "boolean"
              },
              "reminderRecipientsWrite": {
                "type": "boolean"
              },
              "reminderDeliveryRead": {
                "type": "boolean"
              },
              "serviceSync": {
                "type": "boolean",
                "description": "Installed support, independent of this credential’s explicit grants."
              },
              "providerSync": {
                "type": "boolean",
                "description": "Installed support, independent of this credential’s explicit grants."
              },
              "customerSegmentsRead": {
                "type": "boolean",
                "description": "Installed support, independent of this credential’s explicit grants."
              },
              "reportsMonthlyRead": {
                "type": "boolean",
                "description": "Installed monthly reporting support; reports:read is still required. Not a credential grant."
              },
              "dayScheduleOverrides": {
                "type": "boolean",
                "description": "Installed date-specific hours support, returned only when GET /v1/management receives X-CRAD-Capabilities: day-schedule-overrides with that exact case-sensitive value. The field is omitted without this opt-in or for other header values. Require true before offering date controls; missing or false does not establish support. Negotiation grants no access; writes still require the matching business/provider policy read+write scopes and resource grant."
              }
            },
            "required": [
              "contactRecording",
              "schedules",
              "blocks"
            ]
          },
          "ownerSetup": {
            "$ref": "#/components/schemas/OwnerSetupContinuation",
            "description": "Optional on older installations. Absence is unknown, not permission to offer initial setup. Refresh this authenticated read when the owner returns from CRAD."
          },
          "ownerSettings": {
            "$ref": "#/components/schemas/OwnerSettingsContinuations",
            "description": "Optional on older releases. Missing means unknown; use these fixed URLs when present instead of constructing a callback."
          }
        },
        "required": [
          "contractVersion",
          "environment",
          "credentialId",
          "audience",
          "siteId",
          "siteStatus",
          "siteVersion",
          "integrationId",
          "integrationKind",
          "integrationStatus",
          "integrationVersion",
          "scopes",
          "expiresAt",
          "resources",
          "limits",
          "capabilities"
        ],
        "allOf": [
          {
            "if": {
              "required": [
                "ownerSetup"
              ]
            },
            "then": {
              "properties": {
                "capabilities": {
                  "required": [
                    "ownerSetupContinuation"
                  ],
                  "properties": {
                    "ownerSetupContinuation": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "capabilities": {
                  "required": [
                    "ownerSetupContinuation"
                  ],
                  "properties": {
                    "ownerSetupContinuation": {
                      "const": true
                    }
                  }
                }
              },
              "required": [
                "capabilities"
              ]
            },
            "then": {
              "required": [
                "ownerSetup"
              ]
            }
          },
          {
            "if": {
              "required": [
                "ownerSettings"
              ]
            },
            "then": {
              "properties": {
                "capabilities": {
                  "required": [
                    "ownerSettingsContinuations"
                  ],
                  "properties": {
                    "ownerSettingsContinuations": {
                      "const": true
                    }
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "capabilities": {
                  "required": [
                    "ownerSettingsContinuations"
                  ],
                  "properties": {
                    "ownerSettingsContinuations": {
                      "const": true
                    }
                  }
                }
              },
              "required": [
                "capabilities"
              ]
            },
            "then": {
              "required": [
                "ownerSettings"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "capabilities": {
                  "required": [
                    "campaignsRead"
                  ],
                  "properties": {
                    "campaignsRead": {
                      "const": true
                    }
                  }
                }
              },
              "required": [
                "capabilities"
              ]
            },
            "then": {
              "properties": {
                "resources": {
                  "required": [
                    "campaigns"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "resources": {
                  "required": [
                    "campaigns"
                  ]
                }
              },
              "required": [
                "resources"
              ]
            },
            "then": {
              "properties": {
                "capabilities": {
                  "required": [
                    "campaignsRead"
                  ],
                  "properties": {
                    "campaignsRead": {
                      "const": true
                    }
                  }
                }
              },
              "required": [
                "capabilities"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "capabilities": {
                  "required": [
                    "campaignsSend"
                  ],
                  "properties": {
                    "campaignsSend": {
                      "const": true
                    }
                  }
                }
              }
            },
            "then": {
              "properties": {
                "capabilities": {
                  "required": [
                    "campaignsRead"
                  ],
                  "properties": {
                    "campaignsRead": {
                      "const": true
                    }
                  }
                }
              },
              "required": [
                "capabilities"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "campaigns:send"
                  }
                }
              }
            },
            "then": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "campaigns:read"
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "campaigns:read"
                  }
                }
              }
            },
            "then": {
              "properties": {
                "capabilities": {
                  "required": [
                    "campaignsRead"
                  ],
                  "properties": {
                    "campaignsRead": {
                      "const": true
                    }
                  }
                },
                "resources": {
                  "required": [
                    "campaigns"
                  ],
                  "properties": {
                    "campaigns": {
                      "anyOf": [
                        {
                          "properties": {
                            "wholeBusiness": {
                              "const": true
                            }
                          }
                        },
                        {
                          "properties": {
                            "providerIds": {
                              "minItems": 1
                            }
                          }
                        }
                      ]
                    }
                  }
                }
              },
              "required": [
                "capabilities"
              ]
            }
          },
          {
            "if": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "reminder-policy:write"
                  }
                }
              },
              "required": [
                "scopes"
              ]
            },
            "then": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "reminder-policy:read"
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "reminder-recipients:write"
                  }
                }
              },
              "required": [
                "scopes"
              ]
            },
            "then": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "reminder-recipients:read"
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "reminder-delivery:read"
                  }
                }
              },
              "required": [
                "scopes"
              ]
            },
            "then": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "appointments:read"
                  }
                },
                "resources": {
                  "required": [
                    "appointments"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "capabilities": {
                  "properties": {
                    "reminderPolicyWrite": {
                      "const": true
                    }
                  },
                  "required": [
                    "reminderPolicyWrite"
                  ]
                }
              },
              "required": [
                "capabilities"
              ]
            },
            "then": {
              "properties": {
                "capabilities": {
                  "properties": {
                    "reminderPolicyRead": {
                      "const": true
                    }
                  },
                  "required": [
                    "reminderPolicyRead"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "capabilities": {
                  "properties": {
                    "reminderRecipientsWrite": {
                      "const": true
                    }
                  },
                  "required": [
                    "reminderRecipientsWrite"
                  ]
                }
              },
              "required": [
                "capabilities"
              ]
            },
            "then": {
              "properties": {
                "capabilities": {
                  "properties": {
                    "reminderRecipientsRead": {
                      "const": true
                    }
                  },
                  "required": [
                    "reminderRecipientsRead"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "capabilities": {
                  "properties": {
                    "serviceSync": {
                      "const": true
                    }
                  },
                  "required": [
                    "serviceSync"
                  ]
                }
              },
              "required": [
                "capabilities"
              ]
            },
            "then": {
              "properties": {
                "capabilities": {
                  "properties": {
                    "serviceCatalogueRead": {
                      "const": true
                    }
                  },
                  "required": [
                    "serviceCatalogueRead"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "capabilities": {
                  "properties": {
                    "providerSync": {
                      "const": true
                    }
                  },
                  "required": [
                    "providerSync"
                  ]
                }
              },
              "required": [
                "capabilities"
              ]
            },
            "then": {
              "properties": {
                "capabilities": {
                  "properties": {
                    "providersRead": {
                      "const": true
                    }
                  },
                  "required": [
                    "providersRead"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "capabilities": {
                  "properties": {
                    "customerSegmentsRead": {
                      "const": true
                    }
                  },
                  "required": [
                    "customerSegmentsRead"
                  ]
                }
              },
              "required": [
                "capabilities"
              ]
            },
            "then": {
              "properties": {
                "capabilities": {
                  "properties": {
                    "customerDirectory": {
                      "const": true
                    }
                  },
                  "required": [
                    "customerDirectory"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "services:sync"
                  }
                }
              },
              "required": [
                "scopes"
              ]
            },
            "then": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "services:read"
                  }
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "providers:sync"
                  }
                }
              },
              "required": [
                "scopes"
              ]
            },
            "then": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "providers:read"
                  }
                },
                "resources": {
                  "properties": {
                    "providerIds": {
                      "minItems": 1
                    }
                  },
                  "required": [
                    "providerIds"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "contacts:segments:read"
                  }
                }
              },
              "required": [
                "scopes"
              ]
            },
            "then": {
              "properties": {
                "scopes": {
                  "contains": {
                    "const": "contacts:read"
                  }
                }
              }
            }
          }
        ]
      },
      "BusinessCustomerVersion": {
        "type": "string",
        "pattern": "^c(0|[1-9][0-9]{0,18})$",
        "description": "Database-owned canonical customer revision. Read a current customer and its ETag before a basic or block command. Native and API edits share this revision; no-op writes do not increment it. It is not a customer-mapping version."
      },
      "BusinessCustomer": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "$ref": "#/components/schemas/BusinessCustomerVersion"
          },
          "displayName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4096
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+[1-9][0-9]{7,14}$"
          },
          "language": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Language"
              },
              {
                "type": "null"
              }
            ]
          },
          "isBlocked": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "fieldUnavailableReasons": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "displayName": {
                "enum": [
                  "too_large",
                  "invalid_stored_value"
                ]
              },
              "phone": {
                "enum": [
                  "too_large",
                  "invalid_stored_value"
                ]
              },
              "language": {
                "enum": [
                  "too_large",
                  "invalid_stored_value"
                ]
              }
            },
            "required": []
          }
        },
        "required": [
          "businessCustomerId",
          "version",
          "displayName",
          "phone",
          "language",
          "isBlocked",
          "createdAt",
          "fieldUnavailableReasons"
        ],
        "description": "Current basic canonical contact projection, including unmapped and blocked contacts. An unavailable stored name/phone/language is null with its fieldUnavailableReasons entry; source data is preserved. Notes, email, arbitrary custom data, consent, customer proof and booking history are absent."
      },
      "BusinessCustomerQuery": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "nameContains": {
            "type": "string",
            "maxLength": 120
          },
          "language": {
            "$ref": "#/components/schemas/Language"
          },
          "isBlocked": {
            "type": "boolean"
          },
          "sort": {
            "enum": [
              "name",
              "joined"
            ],
            "default": "name"
          },
          "cursor": {
            "type": "string",
            "format": "uuid"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 50
          }
        },
        "required": []
      },
      "BusinessCustomerDirectory": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "customers": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/BusinessCustomer"
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "customers",
          "hasMore",
          "nextCursor"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "hasMore": {
                  "const": false
                }
              },
              "required": [
                "hasMore"
              ]
            },
            "then": {
              "properties": {
                "nextCursor": {
                  "type": "null"
                }
              }
            },
            "else": {
              "properties": {
                "nextCursor": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        ]
      },
      "BusinessCustomerLookup": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "customer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessCustomer"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "customer"
        ]
      },
      "BusinessCustomerBasicPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Trimmed by CRAD. Empty/whitespace-only names and control characters are refused."
          },
          "language": {
            "$ref": "#/components/schemas/Language"
          }
        },
        "required": [],
        "minProperties": 1
      },
      "BusinessCustomerBlockPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "isBlocked": {
            "type": "boolean"
          }
        },
        "required": [
          "isBlocked"
        ]
      },
      "BusinessCustomerCommandReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "enum": [
              "basic",
              "block",
              "phone_correction"
            ]
          },
          "acceptedVersion": {
            "$ref": "#/components/schemas/BusinessCustomerVersion"
          }
        },
        "required": [
          "operationId",
          "businessCustomerId",
          "action",
          "acceptedVersion"
        ]
      },
      "BusinessCustomerCommandResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessCustomerCommandReceipt"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessCustomer"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "enum": [
              null,
              "contact_unavailable"
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "current": {
                  "type": "null"
                }
              },
              "required": [
                "current"
              ]
            },
            "then": {
              "properties": {
                "currentUnavailableReason": {
                  "const": "contact_unavailable"
                }
              }
            },
            "else": {
              "properties": {
                "currentUnavailableReason": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessCustomerOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessCustomerCommandReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessCustomer"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currentUnavailableReason": {
                "enum": [
                  null,
                  "contact_unavailable"
                ]
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "currentUnavailableReason",
              "replayed"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "current": {
                      "type": "null"
                    }
                  },
                  "required": [
                    "current"
                  ]
                },
                "then": {
                  "properties": {
                    "currentUnavailableReason": {
                      "const": "contact_unavailable"
                    }
                  }
                },
                "else": {
                  "properties": {
                    "currentUnavailableReason": {
                      "type": "null"
                    }
                  }
                }
              }
            ]
          }
        ]
      },
      "BusinessCustomerFieldSelector": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "standard"
              },
              "key": {
                "const": "notes"
              }
            },
            "required": [
              "kind",
              "key"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "custom"
              },
              "fieldId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "kind",
              "fieldId"
            ]
          }
        ]
      },
      "BusinessCustomerField": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "kind": {
            "enum": [
              "standard",
              "custom"
            ]
          },
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "Current definition key; control and prototype keys are refused."
          },
          "fieldId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "label": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "he": {
                "type": "string",
                "minLength": 0,
                "maxLength": 200
              },
              "ar": {
                "type": "string",
                "minLength": 0,
                "maxLength": 200
              },
              "en": {
                "type": "string",
                "minLength": 0,
                "maxLength": 200
              }
            },
            "required": []
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "textarea",
              "number",
              "date",
              "select",
              "phone",
              "email",
              "boolean",
              "checkbox",
              "multi_select",
              "multiselect"
            ]
          },
          "access": {
            "enum": [
              "read",
              "readwrite"
            ]
          },
          "exists": {
            "type": "boolean"
          },
          "value": {
            "$ref": "#/components/schemas/SharedFieldValue"
          },
          "valueUnavailableReason": {
            "enum": [
              null,
              "invalid_stored_value",
              "too_large"
            ]
          },
          "options": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "label": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "he": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 200
                    },
                    "ar": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 200
                    },
                    "en": {
                      "type": "string",
                      "minLength": 0,
                      "maxLength": 200
                    }
                  },
                  "required": []
                }
              },
              "required": [
                "id",
                "label"
              ]
            }
          }
        },
        "required": [
          "kind",
          "key",
          "fieldId",
          "label",
          "type",
          "access",
          "exists",
          "value",
          "valueUnavailableReason",
          "options"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "exists": {
                  "const": false
                }
              },
              "required": [
                "exists"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "const": null
                },
                "valueUnavailableReason": {
                  "const": null
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "valueUnavailableReason": {
                  "enum": [
                    "invalid_stored_value",
                    "too_large"
                  ]
                }
              },
              "required": [
                "valueUnavailableReason"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "const": null
                },
                "exists": {
                  "const": true
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "enum": [
                    "number"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "enum": [
                    "boolean",
                    "checkbox"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "enum": [
                    "multi_select",
                    "multiselect"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "oneOf": [
                    {
                      "type": "null"
                    },
                    {
                      "type": "array",
                      "maxItems": 100,
                      "items": {
                        "type": "string",
                        "maxLength": 120
                      }
                    }
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "type": {
                  "enum": [
                    "text",
                    "textarea",
                    "date",
                    "select",
                    "phone",
                    "email"
                  ]
                }
              },
              "required": [
                "type"
              ]
            },
            "then": {
              "properties": {
                "value": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "kind": {
                  "const": "standard"
                }
              },
              "required": [
                "kind"
              ]
            },
            "then": {
              "properties": {
                "key": {
                  "const": "notes"
                },
                "fieldId": {
                  "type": "null"
                },
                "type": {
                  "const": "textarea"
                }
              }
            },
            "else": {
              "properties": {
                "fieldId": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        ],
        "description": "One currently eligible, independently owner-approved Management field. Standard selectors support notes only; custom selectors use the immutable definition UUID. Visibility alone is not approval. No ungranted value or metadata is exposed."
      },
      "BusinessCustomerFields": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "grantRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "projectionEpoch": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "customerVersion": {
            "$ref": "#/components/schemas/BusinessCustomerVersion"
          },
          "projectionVersion": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "fields": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/BusinessCustomerField"
            }
          }
        },
        "required": [
          "businessCustomerId",
          "grantRevision",
          "projectionEpoch",
          "customerVersion",
          "projectionVersion",
          "fields"
        ],
        "description": "Current granted field definitions and values. grantRevision supplies the policy precondition for PATCH; each change also compares expectedExists and expectedValue. projectionVersion describes this current projection and is not a global write precondition. Absent custom keys have exists:false,value:null; notes always has exists:true and may be null."
      },
      "BusinessCustomerFieldChange": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "standard"
              },
              "key": {
                "const": "notes"
              },
              "expectedExists": {
                "type": "boolean"
              },
              "expectedValue": {
                "$ref": "#/components/schemas/SharedFieldValue"
              },
              "operation": {
                "const": "set"
              },
              "value": {
                "$ref": "#/components/schemas/SharedFieldValue"
              }
            },
            "required": [
              "kind",
              "key",
              "expectedExists",
              "expectedValue",
              "operation",
              "value"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "expectedExists": {
                      "const": false
                    }
                  },
                  "required": [
                    "expectedExists"
                  ]
                },
                "then": {
                  "properties": {
                    "expectedValue": {
                      "type": "null"
                    }
                  }
                }
              }
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "standard"
              },
              "key": {
                "const": "notes"
              },
              "expectedExists": {
                "type": "boolean"
              },
              "expectedValue": {
                "$ref": "#/components/schemas/SharedFieldValue"
              },
              "operation": {
                "const": "remove"
              }
            },
            "required": [
              "kind",
              "key",
              "expectedExists",
              "expectedValue",
              "operation"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "expectedExists": {
                      "const": false
                    }
                  },
                  "required": [
                    "expectedExists"
                  ]
                },
                "then": {
                  "properties": {
                    "expectedValue": {
                      "type": "null"
                    }
                  }
                }
              }
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "custom"
              },
              "fieldId": {
                "type": "string",
                "format": "uuid"
              },
              "expectedExists": {
                "type": "boolean"
              },
              "expectedValue": {
                "$ref": "#/components/schemas/SharedFieldValue"
              },
              "operation": {
                "const": "set"
              },
              "value": {
                "$ref": "#/components/schemas/SharedFieldValue"
              }
            },
            "required": [
              "kind",
              "fieldId",
              "expectedExists",
              "expectedValue",
              "operation",
              "value"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "expectedExists": {
                      "const": false
                    }
                  },
                  "required": [
                    "expectedExists"
                  ]
                },
                "then": {
                  "properties": {
                    "expectedValue": {
                      "type": "null"
                    }
                  }
                }
              }
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "custom"
              },
              "fieldId": {
                "type": "string",
                "format": "uuid"
              },
              "expectedExists": {
                "type": "boolean"
              },
              "expectedValue": {
                "$ref": "#/components/schemas/SharedFieldValue"
              },
              "operation": {
                "const": "remove"
              }
            },
            "required": [
              "kind",
              "fieldId",
              "expectedExists",
              "expectedValue",
              "operation"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "expectedExists": {
                      "const": false
                    }
                  },
                  "required": [
                    "expectedExists"
                  ]
                },
                "then": {
                  "properties": {
                    "expectedValue": {
                      "type": "null"
                    }
                  }
                }
              }
            ]
          }
        ]
      },
      "BusinessCustomerFieldsPatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "grantRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "changes": {
            "type": "array",
            "maxItems": 50,
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/BusinessCustomerFieldChange"
            }
          }
        },
        "required": [
          "grantRevision",
          "changes"
        ],
        "description": "Atomic per-selector compare-and-set. Duplicate selectors, unknown keys, malformed values and unavailable grants/definitions are refused. A custom remove deletes its key; notes remove clears it to null. Independent keys can merge despite unrelated customer revisions. Preserve this exact body and the Idempotency-Key for uncertain-outcome recovery."
      },
      "BusinessCustomerFieldReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "fields": {
            "type": "array",
            "maxItems": 50,
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/BusinessCustomerFieldSelector"
            }
          }
        },
        "required": [
          "operationId",
          "businessCustomerId",
          "fields"
        ],
        "description": "Immutable accepted operation reference and selectors only. No former field value is retained."
      },
      "BusinessCustomerFieldResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessCustomerFieldReceipt"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessCustomerFields"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "enum": [
              null,
              "contact_unavailable"
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "current": {
                  "type": "null"
                }
              },
              "required": [
                "current"
              ]
            },
            "then": {
              "properties": {
                "currentUnavailableReason": {
                  "const": "contact_unavailable"
                }
              }
            },
            "else": {
              "properties": {
                "currentUnavailableReason": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessCustomerFieldOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessCustomerFieldReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessCustomerFields"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currentUnavailableReason": {
                "enum": [
                  null,
                  "contact_unavailable"
                ]
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "currentUnavailableReason",
              "replayed"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "current": {
                      "type": "null"
                    }
                  },
                  "required": [
                    "current"
                  ]
                },
                "then": {
                  "properties": {
                    "currentUnavailableReason": {
                      "const": "contact_unavailable"
                    }
                  }
                },
                "else": {
                  "properties": {
                    "currentUnavailableReason": {
                      "type": "null"
                    }
                  }
                }
              }
            ]
          }
        ]
      },
      "BusinessCustomerSyncLive": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "$ref": "#/components/schemas/BusinessCustomerVersion"
          },
          "displayName": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4096
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\+[1-9][0-9]{7,14}$"
          },
          "language": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Language"
              },
              {
                "type": "null"
              }
            ]
          },
          "isBlocked": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "fieldUnavailableReasons": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "displayName": {
                "enum": [
                  "too_large",
                  "invalid_stored_value"
                ]
              },
              "phone": {
                "enum": [
                  "too_large",
                  "invalid_stored_value"
                ]
              },
              "language": {
                "enum": [
                  "too_large",
                  "invalid_stored_value"
                ]
              }
            },
            "required": []
          },
          "removed": {
            "const": false
          },
          "fields": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/BusinessCustomerField"
            }
          }
        },
        "required": [
          "businessCustomerId",
          "version",
          "displayName",
          "phone",
          "language",
          "isBlocked",
          "createdAt",
          "fieldUnavailableReasons",
          "removed"
        ],
        "description": "Current row rehydrated when this page is delivered. fields is present only with current contacts:fields:read scope and contains only currently approved/eligible definitions."
      },
      "BusinessCustomerSyncRemoved": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "$ref": "#/components/schemas/BusinessCustomerVersion"
          },
          "removed": {
            "const": true
          }
        },
        "required": [
          "businessCustomerId",
          "version",
          "removed"
        ],
        "description": "Snapshot membership whose canonical customer is now deleted or outside this tenant. It contains no field values."
      },
      "BusinessCustomerSignal": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "signalVersion": {
            "$ref": "#/components/schemas/BusinessCustomerVersion"
          },
          "type": {
            "enum": [
              "upsert",
              "removed"
            ]
          },
          "changedFields": {
            "type": "array",
            "maxItems": 10000,
            "minItems": 1,
            "items": {
              "type": "string",
              "pattern": "^(?:\\*|displayName|phone|language|isBlocked|createdAt|standard:notes|custom:.{1,100})$"
            },
            "uniqueItems": true
          },
          "source": {
            "type": "string",
            "pattern": "^(?:crad_profile|other_integration|integration:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})$"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessCustomerSyncLive"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "eventId",
          "businessCustomerId",
          "sequence",
          "signalVersion",
          "type",
          "changedFields",
          "source",
          "current"
        ],
        "description": "Metadata-only published signal. eventId/sequence/signalVersion describe the committed captured change; current is freshly rehydrated and can be newer or null. A removed event always identifies businessCustomerId even when current is null. Own integration sources are explicit; another integration is reported only as other_integration. Native writers are crad_profile. Hidden-only changes are skipped while the cursor still advances. Replay is current-state convergence, not a historical payload or byte-identical event-value promise."
      },
      "BusinessCustomerSyncPage": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "snapshot"
              },
              "customers": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BusinessCustomerSyncLive"
                    },
                    {
                      "$ref": "#/components/schemas/BusinessCustomerSyncRemoved"
                    }
                  ]
                }
              },
              "nextCursor": {
                "type": "string",
                "format": "uuid"
              },
              "hasMore": {
                "type": "boolean"
              },
              "watermark": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "projectionEpoch": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "required": [
              "kind",
              "customers",
              "nextCursor",
              "hasMore",
              "watermark",
              "projectionEpoch"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "changes"
              },
              "events": {
                "type": "array",
                "maxItems": 100,
                "items": {
                  "$ref": "#/components/schemas/BusinessCustomerSignal"
                }
              },
              "nextCursor": {
                "type": "string",
                "format": "uuid"
              },
              "hasMore": {
                "type": "boolean"
              },
              "watermark": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "projectionEpoch": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "required": [
              "kind",
              "events",
              "nextCursor",
              "hasMore",
              "watermark",
              "projectionEpoch"
            ]
          }
        ]
      },
      "BusinessCustomerSnapshot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "cursor": {
            "type": "string",
            "format": "uuid"
          },
          "watermark": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "projectionEpoch": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "cursor",
          "watermark",
          "projectionEpoch",
          "expiresAt"
        ],
        "description": "Immutable membership IDs plus publication fence H, never retained note/custom values. Snapshot pages hydrate current rows and may show a native commit newer than H early; it later repeats through delta. Consume all membership pages, then follow the returned changes cursor. Membership expires after 30 minutes."
      },
      "BusinessCustomerCheckpointReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "cursor": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "projectionEpoch": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "appliedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "operationId",
          "cursor",
          "sequence",
          "projectionEpoch",
          "appliedAt"
        ],
        "description": "Immutable acknowledgement of the applied sequence for one integration/projection epoch."
      },
      "BusinessCustomerCheckpoint": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessCustomerCheckpointReceipt"
          },
          "currentProjectionEpoch": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "bootstrapRequired": {
            "type": "boolean"
          },
          "replayed": {
            "type": "boolean"
          },
          "unchanged": {
            "type": "boolean",
            "description": "True only for a successful current checkpoint confirmation that made no new durable receipt. Optional for compatibility."
          }
        },
        "required": [
          "receipt",
          "currentProjectionEpoch",
          "bootstrapRequired",
          "replayed"
        ],
        "description": "Only complete issued snapshot/change pages can be acknowledged. Progress is monotonic per integration and effective projection epoch. Repeating the exact operation/cursor returns this receipt even after cursor expiry; bootstrapRequired tells the caller to restart under current authority/history. Revoked authority still refuses recovery. A validated new UUID for the already acknowledged identical cursor and sequence can return unchanged:true without creating another stored receipt or updating appliedAt. This confirms the current checkpoint; it does not durably reserve that new UUID. Previously accepted operation UUIDs are replayed or rejected for conflict first. Accepted checkpoint receipts are retained for at least 30 days and until their original cursor is no longer valid. An uncertain pending ACK must retain its original UUID and cursor; always honor currentProjectionEpoch and bootstrapRequired, including on replay."
      },
      "BusinessAppointmentVersion": {
        "type": "string",
        "pattern": "^a(?:0|[1-9][0-9]{0,18})$",
        "description": "Opaque physical appointment revision, a0 through a9223372036854775807. Preserve exactly; this is distinct from website lineage versions."
      },
      "BusinessAppointmentStatus": {
        "enum": [
          "PENDING",
          "CONFIRMED",
          "NOW",
          "COMPLETED",
          "CANCELLED",
          "MISSED"
        ]
      },
      "BusinessCalendarGrant": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "credentialId": {
            "type": "string",
            "format": "uuid"
          },
          "integrationId": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "grantRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "roleCeiling": {
            "enum": [
              null,
              "business_manager",
              "provider"
            ]
          },
          "providerIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 100,
            "uniqueItems": true
          },
          "wholeBusiness": {
            "type": "boolean"
          },
          "includeUnassigned": {
            "type": "boolean"
          },
          "notesRead": {
            "type": "boolean"
          }
        },
        "required": [
          "credentialId",
          "integrationId",
          "tenantId",
          "grantRevision",
          "roleCeiling",
          "providerIds",
          "wholeBusiness",
          "includeUnassigned",
          "notesRead"
        ]
      },
      "BusinessAppointmentTerms": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "const": 1
          },
          "policy": {
            "enum": [
              "service_duration_v1",
              "legacy_fixed_slot_v1"
            ]
          },
          "policyVersion": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "serviceId": {
            "type": "string",
            "format": "uuid"
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceName": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "he": {
                "type": "string",
                "maxLength": 4096
              },
              "ar": {
                "type": "string",
                "maxLength": 4096
              },
              "en": {
                "type": "string",
                "maxLength": 4096
              }
            },
            "required": []
          },
          "baseDurationMinutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440
          },
          "removalDurationMinutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 240
          },
          "durationMinutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440
          },
          "slotIntervalMinutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440
          },
          "withRemoval": {
            "type": "boolean"
          },
          "basePriceMajor": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Unknown accepted price remains null, distinct from an explicit zero. Base and total must both be null or both priced."
          },
          "removalPriceMajor": {
            "type": "number",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Stored major currency units; 120 means 120 units, not 1.20. Do not combine with customer booking minor-unit money fields."
          },
          "totalPriceMajor": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "description": "Unknown accepted price remains null, distinct from an explicit zero. Base and total must both be null or both priced."
          },
          "currency": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1
          },
          "websiteBookingId": {
            "type": "string",
            "format": "uuid"
          },
          "origin": {
            "const": "website"
          },
          "serviceUpdatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "slotGridAnchor": {
            "enum": [
              "segment_start"
            ],
            "description": "Present only for accepted treatment-duration grids that restart at each scheduled work segment after a break. Absence preserves the existing day-opening anchor, including historical appointments. Use server-returned availability slots; do not infer the rule from duration, interval, or current business settings."
          },
          "basePriceRangeMajor": {
            "$ref": "#/components/schemas/MajorPriceRange"
          },
          "totalPriceRangeMajor": {
            "$ref": "#/components/schemas/MajorPriceRange"
          }
        },
        "required": [
          "version",
          "policy",
          "policyVersion",
          "serviceId",
          "providerId",
          "serviceName",
          "baseDurationMinutes",
          "removalDurationMinutes",
          "durationMinutes",
          "slotIntervalMinutes",
          "withRemoval",
          "basePriceMajor",
          "removalPriceMajor",
          "totalPriceMajor",
          "currency"
        ],
        "allOf": [
          {
            "if": {
              "required": [
                "basePriceRangeMajor"
              ],
              "properties": {
                "basePriceRangeMajor": {
                  "type": "object"
                }
              }
            },
            "then": {
              "properties": {
                "basePriceMajor": {
                  "type": "null"
                }
              }
            }
          },
          {
            "if": {
              "required": [
                "totalPriceRangeMajor"
              ],
              "properties": {
                "totalPriceRangeMajor": {
                  "type": "object"
                }
              }
            },
            "then": {
              "properties": {
                "totalPriceMajor": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessAppointment": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "$ref": "#/components/schemas/BusinessAppointmentVersion"
          },
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/BusinessAppointmentStatus"
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "priceMajor": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Stored major currency units; 120 means 120 units, not 1.20. Do not combine with customer booking minor-unit money fields."
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Frozen accepted currency, or null when an ordinary legacy appointment did not save a currency. CRAD does not infer a current catalogue currency."
          },
          "terms": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessAppointmentTerms"
              },
              {
                "type": "null"
              }
            ]
          },
          "websiteBookingId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ]
          },
          "fieldUnavailableReasons": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "priceMajor": {
                "enum": [
                  "too_large",
                  "invalid_stored_value"
                ]
              },
              "terms": {
                "enum": [
                  "too_large",
                  "invalid_stored_value"
                ]
              },
              "notes": {
                "enum": [
                  "too_large",
                  "invalid_stored_value"
                ]
              }
            },
            "required": []
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "websiteVersion": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "customer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessCustomer"
              },
              {
                "type": "null"
              }
            ]
          },
          "allowedActions": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "action": {
                  "enum": [
                    "status",
                    "mark_missed",
                    "cancel",
                    "reschedule",
                    "undo",
                    "propose_time"
                  ]
                },
                "status": {
                  "$ref": "#/components/schemas/BusinessAppointmentStatus"
                },
                "allowed": {
                  "type": "boolean"
                },
                "reason": {
                  "type": "string",
                  "pattern": "^[a-z][a-z0-9_]{0,99}$"
                }
              },
              "required": [
                "action",
                "allowed"
              ]
            },
            "maxItems": 10
          },
          "approvalRequired": {
            "type": "boolean",
            "description": "Customer request requiring a clinic decision. Existing appointments and manually entered appointments are preserved."
          },
          "timeProposal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BookingTimeProposal"
              },
              {
                "type": "null"
              }
            ]
          },
          "priceRangeMajor": {
            "$ref": "#/components/schemas/MajorPriceRange"
          }
        },
        "required": [
          "appointmentId",
          "version",
          "businessCustomerId",
          "startAt",
          "endAt",
          "status",
          "providerId",
          "serviceId",
          "priceMajor",
          "currency",
          "terms",
          "websiteBookingId",
          "notes",
          "fieldUnavailableReasons",
          "timezone",
          "websiteVersion",
          "customer",
          "allowedActions"
        ],
        "description": "Current authorized physical appointment. Joined customer basics require contacts:read independently; notes require appointments:notes:read AND the current notesRead grant. No email, private customer fields, raw custom_data or raw snapshot is exported. allowedActions is advisory current state; commands recheck all preconditions.",
        "allOf": [
          {
            "if": {
              "required": [
                "priceRangeMajor"
              ],
              "properties": {
                "priceRangeMajor": {
                  "type": "object"
                }
              }
            },
            "then": {
              "properties": {
                "priceMajor": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessAppointmentDirectory": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "appointments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessAppointment"
            },
            "maxItems": 200
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "appointments",
          "hasMore",
          "nextCursor"
        ]
      },
      "BusinessCalendarQuoteRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "withRemoval": {
            "type": "boolean",
            "default": false
          }
        },
        "required": [
          "businessCustomerId"
        ]
      },
      "BusinessCalendarAvailabilityRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "withRemoval": {
            "type": "boolean",
            "default": false
          },
          "localDate": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [
          "businessCustomerId",
          "localDate"
        ]
      },
      "BusinessCalendarQuote": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "withRemoval": {
            "type": "boolean",
            "default": false
          },
          "quoteVersion": {
            "type": "string",
            "format": "uuid"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "mode": {
            "enum": [
              "legacy_fixed_slot",
              "service_duration"
            ]
          },
          "durationMinutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440
          },
          "slotIntervalMinutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1440
          },
          "totalPriceMajor": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Stored major currency units; 120 means 120 units, not 1.20. Do not combine with customer booking minor-unit money fields."
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "removalAvailable": {
            "type": "boolean"
          },
          "slotGridAnchor": {
            "enum": [
              "segment_start"
            ],
            "description": "Present only for accepted treatment-duration grids that restart at each scheduled work segment after a break. Absence preserves the existing day-opening anchor, including historical appointments. Use server-returned availability slots; do not infer the rule from duration, interval, or current business settings."
          },
          "totalPriceRangeMajor": {
            "$ref": "#/components/schemas/MajorPriceRange"
          }
        },
        "required": [
          "businessCustomerId",
          "providerId",
          "serviceId",
          "withRemoval",
          "quoteVersion",
          "expiresAt",
          "mode",
          "durationMinutes",
          "slotIntervalMinutes",
          "totalPriceMajor",
          "currency",
          "removalAvailable"
        ],
        "allOf": [
          {
            "if": {
              "required": [
                "totalPriceRangeMajor"
              ],
              "properties": {
                "totalPriceRangeMajor": {
                  "type": "object"
                }
              }
            },
            "then": {
              "properties": {
                "totalPriceMajor": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessCalendarAvailability": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "localDate": {
            "type": "string",
            "format": "date"
          },
          "timezone": {
            "type": "string",
            "maxLength": 100
          },
          "quote": {
            "$ref": "#/components/schemas/BusinessCalendarQuote"
          },
          "slots": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "startAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "endAt": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "startAt",
                "endAt"
              ]
            },
            "maxItems": 1440
          }
        },
        "required": [
          "localDate",
          "timezone",
          "quote",
          "slots"
        ]
      },
      "BusinessCalendarCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "withRemoval": {
            "type": "boolean",
            "default": false
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "quoteVersion": {
            "type": "string",
            "format": "uuid"
          },
          "externalActorRef": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "allOf": [
              {
                "pattern": "[^\\s]"
              },
              {
                "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
              }
            ],
            "description": "Optional audit label from your backend. It never grants authority or identifies a CRAD user."
          },
          "bookingIntent": {
            "enum": [
              "appointment",
              "request"
            ],
            "default": "appointment",
            "description": "A public booking adapter using its authenticated server sends request. When requireBookingApproval=true, creation atomically saves PENDING and reserves capacity. Native/manual appointments remain confirmed. Never expose a Management key in the browser."
          },
          "language": {
            "enum": [
              "he",
              "ar",
              "en"
            ],
            "description": "Optional only for bookingIntent:request. Preferred language of this booking's updates and reminders; it does not modify the existing customer's profile language. When omitted, existing language selection remains unchanged. Preserve the original value or absence when recovering an operation."
          },
          "communicationPreferences": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "whatsapp": {
                "type": "boolean"
              },
              "noticeVersion": {
                "const": "website-transactional-whatsapp-v1"
              }
            },
            "required": [
              "whatsapp",
              "noticeVersion"
            ],
            "description": "Allowed only for bookingIntent:request. Explicit customer choice; absence means no consent. Does not enable templates or override global opt-out."
          }
        },
        "required": [
          "businessCustomerId",
          "startAt",
          "quoteVersion"
        ],
        "allOf": [
          {
            "if": {
              "anyOf": [
                {
                  "required": [
                    "communicationPreferences"
                  ]
                },
                {
                  "required": [
                    "language"
                  ]
                }
              ]
            },
            "then": {
              "required": [
                "bookingIntent"
              ],
              "properties": {
                "bookingIntent": {
                  "const": "request"
                }
              }
            }
          }
        ]
      },
      "BusinessCalendarResources": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "timezone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "grant": {
            "$ref": "#/components/schemas/BusinessCalendarGrant"
          },
          "bookingModes": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "legacyFixedSlot": {
                "type": "boolean"
              },
              "serviceDuration": {
                "type": "boolean"
              }
            },
            "required": [
              "legacyFixedSlot",
              "serviceDuration"
            ]
          },
          "providers": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "providerId": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "he": {
                      "type": "string",
                      "maxLength": 4096
                    },
                    "ar": {
                      "type": "string",
                      "maxLength": 4096
                    },
                    "en": {
                      "type": "string",
                      "maxLength": 4096
                    }
                  },
                  "required": []
                },
                "isActive": {
                  "type": "boolean"
                },
                "slotDurationMinutes": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1440
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "providerId",
                "name",
                "isActive",
                "slotDurationMinutes"
              ]
            },
            "maxItems": 200
          },
          "services": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "serviceId": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "he": {
                      "type": "string",
                      "maxLength": 4096
                    },
                    "ar": {
                      "type": "string",
                      "maxLength": 4096
                    },
                    "en": {
                      "type": "string",
                      "maxLength": 4096
                    }
                  },
                  "required": []
                },
                "isActive": {
                  "type": "boolean"
                },
                "priceMajor": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 9007199254740991,
                      "description": "Stored major currency units; 120 means 120 units, not 1.20. Do not combine with customer booking minor-unit money fields."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "currency": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 100,
                      "minLength": 1
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "bookingDurationMinutes": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1440
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "removalDurationMinutes": {
                  "anyOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1440
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "removalPriceMajor": {
                  "anyOf": [
                    {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 9007199254740991,
                      "description": "Stored major currency units; 120 means 120 units, not 1.20. Do not combine with customer booking minor-unit money fields."
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "priceRangeMajor": {
                  "$ref": "#/components/schemas/MajorPriceRange"
                }
              },
              "required": [
                "serviceId",
                "name",
                "isActive",
                "priceMajor",
                "currency",
                "bookingDurationMinutes",
                "removalDurationMinutes",
                "removalPriceMajor"
              ],
              "allOf": [
                {
                  "if": {
                    "required": [
                      "priceRangeMajor"
                    ],
                    "properties": {
                      "priceRangeMajor": {
                        "type": "object"
                      }
                    }
                  },
                  "then": {
                    "properties": {
                      "priceMajor": {
                        "type": "null"
                      }
                    }
                  }
                }
              ]
            },
            "maxItems": 200
          }
        },
        "required": [
          "timezone",
          "grant",
          "bookingModes",
          "providers",
          "services"
        ]
      },
      "BusinessCalendarActionPreviewRequest": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "status"
              },
              "status": {
                "enum": [
                  "PENDING",
                  "CONFIRMED",
                  "NOW",
                  "COMPLETED",
                  "MISSED"
                ]
              }
            },
            "required": [
              "action",
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "status"
              },
              "status": {
                "const": "CANCELLED"
              },
              "notificationIntent": {
                "enum": [
                  "silent",
                  "request_notice"
                ]
              }
            },
            "required": [
              "action",
              "status",
              "notificationIntent"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "mark_missed"
              }
            },
            "required": [
              "action"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "cancel"
              },
              "notificationIntent": {
                "enum": [
                  "silent",
                  "request_notice"
                ]
              }
            },
            "required": [
              "action",
              "notificationIntent"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "reschedule"
              },
              "newStartAt": {
                "type": "string",
                "format": "date-time"
              },
              "notificationIntent": {
                "enum": [
                  "silent",
                  "request_notice"
                ]
              }
            },
            "required": [
              "action",
              "newStartAt",
              "notificationIntent"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "undo"
              },
              "undoOperationId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "action",
              "undoOperationId"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "propose_time"
              },
              "newStartAt": {
                "type": "string",
                "format": "date-time"
              },
              "notificationIntent": {
                "const": "request_notice"
              }
            },
            "required": [
              "action",
              "newStartAt",
              "notificationIntent"
            ]
          }
        ]
      },
      "BusinessCalendarActionRequest": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "status"
              },
              "status": {
                "enum": [
                  "PENDING",
                  "CONFIRMED",
                  "NOW",
                  "COMPLETED",
                  "MISSED"
                ]
              },
              "externalActorRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "allOf": [
                  {
                    "pattern": "[^\\s]"
                  },
                  {
                    "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
                  }
                ],
                "description": "Optional audit label from your backend. It never grants authority or identifies a CRAD user."
              }
            },
            "required": [
              "action",
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "status"
              },
              "status": {
                "const": "CANCELLED"
              },
              "notificationIntent": {
                "enum": [
                  "silent",
                  "request_notice"
                ]
              },
              "externalActorRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "allOf": [
                  {
                    "pattern": "[^\\s]"
                  },
                  {
                    "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
                  }
                ],
                "description": "Optional audit label from your backend. It never grants authority or identifies a CRAD user."
              },
              "previewVersion": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "action",
              "status",
              "notificationIntent",
              "previewVersion"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "mark_missed"
              },
              "externalActorRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "allOf": [
                  {
                    "pattern": "[^\\s]"
                  },
                  {
                    "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
                  }
                ],
                "description": "Optional audit label from your backend. It never grants authority or identifies a CRAD user."
              }
            },
            "required": [
              "action"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "cancel"
              },
              "notificationIntent": {
                "enum": [
                  "silent",
                  "request_notice"
                ]
              },
              "externalActorRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "allOf": [
                  {
                    "pattern": "[^\\s]"
                  },
                  {
                    "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
                  }
                ],
                "description": "Optional audit label from your backend. It never grants authority or identifies a CRAD user."
              },
              "previewVersion": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "action",
              "notificationIntent",
              "previewVersion"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "reschedule"
              },
              "newStartAt": {
                "type": "string",
                "format": "date-time"
              },
              "notificationIntent": {
                "enum": [
                  "silent",
                  "request_notice"
                ]
              },
              "externalActorRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "allOf": [
                  {
                    "pattern": "[^\\s]"
                  },
                  {
                    "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
                  }
                ],
                "description": "Optional audit label from your backend. It never grants authority or identifies a CRAD user."
              },
              "previewVersion": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "action",
              "newStartAt",
              "notificationIntent",
              "previewVersion"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "undo"
              },
              "undoOperationId": {
                "type": "string",
                "format": "uuid"
              },
              "externalActorRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "allOf": [
                  {
                    "pattern": "[^\\s]"
                  },
                  {
                    "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
                  }
                ],
                "description": "Optional audit label from your backend. It never grants authority or identifies a CRAD user."
              }
            },
            "required": [
              "action",
              "undoOperationId"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "const": "propose_time"
              },
              "newStartAt": {
                "type": "string",
                "format": "date-time"
              },
              "notificationIntent": {
                "const": "request_notice"
              },
              "externalActorRef": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200,
                "allOf": [
                  {
                    "pattern": "[^\\s]"
                  },
                  {
                    "pattern": "^[^\\u0000-\\u001f\\u007f]+$"
                  }
                ],
                "description": "Optional audit label from your backend. It never grants authority or identifies a CRAD user."
              },
              "previewVersion": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "action",
              "newStartAt",
              "notificationIntent",
              "previewVersion"
            ]
          }
        ]
      },
      "BusinessCalendarPreview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "previewVersion": {
            "type": "string",
            "format": "uuid"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "$ref": "#/components/schemas/BusinessAppointmentVersion"
          },
          "action": {
            "enum": [
              "status",
              "mark_missed",
              "cancel",
              "reschedule",
              "undo",
              "propose_time"
            ]
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessAppointmentStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "newStartAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "newEndAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "notificationIntent": {
            "enum": [
              "silent",
              "request_notice"
            ]
          },
          "notificationAvailability": {
            "enum": [
              "available",
              "unavailable",
              "not_requested"
            ]
          }
        },
        "required": [
          "previewVersion",
          "expiresAt",
          "appointmentId",
          "version",
          "action",
          "status",
          "newStartAt",
          "newEndAt",
          "notificationIntent",
          "notificationAvailability"
        ]
      },
      "BusinessCalendarAcceptedNotification": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "intent": {
            "enum": [
              "silent",
              "request_notice"
            ]
          },
          "state": {
            "enum": [
              "not_requested",
              "queued",
              "pending",
              "dispatching",
              "accepted",
              "sent",
              "failed",
              "unknown",
              "unavailable",
              "suppressed",
              "expired"
            ]
          },
          "route": {
            "enum": [
              null,
              "legacy_cancellation",
              "business_calendar_change",
              "website"
            ]
          },
          "noticeId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "intent",
          "state",
          "route"
        ]
      },
      "BusinessCalendarCurrentNotification": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "intent": {
            "const": "request_notice"
          },
          "state": {
            "enum": [
              "queued",
              "unavailable",
              "dispatching",
              "accepted",
              "delivered",
              "failed",
              "unknown",
              "suppressed",
              "expired"
            ]
          },
          "route": {
            "enum": [
              "legacy_cancellation",
              "business_calendar_change"
            ]
          },
          "noticeId": {
            "type": "string",
            "format": "uuid"
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,99}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "intent",
          "state",
          "route",
          "noticeId",
          "reason",
          "updatedAt"
        ]
      },
      "BusinessCalendarReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "enum": [
              "create",
              "status",
              "mark_missed",
              "cancel",
              "reschedule",
              "undo",
              "propose_time"
            ]
          },
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "acceptedVersion": {
            "$ref": "#/components/schemas/BusinessAppointmentVersion"
          },
          "successorAppointmentId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "successorVersion": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessAppointmentVersion"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/BusinessAppointmentStatus"
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          },
          "notification": {
            "$ref": "#/components/schemas/BusinessCalendarAcceptedNotification"
          }
        },
        "required": [
          "operationId",
          "action",
          "appointmentId",
          "acceptedVersion",
          "successorAppointmentId",
          "successorVersion",
          "status",
          "startAt",
          "endAt",
          "notification"
        ]
      },
      "BusinessCalendarCommand": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessCalendarReceipt"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessAppointment"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "enum": [
              null,
              "removed",
              "access_unavailable"
            ]
          },
          "replayed": {
            "type": "boolean"
          },
          "undo": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "expectedVersion": {
                "$ref": "#/components/schemas/BusinessAppointmentVersion"
              },
              "previousStatus": {
                "$ref": "#/components/schemas/BusinessAppointmentStatus"
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "operationId",
              "expectedVersion",
              "previousStatus",
              "expiresAt"
            ]
          },
          "notificationCurrent": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessCalendarCurrentNotification"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "description": "receipt preserves the accepted operation facts. current is rehydrated now and may differ or be null. notificationCurrent, when present, is current delivery state distinct from the immutable accepted notification intent. A queued notice is not evidence of delivery. Never retry unknown delivery by creating another command."
      },
      "BusinessCalendarOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessCalendarReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessAppointment"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currentUnavailableReason": {
                "enum": [
                  null,
                  "removed",
                  "access_unavailable"
                ]
              },
              "replayed": {
                "type": "boolean"
              },
              "undo": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "operationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "expectedVersion": {
                    "$ref": "#/components/schemas/BusinessAppointmentVersion"
                  },
                  "previousStatus": {
                    "$ref": "#/components/schemas/BusinessAppointmentStatus"
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "operationId",
                  "expectedVersion",
                  "previousStatus",
                  "expiresAt"
                ]
              },
              "notificationCurrent": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessCalendarCurrentNotification"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "currentUnavailableReason",
              "replayed"
            ]
          },
          {
            "$ref": "#/components/schemas/BusinessCalendarCreateRejected"
          }
        ]
      },
      "BusinessAppointmentRange": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "from",
          "to"
        ],
        "description": "Fixed positive half-open overlapping range, at most 93 days. Omitted providerId means all CURRENTLY GRANTED resources, null means granted unassigned-only, and a UUID means that granted provider. It never means unrestricted whole-business access."
      },
      "BusinessAppointmentSnapshot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "cursor": {
            "type": "string",
            "format": "uuid"
          },
          "watermark": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "projectionEpoch": {
            "type": "string",
            "pattern": "^(?:[a-f0-9]{32}|[a-f0-9]{64})$",
            "description": "Opaque scope/authority identity. Do not parse it as a version or infer a hash algorithm."
          },
          "scopeId": {
            "type": "string",
            "pattern": "^(?:[a-f0-9]{32}|[a-f0-9]{64})$",
            "description": "Opaque scope/authority identity. Do not parse it as a version or infer a hash algorithm."
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "cursor",
          "watermark",
          "projectionEpoch",
          "scopeId",
          "expiresAt"
        ]
      },
      "BusinessAppointmentSyncLive": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "$ref": "#/components/schemas/BusinessAppointmentVersion"
          },
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "$ref": "#/components/schemas/BusinessAppointmentStatus"
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "priceMajor": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Stored major currency units; 120 means 120 units, not 1.20. Do not combine with customer booking minor-unit money fields."
              },
              {
                "type": "null"
              }
            ]
          },
          "currency": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "Frozen accepted currency, or null when an ordinary legacy appointment did not save a currency. CRAD does not infer a current catalogue currency."
          },
          "terms": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessAppointmentTerms"
              },
              {
                "type": "null"
              }
            ]
          },
          "websiteBookingId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ]
          },
          "fieldUnavailableReasons": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "priceMajor": {
                "enum": [
                  "too_large",
                  "invalid_stored_value"
                ]
              },
              "terms": {
                "enum": [
                  "too_large",
                  "invalid_stored_value"
                ]
              },
              "notes": {
                "enum": [
                  "too_large",
                  "invalid_stored_value"
                ]
              }
            },
            "required": []
          },
          "removed": {
            "const": false
          },
          "approvalRequired": {
            "type": "boolean",
            "description": "Customer request requiring a clinic decision. Existing appointments and manually entered appointments are preserved."
          },
          "timeProposal": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BookingTimeProposal"
              },
              {
                "type": "null"
              }
            ]
          },
          "priceRangeMajor": {
            "$ref": "#/components/schemas/MajorPriceRange"
          }
        },
        "required": [
          "appointmentId",
          "version",
          "businessCustomerId",
          "startAt",
          "endAt",
          "status",
          "providerId",
          "serviceId",
          "priceMajor",
          "currency",
          "terms",
          "websiteBookingId",
          "notes",
          "fieldUnavailableReasons",
          "removed"
        ],
        "allOf": [
          {
            "if": {
              "required": [
                "priceRangeMajor"
              ],
              "properties": {
                "priceRangeMajor": {
                  "type": "object"
                }
              }
            },
            "then": {
              "properties": {
                "priceMajor": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessAppointmentSyncRemoved": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "$ref": "#/components/schemas/BusinessAppointmentVersion"
          },
          "removed": {
            "const": true
          }
        },
        "required": [
          "appointmentId",
          "version",
          "removed"
        ]
      },
      "BusinessAppointmentSyncEvent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "signalVersion": {
            "$ref": "#/components/schemas/BusinessAppointmentVersion"
          },
          "type": {
            "enum": [
              "upsert",
              "removed"
            ]
          },
          "changedFields": {
            "type": "array",
            "minItems": 1,
            "maxItems": 20,
            "items": {
              "enum": [
                "*",
                "version",
                "businessCustomerId",
                "providerId",
                "serviceId",
                "priceMajor",
                "startAt",
                "endAt",
                "status",
                "terms",
                "websiteBookingId",
                "notes"
              ]
            }
          },
          "source": {
            "type": "string",
            "pattern": "^(?:crad_appointment|other_integration|management:[a-f0-9-]{36})$",
            "description": "Only this integration can be named management:<its ID>; other integrations and native user IDs are masked."
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessAppointmentSyncLive"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "eventId",
          "appointmentId",
          "sequence",
          "signalVersion",
          "type",
          "changedFields",
          "source",
          "current"
        ]
      },
      "BusinessAppointmentSyncPage": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "snapshot"
              },
              "appointments": {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BusinessAppointmentSyncLive"
                    },
                    {
                      "$ref": "#/components/schemas/BusinessAppointmentSyncRemoved"
                    }
                  ]
                },
                "maxItems": 100
              },
              "nextCursor": {
                "type": "string",
                "format": "uuid"
              },
              "hasMore": {
                "type": "boolean"
              },
              "watermark": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "projectionEpoch": {
                "type": "string",
                "pattern": "^(?:[a-f0-9]{32}|[a-f0-9]{64})$",
                "description": "Opaque scope/authority identity. Do not parse it as a version or infer a hash algorithm."
              },
              "scopeId": {
                "type": "string",
                "pattern": "^(?:[a-f0-9]{32}|[a-f0-9]{64})$",
                "description": "Opaque scope/authority identity. Do not parse it as a version or infer a hash algorithm."
              }
            },
            "required": [
              "kind",
              "appointments",
              "nextCursor",
              "hasMore",
              "watermark",
              "projectionEpoch",
              "scopeId"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "changes"
              },
              "events": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BusinessAppointmentSyncEvent"
                },
                "maxItems": 100
              },
              "nextCursor": {
                "type": "string",
                "format": "uuid"
              },
              "hasMore": {
                "type": "boolean"
              },
              "watermark": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "projectionEpoch": {
                "type": "string",
                "pattern": "^(?:[a-f0-9]{32}|[a-f0-9]{64})$",
                "description": "Opaque scope/authority identity. Do not parse it as a version or infer a hash algorithm."
              },
              "scopeId": {
                "type": "string",
                "pattern": "^(?:[a-f0-9]{32}|[a-f0-9]{64})$",
                "description": "Opaque scope/authority identity. Do not parse it as a version or infer a hash algorithm."
              }
            },
            "required": [
              "kind",
              "events",
              "nextCursor",
              "hasMore",
              "watermark",
              "projectionEpoch",
              "scopeId"
            ]
          }
        ]
      },
      "BusinessAppointmentCheckpoint": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "cursor": {
                "type": "string",
                "format": "uuid"
              },
              "scopeId": {
                "type": "string",
                "pattern": "^(?:[a-f0-9]{32}|[a-f0-9]{64})$",
                "description": "Opaque scope/authority identity. Do not parse it as a version or infer a hash algorithm."
              },
              "sequence": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "projectionEpoch": {
                "type": "string",
                "pattern": "^(?:[a-f0-9]{32}|[a-f0-9]{64})$",
                "description": "Opaque scope/authority identity. Do not parse it as a version or infer a hash algorithm."
              },
              "appliedAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "operationId",
              "cursor",
              "scopeId",
              "sequence",
              "projectionEpoch",
              "appliedAt"
            ]
          },
          "currentProjectionEpoch": {
            "type": "string",
            "pattern": "^(?:[a-f0-9]{32}|[a-f0-9]{64})$",
            "description": "Opaque scope/authority identity. Do not parse it as a version or infer a hash algorithm."
          },
          "bootstrapRequired": {
            "type": "boolean"
          },
          "replayed": {
            "type": "boolean"
          },
          "unchanged": {
            "type": "boolean",
            "description": "True only for a successful current checkpoint confirmation that made no new durable receipt. Optional for compatibility."
          }
        },
        "required": [
          "receipt",
          "currentProjectionEpoch",
          "bootstrapRequired",
          "replayed"
        ],
        "description": "A validated new UUID for the already acknowledged identical cursor and sequence can return unchanged:true without creating another stored receipt or updating appliedAt. This confirms the current checkpoint; it does not durably reserve that new UUID. Previously accepted operation UUIDs are replayed or rejected for conflict first. Accepted checkpoint receipts are retained for at least 30 days and until their original cursor is no longer valid. An uncertain pending ACK must retain its original UUID and cursor; always honor currentProjectionEpoch and bootstrapRequired, including on replay."
      },
      "BusinessBookingPolicyVersion": {
        "type": "string",
        "pattern": "^bp:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:(?:0|[1-9][0-9]{0,18})$",
        "description": "Opaque physical settings-row identity and revision, capped at signed bigint. Preserve exactly; unrelated settings edits and no-ops do not bump it. A recreated row has a different UUID, even at revision zero."
      },
      "BusinessBookingPolicyValues": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 256,
            "description": "Business timezone. Use supportedValues.timezone for a changed value; existing values outside that menu remain readable."
          },
          "slotDurationMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Business default duration in minutes for new legacy fixed-slot appointments. Provider overrides and accepted service snapshots retain their own terms. Existing appointments keep their original end time."
          },
          "minBookingNoticeMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Minimum notice for a new customer booking. Use supportedValues when changing this value."
          },
          "minCancelNoticeMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Minimum notice for customer cancellation. Existing appointments stay in place; future authorized actions use current notice rules."
          },
          "openingHours": {
            "description": "Stored business weekly hours, preserved verbatim including legacy JSON-null. For a changed value send a complete WeeklyHours object: sunday through saturday; each day enabled, open/close HH:mm when enabled, optional breaks [{start,end}]. No overnight intervals, out-of-hours or overlapping breaks. Omit unchanged legacy hours. Provider overrides remain independent."
          },
          "requireBookingApproval": {
            "type": "boolean",
            "default": false,
            "description": "Per-business opt-in for new customer requests only. Existing statuses, snapshots and native/manual appointments are preserved. Approval/decline uses canonical commands; delivery is separate."
          },
          "customerAppointmentChanges": {
            "enum": [
              "self_service",
              "contact_business"
            ],
            "default": "self_service",
            "description": "contact_business refuses new customer bot/public change/cancel mutations with current contact guidance. Owner actions and explicit acceptance/refusal of alternative times stay available. Exact accepted receipt replay is preserved."
          },
          "bookingHorizonDays": {
            "type": "integer",
            "enum": [
              14,
              30,
              60,
              90
            ],
            "description": "Customer booking window in business-local calendar days, inclusive of today through today + this value. Shared by website and WhatsApp. Existing appointments and owner scheduling are preserved. May be absent in immutable receipts from before this capability was installed."
          }
        },
        "required": [
          "timezone",
          "slotDurationMinutes",
          "minBookingNoticeMinutes",
          "minCancelNoticeMinutes",
          "openingHours"
        ]
      },
      "BusinessBookingPolicyProposal": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 256,
            "description": "Business timezone. Use supportedValues.timezone for a changed value; existing values outside that menu remain readable."
          },
          "slotDurationMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Business default duration in minutes for new legacy fixed-slot appointments. Provider overrides and accepted service snapshots retain their own terms. Existing appointments keep their original end time."
          },
          "minBookingNoticeMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Minimum notice for a new customer booking. Use supportedValues when changing this value."
          },
          "minCancelNoticeMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Minimum notice for customer cancellation. Existing appointments stay in place; future authorized actions use current notice rules."
          },
          "openingHours": {
            "description": "Stored business weekly hours, preserved verbatim including legacy JSON-null. For a changed value send a complete WeeklyHours object: sunday through saturday; each day enabled, open/close HH:mm when enabled, optional breaks [{start,end}]. No overnight intervals, out-of-hours or overlapping breaks. Omit unchanged legacy hours. Provider overrides remain independent."
          },
          "requireBookingApproval": {
            "type": "boolean",
            "default": false,
            "description": "Per-business opt-in for new customer requests only. Existing statuses, snapshots and native/manual appointments are preserved. Approval/decline uses canonical commands; delivery is separate."
          },
          "customerAppointmentChanges": {
            "enum": [
              "self_service",
              "contact_business"
            ],
            "default": "self_service",
            "description": "contact_business refuses new customer bot/public change/cancel mutations with current contact guidance. Owner actions and explicit acceptance/refusal of alternative times stay available. Exact accepted receipt replay is preserved."
          },
          "bookingHorizonDays": {
            "type": "integer",
            "enum": [
              14,
              30,
              60,
              90
            ],
            "description": "Customer booking window in business-local calendar days, inclusive of today through today + this value. Shared by website and WhatsApp. Existing appointments and owner scheduling are preserved. May be absent in immutable receipts from before this capability was installed."
          }
        },
        "required": [],
        "minProperties": 1,
        "description": "Partial business policy. Send only edited fields. Changed scalar values must occur in the current supportedValues; unchanged legacy values can be preserved. No tenant, provider, rewrite, activation or messaging-consent fields."
      },
      "BusinessBookingPolicyState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "resourceId": {
            "const": "business"
          },
          "version": {
            "$ref": "#/components/schemas/BusinessBookingPolicyVersion"
          },
          "policy": {
            "$ref": "#/components/schemas/BusinessBookingPolicyValues"
          },
          "existingAppointmentsPreserved": {
            "type": "boolean",
            "const": true
          },
          "durationRewriteAvailable": {
            "type": "boolean",
            "const": false
          },
          "supportedValues": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "timezone": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "maxLength": 256
                }
              },
              "slotDurationMinutes": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "integer"
                }
              },
              "minBookingNoticeMinutes": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "integer"
                }
              },
              "minCancelNoticeMinutes": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "integer"
                }
              },
              "bookingHorizonDays": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "enum": [
                    14,
                    30,
                    60,
                    90
                  ]
                },
                "description": "Supported customer booking windows; use the current returned menu for an edited value. Absent on older deployments."
              }
            },
            "required": [
              "timezone",
              "slotDurationMinutes",
              "minBookingNoticeMinutes",
              "minCancelNoticeMinutes"
            ]
          }
        },
        "required": [
          "resourceId",
          "version",
          "policy",
          "existingAppointmentsPreserved",
          "durationRewriteAvailable",
          "supportedValues"
        ]
      },
      "BusinessBookingPolicyImpact": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "futureAppointmentCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Non-cancelled appointments ending after preview evaluation, including those already started. Bound: 10000; larger impact is refused instead of truncated."
          },
          "protectedSnapshotCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Physical non-null accepted snapshots; counted independently of current feature flags."
          },
          "outsideProposedHoursCount": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 10000,
            "description": "Appointments outside proposed business hours or their existing provider override. Null when the proposed timezone cannot be evaluated."
          },
          "newlyOutsideHoursCount": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 10000,
            "description": "Previously inside but outside after the proposal; null when either timezone is not evaluable."
          },
          "localStartDisplayChangedCount": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 10000,
            "description": "Appointments whose local start display changes with timezone. UTC instants and duration remain unchanged. Null when either timezone is not evaluable."
          },
          "legacyDurationKeptCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Future PENDING/CONFIRMED legacy rows inheriting the changed business duration. Their existing end times are kept."
          },
          "existingAppointmentsPreserved": {
            "type": "boolean",
            "const": true
          },
          "customerNoticeRulesChanged": {
            "type": "boolean"
          }
        },
        "required": [
          "futureAppointmentCount",
          "protectedSnapshotCount",
          "outsideProposedHoursCount",
          "newlyOutsideHoursCount",
          "localStartDisplayChangedCount",
          "legacyDurationKeptCount",
          "existingAppointmentsPreserved",
          "customerNoticeRulesChanged"
        ],
        "description": "Aggregate impact at preview/acceptance; no appointment, provider or customer identifiers. Later edits and bookings can change current impact normally."
      },
      "BusinessBookingPolicyPreviewRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "proposal": {
            "$ref": "#/components/schemas/BusinessBookingPolicyProposal"
          }
        },
        "required": [
          "proposal"
        ]
      },
      "BusinessBookingPolicyApplyRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          },
          "proposal": {
            "$ref": "#/components/schemas/BusinessBookingPolicyProposal"
          }
        },
        "required": [
          "previewId",
          "proposal"
        ]
      },
      "BusinessBookingPolicyPreview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedVersion": {
            "$ref": "#/components/schemas/BusinessBookingPolicyVersion"
          },
          "before": {
            "$ref": "#/components/schemas/BusinessBookingPolicyValues"
          },
          "after": {
            "$ref": "#/components/schemas/BusinessBookingPolicyValues"
          },
          "impact": {
            "$ref": "#/components/schemas/BusinessBookingPolicyImpact"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "existingAppointmentsPreserved": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "previewId",
          "expectedVersion",
          "before",
          "after",
          "impact",
          "expiresAt",
          "existingAppointmentsPreserved"
        ]
      },
      "BusinessBookingPolicyReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "const": "booking_policy_change"
          },
          "resourceId": {
            "const": "business"
          },
          "acceptedVersion": {
            "$ref": "#/components/schemas/BusinessBookingPolicyVersion"
          },
          "before": {
            "$ref": "#/components/schemas/BusinessBookingPolicyValues"
          },
          "after": {
            "$ref": "#/components/schemas/BusinessBookingPolicyValues"
          },
          "impact": {
            "$ref": "#/components/schemas/BusinessBookingPolicyImpact"
          },
          "changed": {
            "type": "boolean"
          },
          "existingAppointmentsPreserved": {
            "type": "boolean",
            "const": true
          }
        },
        "required": [
          "operationId",
          "action",
          "resourceId",
          "acceptedVersion",
          "before",
          "after",
          "impact",
          "changed",
          "existingAppointmentsPreserved"
        ]
      },
      "BusinessBookingPolicyResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessBookingPolicyReceipt"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessBookingPolicyState"
              },
              {
                "type": "null"
              }
            ],
            "description": "Fresh authorized state, separate from immutable acceptance. Null when the settings row no longer exists."
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "replayed"
        ]
      },
      "BusinessBookingPolicyOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessBookingPolicyReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessBookingPolicyState"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "replayed"
            ]
          }
        ]
      },
      "BusinessCustomerPhoneCorrection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "newPhone": {
            "type": "string",
            "pattern": "^\\+[1-9][0-9]{7,14}$",
            "description": "The reviewed replacement number in strict +E.164 format. This command does not establish possession or customer verification."
          }
        },
        "required": [
          "newPhone"
        ]
      },
      "ProviderDurationPolicyValues": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "openingHours": {
            "description": "Stored provider weekly hours. null inherits current business hours. An edited non-null value is a complete WeeklyHours object; omit unchanged legacy JSON."
          },
          "slotDurationMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Stored provider duration override. null means inheritance, not a copied business value. An explicit value equal to the business duration remains an override. Changed values use supportedValues."
          }
        },
        "required": [
          "openingHours",
          "slotDurationMinutes"
        ]
      },
      "ProviderDurationPolicyProposal": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "openingHours": {
            "description": "Stored provider weekly hours. null inherits current business hours. An edited non-null value is a complete WeeklyHours object; omit unchanged legacy JSON."
          },
          "slotDurationMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Stored provider duration override. null means inheritance, not a copied business value. An explicit value equal to the business duration remains an override. Changed values use supportedValues."
          }
        },
        "required": [],
        "minProperties": 1,
        "description": "Edited provider hours/duration only. No provider metadata, service links, tenant, activity or calendar grant fields."
      },
      "BusinessDurationPolicyValues": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 256,
            "description": "Business timezone. Use supportedValues.timezone for a changed value; existing values outside that menu remain readable."
          },
          "slotDurationMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Business duration for new legacy appointments; this duration contract requires explicit keep_existing or rewrite_eligible at apply. Provider overrides and accepted snapshots remain protected."
          },
          "minBookingNoticeMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Minimum notice for a new customer booking. Use supportedValues when changing this value."
          },
          "minCancelNoticeMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Minimum notice for customer cancellation. Existing appointments stay in place; future authorized actions use current notice rules."
          },
          "openingHours": {
            "description": "Stored business weekly hours, preserved verbatim including legacy JSON-null. For a changed value send a complete WeeklyHours object: sunday through saturday; each day enabled, open/close HH:mm when enabled, optional breaks [{start,end}]. No overnight intervals, out-of-hours or overlapping breaks. Omit unchanged legacy hours. Provider overrides remain independent."
          },
          "requireBookingApproval": {
            "type": "boolean",
            "default": false,
            "description": "Per-business opt-in for new customer requests only. Existing statuses, snapshots and native/manual appointments are preserved. Approval/decline uses canonical commands; delivery is separate."
          },
          "customerAppointmentChanges": {
            "enum": [
              "self_service",
              "contact_business"
            ],
            "default": "self_service",
            "description": "contact_business refuses new customer bot/public change/cancel mutations with current contact guidance. Owner actions and explicit acceptance/refusal of alternative times stay available. Exact accepted receipt replay is preserved."
          },
          "bookingHorizonDays": {
            "type": "integer",
            "enum": [
              14,
              30,
              60,
              90
            ],
            "description": "Customer booking window in business-local calendar days, inclusive of today through today + this value. Shared by website and WhatsApp. Existing appointments and owner scheduling are preserved. May be absent in immutable receipts from before this capability was installed."
          }
        },
        "required": [
          "timezone",
          "slotDurationMinutes",
          "minBookingNoticeMinutes",
          "minCancelNoticeMinutes",
          "openingHours"
        ]
      },
      "BusinessDurationPolicyProposal": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 256,
            "description": "Business timezone. Use supportedValues.timezone for a changed value; existing values outside that menu remain readable."
          },
          "slotDurationMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Business duration for new legacy appointments; this duration contract requires explicit keep_existing or rewrite_eligible at apply. Provider overrides and accepted snapshots remain protected."
          },
          "minBookingNoticeMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Minimum notice for a new customer booking. Use supportedValues when changing this value."
          },
          "minCancelNoticeMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Minimum notice for customer cancellation. Existing appointments stay in place; future authorized actions use current notice rules."
          },
          "openingHours": {
            "description": "Stored business weekly hours, preserved verbatim including legacy JSON-null. For a changed value send a complete WeeklyHours object: sunday through saturday; each day enabled, open/close HH:mm when enabled, optional breaks [{start,end}]. No overnight intervals, out-of-hours or overlapping breaks. Omit unchanged legacy hours. Provider overrides remain independent."
          },
          "requireBookingApproval": {
            "type": "boolean",
            "default": false,
            "description": "Per-business opt-in for new customer requests only. Existing statuses, snapshots and native/manual appointments are preserved. Approval/decline uses canonical commands; delivery is separate."
          },
          "customerAppointmentChanges": {
            "enum": [
              "self_service",
              "contact_business"
            ],
            "default": "self_service",
            "description": "contact_business refuses new customer bot/public change/cancel mutations with current contact guidance. Owner actions and explicit acceptance/refusal of alternative times stay available. Exact accepted receipt replay is preserved."
          },
          "bookingHorizonDays": {
            "type": "integer",
            "enum": [
              14,
              30,
              60,
              90
            ],
            "description": "Customer booking window in business-local calendar days, inclusive of today through today + this value. Shared by website and WhatsApp. Existing appointments and owner scheduling are preserved. May be absent in immutable receipts from before this capability was installed."
          }
        },
        "required": [],
        "minProperties": 1,
        "description": "Send only edited business policy fields. Changed scalars use current supportedValues; unchanged legacy values remain readable. No authority, activation or messaging fields."
      },
      "ProviderDurationPolicyVersion": {
        "type": "string",
        "pattern": "^dp:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}:[0-9a-f]{64}$",
        "description": "Opaque physical provider policy identity plus current dependencies. Business settings and service-link changes can invalidate it. Preserve exactly; it is not the provider resource UUID or a schedule/calendar version."
      },
      "BusinessDurationPolicyBusinessState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "resourceId": {
            "const": "business"
          },
          "version": {
            "$ref": "#/components/schemas/BusinessBookingPolicyVersion"
          },
          "policy": {
            "$ref": "#/components/schemas/BusinessDurationPolicyValues"
          },
          "effectiveMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "effectiveOpeningHours": {
            "description": "Current effective stored weekly hours; provider null resolves to the business value."
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 256
          },
          "editor": {
            "type": "null"
          },
          "parentPolicy": {
            "type": "null"
          },
          "supportedValues": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "timezone": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "maxLength": 256
                }
              },
              "slotDurationMinutes": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "integer"
                }
              },
              "minBookingNoticeMinutes": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "integer"
                }
              },
              "minCancelNoticeMinutes": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "integer"
                }
              },
              "bookingHorizonDays": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "enum": [
                    14,
                    30,
                    60,
                    90
                  ]
                },
                "description": "Supported customer booking windows; use the current returned menu for an edited value. Absent on older deployments."
              }
            },
            "required": [
              "timezone",
              "slotDurationMinutes",
              "minBookingNoticeMinutes",
              "minCancelNoticeMinutes"
            ]
          }
        },
        "required": [
          "resourceId",
          "version",
          "policy",
          "effectiveMinutes",
          "effectiveOpeningHours",
          "timezone",
          "editor",
          "parentPolicy",
          "supportedValues"
        ]
      },
      "BusinessDurationPolicyProviderState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "resourceId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "$ref": "#/components/schemas/ProviderDurationPolicyVersion"
          },
          "policy": {
            "$ref": "#/components/schemas/ProviderDurationPolicyValues"
          },
          "effectiveMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "effectiveOpeningHours": {
            "description": "Current effective stored weekly hours; provider null resolves to the business value."
          },
          "timezone": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 256
          },
          "editor": {
            "type": "null"
          },
          "parentPolicy": {
            "$ref": "#/components/schemas/ProviderDurationPolicyValues"
          },
          "supportedValues": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "timezone": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "maxLength": 256
                }
              },
              "slotDurationMinutes": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "integer"
                }
              },
              "minBookingNoticeMinutes": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "integer"
                }
              },
              "minCancelNoticeMinutes": {
                "type": "array",
                "minItems": 1,
                "maxItems": 100,
                "uniqueItems": true,
                "items": {
                  "type": "integer"
                }
              },
              "bookingHorizonDays": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "enum": [
                    14,
                    30,
                    60,
                    90
                  ]
                },
                "description": "Supported customer booking windows; use the current returned menu for an edited value. Absent on older deployments."
              }
            },
            "required": [
              "timezone",
              "slotDurationMinutes",
              "minBookingNoticeMinutes",
              "minCancelNoticeMinutes"
            ]
          }
        },
        "required": [
          "resourceId",
          "version",
          "policy",
          "effectiveMinutes",
          "effectiveOpeningHours",
          "timezone",
          "editor",
          "parentPolicy",
          "supportedValues"
        ]
      },
      "BusinessDurationPolicyState": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/BusinessDurationPolicyBusinessState"
          },
          {
            "$ref": "#/components/schemas/BusinessDurationPolicyProviderState"
          }
        ],
        "description": "Current authorized policy, effective inheritance and reviewed parent from the same observation. Management never exposes the native provider editor."
      },
      "BusinessDurationPolicyImpact": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "eligible": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Future CONFIRMED/PENDING snapshot-null candidates in the selected resource scope. eligible = rewritable + conflict + unchanged."
          },
          "rewritable": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Exact reviewed end changes passing accepted-start capacity/hours checks; atomic rewrite accepts at most 1,000 changes."
          },
          "conflict": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Eligible intervals whose proposed end cannot safely change. They remain untouched."
          },
          "protected": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Accepted snapshots and current service-specific durations remain protected; a business-wide rewrite also protects explicit provider duration overrides."
          },
          "unchanged": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Eligible rows requiring no end change; no artificial revision is created."
          }
        },
        "required": [
          "eligible",
          "rewritable",
          "conflict",
          "protected",
          "unchanged"
        ],
        "description": "Aggregate counts only. No customer/appointment identities, physical versions or private fingerprint. Existing starts, prices, resource binding and accepted snapshots remain unchanged."
      },
      "BusinessDurationPolicyBusinessPreview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          },
          "resourceId": {
            "const": "business"
          },
          "expectedVersion": {
            "$ref": "#/components/schemas/BusinessBookingPolicyVersion"
          },
          "before": {
            "$ref": "#/components/schemas/BusinessDurationPolicyValues"
          },
          "after": {
            "$ref": "#/components/schemas/BusinessDurationPolicyValues"
          },
          "effectiveMinutesBefore": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "effectiveMinutesAfter": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "impact": {
            "$ref": "#/components/schemas/BusinessDurationPolicyImpact"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "editorBefore": {
            "type": "null"
          },
          "editorAfter": {
            "type": "null"
          }
        },
        "required": [
          "previewId",
          "resourceId",
          "expectedVersion",
          "before",
          "after",
          "effectiveMinutesBefore",
          "effectiveMinutesAfter",
          "impact",
          "expiresAt",
          "editorBefore",
          "editorAfter"
        ]
      },
      "BusinessDurationPolicyProviderPreview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          },
          "resourceId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedVersion": {
            "$ref": "#/components/schemas/ProviderDurationPolicyVersion"
          },
          "before": {
            "$ref": "#/components/schemas/ProviderDurationPolicyValues"
          },
          "after": {
            "$ref": "#/components/schemas/ProviderDurationPolicyValues"
          },
          "effectiveMinutesBefore": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "effectiveMinutesAfter": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "impact": {
            "$ref": "#/components/schemas/BusinessDurationPolicyImpact"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "editorBefore": {
            "type": "null"
          },
          "editorAfter": {
            "type": "null"
          }
        },
        "required": [
          "previewId",
          "resourceId",
          "expectedVersion",
          "before",
          "after",
          "effectiveMinutesBefore",
          "effectiveMinutesAfter",
          "impact",
          "expiresAt",
          "editorBefore",
          "editorAfter"
        ]
      },
      "BusinessDurationPolicyMode": {
        "enum": [
          "keep_existing",
          "rewrite_eligible"
        ],
        "description": "Explicit choice after impact review. keep_existing changes settings only; rewrite_eligible additionally changes exactly the reviewed safe legacy ends, atomically and silently. It requires booking-duration:rewrite. No automatic follow-up batches."
      },
      "BusinessDurationPolicyPreviewRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "proposal": {
            "$ref": "#/components/schemas/BusinessDurationPolicyProposal"
          }
        },
        "required": [
          "proposal"
        ]
      },
      "ProviderDurationPolicyPreviewRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "proposal": {
            "$ref": "#/components/schemas/ProviderDurationPolicyProposal"
          }
        },
        "required": [
          "proposal"
        ]
      },
      "BusinessDurationPolicyApplyRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          },
          "proposal": {
            "$ref": "#/components/schemas/BusinessDurationPolicyProposal"
          },
          "mode": {
            "$ref": "#/components/schemas/BusinessDurationPolicyMode"
          }
        },
        "required": [
          "previewId",
          "proposal",
          "mode"
        ]
      },
      "ProviderDurationPolicyApplyRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          },
          "proposal": {
            "$ref": "#/components/schemas/ProviderDurationPolicyProposal"
          },
          "mode": {
            "$ref": "#/components/schemas/BusinessDurationPolicyMode"
          }
        },
        "required": [
          "previewId",
          "proposal",
          "mode"
        ]
      },
      "BusinessDurationPolicyBusinessReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "const": "duration_policy_change"
          },
          "resourceId": {
            "const": "business"
          },
          "acceptedVersion": {
            "$ref": "#/components/schemas/BusinessBookingPolicyVersion"
          },
          "mode": {
            "$ref": "#/components/schemas/BusinessDurationPolicyMode"
          },
          "before": {
            "$ref": "#/components/schemas/BusinessDurationPolicyValues"
          },
          "after": {
            "$ref": "#/components/schemas/BusinessDurationPolicyValues"
          },
          "effectiveMinutesBefore": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "effectiveMinutesAfter": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "impact": {
            "$ref": "#/components/schemas/BusinessDurationPolicyImpact"
          },
          "changed": {
            "type": "boolean"
          },
          "editorChanged": {
            "const": false
          },
          "updatedCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "existingAppointmentsPreserved": {
            "type": "boolean"
          }
        },
        "required": [
          "operationId",
          "action",
          "resourceId",
          "acceptedVersion",
          "mode",
          "before",
          "after",
          "effectiveMinutesBefore",
          "effectiveMinutesAfter",
          "impact",
          "changed",
          "editorChanged",
          "updatedCount",
          "existingAppointmentsPreserved"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "mode": {
                  "const": "keep_existing"
                }
              }
            },
            "then": {
              "properties": {
                "updatedCount": {
                  "const": 0
                },
                "existingAppointmentsPreserved": {
                  "const": true
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "updatedCount": {
                  "const": 0
                }
              }
            },
            "then": {
              "properties": {
                "existingAppointmentsPreserved": {
                  "const": true
                }
              }
            },
            "else": {
              "properties": {
                "existingAppointmentsPreserved": {
                  "const": false
                }
              }
            }
          }
        ]
      },
      "BusinessDurationPolicyProviderReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "const": "duration_policy_change"
          },
          "resourceId": {
            "type": "string",
            "format": "uuid"
          },
          "acceptedVersion": {
            "$ref": "#/components/schemas/ProviderDurationPolicyVersion"
          },
          "mode": {
            "$ref": "#/components/schemas/BusinessDurationPolicyMode"
          },
          "before": {
            "$ref": "#/components/schemas/ProviderDurationPolicyValues"
          },
          "after": {
            "$ref": "#/components/schemas/ProviderDurationPolicyValues"
          },
          "effectiveMinutesBefore": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "effectiveMinutesAfter": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "impact": {
            "$ref": "#/components/schemas/BusinessDurationPolicyImpact"
          },
          "changed": {
            "type": "boolean"
          },
          "editorChanged": {
            "const": false
          },
          "updatedCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "existingAppointmentsPreserved": {
            "type": "boolean"
          }
        },
        "required": [
          "operationId",
          "action",
          "resourceId",
          "acceptedVersion",
          "mode",
          "before",
          "after",
          "effectiveMinutesBefore",
          "effectiveMinutesAfter",
          "impact",
          "changed",
          "editorChanged",
          "updatedCount",
          "existingAppointmentsPreserved"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "mode": {
                  "const": "keep_existing"
                }
              }
            },
            "then": {
              "properties": {
                "updatedCount": {
                  "const": 0
                },
                "existingAppointmentsPreserved": {
                  "const": true
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "updatedCount": {
                  "const": 0
                }
              }
            },
            "then": {
              "properties": {
                "existingAppointmentsPreserved": {
                  "const": true
                }
              }
            },
            "else": {
              "properties": {
                "existingAppointmentsPreserved": {
                  "const": false
                }
              }
            }
          }
        ]
      },
      "BusinessDurationPolicyReceipt": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/BusinessDurationPolicyBusinessReceipt"
          },
          {
            "$ref": "#/components/schemas/BusinessDurationPolicyProviderReceipt"
          }
        ],
        "description": "Immutable acceptance. updatedCount is actual committed end changes; existingAppointmentsPreserved is true iff no ends changed. This is separate from the fresh current policy."
      },
      "BusinessDurationPolicyResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessDurationPolicyReceipt"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessDurationPolicyState"
              },
              {
                "type": "null"
              }
            ],
            "description": "Fresh current authorized policy, possibly newer than acceptance. Null if the resource was deleted; the immutable receipt remains."
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "replayed"
        ]
      },
      "BusinessDurationPolicyOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessDurationPolicyReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessDurationPolicyState"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Fresh current authorized policy, possibly newer than acceptance. Null if the resource was deleted; the immutable receipt remains."
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "replayed"
            ]
          }
        ]
      },
      "BusinessServiceVersion": {
        "type": "string",
        "pattern": "^svc:[0-9a-f-]{36}:(0|[1-9][0-9]{0,18})$",
        "description": "Opaque physical service identity and material revision. Retain the returned value; it is not the serviceId."
      },
      "BusinessServiceCatalogueVersion": {
        "type": "string",
        "pattern": "^scat:[0-9a-f]{64}$",
        "description": "Opaque hash of the exact complete current service order. Names/prices can change without changing this order version."
      },
      "BusinessServiceName": {
        "type": "object",
        "additionalProperties": {
          "type": "string"
        },
        "description": "Stored localized strings. When editing, include at least one nonblank he/ar/en name; managed validators normalize supported fallback keys. Omit an unedited legacy name."
      },
      "BusinessService": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "serviceId": {
            "type": "string",
            "format": "uuid"
          },
          "serviceVersion": {
            "$ref": "#/components/schemas/BusinessServiceVersion"
          },
          "mode": {
            "enum": [
              "legacy",
              "service_duration"
            ]
          },
          "name": {
            "$ref": "#/components/schemas/BusinessServiceName"
          },
          "description": {
            "description": "Stored service description JSON; null and legacy JSON remain readable."
          },
          "priceMajor": {
            "type": [
              "number",
              "null"
            ],
            "description": "Current catalogue price in major units. Nullable legacy price is retained; this is not a booking quote or minor units."
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10000,
            "description": "Stored currency label, including legacy/custom labels and ₪. No inferred ISO currency."
          },
          "isActive": {
            "type": "boolean"
          },
          "displayOrder": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "legacyDurationMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "readOnly": true,
            "description": "Historical duration field, not edited by this contract."
          },
          "bookingDurationMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "removalDurationMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647
          },
          "removalPriceMajor": {
            "type": [
              "number",
              "null"
            ]
          },
          "publication": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "selected": {
                "type": "boolean"
              },
              "eligible": {
                "type": "boolean"
              }
            },
            "required": [
              "selected",
              "eligible"
            ],
            "description": "Current public selection and eligibility, not publication permission. Catalogue creation/activity never automatically selects a public service."
          },
          "deleteBlockers": {
            "type": "array",
            "items": {
              "enum": [
                "appointments_exist",
                "provider_assignment_would_expand"
              ]
            },
            "maxItems": 2,
            "uniqueItems": true,
            "description": "Advisory current blockers; delete rechecks under serialization. Deactivation remains available."
          },
          "priceRangeMajor": {
            "$ref": "#/components/schemas/MajorPriceRange"
          }
        },
        "required": [
          "serviceId",
          "serviceVersion",
          "mode",
          "name",
          "description",
          "priceMajor",
          "currency",
          "isActive",
          "displayOrder",
          "legacyDurationMinutes",
          "bookingDurationMinutes",
          "removalDurationMinutes",
          "removalPriceMajor",
          "publication",
          "deleteBlockers"
        ],
        "allOf": [
          {
            "if": {
              "required": [
                "priceRangeMajor"
              ],
              "properties": {
                "priceRangeMajor": {
                  "type": "object"
                }
              }
            },
            "then": {
              "properties": {
                "priceMajor": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessServiceChanges": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "$ref": "#/components/schemas/BusinessServiceName"
          },
          "description": {
            "description": "Edited description JSON, or null."
          },
          "priceMajor": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 99999999.99,
            "description": "Exact major-unit amount with at most two decimal places. HALA service-duration pricing may be null for a range or for a price decided at the visit. A numeric amount selects a fixed price and clears an existing range; zero is explicit and distinct from null."
          },
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 10000,
            "description": "Legacy mode accepts nullable stored labels. Managed final state requires a nonblank label of1–8 characters."
          },
          "isActive": {
            "type": "boolean"
          },
          "bookingDurationMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 480,
            "description": "Managed final duration1–480 minutes. Legacy mode keeps this null; no in-place conversion."
          },
          "removalDurationMinutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 240,
            "description": "Managed removal duration and price are both null or both present; total duration at most480. Legacy mode keeps both null."
          },
          "removalPriceMajor": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 99999999.99,
            "description": "Major units, at most two decimal places; paired with removalDurationMinutes."
          },
          "priceRangeMajor": {
            "$ref": "#/components/schemas/ServicePriceRange"
          }
        },
        "required": [],
        "minProperties": 1,
        "description": "Only edited fields. No IDs, tenant, version, display order, public selection or legacyDurationMinutes. Changing service terms affects future quotes; accepted bookings/snapshots remain unchanged.",
        "allOf": [
          {
            "if": {
              "required": [
                "priceRangeMajor"
              ],
              "properties": {
                "priceRangeMajor": {
                  "type": "object"
                }
              }
            },
            "then": {
              "properties": {
                "priceMajor": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessServiceCreateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "enum": [
              "legacy",
              "service_duration"
            ],
            "description": "Explicit creation mode. Managed creation requires the existing configured service-duration capability; no enrollment or legacy conversion."
          },
          "changes": {
            "allOf": [
              {
                "$ref": "#/components/schemas/BusinessServiceChanges"
              },
              {
                "required": [
                  "name",
                  "priceMajor",
                  "isActive"
                ]
              }
            ]
          }
        },
        "required": [
          "mode",
          "changes"
        ],
        "description": "New catalogue service. Description defaults null; omitted currency uses the incumbent ₪ label. Managed create also requires bookingDurationMinutes."
      },
      "BusinessServiceUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "changes": {
            "$ref": "#/components/schemas/BusinessServiceChanges"
          }
        },
        "required": [
          "changes"
        ]
      },
      "BusinessServiceReorderRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "orderedIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 1000,
            "uniqueItems": true,
            "description": "Every current catalogue service exactly once, including inactive and legacy entries. Never send only a filtered view."
          }
        },
        "required": [
          "orderedIds"
        ]
      },
      "BusinessServiceCatalogue": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "catalogueVersion": {
            "$ref": "#/components/schemas/BusinessServiceCatalogueVersion"
          },
          "items": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/BusinessService"
            }
          },
          "managedServiceCreationAvailable": {
            "type": "boolean"
          }
        },
        "required": [
          "catalogueVersion",
          "items",
          "managedServiceCreationAvailable"
        ],
        "description": "Complete current tenant catalogue in display-order/id order. More than1000 items returns CATALOGUE_TOO_LARGE, never a truncated reorderable list."
      },
      "BusinessServiceCatalogueReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "enum": [
              "create",
              "update",
              "delete",
              "reorder"
            ]
          },
          "serviceId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "acceptedVersion": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessServiceVersion"
              },
              {
                "$ref": "#/components/schemas/BusinessServiceCatalogueVersion"
              }
            ]
          },
          "changed": {
            "type": "boolean"
          },
          "before": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessService"
              },
              {
                "type": "null"
              }
            ]
          },
          "after": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessService"
              },
              {
                "type": "null"
              }
            ]
          },
          "orderedIds": {
            "anyOf": [
              {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                },
                "maxItems": 1000,
                "uniqueItems": true
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "operationId",
          "action",
          "serviceId",
          "acceptedVersion",
          "changed",
          "before",
          "after",
          "orderedIds"
        ],
        "description": "Immutable acceptance. Reorder has null serviceId/before/after and exact accepted orderedIds/catalogue version. Delete keeps before/prior service version with after null. Other actions have null orderedIds."
      },
      "BusinessServiceCatalogueResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessServiceCatalogueReceipt"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessService"
              },
              {
                "type": "null"
              }
            ]
          },
          "catalogueVersion": {
            "$ref": "#/components/schemas/BusinessServiceCatalogueVersion"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "catalogueVersion",
          "replayed"
        ],
        "description": "Receipt is immutable; current is freshly authorized state and may be newer or null after deletion. Current is null for reorder/delete. Replay never recreates a deleted service."
      },
      "BusinessServiceCatalogueOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessServiceCatalogueReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessService"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "catalogueVersion": {
                "$ref": "#/components/schemas/BusinessServiceCatalogueVersion"
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "catalogueVersion",
              "replayed"
            ]
          }
        ]
      },
      "BusinessPublicPresentation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "location": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "he": {
                "type": "string",
                "maxLength": 300,
                "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
              },
              "ar": {
                "type": "string",
                "maxLength": 300,
                "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
              },
              "en": {
                "type": "string",
                "maxLength": 300,
                "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
              }
            },
            "required": []
          },
          "contactPhone": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\+[1-9][0-9]{7,14}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "websiteUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri",
                "pattern": "^https://",
                "minLength": 1,
                "maxLength": 2048,
                "description": "Canonical backend public-HTTPS validation additionally rejects whitespace, credentials, backslashes, private/internal host syntax and unsupported ports. URL references only; no uploads."
              },
              {
                "type": "null"
              }
            ]
          },
          "imageUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri",
                "pattern": "^https://",
                "minLength": 1,
                "maxLength": 2048,
                "description": "Canonical backend public-HTTPS validation additionally rejects whitespace, credentials, backslashes, private/internal host syntax and unsupported ports. URL references only; no uploads."
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceImages": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "serviceId": {
                  "type": "string",
                  "format": "uuid"
                },
                "imageUrl": {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^https://",
                  "minLength": 1,
                  "maxLength": 2048,
                  "description": "Canonical backend public-HTTPS validation additionally rejects whitespace, credentials, backslashes, private/internal host syntax and unsupported ports. URL references only; no uploads."
                }
              },
              "required": [
                "serviceId",
                "imageUrl"
              ]
            },
            "description": "Unique service identity, including case-insensitive UUID equivalence; every service must currently belong to this business."
          }
        },
        "required": [
          "location",
          "contactPhone",
          "websiteUrl",
          "imageUrl",
          "serviceImages"
        ],
        "description": "Explicitly public fields only. Replacement must send every field; use null/empty objects/arrays to clear. Private tenant/profile metadata is never copied automatically."
      },
      "BusinessPublicationState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "serviceIds": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "services": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "serviceId": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "$ref": "#/components/schemas/Text"
                },
                "eligible": {
                  "type": "boolean"
                }
              },
              "required": [
                "serviceId",
                "name",
                "eligible"
              ]
            }
          },
          "truncated": {
            "const": false
          }
        },
        "required": [
          "version",
          "serviceIds",
          "services",
          "truncated"
        ],
        "description": "Complete bounded owner-reviewed publication options. More than1,000 tenant services refuses CATALOGUE_TOO_LARGE; no partial editable list. Selected IDs are a canonical unique set of at most100, independent of catalogue order. Eligibility is current; a selected service can later become ineligible."
      },
      "BusinessPresentationState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "presentation": {
            "$ref": "#/components/schemas/BusinessPublicPresentation"
          }
        },
        "required": [
          "version",
          "presentation"
        ]
      },
      "BusinessPublicationReplaceRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "serviceIds": {
            "type": "array",
            "maxItems": 100,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        },
        "required": [
          "serviceIds"
        ],
        "description": "Full replacement set; [] explicitly removes every selection. The normal8KiB JSON request limit applies. UUID case aliases are duplicates."
      },
      "BusinessPresentationReplaceRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "presentation": {
            "$ref": "#/components/schemas/BusinessPublicPresentation"
          }
        },
        "required": [
          "presentation"
        ],
        "description": "Full explicit replacement. This authenticated route alone accepts at most1MiB streamed JSON, not image uploads. All URL and service-reference validation remains server authoritative."
      },
      "BusinessPublicationResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "state": {
                "$ref": "#/components/schemas/BusinessPublicationState"
              }
            },
            "required": [
              "operationId",
              "state"
            ],
            "description": "Immutable accepted state for the original UUID."
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessPublicationState"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "enum": [
              null,
              "catalogue_too_large"
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "description": "Current is freshly authorized and may differ from the immutable receipt after later edits or service cleanup. Accepted exact replay precedes fresh CAS/eligibility; current permission remains required.",
        "oneOf": [
          {
            "properties": {
              "current": {
                "$ref": "#/components/schemas/BusinessPublicationState"
              },
              "currentUnavailableReason": {
                "type": "null"
              }
            }
          },
          {
            "properties": {
              "current": {
                "type": "null"
              },
              "currentUnavailableReason": {
                "const": "catalogue_too_large"
              }
            }
          }
        ]
      },
      "BusinessPublicationOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "operationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "state": {
                    "$ref": "#/components/schemas/BusinessPublicationState"
                  }
                },
                "required": [
                  "operationId",
                  "state"
                ],
                "description": "Immutable accepted state for the original UUID."
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessPublicationState"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currentUnavailableReason": {
                "enum": [
                  null,
                  "catalogue_too_large"
                ]
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "currentUnavailableReason",
              "replayed"
            ],
            "oneOf": [
              {
                "properties": {
                  "current": {
                    "$ref": "#/components/schemas/BusinessPublicationState"
                  },
                  "currentUnavailableReason": {
                    "type": "null"
                  }
                }
              },
              {
                "properties": {
                  "current": {
                    "type": "null"
                  },
                  "currentUnavailableReason": {
                    "const": "catalogue_too_large"
                  }
                }
              }
            ]
          }
        ],
        "description": "Read-only lookup under current read+write authority in the original integration/resource namespace. not_found means no accepted operation was found; preserve the original request and UUID, never auto-create another intent."
      },
      "BusinessPresentationResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "state": {
                "$ref": "#/components/schemas/BusinessPresentationState"
              }
            },
            "required": [
              "operationId",
              "state"
            ],
            "description": "Immutable accepted state for the original UUID."
          },
          "current": {
            "$ref": "#/components/schemas/BusinessPresentationState"
          },
          "currentUnavailableReason": {
            "type": "null"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "description": "Current is freshly authorized and may differ from the immutable receipt after later edits or service cleanup. Accepted exact replay precedes fresh CAS/eligibility; current permission remains required."
      },
      "BusinessPresentationOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "operationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "state": {
                    "$ref": "#/components/schemas/BusinessPresentationState"
                  }
                },
                "required": [
                  "operationId",
                  "state"
                ],
                "description": "Immutable accepted state for the original UUID."
              },
              "current": {
                "$ref": "#/components/schemas/BusinessPresentationState"
              },
              "currentUnavailableReason": {
                "type": "null"
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "currentUnavailableReason",
              "replayed"
            ]
          }
        ],
        "description": "Read-only lookup under current read+write authority in the original integration/resource namespace. not_found means no accepted operation was found; preserve the original request and UUID, never auto-create another intent."
      },
      "BusinessReportPeriod": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "startAt",
          "endAt"
        ]
      },
      "BusinessReportsOverview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "type": "string",
            "format": "date-time"
          },
          "timezone": {
            "type": "string",
            "minLength": 1
          },
          "dayKey": {
            "type": "string",
            "format": "date"
          },
          "weekKey": {
            "type": "string",
            "format": "date"
          },
          "periods": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "today": {
                "$ref": "#/components/schemas/BusinessReportPeriod"
              },
              "week": {
                "$ref": "#/components/schemas/BusinessReportPeriod"
              },
              "tomorrow": {
                "$ref": "#/components/schemas/BusinessReportPeriod"
              }
            },
            "required": [
              "today",
              "week",
              "tomorrow"
            ]
          },
          "counts": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "today": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Appointments starting today with non-null status other than CANCELLED."
              },
              "week": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Appointments starting in the current Sunday-based business week with non-null status other than CANCELLED."
              },
              "remainingToday": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Today appointments starting strictly after asOf with status PENDING, CONFIRMED or NOW."
              },
              "tomorrow": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991,
                "description": "Appointments starting tomorrow with non-null status other than CANCELLED."
              }
            },
            "required": [
              "today",
              "week",
              "remainingToday",
              "tomorrow"
            ]
          },
          "tomorrowFirstStartAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Earliest non-CANCELLED appointment start tomorrow; null exactly when tomorrow count is zero."
          }
        },
        "required": [
          "asOf",
          "timezone",
          "dayKey",
          "weekKey",
          "periods",
          "counts",
          "tomorrowFirstStartAt"
        ],
        "description": "One current database observation for the whole business. Business-local dates, Sunday week and half-open [startAt,endAt) periods; daylight-saving days need not last24hours. Counts include all providers and unassigned appointments. No financial totals or customer details."
      },
      "ProviderLoginRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string",
            "minLength": 1,
            "description": "Trimmed and lowercased before use; normalized value must have one @, no whitespace/control characters and at most 320 Unicode code points. Auth validates account eligibility. No existing account is adopted by email."
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "pattern": "^[^\\u0000]*$",
            "writeOnly": true,
            "description": "Exact password, not trimmed. Auth password policy remains authoritative. Never save it in browser storage, logs, receipts or retry queues; keep it in memory only for an explicit request."
          },
          "fullName": {
            "type": "string",
            "pattern": "^[^\\u0000]*$",
            "description": "Optional display name. Trimmed value has at most 200 Unicode code points; omitted or blank becomes Provider. No role or tenant authority is derived from this name."
          }
        },
        "required": [
          "email",
          "password"
        ]
      },
      "ProviderLoginReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "providerId": {
            "type": "string",
            "format": "uuid"
          },
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "email": {
            "type": "string",
            "minLength": 1,
            "maxLength": 320
          },
          "role": {
            "const": "provider"
          },
          "acceptedVersion": {
            "$ref": "#/components/schemas/BusinessProviderVersion"
          }
        },
        "required": [
          "operationId",
          "providerId",
          "userId",
          "email",
          "role",
          "acceptedVersion"
        ]
      },
      "ProviderLoginResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "providerId": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "enum": [
              "pending",
              "accepted",
              "rejected"
            ]
          },
          "cause": {
            "enum": [
              null,
              "auth_not_observed",
              "auth_request_uncertain",
              "auth_request_rejected",
              "auth_identity_mismatch",
              "provider_not_found",
              "provider_changed",
              "already_linked",
              "account_already_linked",
              "auth_cleanup_pending"
            ]
          },
          "reviewRequired": {
            "type": "boolean"
          },
          "receipt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProviderLoginReceipt"
              },
              {
                "type": "null"
              }
            ]
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessProviderState"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "enum": [
              null,
              "provider_not_found"
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "operationId",
          "providerId",
          "state",
          "cause",
          "reviewRequired",
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "allOf": [
          {
            "oneOf": [
              {
                "properties": {
                  "state": {
                    "const": "accepted"
                  },
                  "cause": {
                    "type": "null"
                  },
                  "reviewRequired": {
                    "const": false
                  },
                  "receipt": {
                    "$ref": "#/components/schemas/ProviderLoginReceipt"
                  }
                }
              },
              {
                "properties": {
                  "state": {
                    "const": "pending"
                  },
                  "cause": {
                    "enum": [
                      "auth_not_observed",
                      "auth_request_uncertain",
                      "auth_request_rejected",
                      "auth_identity_mismatch",
                      "provider_not_found",
                      "provider_changed",
                      "already_linked",
                      "account_already_linked",
                      "auth_cleanup_pending"
                    ]
                  },
                  "receipt": {
                    "type": "null"
                  }
                }
              },
              {
                "properties": {
                  "state": {
                    "const": "rejected"
                  },
                  "cause": {
                    "const": "auth_request_rejected"
                  },
                  "reviewRequired": {
                    "const": false
                  },
                  "receipt": {
                    "type": "null"
                  }
                }
              }
            ]
          },
          {
            "oneOf": [
              {
                "properties": {
                  "current": {
                    "$ref": "#/components/schemas/BusinessProviderState"
                  },
                  "currentUnavailableReason": {
                    "type": "null"
                  }
                }
              },
              {
                "properties": {
                  "current": {
                    "type": "null"
                  },
                  "currentUnavailableReason": {
                    "const": "provider_not_found"
                  }
                }
              }
            ]
          }
        ],
        "description": "Accepted has an immutable receipt; current is separate and may have advanced. Pending is unresolved, never a rollback claim. Only rejected is a durable terminal refusal permitting corrected credentials with a new operation. No password or private Auth provenance is returned."
      },
      "ProviderLoginOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "$ref": "#/components/schemas/ProviderLoginResult"
          }
        ]
      },
      "OwnerSetupContinuation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "version",
          "botActive",
          "continuationUrl"
        ],
        "description": "Coarse initial-setup progress for this Management key’s business. The fixed CRAD URL is context only: the actual authorized owner signs in and performs setup. No callback token or machine setup/activation authority. Saved active state can coexist with botActive:false after a later pause. Initial setup is only for platform-enrolled, eligible new businesses; it does not create providers in an existing salon. New businesses are enabled by default; botActive expresses operator intent independently of initial setup readiness.",
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "configured",
              "active",
              "not_available"
            ]
          },
          "version": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "botActive": {
            "type": "boolean"
          },
          "continuationUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri",
                "pattern": "^https://panel\\.crad\\.ai/auth\\?setupTenant=[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "state": {
                  "const": "pending"
                }
              }
            },
            "then": {
              "properties": {
                "version": {
                  "const": 0
                },
                "continuationUrl": {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^https://panel\\.crad\\.ai/auth\\?setupTenant=[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "state": {
                  "enum": [
                    "configured",
                    "active"
                  ]
                }
              }
            },
            "then": {
              "properties": {
                "version": {
                  "type": "integer",
                  "minimum": 1
                },
                "continuationUrl": {
                  "type": "string",
                  "format": "uri",
                  "pattern": "^https://panel\\.crad\\.ai/auth\\?setupTenant=[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$"
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "state": {
                  "const": "not_available"
                }
              }
            },
            "then": {
              "properties": {
                "version": {
                  "type": "null"
                },
                "continuationUrl": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessTemplateRequestInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "purpose",
          "languages"
        ],
        "properties": {
          "purpose": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300,
            "description": "Nonblank purpose, trimmed before storage and operation identity; limit counts Unicode characters."
          },
          "exampleText": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1024,
            "description": "Optional suggested wording. Omitted, null or whitespace-only becomes null; other text is trimmed."
          },
          "languages": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "string",
              "enum": [
                "he",
                "ar",
                "en"
              ]
            },
            "minItems": 1,
            "uniqueItems": true,
            "description": "Choose one to three languages; stored in he/ar/en order."
          }
        }
      },
      "BusinessTemplateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requestId",
          "purpose",
          "exampleText",
          "languages",
          "status",
          "createdAt",
          "completedAt",
          "source"
        ],
        "properties": {
          "requestId": {
            "type": "string",
            "format": "uuid"
          },
          "purpose": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "exampleText": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1024
          },
          "languages": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "string",
              "enum": [
                "he",
                "ar",
                "en"
              ]
            },
            "description": "Historical requests may contain no languages or repeated languages; those values are preserved."
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "done"
            ],
            "description": "CRAD request handling only. done does not attest Meta approval or permission to send."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "native",
              "integration"
            ],
            "description": "Native CRAD account or delegated integration. Actor and credential identities are not disclosed."
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "const": "open"
                }
              }
            },
            "then": {
              "properties": {
                "completedAt": {
                  "type": "null"
                }
              }
            },
            "else": {
              "properties": {
                "completedAt": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          }
        ]
      },
      "BusinessTemplateRequestList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "nextCursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/BusinessTemplateRequest"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "description": "Last returned request ID when another page exists. Reuse the same status and page size; this is a directory cursor, not a synchronization checkpoint."
          }
        }
      },
      "BusinessTemplateRequestResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "properties": {
          "receipt": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operationId",
              "request"
            ],
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "request": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/BusinessTemplateRequest"
                  },
                  {
                    "properties": {
                      "status": {
                        "const": "open"
                      },
                      "completedAt": {
                        "type": "null"
                      }
                    }
                  }
                ]
              }
            }
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessTemplateRequest"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "request_not_found",
              null
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "current": {
                  "type": "null"
                }
              }
            },
            "then": {
              "properties": {
                "currentUnavailableReason": {
                  "const": "request_not_found"
                }
              }
            },
            "else": {
              "properties": {
                "currentUnavailableReason": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "OwnerSettingsContinuations": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "websiteUrl",
          "integrationUrl",
          "deviceUrl",
          "whatsappUrl"
        ],
        "description": "Fixed CRAD owner sign-in links bound to this credential business and, for integration review, this integration. Actual matching owner authorization is required in CRAD. Navigation performs no approval, save, reconnection, enrollment or device registration. No arbitrary return URL, tokens, secrets or proposed grants are accepted. After the owner finishes, refresh authenticated metadata from your backend; there is no automatic success callback.",
        "properties": {
          "websiteUrl": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://panel\\.crad\\.ai/auth\\?ownerTenant=[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}&ownerAction=website$",
            "description": "Review existing website booking and notification settings. This is not a headless policy API."
          },
          "integrationUrl": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://panel\\.crad\\.ai/auth\\?ownerTenant=[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}&ownerAction=integration&integrationId=[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$",
            "description": "Review this integration, credentials, field/history sharing and customer transfers. The integration must still appear in the owner authorized current site. Existing credentials cannot approve their own expansion."
          },
          "deviceUrl": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://panel\\.crad\\.ai/auth\\?ownerTenant=[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}&ownerAction=device$",
            "description": "Open personal browser notification settings. Permission and subscription require explicit owner interaction on that device."
          },
          "whatsappUrl": {
            "description": "Navigation only. CRAD checks the current owner-managed connection mode after sign-in and refuses unsupported legacy businesses without changing their connection. Presence is not connection-mode eligibility, health or readiness; initial-setup eligibility is a separate concern.",
            "type": "string",
            "format": "uri",
            "pattern": "^https://panel\\.crad\\.ai/auth\\?ownerTenant=[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}&ownerAction=whatsapp$"
          }
        }
      },
      "BusinessConversationAvailability": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ]
      },
      "BusinessConversationServiceWindow": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "open": {
            "type": "boolean"
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "open",
          "expiresAt"
        ],
        "description": "Computed from a verified live incoming customer message. History import, opening a conversation, a staff reply or taking control does not open or extend the window. This is separate from connection readiness and permission to send.",
        "oneOf": [
          {
            "properties": {
              "open": {
                "const": true
              },
              "expiresAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          {
            "properties": {
              "open": {
                "const": false
              },
              "expiresAt": {
                "type": "null"
              }
            }
          }
        ]
      },
      "BusinessConversation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "customerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "customerName": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "customerPhone": {
            "type": "string",
            "pattern": "^[0-9]{5,20}$"
          },
          "lastMessageAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastMessageText": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16384
              },
              {
                "type": "null"
              }
            ]
          },
          "lastMessageKind": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "unreadCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 2147483647
          },
          "botMode": {
            "type": "string",
            "enum": [
              "human",
              "bot"
            ]
          },
          "controlVersion": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "version": {
            "type": "string",
            "pattern": "^cv(?:0|[1-9][0-9]*)$",
            "description": "Opaque control version returned by this API. Send it quoted in If-Match when changing control."
          },
          "isBlocked": {
            "type": "boolean"
          },
          "attentionReason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceWindow": {
            "$ref": "#/components/schemas/BusinessConversationServiceWindow"
          },
          "nextAppointment": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "startTime": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "status": {
                    "type": "string",
                    "maxLength": 64
                  }
                },
                "required": [
                  "id",
                  "startTime",
                  "status"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional context, disclosed only with current appointments:read and a calendar grant covering that appointment. Null can mean absent, withheld or unavailable; it is not proof that no booking exists. Use the authorized calendar API for appointment details."
          }
        },
        "required": [
          "id",
          "customerId",
          "customerName",
          "customerPhone",
          "lastMessageAt",
          "lastMessageText",
          "lastMessageKind",
          "unreadCount",
          "botMode",
          "controlVersion",
          "version",
          "isBlocked",
          "attentionReason"
        ]
      },
      "BusinessConversationMessage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "enum": [
              "api",
              "phone",
              "history"
            ]
          },
          "direction": {
            "enum": [
              "inbound",
              "outbound"
            ]
          },
          "kind": {
            "type": "string",
            "maxLength": 64
          },
          "text": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16384
              },
              {
                "type": "null"
              }
            ]
          },
          "content": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "mime_type": {
                "type": "string",
                "maxLength": 1024
              },
              "filename": {
                "type": "string",
                "maxLength": 1024
              },
              "template_name": {
                "type": "string",
                "maxLength": 1024
              },
              "template_language": {
                "type": "string",
                "maxLength": 1024
              },
              "caption": {
                "type": "string",
                "maxLength": 4096
              },
              "interactive_title": {
                "type": "string",
                "maxLength": 4096
              },
              "voice": {
                "type": "boolean"
              },
              "content_unavailable": {
                "type": "boolean"
              },
              "text_truncated": {
                "type": "boolean"
              },
              "interactive_id": {
                "type": "string",
                "maxLength": 1024,
                "description": "Retained incoming button/list payload, when supplied by the provider. Use a verified callback sender and business plus a server-owned opaque action token to authorize an action; text or this value alone is not authority."
              },
              "reply_to_id": {
                "type": "string",
                "maxLength": 1024,
                "description": "Provider context message ID, when available. Compare with a reliably mapped original provider message ID; do not depend on asynchronous status mapping being available before the first valid click."
              }
            },
            "required": []
          },
          "status": {
            "enum": [
              "received",
              "pending",
              "sent",
              "delivered",
              "read",
              "played",
              "failed",
              "unknown"
            ]
          },
          "sentAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time"
          },
          "liveReceivedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dispatchState": {
            "enum": [
              "pending",
              "accepted",
              "rejected",
              "unknown",
              null
            ]
          },
          "requiresReview": {
            "type": "boolean"
          },
          "clientRequestId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "source",
          "direction",
          "kind",
          "text",
          "content",
          "status",
          "sentAt",
          "receivedAt",
          "liveReceivedAt",
          "dispatchState",
          "requiresReview",
          "clientRequestId"
        ],
        "description": "Retained CRAD message metadata and safe text content. No provider credentials, provider media/message IDs or download URL. Media download and message sending are not introduced by these operations. liveReceivedAt is present only for verified live customer arrivals."
      },
      "BusinessConversationList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/BusinessConversation"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ]
      },
      "BusinessConversationSearch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 40,
            "items": {
              "$ref": "#/components/schemas/BusinessConversationMessage"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ]
      },
      "BusinessConversationConnection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ready": {
            "type": "boolean"
          },
          "reason": {
            "enum": [
              "connection_changed",
              "connection_unverified",
              "connection_paused",
              "pilot_disabled",
              "status_unavailable",
              null
            ]
          }
        },
        "required": [
          "ready",
          "reason"
        ],
        "description": "Current CRAD-side connection permission check, not a live Meta delivery probe or a guarantee of message delivery.",
        "oneOf": [
          {
            "properties": {
              "ready": {
                "const": true
              },
              "reason": {
                "type": "null"
              }
            }
          },
          {
            "properties": {
              "ready": {
                "const": false
              },
              "reason": {
                "type": "string"
              }
            }
          }
        ]
      },
      "BusinessConversationThread": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/BusinessConversation"
          },
          "messages": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/BusinessConversationMessage"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "retentionDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 180
          },
          "unresolvedSends": {
            "type": "array",
            "maxItems": 20,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "clientRequestId": {
                  "type": "string",
                  "format": "uuid"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "state": {
                  "enum": [
                    "pending",
                    "unknown"
                  ]
                },
                "requiresReview": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "clientRequestId",
                "createdAt",
                "state",
                "requiresReview"
              ]
            }
          },
          "unresolvedSendCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "serviceWindow": {
            "$ref": "#/components/schemas/BusinessConversationServiceWindow"
          },
          "connection": {
            "$ref": "#/components/schemas/BusinessConversationConnection"
          }
        },
        "required": [
          "conversation",
          "messages",
          "nextCursor",
          "retentionDays",
          "unresolvedSends",
          "unresolvedSendCount",
          "serviceWindow",
          "connection"
        ],
        "description": "Messages are newest first. Use nextCursor for older retained messages, and render chronologically if desired. Not an exhaustive WhatsApp archive. unresolvedSends is a bounded list of existing sends whose outcome is unresolved; its total may be larger. This read neither retries nor resolves a send."
      },
      "BusinessConversationOpenInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "customerId": {
            "type": "string",
            "format": "uuid"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
          }
        },
        "required": [
          "customerId"
        ]
      },
      "BusinessConversationReadInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "messageId": {
            "type": "string",
            "format": "uuid"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
          }
        },
        "required": [
          "messageId"
        ]
      },
      "BusinessConversationControlInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "human",
              "bot"
            ]
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
          }
        },
        "required": [
          "mode"
        ]
      },
      "BusinessConversationReceipt": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "action": {
                "const": "open_contact"
              },
              "request": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "customerId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "externalActorRef": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200,
                        "minLength": 1,
                        "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
                  }
                },
                "required": [
                  "customerId",
                  "externalActorRef"
                ]
              },
              "result": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "conversationId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "conversationId"
                ]
              }
            },
            "required": [
              "operationId",
              "action",
              "request",
              "result"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "action": {
                "const": "mark_read"
              },
              "request": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "conversationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "messageId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "externalActorRef": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200,
                        "minLength": 1,
                        "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
                  }
                },
                "required": [
                  "conversationId",
                  "messageId",
                  "externalActorRef"
                ]
              },
              "result": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "ok": {
                    "const": true
                  }
                },
                "required": [
                  "ok"
                ]
              }
            },
            "required": [
              "operationId",
              "action",
              "request",
              "result"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "action": {
                "const": "set_control"
              },
              "request": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "conversationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "human",
                      "bot"
                    ]
                  },
                  "expectedVersion": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "externalActorRef": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200,
                        "minLength": 1,
                        "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
                  }
                },
                "required": [
                  "conversationId",
                  "mode",
                  "expectedVersion",
                  "externalActorRef"
                ]
              },
              "result": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "botMode": {
                    "type": "string",
                    "enum": [
                      "human",
                      "bot"
                    ]
                  },
                  "controlVersion": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "botMode",
                  "controlVersion"
                ]
              }
            },
            "required": [
              "operationId",
              "action",
              "request",
              "result"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "action": {
                "const": "review_unknown"
              },
              "request": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "conversationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "messageId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "externalActorRef": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 200,
                        "minLength": 1,
                        "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
                  }
                },
                "required": [
                  "conversationId",
                  "messageId",
                  "externalActorRef"
                ]
              },
              "result": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "ok": {
                    "const": true
                  }
                },
                "required": [
                  "ok"
                ]
              }
            },
            "required": [
              "operationId",
              "action",
              "request",
              "result"
            ]
          }
        ],
        "description": "Immutable accepted command receipt, with canonical lowercase CRAD UUIDs and absent externalActorRef represented as null. Retained until tenant deletion, independently of transcript retention. Its result is historical; use current for current control/read state."
      },
      "BusinessConversationResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessConversationReceipt"
          },
          "current": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "conversation": {
                    "$ref": "#/components/schemas/BusinessConversation"
                  },
                  "lastReadAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "lastReadMessageId": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "conversation",
                  "lastReadAt",
                  "lastReadMessageId"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "enum": [
              "conversation_not_found",
              null
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "current": {
                  "type": "null"
                }
              }
            },
            "then": {
              "properties": {
                "currentUnavailableReason": {
                  "const": "conversation_not_found"
                }
              }
            },
            "else": {
              "properties": {
                "currentUnavailableReason": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessConversationOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessConversationReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "conversation": {
                        "$ref": "#/components/schemas/BusinessConversation"
                      },
                      "lastReadAt": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date-time"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "lastReadMessageId": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "conversation",
                      "lastReadAt",
                      "lastReadMessageId"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currentUnavailableReason": {
                "enum": [
                  "conversation_not_found",
                  null
                ]
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "currentUnavailableReason",
              "replayed"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "current": {
                      "type": "null"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "currentUnavailableReason": {
                      "const": "conversation_not_found"
                    }
                  }
                },
                "else": {
                  "properties": {
                    "currentUnavailableReason": {
                      "type": "null"
                    }
                  }
                }
              }
            ]
          }
        ],
        "description": "Read-only recovery. not_found means no committed receipt is visible at this read; an earlier request might still finish. Keep the original UUID/body/If-Match for any explicit retry. Recovery requires current read+write authority for the same integration; key rotation does not transfer another integration’s receipts."
      },
      "BusinessConversationSendInput": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 4096
              },
              "externalActorRef": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 200,
                    "minLength": 1,
                    "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
              }
            },
            "required": [
              "text"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "mediaId": {
                "type": "string",
                "format": "uuid"
              },
              "caption": {
                "type": "string",
                "maxLength": 1024
              },
              "externalActorRef": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 200,
                    "minLength": 1,
                    "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
              }
            },
            "required": [
              "mediaId"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "template": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 512,
                    "pattern": "^[a-z0-9_]+$"
                  },
                  "language": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 16,
                    "pattern": "^[a-z]{2,3}(?:_[A-Z]{2})?$"
                  },
                  "parameters": {
                    "type": "array",
                    "maxItems": 30,
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1024,
                      "pattern": "^[^\\r\\n\\t]+$"
                    }
                  },
                  "quickReplyPayloads": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 3,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 128,
                      "pattern": "^[A-Za-z0-9_-]+$"
                    },
                    "description": "Required exactly for a supported approved UTILITY or MARKETING template with 1..3 QUICK_REPLY buttons. Distinct URL-safe opaque values in the exact catalogue count/order. Bind each to business, recipient, action and current order attempt in your backend; preserve values/order with the original UUID. Forbidden for templates without quick replies and for Authentication."
                  },
                  "headerImageUploadId": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Required exactly for catalogue headerFormat=IMAGE; forbidden otherwise. Use current.mediaId from a still-valid same-conversation JPEG/PNG upload. Set purpose=template_header when uploading outside the customer window. A regular eligible image upload can also be reused. Never use /whatsapp-images uploadId, a raw provider ID or URL."
                  }
                },
                "required": [
                  "name",
                  "language",
                  "parameters"
                ]
              },
              "externalActorRef": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 200,
                    "minLength": 1,
                    "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
              }
            },
            "required": [
              "template"
            ]
          }
        ],
        "description": "Exactly one message kind. Internal media IDs, never raw provider IDs/URLs. Preserve the full body and headers with the operation UUID. IMAGE template headers require a still-valid same-conversation image mediaId. Delivery/read status never confirms an order."
      },
      "BusinessConversationSendReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "conversationId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedVersion": {
            "type": "string",
            "pattern": "^cv(?:0|[1-9][0-9]*)$",
            "description": "Original control version, as acknowledged by the conversation API. Never replace this value during recovery."
          },
          "kind": {
            "enum": [
              "text",
              "media",
              "template"
            ]
          },
          "requestHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
          }
        },
        "required": [
          "operationId",
          "conversationId",
          "expectedVersion",
          "kind",
          "requestHash",
          "externalActorRef"
        ]
      },
      "BusinessConversationSendCurrent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "messageId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "attemptId": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "enum": [
              "pending",
              "accepted",
              "rejected",
              "unknown"
            ]
          },
          "errorCode": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,79}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "reviewed": {
            "type": "boolean"
          },
          "delivery": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "status": {
                    "enum": [
                      "pending",
                      "sent",
                      "delivered",
                      "read",
                      "played",
                      "failed",
                      "unknown"
                    ]
                  },
                  "updatedAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "error": {
                    "anyOf": [
                      {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                          "code": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 2147483647
                          }
                        },
                        "required": [
                          "code"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ],
                    "description": "Bounded Meta delivery-error code, when supplied. No raw provider payload. A code does not prove the recipient-specific cause."
                  }
                },
                "required": [
                  "status",
                  "updatedAt",
                  "error"
                ],
                "allOf": [
                  {
                    "if": {
                      "properties": {
                        "status": {
                          "not": {
                            "const": "failed"
                          }
                        }
                      },
                      "required": [
                        "status"
                      ]
                    },
                    "then": {
                      "properties": {
                        "error": {
                          "type": "null"
                        }
                      }
                    }
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional current delivery evidence for the exact retained message. Separate from dispatch acceptance. Null or absent means no retained verdict; it never permits a resend."
          }
        },
        "required": [
          "messageId",
          "attemptId",
          "state",
          "errorCode",
          "reviewed"
        ],
        "description": "accepted means Meta accepted the send; it does not mean delivered or read. unknown means delivery cannot yet be established. reviewed only acknowledges this uncertainty and never resends. A later verified callback can settle the original attempt."
      },
      "BusinessConversationUploadInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "One nonempty supported file. JPEG/PNG: at most 5 MiB; supported audio, video and documents: at most 16 MiB. Declared MIME and file signature must agree. Ogg voice requires mono Opus."
          },
          "externalActorRef": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
          },
          "purpose": {
            "const": "template_header",
            "description": "Optional dedicated JPEG/PNG image asset for a future approved IMAGE-header template send. This upload purpose alone may run outside the customer window; it does not grant text/ordinary media sending or skip template/consent checks."
          }
        },
        "required": [
          "file"
        ]
      },
      "BusinessConversationUploadReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "conversationId": {
            "type": "string",
            "format": "uuid"
          },
          "fileSha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "kind": {
            "enum": [
              "image",
              "audio",
              "document",
              "video"
            ]
          },
          "mimeType": {
            "enum": [
              "image/jpeg",
              "image/png",
              "audio/aac",
              "audio/amr",
              "audio/mpeg",
              "audio/mp4",
              "audio/ogg",
              "video/mp4",
              "video/3gpp",
              "application/pdf",
              "text/plain",
              "application/msword",
              "application/vnd.ms-excel",
              "application/vnd.ms-powerpoint",
              "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
              "application/vnd.openxmlformats-officedocument.presentationml.presentation"
            ]
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 180
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 16777216
          },
          "voice": {
            "type": "boolean"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
          },
          "purpose": {
            "const": "template_header",
            "description": "Present exactly when the saved upload used this purpose; part of replay identity."
          }
        },
        "required": [
          "operationId",
          "conversationId",
          "fileSha256",
          "kind",
          "mimeType",
          "filename",
          "size",
          "voice",
          "externalActorRef"
        ]
      },
      "BusinessConversationUploadCurrent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "state": {
            "enum": [
              "pending",
              "ready",
              "unknown",
              "failed",
              "expired"
            ]
          },
          "mediaId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "errorCode": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z][a-z0-9_]{0,79}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "state",
          "mediaId",
          "expiresAt",
          "errorCode"
        ]
      },
      "BusinessConversationSendResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessConversationSendReceipt"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessConversationSendCurrent"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "enum": [
              "conversation_not_found",
              null
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "current": {
                  "type": "null"
                }
              }
            },
            "then": {
              "properties": {
                "currentUnavailableReason": {
                  "const": "conversation_not_found"
                }
              }
            },
            "else": {
              "properties": {
                "currentUnavailableReason": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessConversationUploadResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessConversationUploadReceipt"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessConversationUploadCurrent"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "enum": [
              "conversation_not_found",
              null
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "current": {
                  "type": "null"
                }
              }
            },
            "then": {
              "properties": {
                "currentUnavailableReason": {
                  "const": "conversation_not_found"
                }
              }
            },
            "else": {
              "properties": {
                "currentUnavailableReason": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessConversationSendOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "found"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessConversationSendReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessConversationSendCurrent"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currentUnavailableReason": {
                "enum": [
                  "conversation_not_found",
                  null
                ]
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "currentUnavailableReason",
              "replayed"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "current": {
                      "type": "null"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "currentUnavailableReason": {
                      "const": "conversation_not_found"
                    }
                  }
                },
                "else": {
                  "properties": {
                    "currentUnavailableReason": {
                      "type": "null"
                    }
                  }
                }
              }
            ]
          }
        ],
        "description": "Read-only lookup under current authority for the same integration. not_found is a point-in-time observation, not proof an earlier request cannot finish. Do not replace the original operation UUID."
      },
      "BusinessConversationUploadOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "found"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessConversationUploadReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessConversationUploadCurrent"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currentUnavailableReason": {
                "enum": [
                  "conversation_not_found",
                  null
                ]
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "currentUnavailableReason",
              "replayed"
            ],
            "allOf": [
              {
                "if": {
                  "properties": {
                    "current": {
                      "type": "null"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "currentUnavailableReason": {
                      "const": "conversation_not_found"
                    }
                  }
                },
                "else": {
                  "properties": {
                    "currentUnavailableReason": {
                      "type": "null"
                    }
                  }
                }
              }
            ]
          }
        ],
        "description": "Read-only lookup under current authority for the same integration. not_found is a point-in-time observation, not proof an earlier request cannot finish. Do not replace the original operation UUID."
      },
      "BusinessConversationTemplates": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 512
                },
                "language": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 16
                },
                "category": {
                  "enum": [
                    "UTILITY",
                    "MARKETING",
                    "AUTHENTICATION"
                  ]
                },
                "body": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 16384
                },
                "header": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 16384
                },
                "footer": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 16384
                },
                "parameterCount": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 30
                },
                "quickReplyButtons": {
                  "type": "array",
                  "minItems": 1,
                  "maxItems": 3,
                  "items": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "const": "QUICK_REPLY"
                      },
                      "index": {
                        "type": "integer",
                        "enum": [
                          0,
                          1,
                          2
                        ]
                      },
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 25
                      }
                    },
                    "required": [
                      "type",
                      "index",
                      "text"
                    ]
                  },
                  "description": "Present for supported UTILITY or MARKETING templates with 1..3 QUICK_REPLY buttons. Ordered indexes starting at zero; use the exact count/order and check labels. Snapshot drift is refused near dispatch."
                },
                "headerFormat": {
                  "const": "IMAGE",
                  "description": "An image header is required. Mutually exclusive with text header; send with headerImageUploadId from a valid same-conversation JPEG/PNG media upload. Use purpose=template_header only when that asset upload needs the outside-window exception."
                }
              },
              "required": [
                "name",
                "language",
                "category",
                "body",
                "parameterCount"
              ]
            }
          },
          "unavailableCount": {
            "type": "integer",
            "minimum": 0
          },
          "complete": {
            "type": "boolean"
          },
          "marketingOptedOut": {
            "type": "boolean"
          }
        },
        "required": [
          "templates",
          "unavailableCount",
          "complete",
          "marketingOptedOut"
        ],
        "description": "Supported approved positional templates, including IMAGE headers and Utility/Marketing 1..3 quick replies. Unsupported layouts are omitted and counted; complete=false means enumeration is incomplete. Approval/category, current connection, recipient consent and actual send authorization remain required. Authentication COPY_CODE still accepts one 1..15 ASCII alphanumeric code supplied and verified/expired by the integrating application."
      },
      "BusinessConversationReviewInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^[^\\u0000-\\u001f\\u007f]*\\S[^\\u0000-\\u001f\\u007f]*$"
              },
              {
                "type": "null"
              }
            ],
            "description": "Optional audit label from your backend, preserved exactly. CRAD does not verify this external user identity; it grants no permission."
          }
        },
        "required": []
      },
      "BusinessWebsiteIntakeChanges": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "displayName": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "he": {
                "type": "string",
                "maxLength": 100
              },
              "ar": {
                "type": "string",
                "maxLength": 100
              },
              "en": {
                "type": "string",
                "maxLength": 100
              }
            },
            "required": []
          },
          "defaultLanguage": {
            "type": "string",
            "enum": [
              "he",
              "ar",
              "en"
            ]
          },
          "status": {
            "enum": [
              "draft",
              "enabled",
              "paused"
            ]
          }
        },
        "required": [],
        "minProperties": 1
      },
      "BusinessWebsiteNotificationChanges": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "purposes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "confirmation",
                "change",
                "cancellation",
                "reminder",
                "proposal",
                "rejection"
              ]
            },
            "maxItems": 6
          },
          "dailyLimit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          }
        },
        "required": [
          "enabled",
          "purposes",
          "dailyLimit"
        ],
        "description": "Full policy. At least one purpose is required when enabled. Repeated purposes are normalized to a sorted unique selection; retain the original submitted request for recovery.",
        "allOf": [
          {
            "if": {
              "properties": {
                "enabled": {
                  "const": true
                }
              },
              "required": [
                "enabled"
              ]
            },
            "then": {
              "properties": {
                "purposes": {
                  "minItems": 1
                }
              }
            }
          }
        ]
      },
      "BusinessOwnerAlertChanges": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled"
        ]
      },
      "BusinessWebsiteIntakeState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "siteId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "slug": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "enum": [
              "not_configured",
              "draft",
              "enabled",
              "paused"
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "displayName": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "he": {
                "type": "string",
                "maxLength": 100
              },
              "ar": {
                "type": "string",
                "maxLength": 100
              },
              "en": {
                "type": "string",
                "maxLength": 100
              }
            },
            "required": []
          },
          "defaultLanguage": {
            "type": "string",
            "enum": [
              "he",
              "ar",
              "en"
            ]
          },
          "policy": {
            "type": "string",
            "enum": [
              "legacy_fixed_slot_v1",
              "service_duration_v1"
            ]
          },
          "enrolled": {
            "type": "boolean"
          },
          "intakeEnabled": {
            "type": "boolean"
          },
          "allBookingsPaused": {
            "type": "boolean"
          },
          "botActive": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ]
          },
          "activationBlockers": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 100
            },
            "maxItems": 64
          },
          "runtimeEnvironment": {
            "anyOf": [
              {
                "enum": [
                  "sandbox",
                  "production"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "publicOrigin": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 250
              },
              {
                "type": "null"
              }
            ]
          },
          "hostedIntegrationId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "siteId",
          "slug",
          "status",
          "version",
          "displayName",
          "defaultLanguage",
          "policy",
          "enrolled",
          "intakeEnabled",
          "allBookingsPaused",
          "botActive",
          "activationBlockers",
          "runtimeEnvironment",
          "publicOrigin",
          "hostedIntegrationId"
        ]
      },
      "BusinessWebsiteNotificationState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "enabled": {
            "type": "boolean"
          },
          "purposes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "confirmation",
                "change",
                "cancellation",
                "reminder",
                "proposal",
                "rejection"
              ]
            },
            "maxItems": 6,
            "uniqueItems": true
          },
          "dailyLimit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "ready": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "purpose": {
                  "type": "string",
                  "enum": [
                    "confirmation",
                    "change",
                    "cancellation",
                    "reminder",
                    "proposal",
                    "rejection"
                  ]
                },
                "language": {
                  "type": "string",
                  "enum": [
                    "he",
                    "ar",
                    "en"
                  ]
                },
                "available": {
                  "type": "boolean"
                }
              },
              "required": [
                "purpose",
                "language",
                "available"
              ]
            },
            "maxItems": 12
          }
        },
        "required": [
          "version",
          "enabled",
          "purposes",
          "dailyLimit",
          "ready"
        ]
      },
      "BusinessOwnerAlertState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "enabled": {
            "type": "boolean"
          },
          "registeredOwnerDevices": {
            "type": "integer",
            "minimum": 0,
            "maximum": 50
          },
          "devicesTruncated": {
            "type": "boolean"
          }
        },
        "required": [
          "version",
          "enabled",
          "registeredOwnerDevices",
          "devicesTruncated"
        ]
      },
      "BusinessWebsiteIntakeHealth": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "policy": {
            "type": "string",
            "enum": [
              "legacy_fixed_slot_v1",
              "service_duration_v1"
            ]
          },
          "enrolled": {
            "type": "boolean"
          },
          "compatible": {
            "type": "boolean"
          },
          "scanLimit": {
            "const": 1000
          },
          "truncated": {
            "type": "boolean"
          },
          "samples": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "futureAppointments": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "blockedSlots": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "providers": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "services": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "customerProfiles": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "providerLinks": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              }
            },
            "required": [
              "futureAppointments",
              "blockedSlots",
              "providers",
              "services",
              "customerProfiles",
              "providerLinks"
            ]
          },
          "checks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "code": {
                  "type": "string",
                  "maxLength": 100
                },
                "count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 1000
                },
                "state": {
                  "enum": [
                    "pass",
                    "attention"
                  ]
                }
              },
              "required": [
                "code",
                "count",
                "state"
              ]
            },
            "maxItems": 64
          },
          "health": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "intakeEnabled": {
                "type": "boolean"
              },
              "verificationReady": {
                "type": "boolean"
              },
              "notificationPolicyEnabled": {
                "type": "boolean"
              },
              "notificationConsentAuthority": {
                "type": "boolean"
              }
            },
            "required": [
              "intakeEnabled",
              "verificationReady",
              "notificationPolicyEnabled",
              "notificationConsentAuthority"
            ]
          }
        },
        "required": [
          "observedAt",
          "policy",
          "enrolled",
          "compatible",
          "scanLimit",
          "truncated",
          "samples",
          "checks",
          "health"
        ]
      },
      "BusinessOwnerAlertMetrics": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "type": "string",
            "format": "date-time"
          },
          "sampleLimit": {
            "const": 1000
          },
          "sampledJobs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "truncated": {
            "type": "boolean"
          },
          "states": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "queued": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "dispatching": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "accepted": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "failed": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "unknown": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "suppressed": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "expired": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              }
            },
            "required": [
              "queued",
              "dispatching",
              "accepted",
              "failed",
              "unknown",
              "suppressed",
              "expired"
            ]
          },
          "unresolvedUnknown": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "sampledJobs": {
                "type": "integer",
                "minimum": 0,
                "maximum": 1000
              },
              "truncated": {
                "type": "boolean"
              },
              "oldestAgeSeconds": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "sampledJobs",
              "truncated",
              "oldestAgeSeconds"
            ]
          }
        },
        "required": [
          "asOf",
          "sampleLimit",
          "sampledJobs",
          "truncated",
          "states",
          "unresolvedUnknown"
        ]
      },
      "BusinessWebsiteIntakeInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "changes": {
            "$ref": "#/components/schemas/BusinessWebsiteIntakeChanges"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional external staff reference; no CRAD owner identity is asserted. Keep the exact supplied value during recovery."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "changes"
        ]
      },
      "BusinessWebsiteIntakeRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expectedVersion": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "changes": {
            "$ref": "#/components/schemas/BusinessWebsiteIntakeChanges"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional external staff reference; no CRAD owner identity is asserted. Keep the exact supplied value during recovery."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "expectedVersion",
          "changes",
          "externalActorRef"
        ]
      },
      "BusinessWebsiteIntakeResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "request": {
                "$ref": "#/components/schemas/BusinessWebsiteIntakeRequest"
              },
              "state": {
                "$ref": "#/components/schemas/BusinessWebsiteIntakeState"
              }
            },
            "required": [
              "operationId",
              "request",
              "state"
            ]
          },
          "current": {
            "$ref": "#/components/schemas/BusinessWebsiteIntakeState"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "replayed"
        ]
      },
      "BusinessWebsiteIntakeOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "operationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "request": {
                    "$ref": "#/components/schemas/BusinessWebsiteIntakeRequest"
                  },
                  "state": {
                    "$ref": "#/components/schemas/BusinessWebsiteIntakeState"
                  }
                },
                "required": [
                  "operationId",
                  "request",
                  "state"
                ]
              },
              "current": {
                "$ref": "#/components/schemas/BusinessWebsiteIntakeState"
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "replayed"
            ]
          }
        ]
      },
      "BusinessWebsiteNotificationInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "changes": {
            "$ref": "#/components/schemas/BusinessWebsiteNotificationChanges"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional external staff reference; no CRAD owner identity is asserted. Keep the exact supplied value during recovery."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "changes"
        ]
      },
      "BusinessWebsiteNotificationRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expectedVersion": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "changes": {
            "$ref": "#/components/schemas/BusinessWebsiteNotificationChanges"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional external staff reference; no CRAD owner identity is asserted. Keep the exact supplied value during recovery."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "expectedVersion",
          "changes",
          "externalActorRef"
        ]
      },
      "BusinessWebsiteNotificationResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "request": {
                "$ref": "#/components/schemas/BusinessWebsiteNotificationRequest"
              },
              "state": {
                "$ref": "#/components/schemas/BusinessWebsiteNotificationState"
              }
            },
            "required": [
              "operationId",
              "request",
              "state"
            ]
          },
          "current": {
            "$ref": "#/components/schemas/BusinessWebsiteNotificationState"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "replayed"
        ]
      },
      "BusinessWebsiteNotificationOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "operationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "request": {
                    "$ref": "#/components/schemas/BusinessWebsiteNotificationRequest"
                  },
                  "state": {
                    "$ref": "#/components/schemas/BusinessWebsiteNotificationState"
                  }
                },
                "required": [
                  "operationId",
                  "request",
                  "state"
                ]
              },
              "current": {
                "$ref": "#/components/schemas/BusinessWebsiteNotificationState"
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "replayed"
            ]
          }
        ]
      },
      "BusinessOwnerAlertInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "changes": {
            "$ref": "#/components/schemas/BusinessOwnerAlertChanges"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional external staff reference; no CRAD owner identity is asserted. Keep the exact supplied value during recovery."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "changes"
        ]
      },
      "BusinessOwnerAlertRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expectedVersion": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "changes": {
            "$ref": "#/components/schemas/BusinessOwnerAlertChanges"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional external staff reference; no CRAD owner identity is asserted. Keep the exact supplied value during recovery."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "expectedVersion",
          "changes",
          "externalActorRef"
        ]
      },
      "BusinessOwnerAlertResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "request": {
                "$ref": "#/components/schemas/BusinessOwnerAlertRequest"
              },
              "state": {
                "$ref": "#/components/schemas/BusinessOwnerAlertState"
              }
            },
            "required": [
              "operationId",
              "request",
              "state"
            ]
          },
          "current": {
            "$ref": "#/components/schemas/BusinessOwnerAlertState"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "replayed"
        ]
      },
      "BusinessOwnerAlertOperation": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "operationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "request": {
                    "$ref": "#/components/schemas/BusinessOwnerAlertRequest"
                  },
                  "state": {
                    "$ref": "#/components/schemas/BusinessOwnerAlertState"
                  }
                },
                "required": [
                  "operationId",
                  "request",
                  "state"
                ]
              },
              "current": {
                "$ref": "#/components/schemas/BusinessOwnerAlertState"
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "replayed"
            ]
          }
        ]
      },
      "BusinessWhatsappConnectionEvidence": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "result": {
            "type": "string",
            "enum": [
              "healthy",
              "action_required",
              "unknown"
            ]
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "token_invalid",
                  "token_expired",
                  "app_mismatch",
                  "permissions_missing",
                  "asset_unavailable",
                  "not_coexistence",
                  "subscription_missing",
                  "provider_unavailable",
                  "provider_response_invalid",
                  "provider_rate_limited"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "checks": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "token": {
                "type": "string",
                "enum": [
                  "passed",
                  "failed",
                  "unknown"
                ]
              },
              "membership": {
                "type": "string",
                "enum": [
                  "passed",
                  "failed",
                  "unknown"
                ]
              },
              "coexistence": {
                "type": "string",
                "enum": [
                  "passed",
                  "failed",
                  "unknown"
                ]
              },
              "subscription": {
                "type": "string",
                "enum": [
                  "passed",
                  "failed",
                  "unknown"
                ]
              }
            },
            "required": [
              "token",
              "membership",
              "coexistence",
              "subscription"
            ]
          },
          "tokenExpiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dataAccessExpiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "result",
          "reason",
          "checks",
          "tokenExpiresAt",
          "dataAccessExpiresAt"
        ],
        "description": "Finite facts from a GET-only Meta observation. Healthy requires all four checks to pass; this does not prove delivery, activate the bot or extend token expiry.",
        "allOf": [
          {
            "if": {
              "properties": {
                "result": {
                  "const": "healthy"
                }
              }
            },
            "then": {
              "properties": {
                "reason": {
                  "type": "null"
                },
                "checks": {
                  "properties": {
                    "token": {
                      "const": "passed"
                    },
                    "membership": {
                      "const": "passed"
                    },
                    "coexistence": {
                      "const": "passed"
                    },
                    "subscription": {
                      "const": "passed"
                    }
                  }
                }
              }
            },
            "else": {
              "properties": {
                "reason": {
                  "type": "string",
                  "enum": [
                    "token_invalid",
                    "token_expired",
                    "app_mismatch",
                    "permissions_missing",
                    "asset_unavailable",
                    "not_coexistence",
                    "subscription_missing",
                    "provider_unavailable",
                    "provider_response_invalid",
                    "provider_rate_limited"
                  ]
                }
              }
            }
          }
        ]
      },
      "BusinessWhatsappConnectionHealth": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "result": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "healthy",
                  "action_required",
                  "unknown"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "token_invalid",
                  "token_expired",
                  "app_mismatch",
                  "permissions_missing",
                  "asset_unavailable",
                  "not_coexistence",
                  "subscription_missing",
                  "provider_unavailable",
                  "provider_response_invalid",
                  "provider_rate_limited"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "checks": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "token": {
                "type": "string",
                "enum": [
                  "passed",
                  "failed",
                  "unknown"
                ]
              },
              "membership": {
                "type": "string",
                "enum": [
                  "passed",
                  "failed",
                  "unknown"
                ]
              },
              "coexistence": {
                "type": "string",
                "enum": [
                  "passed",
                  "failed",
                  "unknown"
                ]
              },
              "subscription": {
                "type": "string",
                "enum": [
                  "passed",
                  "failed",
                  "unknown"
                ]
              }
            },
            "required": [
              "token",
              "membership",
              "coexistence",
              "subscription"
            ]
          },
          "tokenExpiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "dataAccessExpiresAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "checkedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastHealthyAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "current": {
            "type": "boolean"
          },
          "canCheck": {
            "type": "boolean"
          },
          "checkBlockReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "connection_unverified",
                  "connection_changed",
                  "check_in_progress",
                  "check_rate_limited",
                  "connection_paused",
                  "attempt_unavailable",
                  "operation_not_unknown",
                  "configuration_missing",
                  "tenant_not_enabled",
                  "scope_required"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "retryAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "canReconcileSubscription": {
            "type": "boolean"
          },
          "reconciliationBlockReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "connection_unverified",
                  "connection_changed",
                  "check_in_progress",
                  "check_rate_limited",
                  "connection_paused",
                  "attempt_unavailable",
                  "operation_not_unknown",
                  "configuration_missing",
                  "tenant_not_enabled",
                  "scope_required"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "subscriptionReconciledAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "result",
          "reason",
          "checks",
          "tokenExpiresAt",
          "dataAccessExpiresAt",
          "checkedAt",
          "lastHealthyAt",
          "current",
          "canCheck",
          "checkBlockReason",
          "retryAt",
          "canReconcileSubscription",
          "reconciliationBlockReason",
          "subscriptionReconciledAt"
        ],
        "description": "Saved health evidence and current action availability. Display checkedAt; current does not mean a new live observation was made by this GET. retryAt is nullable. Unknown is not healthy."
      },
      "BusinessWhatsappReminderReadiness": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "schemaVersion": {
            "const": 1
          },
          "checkedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "configurationMatches": {
            "type": "boolean"
          },
          "current": {
            "type": "boolean"
          },
          "readOutcome": {
            "type": "string",
            "enum": [
              "complete",
              "unavailable",
              "unknown"
            ]
          },
          "approvedLanguages": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "he",
                "ar",
                "en"
              ]
            },
            "uniqueItems": true,
            "maxItems": 3
          },
          "languages": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "he": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "available": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "actualLanguage": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "he",
                          "ar",
                          "en"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "languageCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "he",
                          "ar",
                          "en",
                          "en_US"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "available",
                  "actualLanguage",
                  "languageCode"
                ]
              },
              "ar": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "available": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "actualLanguage": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "he",
                          "ar",
                          "en"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "languageCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "he",
                          "ar",
                          "en",
                          "en_US"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "available",
                  "actualLanguage",
                  "languageCode"
                ]
              },
              "en": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "available": {
                    "anyOf": [
                      {
                        "type": "boolean"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "actualLanguage": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "he",
                          "ar",
                          "en"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "languageCode": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": [
                          "he",
                          "ar",
                          "en",
                          "en_US"
                        ]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "available",
                  "actualLanguage",
                  "languageCode"
                ]
              }
            },
            "required": [
              "he",
              "ar",
              "en"
            ]
          }
        },
        "required": [
          "schemaVersion",
          "checkedAt",
          "configurationMatches",
          "current",
          "readOutcome",
          "approvedLanguages",
          "languages"
        ],
        "description": "Saved reminder-template approval observation. Not a new provider check or a guarantee that a reminder can be sent or delivered."
      },
      "BusinessWhatsappConnectionStatus": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "string",
            "pattern": "^wc[a-f0-9]{64}$",
            "description": "Opaque current connection version. Preserve the quoted ETag as If-Match. Do not construct, increment or substitute it on recovery."
          },
          "configured": {
            "type": "boolean"
          },
          "botActive": {
            "type": "boolean"
          },
          "reconciliationAttemptId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "connection": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "state": {
                    "type": "string",
                    "enum": [
                      "prepared",
                      "verified",
                      "ready",
                      "disconnected",
                      "blocked"
                    ]
                  },
                  "displayPhoneNumber": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 64
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "verifiedAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "generation": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "currentBinding": {
                    "type": "boolean"
                  },
                  "outboundAllowed": {
                    "type": "boolean"
                  },
                  "lifecycle": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "event": {
                        "anyOf": [
                          {
                            "type": "string",
                            "enum": [
                              "PARTNER_REMOVED",
                              "ACCOUNT_OFFBOARDED",
                              "ACCOUNT_RECONNECTED"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "occurredAt": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date-time"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "receivedAt": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "date-time"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "requiresVerification": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "event",
                      "occurredAt",
                      "receivedAt",
                      "requiresVerification"
                    ]
                  },
                  "stages": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "subscribe": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "running",
                          "succeeded",
                          "failed",
                          "unknown",
                          "not_requested"
                        ]
                      },
                      "contacts": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "running",
                          "succeeded",
                          "failed",
                          "unknown",
                          "not_requested"
                        ]
                      },
                      "history": {
                        "type": "string",
                        "enum": [
                          "pending",
                          "running",
                          "succeeded",
                          "failed",
                          "unknown",
                          "not_requested"
                        ]
                      }
                    },
                    "required": [
                      "subscribe",
                      "contacts",
                      "history"
                    ]
                  },
                  "eventsReceived": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "historySharingStatus": {
                    "type": "string",
                    "enum": [
                      "unknown",
                      "declined",
                      "receiving",
                      "complete"
                    ]
                  },
                  "health": {
                    "$ref": "#/components/schemas/BusinessWhatsappConnectionHealth"
                  },
                  "reminderReadiness": {
                    "$ref": "#/components/schemas/BusinessWhatsappReminderReadiness"
                  }
                },
                "required": [
                  "state",
                  "displayPhoneNumber",
                  "verifiedAt",
                  "generation",
                  "currentBinding",
                  "outboundAllowed",
                  "lifecycle",
                  "stages",
                  "eventsReceived",
                  "historySharingStatus",
                  "health"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "billingEvidence": {
            "$ref": "#/components/schemas/MetaBillingEvidence",
            "description": "Optional additive evidence under the existing connection-read scope. Older servers may omit it; treat absence as unknown. Shared Messaging accounts can share the observation across businesses."
          }
        },
        "required": [
          "version",
          "configured",
          "botActive",
          "reconciliationAttemptId",
          "connection"
        ],
        "description": "Credential-bound whole-business saved connection view. A null connection means no supported saved Coexistence connection; it does not prove absence of a legacy WhatsApp channel. configured reflects manual-check runtime configuration, not business verification. No credentials, raw asset IDs or provider errors are exposed."
      },
      "BusinessWhatsappConnectionCheckInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional external staff reference; no CRAD owner identity is asserted. Keep the exact supplied value during recovery."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": []
      },
      "BusinessWhatsappConnectionReconcileInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "attemptId": {
            "type": "string",
            "format": "uuid"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional external staff reference; no CRAD owner identity is asserted. Keep the exact supplied value during recovery."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "attemptId"
        ]
      },
      "BusinessWhatsappConnectionRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expectedVersion": {
            "type": "string",
            "pattern": "^wc[a-f0-9]{64}$",
            "description": "Opaque current connection version. Preserve the quoted ETag as If-Match. Do not construct, increment or substitute it on recovery."
          },
          "action": {
            "type": "string",
            "enum": [
              "health_check",
              "reconcile_subscription"
            ]
          },
          "attemptId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=.*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional external staff reference; no CRAD owner identity is asserted. Keep the exact supplied value during recovery."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "expectedVersion",
          "action",
          "attemptId",
          "externalActorRef"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "action": {
                  "const": "health_check"
                }
              }
            },
            "then": {
              "properties": {
                "attemptId": {
                  "type": "null"
                }
              }
            },
            "else": {
              "properties": {
                "attemptId": {
                  "type": "string",
                  "format": "uuid"
                }
              }
            }
          }
        ]
      },
      "BusinessWhatsappConnectionReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "request": {
            "$ref": "#/components/schemas/BusinessWhatsappConnectionRequest"
          },
          "checkedAt": {
            "type": "string",
            "format": "date-time"
          },
          "health": {
            "$ref": "#/components/schemas/BusinessWhatsappConnectionEvidence"
          },
          "settledSubscription": {
            "type": "boolean"
          }
        },
        "required": [
          "operationId",
          "request",
          "checkedAt",
          "health",
          "settledSubscription"
        ],
        "description": "Immutable accepted observation for the original exact request. settledSubscription=true only confirms that an eligible unknown subscription was observed present and its saved state settled. It never means a new subscription was sent."
      },
      "BusinessWhatsappConnectionResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "request": {
            "$ref": "#/components/schemas/BusinessWhatsappConnectionRequest"
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "committed",
              "expired"
            ]
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "receipt": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessWhatsappConnectionReceipt"
              },
              {
                "type": "null"
              }
            ]
          },
          "current": {
            "$ref": "#/components/schemas/BusinessWhatsappConnectionStatus"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "operationId",
          "request",
          "state",
          "startedAt",
          "expiresAt",
          "receipt",
          "current",
          "replayed"
        ],
        "description": "HTTP 200 is a durable operation state, not necessarily completion. Only committed has a receipt. current is freshly authorized saved state and can differ from the immutable receipt. pending/expired never redispatch the original UUID.",
        "allOf": [
          {
            "if": {
              "properties": {
                "state": {
                  "const": "committed"
                }
              }
            },
            "then": {
              "properties": {
                "receipt": {
                  "$ref": "#/components/schemas/BusinessWhatsappConnectionReceipt"
                }
              }
            },
            "else": {
              "properties": {
                "receipt": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessCampaignGrant": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "wholeBusiness": {
            "type": "boolean"
          },
          "providerIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 1000,
            "uniqueItems": true
          }
        },
        "required": [
          "wholeBusiness",
          "providerIds"
        ],
        "description": "Explicit campaign-purpose authority; separate from calendar, contacts and general provider grants. Whole-business requires an empty providerIds array. A scoped key selects one active granted provider and appointment customers per campaign. Empty scoped grants confer no campaign access.",
        "allOf": [
          {
            "if": {
              "properties": {
                "wholeBusiness": {
                  "const": true
                }
              }
            },
            "then": {
              "properties": {
                "providerIds": {
                  "maxItems": 0
                }
              }
            }
          }
        ]
      },
      "BusinessCampaignSegmentFilters": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "away": {
            "type": "string",
            "enum": [
              "3w",
              "1m",
              "2m",
              "3m"
            ]
          },
          "visits": {
            "type": "string",
            "enum": [
              "none",
              "one",
              "recentRegular",
              "regular"
            ]
          },
          "backToBack": {
            "type": "string",
            "enum": [
              "once",
              "repeated"
            ]
          },
          "lateRegular": {
            "const": true
          },
          "noUpcoming": {
            "const": true
          },
          "recentMissed": {
            "const": true
          },
          "newCustomers": {
            "const": true
          },
          "language": {
            "type": "string",
            "enum": [
              "he",
              "ar",
              "en"
            ]
          },
          "notSentBefore": {
            "const": true
          },
          "lastVisit": {
            "type": "string",
            "enum": [
              "within30",
              "notSince60",
              "notSince90"
            ]
          },
          "overdue": {
            "const": true
          },
          "missed": {
            "const": true
          },
          "providerId": {
            "type": "string",
            "format": "uuid"
          },
          "visitedFrom": {
            "type": "string",
            "format": "date"
          },
          "visitedTo": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [],
        "dependentRequired": {
          "visitedFrom": [
            "visitedTo"
          ],
          "visitedTo": [
            "visitedFrom"
          ]
        }
      },
      "BusinessCampaignAudience": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "contacts"
              }
            },
            "required": [
              "kind"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "appointments"
              },
              "from": {
                "type": "string",
                "format": "date-time"
              },
              "to": {
                "type": "string",
                "format": "date-time"
              },
              "statuses": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "PENDING",
                    "CONFIRMED",
                    "NOW"
                  ]
                },
                "maxItems": 3,
                "minItems": 1,
                "description": "Defaults to PENDING, CONFIRMED and NOW. Instants must satisfy from < to."
              }
            },
            "required": [
              "kind",
              "from",
              "to"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "segment"
              },
              "filters": {
                "$ref": "#/components/schemas/BusinessCampaignSegmentFilters"
              },
              "providerName": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 160,
                    "pattern": "^\\s*[\\s\\S]{0,80}\\s*$",
                    "description": "At most 160 JavaScript UTF-16 units in the submitted value and 80 Unicode codepoints after trimming. Blank becomes null."
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "kind",
              "filters"
            ]
          }
        ]
      },
      "BusinessCampaignDraft": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "template": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[a-z0-9_]{1,512}$"
              },
              "language": {
                "type": "string",
                "pattern": "^[a-z]{2,3}(_[A-Za-z0-9]{2,4})?$"
              }
            },
            "required": [
              "name",
              "language"
            ]
          },
          "parameters": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 200,
              "minLength": 1,
              "description": "Trimmed, nonempty. No tab/newline or five consecutive spaces. Lengths use JavaScript UTF-16 units; rendered body is at most 1,024 units."
            },
            "maxItems": 1000
          },
          "matchLanguage": {
            "type": "boolean"
          },
          "audience": {
            "$ref": "#/components/schemas/BusinessCampaignAudience"
          },
          "recipientProfileIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 1000,
            "minItems": 1,
            "description": "Explicit selected contact profile IDs, in reviewed order. Repeated IDs are removed preserving first occurrence; one recipient per normalized number. At most 300 eligible recipients."
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional nonblank external audit reference. At most 200 JavaScript UTF-16 units; original spacing is retained. This never grants identity or authority."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "template",
          "parameters",
          "matchLanguage",
          "audience",
          "recipientProfileIds"
        ]
      },
      "BusinessCampaignTemplateComponent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "maxLength": 50
          },
          "format": {
            "type": "string",
            "maxLength": 50
          },
          "text": {
            "type": "string",
            "maxLength": 16384
          },
          "buttons": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "type": "string",
                  "maxLength": 50
                },
                "text": {
                  "type": "string",
                  "maxLength": 1024
                },
                "url": {
                  "type": "string",
                  "maxLength": 4096
                },
                "phone_number": {
                  "type": "string",
                  "maxLength": 64
                }
              },
              "required": [
                "type"
              ]
            },
            "maxItems": 10
          }
        },
        "required": [
          "type"
        ]
      },
      "BusinessCampaignTemplate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,512}$"
          },
          "language": {
            "type": "string",
            "pattern": "^[a-z]{2,3}(_[A-Za-z0-9]{2,4})?$"
          },
          "status": {
            "type": "string",
            "maxLength": 50
          },
          "category": {
            "type": "string",
            "maxLength": 50
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessCampaignTemplateComponent"
            },
            "maxItems": 10
          },
          "body": {
            "type": "string",
            "maxLength": 16384
          },
          "placeholders": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "supported": {
            "type": "boolean"
          },
          "unsupportedReason": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "name",
          "language",
          "status",
          "category",
          "components",
          "body",
          "placeholders",
          "supported",
          "unsupportedReason"
        ]
      },
      "BusinessCampaignTemplateSnapshot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "pattern": "^[a-z0-9_]{1,512}$"
          },
          "language": {
            "type": "string",
            "pattern": "^[a-z]{2,3}(_[A-Za-z0-9]{2,4})?$"
          },
          "status": {
            "const": "APPROVED"
          },
          "category": {
            "type": "string",
            "maxLength": 50
          },
          "components": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessCampaignTemplateComponent"
            },
            "maxItems": 10
          },
          "body": {
            "type": "string",
            "maxLength": 16384
          },
          "placeholders": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000
          },
          "fingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "bodyFingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": [
          "name",
          "language",
          "status",
          "category",
          "components",
          "body",
          "placeholders",
          "fingerprint",
          "bodyFingerprint"
        ]
      },
      "BusinessCampaignTemplates": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessCampaignTemplate"
            },
            "maxItems": 1000
          },
          "complete": {
            "type": "boolean"
          }
        },
        "required": [
          "templates",
          "complete"
        ],
        "description": "Current template descriptions from at most five 200-item Meta pages. complete:false is not proof of the selected outgoing version set. Unsupported templates are described but cannot be used by a new confirmed campaign."
      },
      "BusinessCampaignCapacity": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "limit": {
            "const": 300
          },
          "remaining": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300
          },
          "resetsAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "limit",
          "remaining",
          "resetsAt"
        ],
        "description": "Shared whole-business rolling 24-hour capacity, also visible to scoped campaign readers. This is current informational capacity, not a recipient reservation or separate provider allowance."
      },
      "BusinessCampaignCandidate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profileId": {
            "type": "string",
            "format": "uuid"
          },
          "fullName": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024
              },
              {
                "type": "null"
              }
            ]
          },
          "phoneNumber": {
            "type": "string",
            "maxLength": 64
          },
          "language": {
            "type": "string",
            "maxLength": 16
          }
        },
        "required": [
          "profileId",
          "fullName",
          "phoneNumber",
          "language"
        ]
      },
      "BusinessCampaignPreview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "string",
            "pattern": "^cp[a-f0-9]{64}$"
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "recipientCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300
          },
          "recipients": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessCampaignCandidate"
            },
            "maxItems": 300
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "profileId": {
                  "type": "string",
                  "format": "uuid"
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "blocked",
                    "not_found",
                    "not_yours",
                    "opted_out",
                    "duplicate",
                    "invalid_phone"
                  ]
                }
              },
              "required": [
                "profileId",
                "reason"
              ]
            },
            "maxItems": 1000
          },
          "templateSnapshot": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessCampaignTemplateSnapshot"
            },
            "maxItems": 4,
            "minItems": 1
          },
          "bindingHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "capacity": {
            "$ref": "#/components/schemas/BusinessCampaignCapacity"
          }
        },
        "required": [
          "version",
          "observedAt",
          "recipientCount",
          "recipients",
          "skipped",
          "templateSnapshot",
          "bindingHash",
          "capacity"
        ],
        "description": "Read-only evaluation of this exact draft. version binds material recipient, template and connection facts; observedAt and capacity do not expire/reserve it. Confirmation re-evaluates current facts and requires a new preview if they changed. It never adds an unselected recipient. bindingHash is opaque, not provider credentials."
      },
      "BusinessCampaignState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "campaignId": {
            "type": "string",
            "format": "uuid"
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "source": {
            "type": "string",
            "enum": [
              "native",
              "integration"
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "confirmation": {
            "type": "string",
            "enum": [
              "legacy_body",
              "full_template"
            ]
          },
          "template": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[a-z0-9_]{1,512}$"
              },
              "language": {
                "type": "string",
                "pattern": "^[a-z]{2,3}(_[A-Za-z0-9]{2,4})?$"
              },
              "body": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 16384
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "parameters": {
                "type": "array",
                "items": {
                  "type": "string",
                  "maxLength": 200
                },
                "maxItems": 1000
              },
              "matchLanguage": {
                "type": "boolean"
              },
              "snapshot": {
                "anyOf": [
                  {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/BusinessCampaignTemplateSnapshot"
                    },
                    "maxItems": 4,
                    "minItems": 1
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "name",
              "language",
              "body",
              "parameters",
              "matchLanguage",
              "snapshot"
            ]
          },
          "audience": {
            "$ref": "#/components/schemas/BusinessCampaignAudience"
          },
          "recipientCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300
          },
          "sentCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300
          },
          "failedCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300
          },
          "unknownCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300
          },
          "pendingCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300
          },
          "sendingCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 300
          },
          "state": {
            "type": "string",
            "enum": [
              "sending",
              "done"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "finishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "stoppedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "pausedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "stopCode": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "campaignId",
          "providerId",
          "source",
          "version",
          "confirmation",
          "template",
          "audience",
          "recipientCount",
          "sentCount",
          "failedCount",
          "unknownCount",
          "pendingCount",
          "sendingCount",
          "state",
          "createdAt",
          "finishedAt",
          "stoppedAt",
          "pausedAt",
          "stopCode"
        ],
        "description": "Current authorized campaign. version is the control revision, not a revision for every delivery update. Historical legacy_body campaigns retain body-only confirmation and continuation behavior; a snapshot is never fabricated for them. New campaigns use full_template. sent means provider acceptance, not proven delivery/read.",
        "allOf": [
          {
            "if": {
              "properties": {
                "confirmation": {
                  "const": "legacy_body"
                }
              }
            },
            "then": {
              "properties": {
                "template": {
                  "properties": {
                    "snapshot": {
                      "type": "null"
                    }
                  }
                }
              }
            },
            "else": {
              "properties": {
                "template": {
                  "properties": {
                    "snapshot": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BusinessCampaignTemplateSnapshot"
                      },
                      "minItems": 1,
                      "maxItems": 4
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "BusinessCampaignRecipient": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "recipientId": {
            "type": "string",
            "format": "uuid"
          },
          "profileId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "fullName": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1024
              },
              {
                "type": "null"
              }
            ]
          },
          "phoneNumber": {
            "type": "string",
            "maxLength": 64
          },
          "language": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ]
          },
          "languageSent": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "sending",
              "sent",
              "failed",
              "unknown"
            ]
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2048
              },
              {
                "type": "null"
              }
            ]
          },
          "errorCode": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "sentAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "recipientId",
          "profileId",
          "fullName",
          "phoneNumber",
          "language",
          "languageSent",
          "state",
          "error",
          "errorCode",
          "sentAt",
          "updatedAt"
        ],
        "description": "Retained campaign-purpose history. A deleted contact may have profileId:null. unknown means a send may have occurred and is never eligible for automatic retry."
      },
      "BusinessCampaignList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessCampaignState"
            },
            "maxItems": 100
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4096,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ]
      },
      "BusinessCampaignAudiencePage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessCampaignCandidate"
            },
            "maxItems": 100
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4096,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ]
      },
      "BusinessCampaignRecipientPage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessCampaignRecipient"
            },
            "maxItems": 100
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4096,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ]
      },
      "BusinessCampaignReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "type": "string",
            "enum": [
              "create",
              "continue",
              "retry",
              "stop"
            ]
          },
          "campaignId": {
            "type": "string",
            "format": "uuid"
          },
          "requestHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "expectedVersion": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "previewVersion": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^cp[a-f0-9]{64}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional nonblank external audit reference. At most 200 JavaScript UTF-16 units; original spacing is retained. This never grants identity or authority."
              },
              {
                "type": "null"
              }
            ]
          },
          "result": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "version": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "affectedCount": {
                "type": "integer",
                "minimum": 0,
                "maximum": 300
              }
            },
            "required": [
              "version",
              "affectedCount"
            ]
          }
        },
        "required": [
          "operationId",
          "action",
          "campaignId",
          "requestHash",
          "expectedVersion",
          "previewVersion",
          "externalActorRef",
          "result"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "action": {
                  "const": "create"
                }
              }
            },
            "then": {
              "properties": {
                "expectedVersion": {
                  "type": "null"
                },
                "previewVersion": {
                  "type": "string",
                  "pattern": "^cp[a-f0-9]{64}$"
                }
              }
            },
            "else": {
              "properties": {
                "expectedVersion": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "previewVersion": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "BusinessCampaignResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessCampaignReceipt"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessCampaignState"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "anyOf": [
              {
                "const": "campaign_not_found"
              },
              {
                "type": "null"
              }
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "current": {
                  "type": "null"
                }
              }
            },
            "then": {
              "properties": {
                "currentUnavailableReason": {
                  "const": "campaign_not_found"
                }
              }
            },
            "else": {
              "properties": {
                "currentUnavailableReason": {
                  "type": "null"
                }
              }
            }
          }
        ],
        "description": "Immutable accepted intent receipt plus current authorized state, which may be newer or unavailable. A successful create/continue/retry queues accepted work for the existing bounded sender; it does not prove recipient delivery. Exact replay never creates another campaign or repeats a control mutation."
      },
      "BusinessCampaignLookup": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/BusinessCampaignResult"
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          }
        ]
      },
      "BusinessCampaignCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "draft": {
            "$ref": "#/components/schemas/BusinessCampaignDraft"
          },
          "confirm": {
            "const": true
          }
        },
        "required": [
          "draft",
          "confirm"
        ]
      },
      "BusinessCampaignControl": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional nonblank external audit reference. At most 200 JavaScript UTF-16 units; original spacing is retained. This never grants identity or authority."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": []
      },
      "BusinessCampaignAudienceQuery": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "audience": {
            "$ref": "#/components/schemas/BusinessCampaignAudience"
          },
          "search": {
            "type": "string",
            "maxLength": 200,
            "default": ""
          },
          "templateName": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[a-z0-9_]{1,512}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 50
          },
          "cursor": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4096,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "audience"
        ],
        "description": "Read-only candidate page. For segment.notSentBefore, supply templateName. Preserve the exact query and principal/resource selection while following nextCursor. Scoped credentials support appointment audiences for one currently active granted provider only."
      },
      "BusinessReminderDraft": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "offsetsMinutes": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 60,
              "maximum": 10080,
              "multipleOf": 60
            },
            "maxItems": 3,
            "uniqueItems": true
          }
        },
        "required": [
          "enabled",
          "offsetsMinutes"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "enabled": {
                  "const": true
                }
              }
            },
            "then": {
              "properties": {
                "offsetsMinutes": {
                  "minItems": 1
                }
              }
            }
          }
        ]
      },
      "BusinessReminderPolicyState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "policyRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "capabilityRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "enabled": {
            "type": "boolean"
          },
          "offsetsMinutes": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 60,
              "maximum": 10080,
              "multipleOf": 60
            },
            "maxItems": 3,
            "uniqueItems": true
          },
          "maxRemindersPerAppointment": {
            "type": "integer",
            "minimum": 0,
            "maximum": 3
          },
          "engineMode": {
            "type": "string",
            "enum": [
              "legacy",
              "paused",
              "v2"
            ]
          },
          "timezone": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "pattern": "\\S"
          },
          "summary": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "futureAppointments": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "mixedSchedules": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "suppressedAppointments": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "futureAppointments",
              "mixedSchedules",
              "suppressedAppointments"
            ]
          },
          "readiness": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "offsetMinutes": {
                  "type": "integer",
                  "minimum": 60,
                  "maximum": 10080,
                  "multipleOf": 60
                },
                "language": {
                  "type": "string",
                  "enum": [
                    "he",
                    "ar",
                    "en"
                  ]
                },
                "available": {
                  "type": "boolean"
                },
                "actualLanguage": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "he",
                        "ar",
                        "en"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "checkedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "body": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 16384
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "footer": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 1024
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "offsetMinutes",
                "language",
                "available",
                "actualLanguage",
                "checkedAt",
                "reason",
                "body",
                "footer"
              ]
            },
            "maxItems": 504
          }
        },
        "required": [
          "policyRevision",
          "capabilityRevision",
          "enabled",
          "offsetsMinutes",
          "maxRemindersPerAppointment",
          "engineMode",
          "timezone",
          "summary",
          "readiness"
        ],
        "description": "Saved policy and readiness. The platform ceiling and engineMode are read-only to business integrations. Readiness is saved registry evidence, not a fresh Meta check or delivery promise.",
        "allOf": [
          {
            "if": {
              "properties": {
                "enabled": {
                  "const": true
                }
              }
            },
            "then": {
              "properties": {
                "offsetsMinutes": {
                  "minItems": 1
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "maxRemindersPerAppointment": {
                  "const": 0
                }
              }
            },
            "then": {
              "properties": {
                "offsetsMinutes": {
                  "maxItems": 0
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "maxRemindersPerAppointment": {
                  "const": 1
                }
              }
            },
            "then": {
              "properties": {
                "offsetsMinutes": {
                  "maxItems": 1
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "maxRemindersPerAppointment": {
                  "const": 2
                }
              }
            },
            "then": {
              "properties": {
                "offsetsMinutes": {
                  "maxItems": 2
                }
              }
            }
          },
          {
            "if": {
              "properties": {
                "maxRemindersPerAppointment": {
                  "const": 3
                }
              }
            },
            "then": {
              "properties": {
                "offsetsMinutes": {
                  "maxItems": 3
                }
              }
            }
          }
        ]
      },
      "BusinessReminderPolicyPreviewInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "draft": {
            "$ref": "#/components/schemas/BusinessReminderDraft"
          },
          "scope": {
            "type": "string",
            "enum": [
              "new_bookings",
              "existing_future"
            ]
          }
        },
        "required": [
          "draft",
          "scope"
        ]
      },
      "BusinessReminderPolicyPreview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "policyRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "capabilityRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "normalizedDraft": {
            "$ref": "#/components/schemas/BusinessReminderDraft"
          },
          "scope": {
            "type": "string",
            "enum": [
              "new_bookings",
              "existing_future"
            ]
          },
          "computedAt": {
            "type": "string",
            "format": "date-time"
          },
          "fingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{32}$"
          },
          "counts": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "appointments": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "added": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "kept": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "cancelled": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "skipped": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "appointments",
              "added",
              "kept",
              "cancelled",
              "skipped"
            ]
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "reason": {
                  "const": "eligibility_or_cap"
                },
                "count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "reason",
                "count"
              ]
            },
            "maxItems": 1
          }
        },
        "required": [
          "policyRevision",
          "capabilityRevision",
          "normalizedDraft",
          "scope",
          "computedAt",
          "fingerprint",
          "counts",
          "reasons"
        ]
      },
      "BusinessReminderPolicyApply": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "draft": {
            "$ref": "#/components/schemas/BusinessReminderDraft"
          },
          "scope": {
            "type": "string",
            "enum": [
              "new_bookings",
              "existing_future"
            ]
          },
          "fingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{32}$"
          },
          "confirm": {
            "const": true
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional nonblank external audit reference, up to 200 Unicode codepoints. Preserved spacing; it does not grant identity or authority."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "draft",
          "scope",
          "fingerprint",
          "confirm"
        ]
      },
      "BusinessReminderPolicyRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expectedPolicyRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "expectedCapabilityRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "draft": {
            "$ref": "#/components/schemas/BusinessReminderDraft"
          },
          "scope": {
            "type": "string",
            "enum": [
              "new_bookings",
              "existing_future"
            ]
          },
          "fingerprint": {
            "type": "string",
            "pattern": "^[a-f0-9]{32}$"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional nonblank external audit reference, up to 200 Unicode codepoints. Preserved spacing; it does not grant identity or authority."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "expectedPolicyRevision",
          "expectedCapabilityRevision",
          "draft",
          "scope",
          "fingerprint",
          "externalActorRef"
        ]
      },
      "BusinessReminderPolicyAccepted": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "const": "policy"
          },
          "policyRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "capabilityRevision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "appliedAt": {
            "type": "string",
            "format": "date-time"
          },
          "scope": {
            "type": "string",
            "enum": [
              "new_bookings",
              "existing_future"
            ]
          },
          "draft": {
            "$ref": "#/components/schemas/BusinessReminderDraft"
          }
        },
        "required": [
          "operationId",
          "tenantId",
          "kind",
          "policyRevision",
          "capabilityRevision",
          "appliedAt",
          "scope",
          "draft"
        ]
      },
      "BusinessReminderPolicyReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "request": {
            "$ref": "#/components/schemas/BusinessReminderPolicyRequest"
          },
          "state": {
            "$ref": "#/components/schemas/BusinessReminderPolicyAccepted"
          }
        },
        "required": [
          "operationId",
          "request",
          "state"
        ]
      },
      "BusinessReminderPolicyResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessReminderPolicyReceipt"
          },
          "current": {
            "$ref": "#/components/schemas/BusinessReminderPolicyState"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "replayed"
        ]
      },
      "BusinessReminderPolicyLookup": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessReminderPolicyReceipt"
              },
              "current": {
                "$ref": "#/components/schemas/BusinessReminderPolicyState"
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "replayed"
            ]
          }
        ]
      },
      "BusinessReminderRecipientState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "recipient": {
            "type": "string",
            "pattern": "^[0-9]{5,20}$"
          },
          "version": {
            "type": "string",
            "pattern": "^rr[a-f0-9]{64}$"
          },
          "allowed": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "source": {
            "type": "string",
            "enum": [
              "default",
              "owner",
              "legacy_profile",
              "integration"
            ]
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          },
          "engineMode": {
            "type": "string",
            "enum": [
              "legacy",
              "paused",
              "v2"
            ]
          }
        },
        "required": [
          "businessCustomerId",
          "recipient",
          "version",
          "allowed",
          "revision",
          "source",
          "updatedAt",
          "engineMode"
        ],
        "description": "Preference is shared by the same normalized phone within this business. The version also binds this contact and its current phone; a changed phone refuses a stale write."
      },
      "BusinessReminderRecipientChanges": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expectedRecipient": {
            "type": "string",
            "pattern": "^[0-9]{5,20}$"
          },
          "allowed": {
            "type": "boolean"
          },
          "acknowledgedReenable": {
            "type": "boolean"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional nonblank external audit reference, up to 200 Unicode codepoints. Preserved spacing; it does not grant identity or authority."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "expectedRecipient",
          "allowed",
          "acknowledgedReenable"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "allowed": {
                  "const": true
                }
              }
            },
            "then": {
              "properties": {
                "acknowledgedReenable": {
                  "const": true
                }
              }
            }
          }
        ]
      },
      "BusinessReminderRecipientRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "expectedVersion": {
            "type": "string",
            "pattern": "^rr[a-f0-9]{64}$"
          },
          "expectedRecipient": {
            "type": "string",
            "pattern": "^[0-9]{5,20}$"
          },
          "allowed": {
            "type": "boolean"
          },
          "acknowledgedReenable": {
            "type": "boolean"
          },
          "externalActorRef": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200,
                "minLength": 1,
                "pattern": "^(?=[\\s\\S]*\\S)[^\\u0000-\\u001f\\u007f]+$",
                "description": "Optional nonblank external audit reference, up to 200 Unicode codepoints. Preserved spacing; it does not grant identity or authority."
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "businessCustomerId",
          "expectedVersion",
          "expectedRecipient",
          "allowed",
          "acknowledgedReenable",
          "externalActorRef"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "allowed": {
                  "const": true
                }
              }
            },
            "then": {
              "properties": {
                "acknowledgedReenable": {
                  "const": true
                }
              }
            }
          }
        ]
      },
      "BusinessReminderRecipientAccepted": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "const": "recipient"
          },
          "recipient": {
            "type": "string",
            "pattern": "^[0-9]{5,20}$"
          },
          "allowed": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "source": {
            "type": "string",
            "enum": [
              "default",
              "owner",
              "legacy_profile",
              "integration"
            ]
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "operationId",
          "tenantId",
          "kind",
          "recipient",
          "allowed",
          "revision",
          "source",
          "updatedAt"
        ]
      },
      "BusinessReminderRecipientReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "request": {
            "$ref": "#/components/schemas/BusinessReminderRecipientRequest"
          },
          "state": {
            "$ref": "#/components/schemas/BusinessReminderRecipientAccepted"
          }
        },
        "required": [
          "operationId",
          "request",
          "state"
        ]
      },
      "BusinessReminderRecipientResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessReminderRecipientReceipt"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessReminderRecipientState"
              },
              {
                "type": "null"
              }
            ]
          },
          "currentUnavailableReason": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "customer_not_found",
                  "recipient_changed"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "currentUnavailableReason",
          "replayed"
        ],
        "allOf": [
          {
            "oneOf": [
              {
                "properties": {
                  "current": {
                    "type": "null"
                  },
                  "currentUnavailableReason": {
                    "type": "string",
                    "enum": [
                      "customer_not_found",
                      "recipient_changed"
                    ]
                  }
                }
              },
              {
                "properties": {
                  "current": {
                    "$ref": "#/components/schemas/BusinessReminderRecipientState"
                  },
                  "currentUnavailableReason": {
                    "type": "null"
                  }
                }
              }
            ]
          }
        ]
      },
      "BusinessReminderRecipientLookup": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "not_found"
              }
            },
            "required": [
              "status"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessReminderRecipientReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessReminderRecipientState"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currentUnavailableReason": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "customer_not_found",
                      "recipient_changed"
                    ]
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "currentUnavailableReason",
              "replayed"
            ],
            "allOf": [
              {
                "oneOf": [
                  {
                    "properties": {
                      "current": {
                        "type": "null"
                      },
                      "currentUnavailableReason": {
                        "type": "string",
                        "enum": [
                          "customer_not_found",
                          "recipient_changed"
                        ]
                      }
                    }
                  },
                  {
                    "properties": {
                      "current": {
                        "$ref": "#/components/schemas/BusinessReminderRecipientState"
                      },
                      "currentUnavailableReason": {
                        "type": "null"
                      }
                    }
                  }
                ]
              }
            ]
          }
        ]
      },
      "BusinessReminderAppointmentQuery": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "appointmentIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 200,
            "minItems": 1,
            "uniqueItems": true
          }
        },
        "required": [
          "appointmentIds"
        ]
      },
      "BusinessReminderAppointmentState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "engineMode": {
            "type": "string",
            "enum": [
              "legacy",
              "paused",
              "v2"
            ]
          },
          "reminders": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "offsetMinutes": {
                  "type": "integer",
                  "minimum": 60,
                  "maximum": 10080,
                  "multipleOf": 60
                },
                "scheduledAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "state": {
                  "type": "string",
                  "enum": [
                    "scheduled",
                    "queued",
                    "accepted",
                    "delivered",
                    "failed",
                    "unknown",
                    "suppressed",
                    "expired"
                  ]
                },
                "reason": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 100
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "offsetMinutes",
                "scheduledAt",
                "updatedAt",
                "state",
                "reason"
              ]
            },
            "maxItems": 168
          }
        },
        "required": [
          "appointmentId",
          "engineMode",
          "reminders"
        ],
        "description": "Physical appointment reminder timeline, not a website booking notification record. Legacy mode with an empty list means this V2 timeline is unavailable. Unknown is not a definite retryable failure. The cap limits admission, not retained historical rows."
      },
      "BusinessReminderAppointmentStates": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/BusinessReminderAppointmentState"
        },
        "maxItems": 200,
        "minItems": 1
      },
      "BusinessDirectorySnapshot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "cursor": {
            "type": "string",
            "format": "uuid"
          },
          "watermark": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "projectionEpoch": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "cursor",
          "watermark",
          "projectionEpoch",
          "expiresAt"
        ],
        "description": "Fixed membership IDs plus a publication watermark. Pages hydrate current authorized values, not historical values. Complete all membership pages, then follow the returned changes cursor. Membership expires after 30 minutes."
      },
      "BusinessDirectoryCheckpoint": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/BusinessCustomerCheckpointReceipt"
          },
          "currentProjectionEpoch": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "bootstrapRequired": {
            "type": "boolean"
          },
          "replayed": {
            "type": "boolean"
          },
          "unchanged": {
            "type": "boolean",
            "description": "True only for a successful current checkpoint confirmation that made no new durable receipt. Optional for compatibility."
          }
        },
        "required": [
          "receipt",
          "currentProjectionEpoch",
          "bootstrapRequired",
          "replayed"
        ],
        "description": "ACK only after committing the page and nextCursor in your own database. A snapshot page with hasMore:true returns a partial cursor that cannot be acknowledged. A snapshot page with hasMore:false returns a complete changes cursor. Every changes page nextCursor is acknowledgeable, including empty filtered pages and hasMore:true. Exact operation UUID/cursor replay returns an immutable receipt plus currentProjectionEpoch/bootstrapRequired. It does not prove the external copy correct. Progress never moves backwards. A validated new UUID for the already acknowledged identical cursor and sequence can return unchanged:true without creating another stored receipt or updating appliedAt. This confirms the current checkpoint; it does not durably reserve that new UUID. Previously accepted operation UUIDs are replayed or rejected for conflict first. Accepted checkpoint receipts are retained for at least 30 days and until their original cursor is no longer valid. An uncertain pending ACK must retain its original UUID and cursor; always honor currentProjectionEpoch and bootstrapRequired, including on replay."
      },
      "BusinessDirectorySyncProvider": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "providerId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "$ref": "#/components/schemas/BusinessProviderVersion"
          },
          "name": {
            "$ref": "#/components/schemas/BusinessProviderDisplayName"
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "description": "Ordinary provider contact text; no customer phone proof, consent, sender connection or login authority."
          },
          "color": {
            "type": "string",
            "description": "Stored custom color text, including legacy values."
          },
          "isActive": {
            "type": "boolean"
          },
          "hasLinkedUser": {
            "type": "boolean",
            "description": "Only a linkage indicator. No user identity, login credentials or user-management permission."
          },
          "assignment": {
            "$ref": "#/components/schemas/BusinessProviderAssignment"
          },
          "activityEffects": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "activate": {
                "enum": [
                  "none",
                  "managed_booking_unavailable",
                  "managed_booking_restored"
                ]
              },
              "deactivate": {
                "enum": [
                  "none",
                  "managed_booking_unavailable",
                  "managed_booking_restored"
                ]
              }
            },
            "required": [
              "activate",
              "deactivate"
            ]
          },
          "displayOrder": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": -2147483648,
            "maximum": 2147483647,
            "description": "Current stored ordering; does not widen selected provider authority. Use providerId to break ties."
          }
        },
        "required": [
          "providerId",
          "version",
          "name",
          "email",
          "phone",
          "color",
          "isActive",
          "hasLinkedUser",
          "assignment",
          "activityEffects",
          "displayOrder"
        ]
      },
      "BusinessServiceSyncContext": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "catalogueVersion": {
            "$ref": "#/components/schemas/BusinessServiceCatalogueVersion"
          },
          "managedServiceCreationAvailable": {
            "type": "boolean"
          }
        },
        "required": [
          "catalogueVersion",
          "managedServiceCreationAvailable"
        ]
      },
      "BusinessServiceSyncMember": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "serviceId": {
                "type": "string",
                "format": "uuid"
              },
              "serviceVersion": {
                "$ref": "#/components/schemas/BusinessServiceVersion"
              },
              "mode": {
                "enum": [
                  "legacy",
                  "service_duration"
                ]
              },
              "name": {
                "$ref": "#/components/schemas/BusinessServiceName"
              },
              "description": {
                "description": "Stored service description JSON; null and legacy JSON remain readable."
              },
              "priceMajor": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "Current catalogue price in major units. Nullable legacy price is retained; this is not a booking quote or minor units."
              },
              "currency": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 10000,
                "description": "Stored currency label, including legacy/custom labels and ₪. No inferred ISO currency."
              },
              "isActive": {
                "type": "boolean"
              },
              "displayOrder": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -2147483648,
                "maximum": 2147483647
              },
              "legacyDurationMinutes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -2147483648,
                "maximum": 2147483647,
                "readOnly": true,
                "description": "Historical duration field, not edited by this contract."
              },
              "bookingDurationMinutes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -2147483648,
                "maximum": 2147483647
              },
              "removalDurationMinutes": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -2147483648,
                "maximum": 2147483647
              },
              "removalPriceMajor": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "publication": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "selected": {
                    "type": "boolean"
                  },
                  "eligible": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "selected",
                  "eligible"
                ],
                "description": "Current public selection and eligibility, not publication permission. Catalogue creation/activity never automatically selects a public service."
              },
              "deleteBlockers": {
                "type": "array",
                "items": {
                  "enum": [
                    "appointments_exist",
                    "provider_assignment_would_expand"
                  ]
                },
                "maxItems": 2,
                "uniqueItems": true,
                "description": "Advisory current blockers; delete rechecks under serialization. Deactivation remains available."
              },
              "removed": {
                "const": false
              },
              "priceRangeMajor": {
                "$ref": "#/components/schemas/MajorPriceRange"
              }
            },
            "required": [
              "serviceId",
              "serviceVersion",
              "mode",
              "name",
              "description",
              "priceMajor",
              "currency",
              "isActive",
              "displayOrder",
              "legacyDurationMinutes",
              "bookingDurationMinutes",
              "removalDurationMinutes",
              "removalPriceMajor",
              "publication",
              "deleteBlockers",
              "removed"
            ],
            "allOf": [
              {
                "if": {
                  "required": [
                    "priceRangeMajor"
                  ],
                  "properties": {
                    "priceRangeMajor": {
                      "type": "object"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "priceMajor": {
                      "type": "null"
                    }
                  }
                }
              }
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "serviceId": {
                "type": "string",
                "format": "uuid"
              },
              "removed": {
                "const": true
              }
            },
            "required": [
              "serviceId",
              "removed"
            ]
          }
        ]
      },
      "BusinessServiceSyncEvent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "type": {
            "enum": [
              "upsert",
              "removed"
            ]
          },
          "changedFields": {
            "type": "array",
            "items": {
              "enum": [
                "*",
                "serviceVersion",
                "mode",
                "name",
                "description",
                "priceMajor",
                "currency",
                "isActive",
                "displayOrder",
                "legacyDurationMinutes",
                "bookingDurationMinutes",
                "removalDurationMinutes",
                "removalPriceMajor",
                "publication",
                "deleteBlockers"
              ]
            },
            "maxItems": 64,
            "minItems": 1,
            "uniqueItems": true
          },
          "serviceId": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "const": "crad_catalogue"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessService"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "eventId",
          "sequence",
          "type",
          "changedFields",
          "serviceId",
          "source",
          "current"
        ],
        "description": "Metadata signal with current authorized hydration. A removal signal can have a newer non-null current value. Apply current, not type alone. Sequence is not the resource ETag; changedFields are invalidation categories, not historical values."
      },
      "BusinessServiceSyncPage": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "snapshot"
              },
              "services": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BusinessServiceSyncMember"
                },
                "maxItems": 100
              },
              "nextCursor": {
                "type": "string",
                "format": "uuid"
              },
              "hasMore": {
                "type": "boolean"
              },
              "watermark": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "projectionEpoch": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "context": {
                "$ref": "#/components/schemas/BusinessServiceSyncContext"
              }
            },
            "required": [
              "kind",
              "services",
              "nextCursor",
              "hasMore",
              "watermark",
              "projectionEpoch",
              "context"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "changes"
              },
              "events": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BusinessServiceSyncEvent"
                },
                "maxItems": 100
              },
              "nextCursor": {
                "type": "string",
                "format": "uuid"
              },
              "hasMore": {
                "type": "boolean"
              },
              "watermark": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "projectionEpoch": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              },
              "context": {
                "$ref": "#/components/schemas/BusinessServiceSyncContext"
              }
            },
            "required": [
              "kind",
              "events",
              "nextCursor",
              "hasMore",
              "watermark",
              "projectionEpoch",
              "context"
            ]
          }
        ],
        "description": "Current-state page. Atomically apply data and nextCursor even when events is empty. Do not combine the two independent feeds as a historical snapshot; fresh quote/availability remains required before booking."
      },
      "BusinessProviderSyncMember": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "providerId": {
                "type": "string",
                "format": "uuid"
              },
              "version": {
                "$ref": "#/components/schemas/BusinessProviderVersion"
              },
              "name": {
                "$ref": "#/components/schemas/BusinessProviderDisplayName"
              },
              "email": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Ordinary provider contact text; no customer phone proof, consent, sender connection or login authority."
              },
              "color": {
                "type": "string",
                "description": "Stored custom color text, including legacy values."
              },
              "isActive": {
                "type": "boolean"
              },
              "hasLinkedUser": {
                "type": "boolean",
                "description": "Only a linkage indicator. No user identity, login credentials or user-management permission."
              },
              "assignment": {
                "$ref": "#/components/schemas/BusinessProviderAssignment"
              },
              "activityEffects": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "activate": {
                    "enum": [
                      "none",
                      "managed_booking_unavailable",
                      "managed_booking_restored"
                    ]
                  },
                  "deactivate": {
                    "enum": [
                      "none",
                      "managed_booking_unavailable",
                      "managed_booking_restored"
                    ]
                  }
                },
                "required": [
                  "activate",
                  "deactivate"
                ]
              },
              "displayOrder": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": -2147483648,
                "maximum": 2147483647,
                "description": "Current stored ordering; does not widen selected provider authority. Use providerId to break ties."
              },
              "removed": {
                "const": false
              }
            },
            "required": [
              "providerId",
              "version",
              "name",
              "email",
              "phone",
              "color",
              "isActive",
              "hasLinkedUser",
              "assignment",
              "activityEffects",
              "displayOrder",
              "removed"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "providerId": {
                "type": "string",
                "format": "uuid"
              },
              "removed": {
                "const": true
              }
            },
            "required": [
              "providerId",
              "removed"
            ]
          }
        ]
      },
      "BusinessProviderSyncEvent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1,
            "maximum": 9007199254740991
          },
          "type": {
            "enum": [
              "upsert",
              "removed"
            ]
          },
          "changedFields": {
            "type": "array",
            "items": {
              "enum": [
                "*",
                "version",
                "name",
                "email",
                "phone",
                "color",
                "isActive",
                "hasLinkedUser",
                "assignment",
                "activityEffects",
                "displayOrder"
              ]
            },
            "maxItems": 64,
            "minItems": 1,
            "uniqueItems": true
          },
          "providerId": {
            "type": "string",
            "format": "uuid"
          },
          "source": {
            "const": "crad_provider"
          },
          "current": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BusinessDirectorySyncProvider"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "eventId",
          "sequence",
          "type",
          "changedFields",
          "providerId",
          "source",
          "current"
        ],
        "description": "Metadata signal with current authorized hydration. A removal signal can have a newer non-null current value. Apply current, not type alone. Sequence is not the resource ETag; changedFields are invalidation categories, not historical values."
      },
      "BusinessProviderSyncPage": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "snapshot"
              },
              "providers": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BusinessProviderSyncMember"
                },
                "maxItems": 100
              },
              "nextCursor": {
                "type": "string",
                "format": "uuid"
              },
              "hasMore": {
                "type": "boolean"
              },
              "watermark": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "projectionEpoch": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "required": [
              "kind",
              "providers",
              "nextCursor",
              "hasMore",
              "watermark",
              "projectionEpoch"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "kind": {
                "const": "changes"
              },
              "events": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/BusinessProviderSyncEvent"
                },
                "maxItems": 100
              },
              "nextCursor": {
                "type": "string",
                "format": "uuid"
              },
              "hasMore": {
                "type": "boolean"
              },
              "watermark": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "projectionEpoch": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "required": [
              "kind",
              "events",
              "nextCursor",
              "hasMore",
              "watermark",
              "projectionEpoch"
            ]
          }
        ],
        "description": "Current-state page. Atomically apply data and nextCursor even when events is empty. Do not combine the two independent feeds as a historical snapshot; fresh quote/availability remains required before booking."
      },
      "BusinessCustomerSegmentFilters": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "away": {
            "type": "string",
            "enum": [
              "3w",
              "1m",
              "2m",
              "3m"
            ]
          },
          "visits": {
            "type": "string",
            "enum": [
              "none",
              "one",
              "recentRegular",
              "regular"
            ]
          },
          "backToBack": {
            "type": "string",
            "enum": [
              "once",
              "repeated"
            ]
          },
          "lateRegular": {
            "type": "boolean"
          },
          "noUpcoming": {
            "type": "boolean"
          },
          "recentMissed": {
            "type": "boolean"
          },
          "newCustomers": {
            "type": "boolean"
          },
          "lastVisit": {
            "type": "string",
            "enum": [
              "within30",
              "notSince60",
              "notSince90"
            ]
          },
          "overdue": {
            "type": "boolean"
          },
          "missed": {
            "type": "boolean"
          },
          "providerId": {
            "type": "string",
            "format": "uuid"
          },
          "visitedFrom": {
            "type": "string",
            "format": "date"
          },
          "visitedTo": {
            "type": "string",
            "format": "date"
          }
        },
        "required": [],
        "dependentRequired": {
          "visitedFrom": [
            "visitedTo"
          ],
          "visitedTo": [
            "visitedFrom"
          ]
        },
        "description": "AND-combined Contacts criteria, including retained legacy choices. Both visit dates are required together. False toggles are ignored. Message-history criteria are not accepted."
      },
      "BusinessCustomerSegmentsQuery": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "search": {
            "type": "string",
            "maxLength": 200,
            "default": "",
            "description": "Normalized name words, phone or email match. Email is searchable under this explicit scope but is not returned.",
            "pattern": "^[^\\u0000-\\u001f\\u007f]*$"
          },
          "languages": {
            "type": "array",
            "items": {
              "enum": [
                "he",
                "ar",
                "en"
              ]
            },
            "maxItems": 3,
            "uniqueItems": true,
            "default": []
          },
          "status": {
            "enum": [
              "all",
              "active",
              "blocked"
            ],
            "default": "all"
          },
          "segments": {
            "$ref": "#/components/schemas/BusinessCustomerSegmentFilters"
          },
          "sort": {
            "enum": [
              "name",
              "joined",
              "lastAppointment"
            ],
            "default": "name"
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 50
          },
          "cursor": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "pattern": "^cs1\\.[A-Za-z0-9_-]+\\.[a-f0-9]{64}$",
            "description": "Opaque encrypted and authenticated current-query pagination token with a 15-minute expiry. Keep the complete query unchanged; restart after credential rotation, INVALID_CURSOR or expiry. Not a frozen history snapshot or a synchronization cursor. Do not decode or construct it."
          },
          "countQueries": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,64}$"
                },
                "segments": {
                  "$ref": "#/components/schemas/BusinessCustomerSegmentFilters"
                }
              },
              "required": [
                "id",
                "segments"
              ]
            },
            "maxItems": 32
          }
        },
        "required": [],
        "description": "Read-only query; no Idempotency-Key or If-Match. countQueries IDs must be unique. Each proposal replaces segments and shares the same base search/languages/status. Complete counts refuse beyond the supported 20,000-contact ceiling; no partial totals."
      },
      "BusinessCustomerSegmentsResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "customers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessCustomer"
            },
            "maxItems": 100
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2048,
            "pattern": "^cs1\\.[A-Za-z0-9_-]+\\.[a-f0-9]{64}$",
            "description": "Opaque encrypted and authenticated current-query pagination token with a 15-minute expiry. Keep the complete query unchanged; restart after credential rotation, INVALID_CURSOR or expiry. Not a frozen history snapshot or a synchronization cursor. Do not decode or construct it."
          },
          "observedAt": {
            "type": "string",
            "format": "date-time"
          },
          "timezone": {
            "type": "string",
            "minLength": 1
          },
          "counts": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0,
                "maximum": 20000
              },
              "base": {
                "type": "integer",
                "minimum": 0,
                "maximum": 20000
              },
              "matched": {
                "type": "integer",
                "minimum": 0,
                "maximum": 20000
              },
              "languages": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "he": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 20000
                  },
                  "ar": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 20000
                  },
                  "en": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 20000
                  }
                },
                "required": [
                  "he",
                  "ar",
                  "en"
                ]
              },
              "queries": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "id": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,64}$"
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 20000
                    }
                  },
                  "required": [
                    "id",
                    "count"
                  ]
                },
                "maxItems": 32
              }
            },
            "required": [
              "total",
              "base",
              "matched",
              "languages",
              "queries"
            ]
          }
        },
        "required": [
          "customers",
          "nextCursor",
          "observedAt",
          "timezone",
          "counts"
        ],
        "description": "total and language counts cover all business contacts; base applies search/languages/status; matched applies segments; query counts evaluate each replacement proposal over base. No appointment rows, raw visit statistics, email values or private notes. Each response is a current read; pages may change as the business changes."
      },
      "BusinessMonthlyCounts": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "completed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "cancelled": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "missed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "pending": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "confirmed": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "inProgress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "unknown": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "total",
          "completed",
          "cancelled",
          "missed",
          "pending",
          "confirmed",
          "inProgress",
          "unknown"
        ]
      },
      "BusinessMonthlyServiceValue": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "currency": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "description": "Accepted snapshot currency; null for legacy rows without a stored currency. Never inferred from the current catalogue."
          },
          "completedValueMajor": {
            "type": "number",
            "minimum": 0,
            "description": "Sum of known accepted prices for COMPLETED appointments in this currency. Service value, not received payments or revenue."
          },
          "pricedCompleted": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "unpricedCompleted": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "currency",
          "completedValueMajor",
          "pricedCompleted",
          "unpricedCompleted"
        ]
      },
      "BusinessMonthlyDay": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "counts": {
            "$ref": "#/components/schemas/BusinessMonthlyCounts"
          },
          "serviceValues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessMonthlyServiceValue"
            }
          }
        },
        "required": [
          "date",
          "counts",
          "serviceValues"
        ]
      },
      "BusinessMonthlyService": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "serviceId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "name": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "he": {
                "type": "string"
              },
              "ar": {
                "type": "string"
              },
              "en": {
                "type": "string"
              }
            }
          },
          "withRemoval": {
            "type": "boolean"
          },
          "counts": {
            "$ref": "#/components/schemas/BusinessMonthlyCounts"
          },
          "serviceValues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessMonthlyServiceValue"
            }
          }
        },
        "required": [
          "serviceId",
          "name",
          "withRemoval",
          "counts",
          "serviceValues"
        ]
      },
      "BusinessMonthlyProvider": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "providerId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "name": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "he": {
                "type": "string"
              },
              "ar": {
                "type": "string"
              },
              "en": {
                "type": "string"
              }
            }
          },
          "counts": {
            "$ref": "#/components/schemas/BusinessMonthlyCounts"
          },
          "serviceValues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessMonthlyServiceValue"
            }
          }
        },
        "required": [
          "providerId",
          "name",
          "counts",
          "serviceValues"
        ]
      },
      "BusinessReportsMonthly": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "asOf": {
            "type": "string",
            "format": "date-time"
          },
          "timezone": {
            "type": "string",
            "minLength": 1
          },
          "month": {
            "type": "string",
            "pattern": "^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])$"
          },
          "period": {
            "$ref": "#/components/schemas/BusinessReportPeriod"
          },
          "counts": {
            "$ref": "#/components/schemas/BusinessMonthlyCounts"
          },
          "serviceValues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessMonthlyServiceValue"
            }
          },
          "days": {
            "type": "array",
            "minItems": 28,
            "maxItems": 31,
            "items": {
              "$ref": "#/components/schemas/BusinessMonthlyDay"
            }
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessMonthlyService"
            }
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessMonthlyProvider"
            }
          }
        },
        "required": [
          "asOf",
          "timezone",
          "month",
          "period",
          "counts",
          "serviceValues",
          "days",
          "services",
          "providers"
        ],
        "description": "Complete business month from one database observation, using current appointment start times and statuses. Every calendar day is returned, including zero days. Cancelled/missed records remain in counts. Snapshot names and removal options retain historical identities. Completed service values are grouped by accepted currency; missing prices are counted, not silently zero-valued. No customer PII or actual payment claims. Counts are physical records, including CANCELLED predecessors retained by replacement reschedules; they are not a unique-booking funnel."
      },
      "BookingTimeProposal": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "proposalId": {
            "type": "string",
            "format": "uuid"
          },
          "appointmentVersion": {
            "$ref": "#/components/schemas/BusinessAppointmentVersion"
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "state": {
            "enum": [
              "offered",
              "accepted",
              "declined"
            ]
          }
        },
        "required": [
          "proposalId",
          "appointmentVersion",
          "startAt",
          "endAt",
          "expiresAt",
          "state"
        ],
        "description": "Version-bound alternative for a pending request. The original keeps its slot; the alternative is not held. Acceptance rechecks capacity and creates one confirmed successor preserving accepted terms. Expired or replaced offers cannot be accepted."
      },
      "BusinessAppointmentProposalAvailability": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "version": {
            "$ref": "#/components/schemas/BusinessAppointmentVersion"
          },
          "localDate": {
            "type": "string",
            "format": "date"
          },
          "timezone": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "durationMinutes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 480
          },
          "slots": {
            "type": "array",
            "maxItems": 1440,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "startAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "endAt": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "startAt",
                "endAt"
              ]
            }
          }
        },
        "required": [
          "appointmentId",
          "version",
          "localDate",
          "timezone",
          "durationMinutes",
          "slots"
        ]
      },
      "BookingProposalResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "proposalId": {
            "type": "string",
            "format": "uuid"
          },
          "response": {
            "enum": [
              "accept",
              "decline"
            ]
          }
        },
        "required": [
          "proposalId",
          "response"
        ]
      },
      "BookingProposalResponseResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "proposalId": {
            "type": "string",
            "format": "uuid"
          },
          "response": {
            "enum": [
              "accepted",
              "declined"
            ]
          },
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "currentAppointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "enum": [
              "pending",
              "confirmed"
            ]
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "operationId",
          "proposalId",
          "response",
          "appointmentId",
          "currentAppointmentId",
          "status",
          "startAt",
          "endAt",
          "replayed"
        ]
      },
      "BusinessAppointmentLineage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "appointmentId",
          "rootAppointmentId",
          "current"
        ],
        "properties": {
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "rootAppointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "current": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "appointmentId",
              "version",
              "status",
              "startAt",
              "endAt",
              "cancellationFinal"
            ],
            "properties": {
              "appointmentId": {
                "type": "string",
                "format": "uuid"
              },
              "version": {
                "type": "string",
                "pattern": "^a(?:0|[1-9][0-9]{0,18})$"
              },
              "status": {
                "type": "string",
                "enum": [
                  "PENDING",
                  "CONFIRMED",
                  "NOW",
                  "COMPLETED",
                  "CANCELLED",
                  "MISSED"
                ]
              },
              "startAt": {
                "type": "string",
                "format": "date-time"
              },
              "endAt": {
                "type": "string",
                "format": "date-time"
              },
              "cancellationFinal": {
                "type": "boolean",
                "description": "True only for a current CANCELLED appointment whose canonical snapshot or approval rules prohibit restoration. False for active appointments and for legacy cancellations that may be restored. Not inferred from this caller's allowedActions. Immutable create receipts and private notes must be retained even when a phone hold ends."
              }
            }
          }
        }
      },
      "BusinessCalendarCreateRejected": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "status",
          "receipt",
          "replayed"
        ],
        "properties": {
          "status": {
            "const": "rejected"
          },
          "replayed": {
            "type": "boolean"
          },
          "receipt": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "operationId",
              "action",
              "outcome",
              "resolvedAt"
            ],
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "action": {
                "const": "create"
              },
              "outcome": {
                "const": "not_executed"
              },
              "resolvedAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        }
      },
      "BusinessCalendarCreateResolution": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/BusinessCalendarCreateRejected"
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "status": {
                "const": "committed"
              },
              "receipt": {
                "$ref": "#/components/schemas/BusinessCalendarReceipt"
              },
              "current": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessAppointment"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "currentUnavailableReason": {
                "enum": [
                  null,
                  "removed",
                  "access_unavailable"
                ]
              },
              "replayed": {
                "type": "boolean"
              },
              "undo": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "operationId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "expectedVersion": {
                    "$ref": "#/components/schemas/BusinessAppointmentVersion"
                  },
                  "previousStatus": {
                    "$ref": "#/components/schemas/BusinessAppointmentStatus"
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "operationId",
                  "expectedVersion",
                  "previousStatus",
                  "expiresAt"
                ]
              },
              "notificationCurrent": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/BusinessCalendarCurrentNotification"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "lineage": {
                "$ref": "#/components/schemas/BusinessAppointmentLineage"
              }
            },
            "required": [
              "status",
              "receipt",
              "current",
              "currentUnavailableReason",
              "replayed",
              "lineage"
            ]
          }
        ]
      },
      "MajorPriceRange": {
        "anyOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "min",
              "max"
            ],
            "properties": {
              "min": {
                "type": "number",
                "minimum": 0,
                "maximum": 90071992547409.9
              },
              "max": {
                "type": "number",
                "minimum": 0,
                "maximum": 90071992547409.9
              }
            }
          },
          {
            "type": "null"
          }
        ],
        "description": "Non-final inclusive price bounds in major currency units. Both finite bounds are required; min must be strictly below max and amounts have at most two decimal places. The companion exact amount is null. Omitted or null means no range, not a zero price. Accepted bounds are frozen and must not be recomputed from the current catalogue."
      },
      "ServicePriceRange": {
        "anyOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "min",
              "max"
            ],
            "properties": {
              "min": {
                "type": "number",
                "minimum": 0,
                "maximum": 99999999.99
              },
              "max": {
                "type": "number",
                "minimum": 0,
                "maximum": 99999999.99
              }
            }
          },
          {
            "type": "null"
          }
        ],
        "description": "HALA service-duration price range in major currency units, with min strictly below max and at most two decimal places. An object selects range pricing and requires priceMajor to be omitted or null. Explicit null clears the range; supply a numeric priceMajor to choose a fixed price. An omitted range preserves an existing range during duration-only or legacy null-price updates; a numeric priceMajor selects a fixed price and clears it."
      },
      "MinorPriceRange": {
        "anyOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "min",
              "max"
            ],
            "properties": {
              "min": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "max": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            }
          },
          {
            "type": "null"
          }
        ],
        "description": "Non-final inclusive bounds in minor currency units; 35000–60000 means 350–600 ILS. Both safe integer bounds are required and min must be strictly below max. The companion exact amount is null. Omitted or null means no range. Accepted bounds are immutable quote/booking terms."
      },
      "DateScheduleDayHours": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "open": {
            "type": "string",
            "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "close": {
            "type": "string",
            "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
          },
          "breaks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "start": {
                  "type": "string",
                  "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                },
                "end": {
                  "type": "string",
                  "pattern": "^(?:[01][0-9]|2[0-3]):[0-5][0-9]$"
                }
              },
              "required": [
                "start",
                "end"
              ]
            },
            "maxItems": 10
          }
        },
        "required": [
          "enabled"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "enabled": {
                  "const": true
                }
              }
            },
            "then": {
              "required": [
                "open",
                "close"
              ]
            }
          }
        ]
      },
      "DateScheduleDay": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "version": {
            "type": "string",
            "pattern": "^ds:[a-f0-9]{64}$"
          },
          "dayHours": {
            "$ref": "#/components/schemas/DateScheduleDayHours"
          },
          "weeklyHours": {
            "$ref": "#/components/schemas/DateScheduleDayHours"
          },
          "overridden": {
            "type": "boolean"
          }
        },
        "required": [
          "date",
          "version",
          "dayHours",
          "weeklyHours",
          "overridden"
        ]
      },
      "DateScheduleState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "resourceId": {
            "oneOf": [
              {
                "const": "business"
              },
              {
                "type": "string",
                "format": "uuid"
              }
            ]
          },
          "timezone": {
            "type": "string",
            "minLength": 1
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "version": {
            "type": "string",
            "pattern": "^ds:[a-f0-9]{64}$"
          },
          "dayHours": {
            "$ref": "#/components/schemas/DateScheduleDayHours"
          },
          "weeklyHours": {
            "$ref": "#/components/schemas/DateScheduleDayHours"
          },
          "overridden": {
            "type": "boolean"
          }
        },
        "required": [
          "resourceId",
          "timezone",
          "date",
          "version",
          "dayHours",
          "weeklyHours",
          "overridden"
        ]
      },
      "DateSchedulePage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "resourceId": {
            "oneOf": [
              {
                "const": "business"
              },
              {
                "type": "string",
                "format": "uuid"
              }
            ]
          },
          "timezone": {
            "type": "string",
            "minLength": 1
          },
          "days": {
            "type": "array",
            "maxItems": 93,
            "items": {
              "$ref": "#/components/schemas/DateScheduleDay"
            }
          }
        },
        "required": [
          "resourceId",
          "timezone",
          "days"
        ]
      },
      "DateScheduleProposal": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "dayHours": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DateScheduleDayHours"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "dayHours"
        ]
      },
      "DateSchedulePreview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          },
          "resourceId": {
            "oneOf": [
              {
                "const": "business"
              },
              {
                "type": "string",
                "format": "uuid"
              }
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "expectedVersion": {
            "type": "string",
            "pattern": "^ds:[a-f0-9]{64}$"
          },
          "dayHours": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DateScheduleDayHours"
              },
              {
                "type": "null"
              }
            ]
          },
          "affectedAppointments": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "appointmentId": {
                  "type": "string",
                  "format": "uuid"
                },
                "startAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "endAt": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "appointmentId",
                "startAt",
                "endAt"
              ]
            }
          },
          "affectedCount": {
            "type": "integer",
            "minimum": 0
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "existingAppointmentsPreserved": {
            "const": true
          },
          "effectiveDayHours": {
            "$ref": "#/components/schemas/DateScheduleDayHours"
          }
        },
        "required": [
          "previewId",
          "resourceId",
          "date",
          "expectedVersion",
          "dayHours",
          "affectedAppointments",
          "affectedCount",
          "expiresAt",
          "existingAppointmentsPreserved",
          "effectiveDayHours"
        ]
      },
      "DateScheduleApply": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "previewId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "previewId"
        ]
      },
      "DateScheduleReceipt": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "const": "date_schedule"
          },
          "resourceId": {
            "oneOf": [
              {
                "const": "business"
              },
              {
                "type": "string",
                "format": "uuid"
              }
            ]
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "dayHours": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DateScheduleDayHours"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "type": "string",
            "pattern": "^ds:[a-f0-9]{64}$"
          },
          "preservedAppointmentCount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "operationId",
          "action",
          "resourceId",
          "date",
          "dayHours",
          "version",
          "preservedAppointmentCount"
        ]
      },
      "DateScheduleResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "$ref": "#/components/schemas/DateScheduleReceipt"
          },
          "current": {
            "$ref": "#/components/schemas/DateScheduleState"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "replayed"
        ]
      },
      "MessagingWebhookInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "callbackUrl": {
            "type": "string",
            "format": "uri",
            "maxLength": 1024,
            "pattern": "^https://[^\\s\\\\?#]+$",
            "description": "Exact CRAD-approved canonical HTTPS URL, including its path. No credentials, non-default port, IP-literal host, query or fragment. Hostnames must be lowercase; a host-only URL includes its trailing slash."
          },
          "signingSecret": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "minLength": 64,
            "maxLength": 64,
            "writeOnly": true,
            "description": "Random 32-byte secret encoded as 64 lowercase hexadecimal characters. HMAC uses this literal string as its key, not decoded bytes. Never returned by the API."
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "callbackUrl",
          "signingSecret",
          "enabled"
        ]
      },
      "MessagingWebhookState": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "supported": {
            "const": true
          },
          "approvedCallbackUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri",
                "maxLength": 1024,
                "pattern": "^https://[^\\s\\\\?#]+$",
                "description": "Exact CRAD-approved canonical HTTPS URL, including its path. No credentials, non-default port, IP-literal host, query or fragment. Hostnames must be lowercase; a host-only URL includes its trailing slash."
              },
              {
                "type": "null"
              }
            ]
          },
          "registered": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "subscriptionId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "callbackUrl": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri",
                "maxLength": 1024,
                "pattern": "^https://[^\\s\\\\?#]+$",
                "description": "Exact CRAD-approved canonical HTTPS URL, including its path. No credentials, non-default port, IP-literal host, query or fragment. Hostnames must be lowercase; a host-only URL includes its trailing slash."
              },
              {
                "type": "null"
              }
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "enum": [
                "message.received",
                "message.status"
              ]
            },
            "minItems": 2,
            "maxItems": 2,
            "uniqueItems": true
          },
          "pending": {
            "type": "integer",
            "minimum": 0
          },
          "failed": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "supported",
          "approvedCallbackUrl",
          "registered",
          "enabled",
          "subscriptionId",
          "callbackUrl",
          "events",
          "pending",
          "failed"
        ],
        "description": "Current integration-scoped configuration. supported identifies installed HTTP support, not active delivery. registered means a credential has been bound; enabled is separate. Pending includes leased events. A missing approval or registration is represented by null IDs/URLs, not an invented destination."
      },
      "MessagingWebhookSetResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "subscriptionId": {
                "type": "string",
                "format": "uuid"
              },
              "enabled": {
                "type": "boolean"
              }
            },
            "required": [
              "operationId",
              "subscriptionId",
              "enabled"
            ]
          },
          "current": {
            "$ref": "#/components/schemas/MessagingWebhookState"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "replayed"
        ]
      },
      "MessagingWebhookDelivery": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "eventId": {
            "type": "string",
            "format": "uuid"
          },
          "type": {
            "enum": [
              "message.received",
              "message.status"
            ]
          },
          "state": {
            "enum": [
              "pending",
              "leased",
              "delivered",
              "failed",
              "expired"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastStatus": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 100,
            "maximum": 599
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 80
          },
          "nextAttemptAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "eventId",
          "type",
          "state",
          "attempts",
          "occurredAt",
          "lastStatus",
          "lastError",
          "nextAttemptAt"
        ]
      },
      "MessagingWebhookDeliveryList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "deliveries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessagingWebhookDelivery"
            },
            "maxItems": 100
          },
          "more": {
            "type": "boolean"
          }
        },
        "required": [
          "deliveries",
          "more"
        ],
        "description": "Oldest matching events first. more indicates additional matching records beyond this bounded result; this endpoint has no cursor. No message content or signing secret is included."
      },
      "MessagingWebhookRetryInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {},
        "required": []
      },
      "MessagingWebhookRetryResult": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "receipt": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "operationId": {
                "type": "string",
                "format": "uuid"
              },
              "eventId": {
                "type": "string",
                "format": "uuid"
              }
            },
            "required": [
              "operationId",
              "eventId"
            ]
          },
          "current": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "eventId": {
                "type": "string",
                "format": "uuid"
              },
              "state": {
                "enum": [
                  "pending",
                  "leased",
                  "delivered",
                  "failed",
                  "expired"
                ]
              },
              "attempts": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "eventId",
              "state",
              "attempts"
            ]
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "receipt",
          "current",
          "replayed"
        ]
      },
      "MessagingWebhookAddress": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{5,20}$"
          },
          "userId": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": [
          "phone",
          "userId"
        ],
        "anyOf": [
          {
            "properties": {
              "phone": {
                "type": "string"
              }
            }
          },
          {
            "properties": {
              "userId": {
                "type": "string"
              }
            }
          }
        ],
        "description": "Available Meta recipient identity. phone is digits without a leading plus; userId can identify a recipient whose phone is unavailable. At least one is non-null."
      },
      "MessagingWebhookReceivedData": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "messageId": {
            "type": "string",
            "format": "uuid"
          },
          "conversationId": {
            "type": "string",
            "format": "uuid"
          },
          "providerMessageId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "from": {
            "$ref": "#/components/schemas/MessagingWebhookAddress"
          },
          "kind": {
            "type": "string",
            "maxLength": 64
          },
          "text": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 16384
          },
          "content": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "string",
                "boolean"
              ]
            },
            "description": "Bounded retained message metadata; not raw Meta payloads or authenticated media download URLs."
          },
          "providerTimestamp": {
            "type": "string",
            "format": "date-time"
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "messageId",
          "conversationId",
          "providerMessageId",
          "from",
          "kind",
          "text",
          "content",
          "providerTimestamp",
          "receivedAt"
        ]
      },
      "MessagingWebhookStatusData": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "messageId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "conversationId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "operationId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "Original CRAD send Idempotency-Key when a reliable retained mapping is available; otherwise null."
          },
          "providerMessageId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024
          },
          "phoneNumberId": {
            "type": "string",
            "pattern": "^[0-9]{1,40}$"
          },
          "recipient": {
            "$ref": "#/components/schemas/MessagingWebhookAddress"
          },
          "status": {
            "enum": [
              "sent",
              "delivered",
              "read",
              "played",
              "failed"
            ]
          },
          "providerTimestamp": {
            "type": "string",
            "format": "date-time"
          },
          "error": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "code": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2147483647
                  }
                },
                "required": [
                  "code"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Bounded Meta delivery-error code, when supplied. No raw provider payload. A code does not prove the recipient-specific cause."
          }
        },
        "required": [
          "messageId",
          "conversationId",
          "operationId",
          "providerMessageId",
          "phoneNumberId",
          "recipient",
          "status",
          "providerTimestamp"
        ],
        "allOf": [
          {
            "if": {
              "properties": {
                "status": {
                  "not": {
                    "const": "failed"
                  }
                }
              },
              "required": [
                "status"
              ]
            },
            "then": {
              "properties": {
                "error": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "MessagingWebhookEvent": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schemaVersion": {
                "const": 1
              },
              "eventId": {
                "type": "string",
                "format": "uuid"
              },
              "type": {
                "const": "message.received"
              },
              "subscriptionId": {
                "type": "string",
                "format": "uuid"
              },
              "siteId": {
                "type": "string",
                "format": "uuid"
              },
              "integrationId": {
                "type": "string",
                "format": "uuid"
              },
              "occurredAt": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "$ref": "#/components/schemas/MessagingWebhookReceivedData"
              }
            },
            "required": [
              "schemaVersion",
              "eventId",
              "type",
              "subscriptionId",
              "siteId",
              "integrationId",
              "occurredAt",
              "data"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "schemaVersion": {
                "const": 1
              },
              "eventId": {
                "type": "string",
                "format": "uuid"
              },
              "type": {
                "const": "message.status"
              },
              "subscriptionId": {
                "type": "string",
                "format": "uuid"
              },
              "siteId": {
                "type": "string",
                "format": "uuid"
              },
              "integrationId": {
                "type": "string",
                "format": "uuid"
              },
              "occurredAt": {
                "type": "string",
                "format": "date-time"
              },
              "data": {
                "$ref": "#/components/schemas/MessagingWebhookStatusData"
              }
            },
            "required": [
              "schemaVersion",
              "eventId",
              "type",
              "subscriptionId",
              "siteId",
              "integrationId",
              "occurredAt",
              "data"
            ]
          }
        ],
        "description": "At-least-once live message/status notification. Verify the exact raw body with HMAC before parsing, then durably deduplicate by eventId. Events can arrive out of order. Early statuses can have null CRAD IDs; if a retained outgoing message is subsequently linked, a distinct status event with a new eventId supplies the resolved IDs. Retry bodies are immutable after the first delivery attempt. Payload retention follows the source message/receipt; expired content cannot be retried."
      },
      "WhatsappProfilePatch": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "about": {
            "type": "string",
            "minLength": 1,
            "maxLength": 139
          },
          "address": {
            "type": "string",
            "maxLength": 256
          },
          "description": {
            "type": "string",
            "maxLength": 512
          },
          "email": {
            "type": "string",
            "description": "Empty clears the value; a nonempty value must be a valid email address.",
            "maxLength": 128
          },
          "websites": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "type": "string",
              "format": "uri",
              "pattern": "^https?://",
              "description": "No username/password.",
              "maxLength": 256
            }
          },
          "vertical": {
            "enum": [
              "UNDEFINED",
              "OTHER",
              "AUTO",
              "BEAUTY",
              "APPAREL",
              "EDU",
              "ENTERTAIN",
              "EVENT_PLAN",
              "FINANCE",
              "GROCERY",
              "GOVT",
              "HOTEL",
              "HEALTH",
              "NONPROFIT",
              "PROF_SERVICES",
              "RETAIL",
              "TRAVEL",
              "RESTAURANT",
              "NOT_A_BIZ"
            ]
          },
          "imageUploadId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [],
        "minProperties": 1,
        "description": "Changed fields only. CRAD input caps; omitted fields are preserved. imageUploadId must be a ready current-binding business_profile image from the resumable image endpoint. Raw handles, URLs and caller-selected phone/WABA IDs are refused. about cannot be blank; vertical cannot be cleared."
      },
      "WhatsappBusinessProfile": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "about": {
            "type": "string",
            "maxLength": 139
          },
          "address": {
            "type": "string",
            "maxLength": 256
          },
          "description": {
            "type": "string",
            "maxLength": 512
          },
          "email": {
            "type": "string",
            "description": "Empty clears the value; a nonempty value must be a valid email address.",
            "maxLength": 128
          },
          "websites": {
            "type": "array",
            "maxItems": 2,
            "items": {
              "type": "string",
              "format": "uri",
              "pattern": "^https?://",
              "description": "No username/password.",
              "maxLength": 256
            }
          },
          "vertical": {
            "type": "string",
            "maxLength": 80
          },
          "profilePictureUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Provider-returned HTTPS picture URL, not an upload handle. CRAD does not fetch caller-provided URLs."
          }
        },
        "required": [
          "about",
          "address",
          "description",
          "email",
          "websites",
          "vertical",
          "profilePictureUrl"
        ]
      },
      "WhatsappProfileRead": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "profile": {
            "$ref": "#/components/schemas/WhatsappBusinessProfile"
          },
          "version": {
            "type": "string",
            "pattern": "^wp[a-f0-9]{64}$"
          }
        },
        "required": [
          "profile",
          "version"
        ]
      },
      "WhatsappTemplateDefinition": {
        "oneOf": [
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[a-z][a-z0-9_]*$",
                "maxLength": 80
              },
              "language": {
                "enum": [
                  "ar",
                  "en_US",
                  "he"
                ]
              },
              "category": {
                "enum": [
                  "UTILITY",
                  "MARKETING"
                ]
              },
              "body": {
                "type": "string",
                "minLength": 1,
                "description": "Contiguous positional variables {{1}} through {{N}}; no skipped positions or named variables. At most 30 positions.",
                "maxLength": 1024
              },
              "examples": {
                "type": "array",
                "maxItems": 30,
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "description": "Exactly one sample per positional variable, in order."
              },
              "header": {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "const": "text"
                      },
                      "text": {
                        "type": "string",
                        "minLength": 1,
                        "description": "Fixed text; no placeholder delimiters.",
                        "maxLength": 60
                      }
                    },
                    "required": [
                      "type",
                      "text"
                    ]
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "type": {
                        "const": "image"
                      },
                      "uploadId": {
                        "type": "string",
                        "format": "uuid"
                      }
                    },
                    "required": [
                      "type",
                      "uploadId"
                    ]
                  }
                ]
              },
              "footer": {
                "type": "string",
                "minLength": 1,
                "description": "Fixed text; no placeholder delimiters.",
                "maxLength": 60
              },
              "buttons": {
                "type": "array",
                "maxItems": 3,
                "uniqueItems": true,
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 25
                },
                "description": "Ordered distinct QUICK_REPLY labels. At send time supply exactly this many opaque payloads."
              }
            },
            "required": [
              "name",
              "language",
              "category",
              "body"
            ]
          },
          {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[a-z][a-z0-9_]*$",
                "maxLength": 80
              },
              "language": {
                "enum": [
                  "ar",
                  "en_US",
                  "he"
                ]
              },
              "category": {
                "const": "AUTHENTICATION"
              },
              "authentication": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "addSecurityRecommendation": {
                    "type": "boolean"
                  },
                  "codeExpirationMinutes": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 90
                  },
                  "copyCodeText": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 25
                  }
                },
                "required": [
                  "addSecurityRecommendation",
                  "codeExpirationMinutes",
                  "copyCodeText"
                ]
              }
            },
            "required": [
              "name",
              "language",
              "category",
              "authentication"
            ]
          }
        ],
        "description": "Closed CRAD creation/editing contract. Meta review, eligibility and provider restrictions still apply. Authentication is standard COPY_CODE, without custom message text or header. The code-expiration footer does not create code generation, verification or expiry enforcement in CRAD. Examples default to [] when there are no body variables."
      },
      "WhatsappOwnedTemplate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Provider name created as crad_<full tenant hex>_<requested name>.",
            "maxLength": 512
          },
          "language": {
            "enum": [
              "ar",
              "en_US",
              "he"
            ]
          },
          "category": {
            "enum": [
              "UTILITY",
              "MARKETING",
              "AUTHENTICATION"
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "providerId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{1,40}$",
            "description": "Informational provider identity; never accepted as an editable resource selector."
          },
          "status": {
            "type": "string",
            "pattern": "^[A-Z_]+$",
            "maxLength": 40
          },
          "definition": {
            "$ref": "#/components/schemas/WhatsappTemplateDefinition"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "language",
          "category",
          "version",
          "providerId",
          "status",
          "definition",
          "updatedAt"
        ],
        "description": "Only templates created and registered for this business through this API. Shared starters and another business's resources cannot be edited/deleted even when a WABA is shared. Local accepted operation state is separate from Meta approval."
      },
      "WhatsappOwnedTemplateRead": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Provider name created as crad_<full tenant hex>_<requested name>.",
            "maxLength": 512
          },
          "language": {
            "enum": [
              "ar",
              "en_US",
              "he"
            ]
          },
          "category": {
            "enum": [
              "UTILITY",
              "MARKETING",
              "AUTHENTICATION"
            ]
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "providerId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{1,40}$",
            "description": "Informational provider identity; never accepted as an editable resource selector."
          },
          "status": {
            "type": "string",
            "pattern": "^[A-Z_]+$",
            "maxLength": 40,
            "description": "Current Meta status observed during this GET when the template exists at Meta. Otherwise the stored state of a template that never reached Meta (LOCAL_PENDING, LOCAL_REJECTED, LOCAL_UNKNOWN), DELETED, or UNKNOWN for a stored Meta ID that Meta no longer lists. It does not certify approval of the local definition or version."
          },
          "definition": {
            "$ref": "#/components/schemas/WhatsappTemplateDefinition"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "providerStatus": {
            "type": [
              "string",
              "null"
            ],
            "description": "Current Meta status, or null when a complete lookup found no matching resource. Provider errors or incomplete lookups return 503 instead of a stale result."
          },
          "providerCheckedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Time of this provider observation; updatedAt remains the local submission update time."
          },
          "submissionStatus": {
            "type": "string",
            "pattern": "^[A-Z_]+$",
            "maxLength": 40,
            "description": "Stored submission result, retained independently of current provider approval. A rejected edit can retain an attempted definition while the earlier provider content remains APPROVED."
          }
        },
        "required": [
          "id",
          "name",
          "language",
          "category",
          "version",
          "providerId",
          "status",
          "definition",
          "updatedAt",
          "providerStatus",
          "providerCheckedAt",
          "submissionStatus"
        ]
      },
      "WhatsappOwnedTemplateList": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/WhatsappOwnedTemplateRead"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "nextCursor"
        ]
      },
      "WhatsappTemplateOperation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "enum": [
              "pending",
              "succeeded",
              "rejected",
              "unknown"
            ]
          },
          "request": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "action": {
                "enum": [
                  "create",
                  "edit",
                  "delete"
                ]
              },
              "templateId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "expectedVersion": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1
              },
              "definition": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/WhatsappTemplateDefinition"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "action",
              "templateId",
              "expectedVersion",
              "definition"
            ]
          },
          "template": {
            "$ref": "#/components/schemas/WhatsappOwnedTemplate"
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-Z_0-9]{1,80}$"
          },
          "replayed": {
            "type": "boolean"
          }
        },
        "required": [
          "operationId",
          "state",
          "request",
          "template",
          "errorCode",
          "replayed"
        ],
        "description": "succeeded records the submitted provider action, not template approval or message delivery. A missing/unknown/pending receipt is never permission to submit a new write. Reuse the original UUID/body; explicit reconciliation reads provider state without repeating a create/edit/delete."
      },
      "WhatsappImagePurpose": {
        "enum": [
          "template_header",
          "business_profile"
        ]
      },
      "WhatsappResumableImage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "uploadId": {
            "type": "string",
            "format": "uuid"
          },
          "purpose": {
            "$ref": "#/components/schemas/WhatsappImagePurpose"
          },
          "mimeType": {
            "enum": [
              "image/jpeg",
              "image/png"
            ]
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 180
          },
          "byteSize": {
            "type": "integer",
            "minimum": 1,
            "maximum": 5242880
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "uploadId",
          "purpose",
          "mimeType",
          "filename",
          "byteSize",
          "sha256",
          "expiresAt"
        ],
        "description": "Internal resumable-image identity. Bound to this business, integration, connection and purpose, with a conservative CRAD 24-hour lifetime. No raw Meta handle is returned. Distinct from a conversation mediaId and cannot be sent as headerImageUploadId."
      },
      "WhatsappProfileOperation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "requestHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "state": {
            "enum": [
              "pending",
              "committed",
              "rejected",
              "unknown",
              "reviewed"
            ]
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[a-z_]{1,80}$"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "replayed": {
            "type": "boolean"
          },
          "kind": {
            "const": "profile"
          },
          "request": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "expectedVersion": {
                "type": "string",
                "pattern": "^wp[a-f0-9]{64}$"
              },
              "patch": {
                "$ref": "#/components/schemas/WhatsappProfilePatch"
              }
            },
            "required": [
              "expectedVersion",
              "patch"
            ]
          },
          "upload": {
            "type": "null"
          },
          "reviewedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Timestamp of an explicit native owner/super-admin review, otherwise null. reviewed releases the unresolved-write fence without claiming Meta applied the prior request. No reviewer identity is disclosed. Older producers may omit this member."
          }
        },
        "required": [
          "operationId",
          "requestHash",
          "state",
          "errorCode",
          "createdAt",
          "completedAt",
          "replayed",
          "kind",
          "request",
          "upload"
        ],
        "description": "One reserved provider write at most. An unresolved write blocks another profile operation on this connection. Pending ages to unknown after the claim window. Text-only reconciliation uses a provider read. A native owner/super-admin can explicitly review an uncertain operation: reviewed acknowledges uncertainty without claiming the provider applied it, permits a separately reviewed new PATCH with fresh ETag/UUID, and remains terminal for the original UUID. Server keys cannot perform this review.",
        "allOf": [
          {
            "if": {
              "properties": {
                "state": {
                  "const": "reviewed"
                }
              },
              "required": [
                "state"
              ]
            },
            "then": {
              "required": [
                "reviewedAt"
              ],
              "properties": {
                "reviewedAt": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "else": {
              "properties": {
                "reviewedAt": {
                  "type": "null"
                }
              }
            }
          }
        ]
      },
      "WhatsappImageOperation": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "requestHash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "state": {
            "enum": [
              "pending",
              "ready",
              "rejected",
              "unknown"
            ]
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[a-z_]{1,80}$"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "replayed": {
            "type": "boolean"
          },
          "kind": {
            "const": "upload"
          },
          "request": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "purpose": {
                "$ref": "#/components/schemas/WhatsappImagePurpose"
              },
              "mimeType": {
                "enum": [
                  "image/jpeg",
                  "image/png"
                ]
              },
              "filename": {
                "type": "string",
                "minLength": 1,
                "maxLength": 180
              },
              "byteSize": {
                "type": "integer",
                "minimum": 1,
                "maximum": 5242880
              },
              "sha256": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            },
            "required": [
              "purpose",
              "mimeType",
              "filename",
              "byteSize",
              "sha256"
            ]
          },
          "upload": {
            "$ref": "#/components/schemas/WhatsappResumableImage"
          },
          "reviewedAt": {
            "type": "null",
            "description": "Uploads have no owner-review transition. Older producers may omit this member."
          }
        },
        "required": [
          "operationId",
          "requestHash",
          "state",
          "errorCode",
          "createdAt",
          "completedAt",
          "replayed",
          "kind",
          "request",
          "upload"
        ],
        "description": "Keep original UUID, purpose, filename and file bytes. Exact retries recover this attempt without re-uploading. An unknown upload is never automatically restarted. ready is usable only while the returned expiry and current binding/purpose checks remain valid."
      },
      "WhatsappOperationNotFound": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "status": {
            "const": "not_found"
          }
        },
        "required": [
          "status"
        ],
        "description": "No visible receipt exists at this instant. This is not proof that a concurrent operation was cancelled or that a fresh UUID is safe."
      },
      "WhatsappImageUploadInput": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "One JPEG/PNG file, signature matching declared MIME, 1..5 MiB. CRAD limits, not a universal Meta limit."
          },
          "purpose": {
            "$ref": "#/components/schemas/WhatsappImagePurpose"
          }
        },
        "required": [
          "file",
          "purpose"
        ]
      },
      "MessagingCapability": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "installed": {
            "type": "boolean"
          },
          "providerSupported": {
            "type": "boolean"
          },
          "granted": {
            "type": "boolean"
          },
          "ready": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "reason": {
            "enum": [
              "not_installed",
              "provider_unsupported",
              "scope_required",
              "configuration_missing",
              "connection_blocked",
              "readiness_unknown",
              null
            ]
          }
        },
        "required": [
          "installed",
          "providerSupported",
          "granted",
          "ready",
          "reason"
        ],
        "description": "Installed contract, transport support, actual key grant and readiness are independent. null readiness means no live provider probe established readiness; require the action's own checks."
      },
      "MessagingCapabilities": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "contractVersion": {
            "const": 1
          },
          "tenantId": {
            "type": "string",
            "format": "uuid"
          },
          "workspacePurpose": {
            "enum": [
              "appointments",
              "marketing",
              "external_messaging"
            ]
          },
          "provider": {
            "enum": [
              "whatsapp_cloud_api",
              "openwa",
              "twilio"
            ]
          },
          "connectionMode": {
            "enum": [
              "legacy",
              "owner_cloud_api_v1",
              "owner_coexistence_v1",
              "owner_openwa_v1"
            ]
          },
          "scopes": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "connection": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "configured": {
                "type": "boolean"
              },
              "policyAllowed": {
                "type": "boolean"
              },
              "policyReason": {
                "type": [
                  "string",
                  "null"
                ],
                "pattern": "^[a-z_]{1,64}$"
              },
              "checkedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "checkCurrent": {
                "type": "boolean"
              },
              "healthy": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "configured",
              "policyAllowed",
              "policyReason",
              "checkedAt",
              "checkCurrent",
              "healthy"
            ]
          },
          "features": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "conversations": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "read": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  },
                  "write": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  },
                  "send": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "installed": {
                        "type": "boolean"
                      },
                      "providerSupported": {
                        "type": "boolean"
                      },
                      "granted": {
                        "type": "boolean"
                      },
                      "ready": {
                        "type": [
                          "boolean",
                          "null"
                        ]
                      },
                      "reason": {
                        "enum": [
                          "not_installed",
                          "provider_unsupported",
                          "scope_required",
                          "configuration_missing",
                          "connection_blocked",
                          "readiness_unknown",
                          null
                        ]
                      },
                      "requiresConversationCheck": {
                        "const": true
                      }
                    },
                    "required": [
                      "installed",
                      "providerSupported",
                      "granted",
                      "ready",
                      "reason",
                      "requiresConversationCheck"
                    ]
                  }
                },
                "required": [
                  "read",
                  "write",
                  "send"
                ]
              },
              "media": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "read": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  }
                },
                "required": [
                  "read"
                ]
              },
              "messagingWebhooks": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "read": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  },
                  "write": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  }
                },
                "required": [
                  "read",
                  "write"
                ]
              },
              "templateRequests": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "read": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  },
                  "write": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  }
                },
                "required": [
                  "read",
                  "write"
                ]
              },
              "whatsappConnection": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "read": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  },
                  "check": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  }
                },
                "required": [
                  "read",
                  "check"
                ]
              },
              "whatsappTemplates": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "read": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  },
                  "write": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  }
                },
                "required": [
                  "read",
                  "write"
                ]
              },
              "whatsappProfile": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "read": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  },
                  "write": {
                    "$ref": "#/components/schemas/MessagingCapability"
                  }
                },
                "required": [
                  "read",
                  "write"
                ]
              }
            },
            "required": [
              "conversations",
              "media",
              "messagingWebhooks",
              "templateRequests",
              "whatsappConnection",
              "whatsappTemplates",
              "whatsappProfile"
            ]
          }
        },
        "required": [
          "contractVersion",
          "tenantId",
          "workspacePurpose",
          "provider",
          "connectionMode",
          "scopes",
          "connection",
          "features"
        ],
        "description": "Server-only read of installed support and saved connection evidence, not a live Meta probe, activation, permission grant or appointment enrollment. A known transport name does not imply that every commercial API feature supports it."
      },
      "MetaBillingEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "state",
          "reason",
          "observedAt",
          "wabaId"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "observed",
              "stale",
              "unknown"
            ]
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "currency_missing",
              "payment_issue",
              null
            ]
          },
          "observedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "wabaId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9]{5,32}$",
            "description": "Current Messaging account (legacy WABA) scope; no phone number or payment credential."
          }
        },
        "allOf": [
          {
            "if": {
              "properties": {
                "state": {
                  "const": "unknown"
                }
              }
            },
            "then": {
              "properties": {
                "reason": {
                  "const": null
                },
                "observedAt": {
                  "const": null
                }
              }
            },
            "else": {
              "properties": {
                "reason": {
                  "type": "string",
                  "enum": [
                    "currency_missing",
                    "payment_issue"
                  ]
                },
                "observedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "wabaId": {
                  "type": "string",
                  "pattern": "^[0-9]{5,32}$"
                }
              }
            }
          }
        ],
        "description": "Saved signature-verified failed-delivery evidence, independent of connection readiness. observed is within 24 hours; stale is older than 24 hours and within 7 days. Unknown or absence is not proof of recovery. No Graph billing probe, provider retry or billing mutation is performed."
      },
      "BusinessAppointmentOverviewItem": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "appointmentId": {
            "type": "string",
            "format": "uuid"
          },
          "startAt": {
            "type": "string",
            "format": "date-time"
          },
          "endAt": {
            "type": "string",
            "format": "date-time"
          },
          "timezone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/BusinessAppointmentStatus"
          },
          "approvalRequired": {
            "type": "boolean",
            "description": "Customer request requiring a clinic decision. Existing appointments and manually entered appointments are preserved."
          },
          "serviceId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "serviceName": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Text"
              },
              {
                "type": "null"
              }
            ]
          },
          "providerId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ]
          },
          "providerName": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Text"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "appointmentId",
          "startAt",
          "endAt",
          "timezone",
          "status",
          "approvalRequired",
          "serviceId",
          "serviceName",
          "providerId",
          "providerName"
        ]
      },
      "BusinessAppointmentOverviewSection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessAppointmentOverviewItem"
            },
            "maxItems": 20
          },
          "hasMore": {
            "type": "boolean",
            "description": "Another matching appointment is visible in this section under the same grant and filters."
          }
        },
        "required": [
          "items",
          "hasMore"
        ]
      },
      "BusinessCustomerAppointmentOverview": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "businessCustomerId": {
            "type": "string",
            "format": "uuid"
          },
          "asOf": {
            "type": "string",
            "format": "date-time"
          },
          "recent": {
            "$ref": "#/components/schemas/BusinessAppointmentOverviewRecentSection"
          },
          "upcoming": {
            "$ref": "#/components/schemas/BusinessAppointmentOverviewSection"
          }
        },
        "required": [
          "businessCustomerId",
          "asOf"
        ],
        "anyOf": [
          {
            "required": [
              "recent"
            ]
          },
          {
            "required": [
              "upcoming"
            ]
          }
        ]
      },
      "BusinessAppointmentOverviewRecentSection": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BusinessAppointmentOverviewItem"
            },
            "maxItems": 20
          },
          "hasMore": {
            "type": "boolean",
            "description": "Another matching appointment is visible in this section under the same grant and filters."
          },
          "nextCursor": {
            "type": "string",
            "format": "uuid",
            "description": "Available only when recent pagination was requested and at least one further authorized match exists. Pass this opaque value as recentCursor."
          }
        },
        "required": [
          "items",
          "hasMore"
        ],
        "dependentSchemas": {
          "nextCursor": {
            "properties": {
              "hasMore": {
                "const": true
              }
            }
          }
        }
      }
    }
  }
}
