{
  "openapi": "3.0.3",
  "info": {
    "title": "XChat HTTP API",
    "version": "1.0.0",
    "description": "Canonical source-owned contract for XChat authentication, profile, selected media, and bounded voice/stream projections. JSON responses omit null and default-valued properties unless stated otherwise."
  },
  "servers": [
    {
      "url": "https://teamyfy.ru"
    }
  ],
  "x-xchat-realtime": {
    "url": "wss://x-chatting.online/api/v1/realtime/ws",
    "ticketQueryParameter": "ticket",
    "deviceIdQueryParameter": "device_id",
    "messageSchema": "../realtime/xchat-realtime-v1.schema.json",
    "description": "Obtain a one-use ticket with X-Teamyfy-Content-Protocol: 1 and the current X-Teamyfy-Content-Generation UUID. The ticket binds the socket and queued mutable controls to that generation; a reset closes stale sockets with CONTENT_GENERATION_CHANGED. URL-encode ticket/device query values; never put long-lived JWTs in the URL."
  },
  "tags": [
    {
      "name": "Auth"
    },
    {
      "name": "Profile"
    },
    {
      "name": "Media"
    },
    {
      "name": "Voice"
    },
    {
      "name": "Stream"
    },
    {
      "name": "Friends"
    },
    {
      "name": "Encryption"
    }
  ],
  "paths": {
    "/api/v1/chat/push/subscription": {
      "put": {
        "operationId": "subscribeBrowserPush",
        "tags": [
          "Profile"
        ],
        "description": "Bind the browser endpoint to the authenticated account. A repeated binding attempt for the same account and subscription keys retains its delivery generation.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrowserPushSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Registered browser endpoint and its opaque delivery generation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrowserPushSubscriptionResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "unsubscribeBrowserPush",
        "tags": [
          "Profile"
        ],
        "description": "Remove the caller's subscription for the supplied binding ID. Legacy requests without a binding ID can remove only subscriptions that have not been claimed by a registration attempt.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteBrowserPushSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Unsubscription request processed"
          }
        }
      }
    },
    "/api/v1/notifications/preferences": {
      "get": {
        "operationId": "getNotificationPreferences",
        "tags": [
          "Profile"
        ],
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "responses": {
          "200": {
            "description": "Account-private committed notification snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationPreferencesResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateNotificationPreference",
        "tags": [
          "Profile"
        ],
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNotificationPreferenceRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account-private committed notification snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationPreferencesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/notifications/settings": {
      "patch": {
        "operationId": "updateNotificationSettings",
        "tags": [
          "Profile"
        ],
        "parameters": [
          {
            "name": "fields",
            "in": "query",
            "required": false,
            "style": "form",
            "explode": false,
            "description": "Comma-separated names of the edited settings. These fields are applied atomically to the current settings. Omit the parameter to replace all settings. Empty, duplicate or unknown fields are rejected.",
            "schema": {
              "type": "array",
              "minItems": 1,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "quietHoursEnabled",
                  "quietStartMinutes",
                  "quietEndMinutes",
                  "quietTimezone",
                  "mentionsEnabled",
                  "repliesEnabled",
                  "threadsEnabled"
                ]
              }
            }
          }
        ],
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNotificationSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Account-private committed notification snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotificationPreferencesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/communities/{communityId}/sections": {
      "post": {
        "operationId": "createCommunitySection",
        "tags": [
          "Communities"
        ],
        "description": "Requires permission to manage the community structure. When access is supplied, viewing rules and section attributes are saved atomically. Without access, creation inherits visibility and an edit preserves existing rules. A successful commit invalidates each active member's own navigation projection.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCommunitySectionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved resource with final access rules",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunitySectionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/communities/{communityId}/sections/{sectionId}": {
      "patch": {
        "operationId": "updateCommunitySection",
        "tags": [
          "Communities"
        ],
        "description": "Requires permission to manage the community structure. When access is supplied, viewing rules and section attributes are saved atomically. Without access, creation inherits visibility and an edit preserves existing rules. A successful commit invalidates each active member's own navigation projection.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "sectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCommunitySectionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved resource with final access rules",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunitySectionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/profile/mentions/resolve": {
      "post": {
        "operationId": "resolveMentions",
        "tags": [
          "Profile"
        ],
        "description": "Batch resolve current and retained historical public identifiers to stable user IDs and current identifiers. Unknown identifiers are omitted. ownIdentifiers contains only the authenticated account identifiers; responses must not be cached or shared between accounts.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveMentionsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resolved users and the authenticated account own identifiers",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolveMentionsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Resolve historical mention identifiers to stable account owners and current public identifiers"
      }
    },
    "/api/v1/feedback": {
      "post": {
        "tags": [
          "Feedback"
        ],
        "operationId": "createFeedback",
        "summary": "Submit account-owned feedback without publishing it",
        "description": "Authenticated, 5 requests per minute per account. Description is trimmed and limited to 500 Unicode code points. Optional imageUploadId is an unused READY upload owned by this account from the existing chat upload flow, at most 5 MiB, whose actual raster is validated. It is consumed atomically with feedback. No chat/message attachment ID or URL is accepted. Same clientRequestId and normalized content returns the original result; changed content conflicts. No automatic logs are accepted or stored and no public feedback list exists.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFeedbackRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created or identical idempotent replay",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedbackResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid description, metadata, UUID or actual raster"
          },
          "401": {
            "description": "Authentication required"
          },
          "404": {
            "description": "Owned image upload was not found"
          },
          "409": {
            "description": "Request ID content differs or image was consumed, cancelled, reserved or expired"
          },
          "413": {
            "description": "JSON exceeds 8192 bytes or image exceeds 5 MiB"
          },
          "429": {
            "description": "Feedback account rate limit exceeded"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "Bounded media/database work unavailable; retry the same request ID"
          }
        }
      }
    },
    "/api/v1/profile/names/resolve": {
      "post": {
        "operationId": "resolveUserNameOverrides",
        "tags": [
          "Profile"
        ],
        "description": "Batch resolve viewer-owned private aliases and optional joined-community nicknames. An item is returned for every distinct requested ID, even unknown IDs. Private alias takes precedence over community nickname, then canonical display name. Personalized results must never be shared between viewers.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveUserNamesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-scoped result.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserNameOverridesListResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/profile/users/{userId}/alias": {
      "patch": {
        "operationId": "updatePrivateUserAlias",
        "tags": [
          "Profile"
        ],
        "description": "Set or clear an alias owned exclusively by the authenticated viewer. Never changes the target profile. Other devices of this viewer receive a content-free invalidation; the target and other users do not.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserAliasRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-scoped result.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserAliasResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/communities/{communityId}/members/me/nickname": {
      "patch": {
        "operationId": "updateOwnCommunityNickname",
        "tags": [
          "Profile"
        ],
        "description": "Set or clear only the authenticated joined, non-banned member nickname. Existing administrator ACLs are unchanged. Nicknames are available only within this community to joined members and disappear on membership removal.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCommunityNicknameRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Viewer-scoped result.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityNicknameResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ]
      }
    },
    "/api/v1/friends/activity": {
      "post": {
        "operationId": "getFriendActivity",
        "tags": [
          "Friends"
        ],
        "summary": "Refresh activity for an exact loaded friend window",
        "description": "Accepts 1..100 positive user IDs; duplicate IDs are deduplicated after enforcing the raw request bound. Returns only current, non-blocked friends, including explicit idle items. Omitted IDs are not eligible friends. The response grants no room access and uses the same activity visibility as the existing friends list.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FriendActivityRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Current activity for eligible requested friends",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FriendActivityBatchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/auth/register": {
      "post": {
        "operationId": "register",
        "tags": [
          "Auth"
        ],
        "summary": "Register a user and issue an access session",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Registered. Cookie mode returns an empty accessToken and tokenType Cookie while setting the HttpOnly cookie.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Set-Cookie": {
                "$ref": "#/components/headers/WebSessionSetCookie"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/auth/login": {
      "post": {
        "operationId": "login",
        "tags": [
          "Auth"
        ],
        "summary": "Authenticate and issue an access session",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Authenticated. Cookie mode returns an empty accessToken and tokenType Cookie while setting the HttpOnly cookie.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Set-Cookie": {
                "$ref": "#/components/headers/WebSessionSetCookie"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "operationId": "logout",
        "tags": [
          "Auth"
        ],
        "summary": "Revoke the current device session",
        "description": "Requires current access authentication, revokes its persistent session and all refresh generations, and expires both Web cookies. Already-revoked access returns 401 and cannot refresh.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "responses": {
          "204": {
            "description": "Current persistent session revoked and Web cookies expired.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Set-Cookie": {
                "$ref": "#/components/headers/WebSessionClearCookie"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ]
      }
    },
    "/api/v1/auth/refresh": {
      "post": {
        "operationId": "refreshAccessToken",
        "tags": [
          "Auth"
        ],
        "summary": "Rotate a device-bound refresh proof",
        "description": "Accepts an opaque native refreshToken JSON proof or an HttpOnly refresh cookie with X-XChat-Session: cookie. No valid access JWT is required. X-XChat-Device-Id must match the original login. Returns a 15-minute access token and rotates the refresh generation within an absolute 30-day session. Reuse of the immediate predecessor within 120 seconds returns its exact successor without further rotation; verified older or late reuse revokes that session family.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "responses": {
          "200": {
            "description": "Session rotated.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              },
              "Set-Cookie": {
                "$ref": "#/components/headers/WebSessionSetCookie"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccessTokenRefreshResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccessTokenRefreshRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/realtime-ticket": {
      "post": {
        "operationId": "issueRealtimeTicket",
        "tags": [
          "Auth"
        ],
        "summary": "Issue a short-lived one-time WebSocket admission ticket",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Current history generation from the negotiated workspace/capability. Mismatch returns 409 before content allocation."
          }
        ],
        "responses": {
          "200": {
            "description": "One-time ticket issued.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RealtimeTicketResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/profile/me": {
      "get": {
        "operationId": "getOwnProfile",
        "tags": [
          "Profile"
        ],
        "summary": "Get the authenticated user's profile",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "responses": {
          "200": {
            "description": "Own profile.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfileResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "patch": {
        "operationId": "updateOwnProfile",
        "tags": [
          "Profile"
        ],
        "summary": "Update the authenticated user's profile",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProfileRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated own profile.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfileResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/profile/me/avatar": {
      "post": {
        "operationId": "updateOwnAvatar",
        "tags": [
          "Profile"
        ],
        "summary": "Replace the authenticated user's avatar",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/AvatarUploadRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated own profile.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfileResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/profile/users/by-identifier/{userIdentifier}": {
      "get": {
        "operationId": "getPublicProfileByIdentifier",
        "tags": [
          "Profile"
        ],
        "summary": "Get a public profile by stable identifier",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "userIdentifier",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Public profile.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicUserProfileResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/media/link-preview": {
      "get": {
        "operationId": "resolveLinkPreview",
        "tags": [
          "Media"
        ],
        "summary": "Resolve bounded public link metadata",
        "description": "Returns generic link metadata and, for recognized public YouTube, VK Video, or RUTUBE links, provider-owned scalar identifiers. Provider iframe HTML and embed URLs are never returned.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Public HTTP or HTTPS link. A missing scheme is normalized to HTTPS by the server.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2000
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bounded link preview. externalVideo is omitted for generic links.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkPreviewResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "413": {
            "$ref": "#/components/responses/PayloadTooLarge"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "$ref": "#/components/responses/BadGateway"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "$ref": "#/components/responses/GatewayTimeout"
          }
        }
      }
    },
    "/api/v1/voice/communities/{communityId}/summaries": {
      "post": {
        "operationId": "getVoiceChannelSummaries",
        "tags": [
          "Voice"
        ],
        "summary": "Read up to 100 visible channel summaries",
        "description": "Read up to 100 visible channel summaries. Authorization is evaluated before projection. Unauthorized, unknown, foreign-community and non-voice channels are omitted; a visible idle channel is returned with an absent or null session. Only host profiles and the current actor control state are projected.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful projection. Null and default values may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceChannelSummariesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceChannelSummariesRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/communities/{communityId}/locations": {
      "post": {
        "operationId": "getVoiceMemberLocations",
        "tags": [
          "Voice"
        ],
        "summary": "Locate up to 100 requested members in visible voice channels",
        "description": "Locate up to 100 requested members in visible voice channels. Users without a visible active location, including banned or absent members, are omitted. This endpoint does not return rosters.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful projection. Null and default values may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceMemberLocationsResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceMemberLocationsRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/channels/{channelId}/participants": {
      "get": {
        "operationId": "getVoiceParticipantsPage",
        "tags": [
          "Voice"
        ],
        "summary": "Read a bounded voice roster ordered by joinedAt then userId",
        "description": "Read a bounded voice roster ordered by joinedAt then userId. Header revision and rows share one database snapshot. Cursor binds channel, session and roster revision; a replaced session or changed revision returns 409. Restart without a cursor and discard older pages.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum returned entries; malformed and out-of-range values are rejected with 400.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque continuation returned by the preceding page. Invalid tokens return 400; stale roster revisions return 409 and require restarting from the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful projection. Null and default values may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceParticipantsPageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/voice/channels/{channelId}/heartbeat": {
      "post": {
        "operationId": "heartbeatVoiceChannel",
        "tags": [
          "Voice"
        ],
        "summary": "Renew current device participation",
        "description": "Renew the exact session, participation UUID and current device from the required ownership protocol 1 command. compact=true selects the compact actor state; omission preserves the full response shape. Heartbeats do not advance revisions.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "compact",
            "in": "query",
            "required": false,
            "description": "Only the literal true selects VoiceHeartbeatAckResponse; omission and all other values preserve VoiceSessionResponse.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful projection. Null and default values may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/VoiceSessionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/VoiceHeartbeatAckResponse"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceSessionCommandRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/streams/active/summaries": {
      "get": {
        "operationId": "getActiveStreamSummaries",
        "tags": [
          "Stream"
        ],
        "summary": "Read live stream summaries across visible communities",
        "description": "Read live stream summaries across visible communities. Membership and effective channel or section ACLs are applied before LIMIT. Profiles are loaded only for returned hosts. Directory cursor binds the actor and descending startedAt/id ordering; new entries are obtained by refreshing the first page.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum returned entries; malformed and out-of-range values are rejected with 400.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque continuation returned by the preceding directory page, bound to the actor and descending startedAt/id ordering. Invalid tokens return 400. Refresh the first page to obtain new entries.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful projection. Null and default values may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamSummaryPageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/streams/channels/{channelId}/summary": {
      "get": {
        "operationId": "getChannelStreamSummary",
        "tags": [
          "Stream"
        ],
        "summary": "Read one visible live stream summary",
        "description": "Read one visible live stream summary. No active session returns 404; denied channel access returns 403. Legacy stream mutation responses remain unchanged; refresh this summary after a mutation under a client request fence.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful projection. Null and default values may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamSessionSummaryResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/streams/{sessionId}/participants/page": {
      "get": {
        "operationId": "getStreamParticipantsPage",
        "tags": [
          "Stream"
        ],
        "summary": "Read stream participants ordered by HOST then SPEAKER then VIEWER, joinedAt and userId",
        "description": "Read stream participants ordered by HOST then SPEAKER then VIEWER, joinedAt and userId. Header revision, count and rows share one database snapshot. Cursor binds actor, session and roster revision; a changed revision returns 409. An ended accessible stream returns ENDED with an empty roster. Only the returned page profiles are hydrated.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum returned entries; malformed and out-of-range values are rejected with 400.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Opaque continuation returned by the preceding page. Invalid tokens return 400; stale roster revisions return 409 and require restarting from the first page.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful projection. Null and default values may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamParticipantPageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/chat/attachments/{attachmentId}/download": {
      "get": {
        "operationId": "downloadChatAttachment",
        "tags": [
          "Media"
        ],
        "summary": "Download an authorized attachment or single byte range",
        "description": "Every request authorizes the current DM/channel message before metadata or data access. No public URL or URL credential. Satisfiable single bytes range returns 206; If-Range mismatch, weak/date validator, unknown unit or unsupported multiple ranges returns full 200. Malformed/unsatisfiable single bytes range returns 416. Empty resources ignore Range and return empty 200. A storage identity change between metadata and body open returns 409. Authenticated responses must not enter shared caches.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "Range",
            "in": "header",
            "description": "Single inclusive bytes=start-end, bytes=start- or bytes=-suffix-length. End clamps to EOF; large numeric bounds saturate safely. Supported single-range header is bounded to 4096 characters.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Range",
            "in": "header",
            "description": "Exact strong ETag from HEAD/GET. Mismatch yields full 200; range clients should inspect status/identity before reading the body.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full immutable representation, including existing full-download clients.",
            "headers": {
              "Content-Length": {
                "description": "Full representation size on HEAD/200; transferred byte count on 206.",
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                }
              },
              "Content-Type": {
                "description": "Original attachment MIME type.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "Strong opaque identity, stable for unchanged bytes and representation metadata.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[0-9a-f]{64}\"$"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store, no-transform"
                  ]
                }
              },
              "Content-Encoding": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "identity"
                  ]
                }
              },
              "Content-Disposition": {
                "description": "Existing attachment download disposition and sanitized filename.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "*/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "Exact single range; Content-Length is range size, not full resource size.",
            "headers": {
              "Content-Length": {
                "description": "Full representation size on HEAD/200; transferred byte count on 206.",
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                }
              },
              "Content-Type": {
                "description": "Original attachment MIME type.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "Strong opaque identity, stable for unchanged bytes and representation metadata.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[0-9a-f]{64}\"$"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store, no-transform"
                  ]
                }
              },
              "Content-Encoding": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "identity"
                  ]
                }
              },
              "Content-Disposition": {
                "description": "Existing attachment download disposition and sanitized filename.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string",
                  "pattern": "^bytes [0-9]+-[0-9]+/[0-9]+$"
                }
              }
            },
            "content": {
              "*/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "416": {
            "description": "Invalid or unsatisfiable supported single byte range, after authorization. Empty body.",
            "headers": {
              "Content-Range": {
                "schema": {
                  "type": "string",
                  "pattern": "^bytes \\*/[0-9]+$"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer",
                  "enum": [
                    0
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store, no-transform"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "head": {
        "operationId": "describeChatAttachmentDownload",
        "tags": [
          "Media"
        ],
        "summary": "Read authorized immutable attachment metadata",
        "description": "Same current-message authorization as GET. Reports total size/type/strong ETag without opening a body stream. Ignores Range and If-Range. HEAD responses have no body, including errors.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full representation metadata with no body.",
            "headers": {
              "Content-Length": {
                "description": "Full representation size on HEAD/200; transferred byte count on 206.",
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                }
              },
              "Content-Type": {
                "description": "Original attachment MIME type.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "Strong opaque identity, stable for unchanged bytes and representation metadata.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[0-9a-f]{64}\"$"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store, no-transform"
                  ]
                }
              },
              "Content-Encoding": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "identity"
                  ]
                }
              },
              "Content-Disposition": {
                "description": "Existing attachment download disposition and sanitized filename.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest; no response body."
          },
          "401": {
            "description": "Unauthorized; no response body."
          },
          "403": {
            "description": "Forbidden; no response body."
          },
          "404": {
            "description": "NotFound; no response body."
          },
          "429": {
            "description": "TooManyRequests; no response body."
          },
          "500": {
            "description": "InternalServerError; no response body."
          },
          "503": {
            "description": "ServiceUnavailable; no response body."
          }
        }
      }
    },
    "/api/v1/voice/direct/{conversationId}/start": {
      "post": {
        "operationId": "directVoiceStart",
        "tags": [
          "Voice"
        ],
        "summary": "Apply identity-fenced voice start",
        "description": "Commands must bind the observed session. Channel mutations also bind the immutable actor participation; stage moderation additionally binds the target participation. Missing protocol or required identity is 426; stale identity is 409. Start/join admit a new participation only when the observed session and participation absence still match under the database transition lock.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current voice session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceSessionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "description": "The expected call expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceSessionCommandRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/direct/{conversationId}/join": {
      "post": {
        "operationId": "directVoiceJoin",
        "tags": [
          "Voice"
        ],
        "summary": "Apply identity-fenced voice join",
        "description": "Commands must bind the observed session. Channel mutations also bind the immutable actor participation; stage moderation additionally binds the target participation. Missing protocol or required identity is 426; stale identity is 409. Start/join admit a new participation only when the observed session and participation absence still match under the database transition lock.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current voice session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceSessionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "description": "The expected call expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceSessionCommandRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/direct/{conversationId}/leave": {
      "post": {
        "operationId": "directVoiceLeave",
        "tags": [
          "Voice"
        ],
        "summary": "Apply identity-fenced voice leave",
        "description": "Commands must bind the observed session. Channel mutations also bind the immutable actor participation; stage moderation additionally binds the target participation. Missing protocol or required identity is 426; stale identity is 409. Start/join admit a new participation only when the observed session and participation absence still match under the database transition lock.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Exact voice ownership ended."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "description": "The expected call expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceSessionCommandRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/direct/{conversationId}/state": {
      "patch": {
        "operationId": "directVoiceState",
        "tags": [
          "Voice"
        ],
        "summary": "Apply identity-fenced voice state",
        "description": "Commands must bind the observed session. Channel mutations also bind the immutable actor participation; stage moderation additionally binds the target participation. Missing protocol or required identity is 426; stale identity is 409. Start/join admit a new participation only when the observed session and participation absence still match under the database transition lock.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current voice session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceSessionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "description": "The expected call expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDirectVoiceParticipantStateRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/channels/{channelId}/start": {
      "post": {
        "operationId": "channelVoiceStart",
        "tags": [
          "Voice"
        ],
        "summary": "Apply identity-fenced voice start",
        "description": "Commands must bind the observed session. Channel mutations also bind the immutable actor participation; stage moderation additionally binds the target participation. Missing protocol or required identity is 426; stale identity is 409. Start/join admit a new participation only when the observed session and participation absence still match under the database transition lock.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current voice session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceSessionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartChannelVoiceSessionRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/channels/{channelId}/join": {
      "post": {
        "operationId": "channelVoiceJoin",
        "tags": [
          "Voice"
        ],
        "summary": "Apply identity-fenced voice join",
        "description": "Commands must bind the observed session. Channel mutations also bind the immutable actor participation; stage moderation additionally binds the target participation. Missing protocol or required identity is 426; stale identity is 409. Start/join admit a new participation only when the observed session and participation absence still match under the database transition lock.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current voice session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceSessionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceSessionCommandRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/channels/{channelId}/leave": {
      "post": {
        "operationId": "channelVoiceLeave",
        "tags": [
          "Voice"
        ],
        "summary": "Apply identity-fenced voice leave",
        "description": "Commands must bind the observed session. Channel mutations also bind the immutable actor participation; stage moderation additionally binds the target participation. Missing protocol or required identity is 426; stale identity is 409. Start/join admit a new participation only when the observed session and participation absence still match under the database transition lock.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Exact voice ownership ended."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceSessionCommandRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/channels/{channelId}/state": {
      "patch": {
        "operationId": "channelVoiceState",
        "tags": [
          "Voice"
        ],
        "summary": "Apply identity-fenced voice state",
        "description": "Commands must bind the observed session. Channel mutations also bind the immutable actor participation; stage moderation additionally binds the target participation. Missing protocol or required identity is 426; stale identity is 409. Start/join admit a new participation only when the observed session and participation absence still match under the database transition lock.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current voice session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceSessionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDirectVoiceParticipantStateRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/channels/{channelId}/stage/hand": {
      "patch": {
        "operationId": "channelVoiceStageHand",
        "tags": [
          "Voice"
        ],
        "summary": "Apply identity-fenced voice stage/hand",
        "description": "Commands must bind the observed session. Channel mutations also bind the immutable actor participation; stage moderation additionally binds the target participation. Missing protocol or required identity is 426; stale identity is 409. Start/join admit a new participation only when the observed session and participation absence still match under the database transition lock.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current voice session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceSessionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVoiceHandRaisedRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/channels/{channelId}/stage/participants/{userId}": {
      "patch": {
        "operationId": "channelVoiceStageParticipantsUser",
        "tags": [
          "Voice"
        ],
        "summary": "Apply identity-fenced voice stage/participants/{userId}",
        "description": "Commands must bind the observed session. Channel mutations also bind the immutable actor participation; stage moderation additionally binds the target participation. Missing protocol or required identity is 426; stale identity is 409. Start/join admit a new participation only when the observed session and participation absence still match under the database transition lock.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current voice session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceSessionResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVoiceStageRoleRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/direct/{conversationId}/heartbeat": {
      "post": {
        "operationId": "heartbeatDirectVoice",
        "tags": [
          "Voice"
        ],
        "summary": "Renew exact direct-call owner activity",
        "description": "Requires ownership 1, liveness 1, exact session and participation UUID and owning device. The participation must have opted in at start/join. Only accepted calls with both owners opted in expire after either owner exceeds the advertised reconnect grace. A heartbeat after grace atomically commits terminal history/events and returns 410. Legacy/mixed calls are exempt. No full roster or profile query is needed in the response.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": false,
            "description": "Current device identity. Omission retains the legacy device identity for rolling clients.",
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current voice session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceDirectHeartbeatAckResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "description": "The expected call expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceSessionCommandRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/ice-servers": {
      "get": {
        "operationId": "getVoiceIceConfiguration",
        "tags": [
          "Voice"
        ],
        "summary": "Get media connectivity and voice protocol policy",
        "description": "Ownership and direct liveness capabilities and configured intervals are explicitly serialized. Missing capability on an older server means unsupported; complete backend rollout before client activation.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Current voice session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceIceConfigurationResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/chat/forward": {
      "post": {
        "tags": [
          "Chat"
        ],
        "operationId": "forwardMessage",
        "summary": "Forward an authorized root message with durable attribution",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForwardMessageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Forwarded message or replay",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardMessageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ]
      }
    },
    "/api/v1/dm/conversations/{conversationId}/messages/content": {
      "get": {
        "tags": [
          "Chat"
        ],
        "operationId": "browseDirectChatContent",
        "summary": "Browse media or links in the complete authorized chat history",
        "description": "Read-only search with the same conversation/channel authorization as timeline reads. MEDIA includes image/video/audio attachments, recorded media, legacy direct images, inline image markup, stickers and direct media URLs. LINKS includes ordinary HTTP(S), www and bare-domain links (including captions), excluding inline image destinations and legacy image locators. q filters message text or attachment filenames literally and case-insensitively; omitted/blank q browses all matches. System events are excluded.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "MEDIA",
                "LINKS"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100,
              "default": ""
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50
            },
            "description": "Clamped to 1..100."
          },
          {
            "name": "beforeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching messages and cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectChatContentPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/channels/{channelId}/messages/content": {
      "get": {
        "tags": [
          "Chat"
        ],
        "operationId": "browseChannelChatContent",
        "summary": "Browse media or links in the complete authorized chat history",
        "description": "Read-only search with the same conversation/channel authorization as timeline reads. MEDIA includes image/video/audio attachments, recorded media, legacy direct images, inline image markup, stickers and direct media URLs. LINKS includes ordinary HTTP(S), www and bare-domain links (including captions), excluding inline image destinations and legacy image locators. q filters message text or attachment filenames literally and case-insensitively; omitted/blank q browses all matches. System events are excluded.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "MEDIA",
                "LINKS"
              ]
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 100,
              "default": ""
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50
            },
            "description": "Clamped to 1..100."
          },
          {
            "name": "beforeId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching messages and cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChannelChatContentPage"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/auth/password-reset/request": {
      "post": {
        "operationId": "requestPasswordReset",
        "tags": [
          "Account Security"
        ],
        "summary": "Request a password reset code. The response does not disclose whether an account exists.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordResetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountChallengeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/auth/password-reset/verify": {
      "post": {
        "operationId": "verifyPasswordReset",
        "tags": [
          "Account Security"
        ],
        "summary": "Consume the reset code and issue a one-use five-minute reset ticket.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountCodeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasswordResetTicketResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/auth/password-reset/complete": {
      "post": {
        "operationId": "completePasswordReset",
        "tags": [
          "Account Security"
        ],
        "summary": "Replace the password and invalidate earlier access sessions atomically.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordResetCompleteRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/profile/me/email/verification/request": {
      "post": {
        "operationId": "requestEmailVerification",
        "tags": [
          "Account Security"
        ],
        "summary": "Send a confirmation code to the current account email.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountChallengeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/profile/me/email/verification/confirm": {
      "post": {
        "operationId": "confirmEmailVerification",
        "tags": [
          "Account Security"
        ],
        "summary": "Confirm ownership of the current email.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AccountCodeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfileResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/profile/me/email/change/request": {
      "post": {
        "operationId": "requestEmailChange",
        "tags": [
          "Account Security"
        ],
        "summary": "Reauthenticate using the current password and send code to new email. A verified current email also receives its own approval code.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailChangeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailChangeChallengeResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/profile/me/email/change/confirm": {
      "post": {
        "operationId": "confirmEmailChange",
        "tags": [
          "Account Security"
        ],
        "summary": "Atomically replace the email after new-address confirmation and, when required, approval from the verified old address.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailChangeConfirmRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfileResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/auth/sessions": {
      "get": {
        "operationId": "listAccountSessions",
        "tags": [
          "Auth"
        ],
        "summary": "List active sessions belonging to the current account",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "responses": {
          "200": {
            "description": "Active sessions; current marks the requesting session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountSessionsResponse"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/api/v1/auth/sessions/{sessionId}": {
      "delete": {
        "operationId": "revokeAccountSession",
        "tags": [
          "Auth"
        ],
        "summary": "Revoke one session owned by this account",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Sessions revoked."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/api/v1/auth/sessions/revoke-all": {
      "post": {
        "operationId": "revokeAllAccountSessions",
        "tags": [
          "Auth"
        ],
        "summary": "Revoke every session including the requesting device",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "responses": {
          "204": {
            "description": "Sessions revoked."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/api/v1/e2ee/identity": {
      "get": {
        "operationId": "getE2eeIdentity",
        "tags": [
          "Encryption"
        ],
        "description": "Current account public identity and opaque encrypted recovery backup. No private key or recovery secret is disclosed to the server.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eeBackupResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "registerE2eeIdentity",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eeIdentityResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterE2eeIdentityRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/devices": {
      "post": {
        "operationId": "registerE2eeDevice",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eeIdentityResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterE2eeDeviceRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/dm/{conversationId}/audience": {
      "get": {
        "operationId": "getE2eeDirectAudience",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eeAudienceResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/media/e2ee/rooms/state": {
      "post": {
        "operationId": "getE2eeRoomState",
        "tags": [
          "Encryption"
        ],
        "description": "Exact current participation/device/lease roster epoch. A null envelope means the deterministic leader must publish before any SDK connect.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eeRoomStateResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/E2eeRoomStateRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/media/e2ee/rooms/key": {
      "post": {
        "operationId": "publishE2eeRoomKey",
        "tags": [
          "Encryption"
        ],
        "description": "Leader-only compare-and-set for the exact current epoch. Signed JWE recipients must be precisely the active admitted devices; account recovery devices are excluded.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eeRoomStateResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishE2eeRoomKeyRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/media/transport/leases": {
      "post": {
        "operationId": "acquireMediaLease",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaLeaseResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcquireMediaLeaseRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/media/transport/leases/{leaseId}/heartbeat": {
      "post": {
        "operationId": "heartbeatMediaLease",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "leaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaLeaseHeartbeatResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaLeaseGenerationRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/media/transport/leases/{leaseId}/release": {
      "post": {
        "operationId": "releaseMediaLease",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "leaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Completed"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaLeaseGenerationRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/media/transport/leases/{leaseId}/publication": {
      "put": {
        "operationId": "updateMediaPublication",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "leaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaPublicationResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMediaPublicationRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/chat/forward-source": {
      "get": {
        "operationId": "getForwardSourceAttribution",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "scopeType",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "messageId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardedMessageAttribution"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/dm/conversations/{conversationId}/messages": {
      "post": {
        "operationId": "sendDirectMessage",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardedDirectMessage"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendDirectMessageRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/dm/conversations/{conversationId}/messages/{messageId}": {
      "patch": {
        "operationId": "updateDirectMessage",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardedDirectMessage"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDirectMessageRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/dm/conversations/{conversationId}/prepared-attachments": {
      "post": {
        "operationId": "sendPreparedDirectAttachments",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForwardedDirectMessage"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendPreparedAttachmentsRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/dm/conversations/{conversationId}/messages/{messageId}/thread": {
      "get": {
        "operationId": "getDirectMessageThread",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageThreadPageResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "sendDirectMessageThreadReply",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageThreadReplyResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageThreadReplyRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/dm/conversations/{conversationId}/messages/{messageId}/thread/{replyId}": {
      "patch": {
        "operationId": "updateDirectMessageThreadReply",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "replyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageThreadReplyResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMessageThreadReplyRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteDirectMessageThreadReply",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "replyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "204": {
            "description": "Completed"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/chat/drafts": {
      "get": {
        "operationId": "getChatDrafts",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ChatDraftResponse"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/chat/drafts/{scopeType}/{scopeId}": {
      "put": {
        "operationId": "saveChatDraft",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatDraftResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SaveChatDraftRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteChatDraft",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "204": {
            "description": "Completed"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/chat/scheduled": {
      "get": {
        "operationId": "getScheduledMessages",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ScheduledChatMessageResponse"
                  }
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "scheduleChatMessage",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledChatMessageResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleChatMessageRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/chat/scheduled/page": {
      "get": {
        "operationId": "getScheduledMessagesPage",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledChatMessageListPageResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/chat/scheduled/{scheduledId}": {
      "patch": {
        "operationId": "updateScheduledChatMessage",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "scheduledId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledChatMessageResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateScheduledChatMessageRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "cancelScheduledChatMessage",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "scheduledId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledChatMessageResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/media/private/{objectKey}": {
      "get": {
        "operationId": "readPrivateMedia",
        "tags": [
          "Media"
        ],
        "summary": "Download an authorized attachment or single byte range",
        "description": "Authenticated legacy/private object and thumbnail delivery. Object key can contain slash-separated path segments; current message/story/upload ACL is checked before metadata or range access. Public avatars, custom emojis and structure icons are excluded. Browser GET/HEAD alone permits the scoped same-origin session cookie without session-mode header.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": []
          }
        ],
        "parameters": [
          {
            "name": "objectKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 512
            },
            "description": "Ktor tailcard key: encode each path segment separately and preserve literal / separators. Do not percent-encode the complete key as one segment. The server joins tailcard segments with /. Use the authorized media URL returned by Teamyfy when available.",
            "x-allow-reserved-path": true
          },
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "Range",
            "in": "header",
            "description": "Single inclusive bytes=start-end, bytes=start- or bytes=-suffix-length. End clamps to EOF; large numeric bounds saturate safely. Supported single-range header is bounded to 4096 characters.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Range",
            "in": "header",
            "description": "Exact strong ETag from HEAD/GET. Mismatch yields full 200; range clients should inspect status/identity before reading the body.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full immutable representation, including existing full-download clients.",
            "headers": {
              "Content-Length": {
                "description": "Full representation size on HEAD/200; transferred byte count on 206.",
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                }
              },
              "Content-Type": {
                "description": "Original attachment MIME type.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "Strong opaque identity, stable for unchanged bytes and representation metadata.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[0-9a-f]{64}\"$"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store, no-transform"
                  ]
                }
              },
              "Content-Encoding": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "identity"
                  ]
                }
              },
              "Content-Disposition": {
                "description": "Existing attachment download disposition and sanitized filename.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "*/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "Exact single range; Content-Length is range size, not full resource size.",
            "headers": {
              "Content-Length": {
                "description": "Full representation size on HEAD/200; transferred byte count on 206.",
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                }
              },
              "Content-Type": {
                "description": "Original attachment MIME type.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "Strong opaque identity, stable for unchanged bytes and representation metadata.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[0-9a-f]{64}\"$"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store, no-transform"
                  ]
                }
              },
              "Content-Encoding": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "identity"
                  ]
                }
              },
              "Content-Disposition": {
                "description": "Existing attachment download disposition and sanitized filename.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string",
                  "pattern": "^bytes [0-9]+-[0-9]+/[0-9]+$"
                }
              }
            },
            "content": {
              "*/*": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "416": {
            "description": "Invalid or unsatisfiable supported single byte range, after authorization. Empty body.",
            "headers": {
              "Content-Range": {
                "schema": {
                  "type": "string",
                  "pattern": "^bytes \\*/[0-9]+$"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer",
                  "enum": [
                    0
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store, no-transform"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "head": {
        "operationId": "headPrivateMedia",
        "tags": [
          "Media"
        ],
        "summary": "Read authorized immutable attachment metadata",
        "description": "Authenticated legacy/private object and thumbnail delivery. Object key can contain slash-separated path segments; current message/story/upload ACL is checked before metadata or range access. Public avatars, custom emojis and structure icons are excluded. Browser GET/HEAD alone permits the scoped same-origin session cookie without session-mode header.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": []
          }
        ],
        "parameters": [
          {
            "name": "objectKey",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 512
            },
            "description": "Ktor tailcard key: encode each path segment separately and preserve literal / separators. Do not percent-encode the complete key as one segment. The server joins tailcard segments with /. Use the authorized media URL returned by Teamyfy when available.",
            "x-allow-reserved-path": true
          },
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "responses": {
          "200": {
            "description": "Full representation metadata with no body.",
            "headers": {
              "Content-Length": {
                "description": "Full representation size on HEAD/200; transferred byte count on 206.",
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                }
              },
              "Content-Type": {
                "description": "Original attachment MIME type.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "Strong opaque identity, stable for unchanged bytes and representation metadata.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[0-9a-f]{64}\"$"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store, no-transform"
                  ]
                }
              },
              "Content-Encoding": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "identity"
                  ]
                }
              },
              "Content-Disposition": {
                "description": "Existing attachment download disposition and sanitized filename.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "BadRequest; no response body."
          },
          "401": {
            "description": "Unauthorized; no response body."
          },
          "403": {
            "description": "Forbidden; no response body."
          },
          "404": {
            "description": "NotFound; no response body."
          },
          "429": {
            "description": "TooManyRequests; no response body."
          },
          "500": {
            "description": "InternalServerError; no response body."
          },
          "503": {
            "description": "ServiceUnavailable; no response body."
          }
        }
      }
    },
    "/api/v1/voice/diagnostics": {
      "post": {
        "operationId": "sendVoiceDiagnostic",
        "tags": [
          "Voice"
        ],
        "summary": "Record bounded media diagnostics",
        "description": "Uses a dedicated per-user diagnostic rate bucket, independent of voice heartbeat admission. Optional details are controlled by the manual diagnosticsDetailedEnabled policy. Never include media payloads, secrets, SDP, device labels or raw pipeline identifiers.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceDiagnosticRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Best-effort diagnostic accepted. Detailed observations are discarded when the server policy is disabled."
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/e2ee/recovery/passphrase": {
      "get": {
        "operationId": "getE2eePassphraseBackup",
        "tags": [
          "Encryption"
        ],
        "description": "Account/session/device-bound server-blind recovery. Root-signed backup revision uses compare-and-set. Transfers expire after at most 10 minutes; approval and consumption are each single-use. Requires X-XChat-Device-Id to match the authenticated account session. Dedicated recovery budget: 60 requests/minute/account; creation additionally 12/10 minutes/account and at most 5 unexpired requests.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eePassphraseBackupResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Recovery JSON body exceeds 72 KiB"
          }
        }
      },
      "post": {
        "operationId": "putE2eePassphraseBackup",
        "tags": [
          "Encryption"
        ],
        "description": "Account/session/device-bound server-blind recovery. Root-signed backup revision uses compare-and-set. Transfers expire after at most 10 minutes; approval and consumption are each single-use. Requires X-XChat-Device-Id to match the authenticated account session. Dedicated recovery budget: 60 requests/minute/account; creation additionally 12/10 minutes/account and at most 5 unexpired requests.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eePassphraseBackupResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Recovery JSON body exceeds 72 KiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutE2eePassphraseBackupRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/recovery/transfers": {
      "post": {
        "operationId": "createE2eeDeviceTransfer",
        "tags": [
          "Encryption"
        ],
        "description": "Account/session/device-bound server-blind recovery. Root-signed backup revision uses compare-and-set. Transfers expire after at most 10 minutes; approval and consumption are each single-use. Requires X-XChat-Device-Id to match the authenticated account session. Dedicated recovery budget: 60 requests/minute/account; creation additionally 12/10 minutes/account and at most 5 unexpired requests.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eeDeviceTransferResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Recovery JSON body exceeds 72 KiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateE2eeDeviceTransferRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/recovery/transfers/{requestId}": {
      "get": {
        "operationId": "getE2eeDeviceTransfer",
        "tags": [
          "Encryption"
        ],
        "description": "Account/session/device-bound server-blind recovery. Root-signed backup revision uses compare-and-set. Transfers expire after at most 10 minutes; approval and consumption are each single-use. Requires X-XChat-Device-Id to match the authenticated account session. Dedicated recovery budget: 60 requests/minute/account; creation additionally 12/10 minutes/account and at most 5 unexpired requests.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eeDeviceTransferResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Recovery JSON body exceeds 72 KiB"
          }
        }
      }
    },
    "/api/v1/e2ee/recovery/transfers/{requestId}/approve": {
      "post": {
        "operationId": "approveE2eeDeviceTransfer",
        "tags": [
          "Encryption"
        ],
        "description": "Account/session/device-bound server-blind recovery. Root-signed backup revision uses compare-and-set. Transfers expire after at most 10 minutes; approval and consumption are each single-use. Requires X-XChat-Device-Id to match the authenticated account session. Dedicated recovery budget: 60 requests/minute/account; creation additionally 12/10 minutes/account and at most 5 unexpired requests.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eeDeviceTransferResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Recovery JSON body exceeds 72 KiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveE2eeDeviceTransferRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/recovery/transfers/{requestId}/consume": {
      "post": {
        "operationId": "consumeE2eeDeviceTransfer",
        "tags": [
          "Encryption"
        ],
        "description": "Account/session/device-bound server-blind recovery. Root-signed backup revision uses compare-and-set. Transfers expire after at most 10 minutes; approval and consumption are each single-use. Requires X-XChat-Device-Id to match the authenticated account session. Dedicated recovery budget: 60 requests/minute/account; creation additionally 12/10 minutes/account and at most 5 unexpired requests.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eeDeviceTransferResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Recovery JSON body exceeds 72 KiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsumeE2eeDeviceTransferRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/devices/content-capability": {
      "get": {
        "operationId": "getSecureDeviceContentCapability",
        "tags": [
          "Encryption"
        ],
        "description": "Read this authenticated current device certificate and monotonic content-capability revision. A signed lease is a bounded support declaration, not proof of physical online status. Private no-store.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureDeviceContentCapabilityResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "put": {
        "operationId": "putSecureDeviceContentCapability",
        "tags": [
          "Encryption"
        ],
        "description": "Publish or withdraw the current device content capabilities using its canonical device signature and expected revision. The five-minute maximum lease is bound to the exact current certificate; compare-and-set and eligibility mutation locking prevent stale updates from authorizing fresh sends. Private no-store.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureDeviceContentCapabilityResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutSecureDeviceContentCapabilityRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/content-capabilities/query": {
      "post": {
        "operationId": "querySecureContentCapabilities",
        "tags": [
          "Encryption"
        ],
        "description": "Observe rendition support for the exact current conversation head and all current devices of every eligible account, including devices outside the MLS roster that can read archive history. Missing, expired or unsupported declarations and audience overflow produce ready=false. This observation is not a reusable send permit; fresh application acceptance repeats the complete check under the eligibility/head transaction locks. Private no-store.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bounded content-capability observation for the current conversation head and complete eligible device audience; private, no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuerySecureContentCapabilitiesResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuerySecureContentCapabilitiesRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/capability": {
      "get": {
        "operationId": "getSecureMessagingCapability",
        "tags": [
          "Encryption"
        ],
        "description": "Authenticated account-session/device-bound MLS relay. Disabled until explicit history cutover. Device and root signatures bind the exact scope, generation, roster and epoch; current ACL/device revocation and durable replay are transactionally fenced. No plaintext message or secret key is accepted. Canonical signed payload bytes are retained. Application response and realtime UPSERT contain opaque encrypted projections.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureMessagingCapabilityResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          }
        }
      }
    },
    "/api/v1/e2ee/key-packages": {
      "post": {
        "operationId": "publishSecureKeyPackages",
        "tags": [
          "Encryption"
        ],
        "description": "Authenticated account-session/device-bound MLS relay. Disabled until explicit history cutover. Device and root signatures bind the exact scope, generation, roster and epoch; current ACL/device revocation and durable replay are transactionally fenced. No plaintext message or secret key is accepted. Canonical signed payload bytes are retained. Application response and realtime UPSERT contain opaque encrypted projections.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureKeyPackageListResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishSecureKeyPackagesRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/devices/revoke": {
      "post": {
        "operationId": "revokeSecureDevice",
        "tags": [
          "Encryption"
        ],
        "description": "Authenticated account-session/device-bound MLS relay. Disabled until explicit history cutover. Device and root signatures bind the exact scope, generation, roster and epoch; current ACL/device revocation and durable replay are transactionally fenced. No plaintext message or secret key is accepted. Canonical signed payload bytes are retained. Application response and realtime UPSERT contain opaque encrypted projections.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          },
          "204": {
            "description": "Device cryptographically revoked. Existing MLS conversations require removal before new sends."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RevokeSecureDeviceRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/state": {
      "get": {
        "operationId": "getSecureConversationState",
        "tags": [
          "Encryption"
        ],
        "description": "Authenticated account-session/device-bound MLS relay. Disabled until explicit history cutover. Device and root signatures bind the exact scope, generation, roster and epoch; current ACL/device revocation and durable replay are transactionally fenced. No plaintext message or secret key is accepted. Canonical signed payload bytes are retained. Application response and realtime UPSERT contain opaque encrypted projections.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureConversationStateResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/key-packages/reserve": {
      "post": {
        "operationId": "reserveSecureKeyPackages",
        "tags": [
          "Encryption"
        ],
        "description": "Authenticated account-session/device-bound MLS relay. Disabled until explicit history cutover. Device and root signatures bind the exact scope, generation, roster and epoch; current ACL/device revocation and durable replay are transactionally fenced. No plaintext message or secret key is accepted. Canonical signed payload bytes are retained. Application response and realtime UPSERT contain opaque encrypted projections.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureKeyPackageReservationResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReserveSecureKeyPackagesRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/transitions": {
      "post": {
        "operationId": "submitSecureTransition",
        "tags": [
          "Encryption"
        ],
        "description": "Authenticated account-session/device-bound MLS relay. Disabled until explicit history cutover. Device and root signatures bind the exact scope, generation, roster and epoch; current ACL/device revocation and durable replay are transactionally fenced. No plaintext message or secret key is accepted. Canonical signed payload bytes are retained. Application response and realtime UPSERT contain opaque encrypted projections.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureTransitionResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitSecureTransitionRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/control": {
      "get": {
        "operationId": "getSecureControl",
        "tags": [
          "Encryption"
        ],
        "description": "Authenticated account-session/device-bound MLS relay. Disabled until explicit history cutover. Device and root signatures bind the exact scope, generation, roster and epoch; current ACL/device revocation and durable replay are transactionally fenced. No plaintext message or secret key is accepted. Canonical signed payload bytes are retained. Application response and realtime UPSERT contain opaque encrypted projections.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "afterEpoch",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureControlPageResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/applications": {
      "post": {
        "operationId": "submitSecureApplication",
        "tags": [
          "Encryption"
        ],
        "description": "Authenticated account-session/device-bound MLS relay. Disabled until explicit history cutover. Device and root signatures bind the exact scope, generation, roster and epoch; current ACL/device revocation and durable replay are transactionally fenced. No plaintext message or secret key is accepted. Canonical signed payload bytes are retained. Application response and realtime UPSERT contain opaque encrypted projections.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureApplicationResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitSecureApplicationRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/communities/{communityId}/members/{memberUserId}": {
      "get": {
        "operationId": "getCommunityMember",
        "tags": [
          "Communities"
        ],
        "summary": "Read an exact community member",
        "description": "Requires an active community membership; banned viewers are rejected.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "memberUserId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current member projection. Default and null properties may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityMemberResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/communities/{communityId}/members/{memberUserId}/moderation": {
      "patch": {
        "operationId": "updateCommunityMemberModeration",
        "tags": [
          "Communities"
        ],
        "summary": "Moderate a lower-ranking community member",
        "description": "Requires moderator, admin or owner and a strictly lower-ranking target. Self moderation is rejected. Chat and microphone restrictions are independent. Audio lease revocation is durable and provider eviction retries asynchronously.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "memberUserId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current member projection. Default and null properties may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityMemberResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCommunityMemberModerationRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/communities/{communityId}/roles": {
      "post": {
        "operationId": "createCommunityCustomRole",
        "tags": [
          "Communities"
        ],
        "summary": "Create a community custom role",
        "description": "Requires the community owner or administrator role. Member-list visibility is display-only and defaults to true for new roles; omitted or null update visibility preserves the existing value. Returned role is also used in the community structure response.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current custom role, with default and null properties omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityCustomRoleResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCommunityCustomRoleRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/communities/{communityId}/roles/{roleId}": {
      "patch": {
        "operationId": "updateCommunityCustomRole",
        "tags": [
          "Communities"
        ],
        "summary": "Update a community custom role",
        "description": "Requires the community owner or administrator role. Member-list visibility is display-only and defaults to true for new roles; omitted or null update visibility preserves the existing value. Returned role is also used in the community structure response.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "roleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current custom role, with default and null properties omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityCustomRoleResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCommunityCustomRoleRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/cooperative-admissions": {
      "post": {
        "operationId": "createSecureCooperativeAdmission",
        "tags": [
          "Encryption"
        ],
        "description": "Explicit cooperative admission for one missing current device of the pinned CHANNEL authority. ACTIVE CHANNEL only; five-minute root-signed intent, selected admitted nonauthority helper, exact pure Add proposal and root approval. Reads never claim or approve. Unknown relay returns MLS_COOPERATIVE_NOT_FOUND after scope authentication. Lists contain at most 8 summaries without proposal, approval or directory proofs. Missing/expired/cancelled relay cannot authorize any fresh nonauthority channel membership change; exact accepted transition receipt replay remains valid.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureCooperativeAdmissionResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSecureCooperativeAdmissionRequest"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listSecureCooperativeAdmissions",
        "tags": [
          "Encryption"
        ],
        "description": "Explicit cooperative admission for one missing current device of the pinned CHANNEL authority. ACTIVE CHANNEL only; five-minute root-signed intent, selected admitted nonauthority helper, exact pure Add proposal and root approval. Reads never claim or approve. Unknown relay returns MLS_COOPERATIVE_NOT_FOUND after scope authentication. Lists contain at most 8 summaries without proposal, approval or directory proofs. Missing/expired/cancelled relay cannot authorize any fresh nonauthority channel membership change; exact accepted transition receipt replay remains valid.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureCooperativeAdmissionListResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/cooperative-admissions/{requestId}": {
      "get": {
        "operationId": "getSecureCooperativeAdmission",
        "tags": [
          "Encryption"
        ],
        "description": "Explicit cooperative admission for one missing current device of the pinned CHANNEL authority. ACTIVE CHANNEL only; five-minute root-signed intent, selected admitted nonauthority helper, exact pure Add proposal and root approval. Reads never claim or approve. Unknown relay returns MLS_COOPERATIVE_NOT_FOUND after scope authentication. Lists contain at most 8 summaries without proposal, approval or directory proofs. Missing/expired/cancelled relay cannot authorize any fresh nonauthority channel membership change; exact accepted transition receipt replay remains valid.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureCooperativeAdmissionResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/cooperative-admissions/{requestId}/claim": {
      "post": {
        "operationId": "claimSecureCooperativeAdmission",
        "tags": [
          "Encryption"
        ],
        "description": "Explicit cooperative admission for one missing current device of the pinned CHANNEL authority. ACTIVE CHANNEL only; five-minute root-signed intent, selected admitted nonauthority helper, exact pure Add proposal and root approval. Reads never claim or approve. Unknown relay returns MLS_COOPERATIVE_NOT_FOUND after scope authentication. Lists contain at most 8 summaries without proposal, approval or directory proofs. Missing/expired/cancelled relay cannot authorize any fresh nonauthority channel membership change; exact accepted transition receipt replay remains valid.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureCooperativeAdmissionResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/cooperative-admissions/{requestId}/proposal": {
      "post": {
        "operationId": "proposeSecureCooperativeAdmission",
        "tags": [
          "Encryption"
        ],
        "description": "Explicit cooperative admission for one missing current device of the pinned CHANNEL authority. ACTIVE CHANNEL only; five-minute root-signed intent, selected admitted nonauthority helper, exact pure Add proposal and root approval. Reads never claim or approve. Unknown relay returns MLS_COOPERATIVE_NOT_FOUND after scope authentication. Lists contain at most 8 summaries without proposal, approval or directory proofs. Missing/expired/cancelled relay cannot authorize any fresh nonauthority channel membership change; exact accepted transition receipt replay remains valid.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureCooperativeAdmissionResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProposeSecureCooperativeAdmissionRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/cooperative-admissions/{requestId}/approve": {
      "post": {
        "operationId": "approveSecureCooperativeAdmission",
        "tags": [
          "Encryption"
        ],
        "description": "Explicit cooperative admission for one missing current device of the pinned CHANNEL authority. ACTIVE CHANNEL only; five-minute root-signed intent, selected admitted nonauthority helper, exact pure Add proposal and root approval. Reads never claim or approve. Unknown relay returns MLS_COOPERATIVE_NOT_FOUND after scope authentication. Lists contain at most 8 summaries without proposal, approval or directory proofs. Missing/expired/cancelled relay cannot authorize any fresh nonauthority channel membership change; exact accepted transition receipt replay remains valid.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureCooperativeAdmissionResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApproveSecureCooperativeAdmissionRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/cooperative-admissions/{requestId}/cancel": {
      "post": {
        "operationId": "cancelSecureCooperativeAdmission",
        "tags": [
          "Encryption"
        ],
        "description": "Explicit cooperative admission for one missing current device of the pinned CHANNEL authority. ACTIVE CHANNEL only; five-minute root-signed intent, selected admitted nonauthority helper, exact pure Add proposal and root approval. Reads never claim or approve. Unknown relay returns MLS_COOPERATIVE_NOT_FOUND after scope authentication. Lists contain at most 8 summaries without proposal, approval or directory proofs. Missing/expired/cancelled relay cannot authorize any fresh nonauthority channel membership change; exact accepted transition receipt replay remains valid.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureCooperativeAdmissionResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/streams/channels/{channelId}/start-operations/{operationId}": {
      "get": {
        "operationId": "getStreamStartOperation",
        "tags": [
          "Stream"
        ],
        "summary": "Read the exact device-owned stream Start outcome",
        "description": "Existing exact receipts take precedence. Absent recent UUIDv7 returns UNKNOWN; expired UUID returns EXPIRED with durable retiredThroughEpochMs and proof no LIVE receipt was retired. UNKNOWN and HTTP failures cannot release custody. Receipt access remains account/session/device bound after channel ACL revocation.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical lowercase UUIDv7. First48 bits encode the fresh server clock timestamp."
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "description": "Must equal the current authenticated account session device. Legacy or omitted values are rejected.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful projection. Null and default values may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamStartOperationResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Private operation receipts are never cached.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "post": {
        "operationId": "startStreamOperation",
        "tags": [
          "Stream"
        ],
        "summary": "Start exactly once under a durable operation identifier",
        "description": "Requires ownershipProtocolVersion 1 and current broadcast access. Client obtains a fresh account clock and embeds serverTimeEpochMs in UUIDv7. Fresh Start is admitted for ten minutes (30s future skew); old UUIDs behind the durable monotonic account floor return EXPIRED permanently, including after wall-clock rollback. Receipt and stream commit atomically. Existing receipt wins over expiry; CANCELLED/REJECTED never create a stream. Caps of 4096 records/device and 16384/account cause temporary429 without a terminal claim. GC removes only expired non-LIVE receipts; it never implicitly Ends a stream.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical lowercase UUIDv7. First48 bits encode the fresh server clock timestamp."
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "description": "Must equal the current authenticated account session device. Legacy or omitted values are rejected.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful projection. Null and default values may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamStartOperationResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Private operation receipts are never cached.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartStreamSessionRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/streams/channels/{channelId}/start-operations/{operationId}/cancel": {
      "post": {
        "operationId": "cancelStreamStartOperation",
        "tags": [
          "Stream"
        ],
        "summary": "Prevent an uncommitted exact Start without ending a hosted stream",
        "description": "Exact receipt always wins. Unknown recent UUIDv7 becomes a durable cancellation tombstone; existing STARTED remains LIVE until explicit End. Expired unknown returns EXPIRED under the durable account floor. At capacity returns nonterminal429; future malformed timestamps are nonterminal400.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "description": "Internal numeric identifier.",
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          },
          {
            "name": "operationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Canonical lowercase UUIDv7. First48 bits encode the fresh server clock timestamp."
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "description": "Must equal the current authenticated account session device. Legacy or omitted values are rejected.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful projection. Null and default values may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamStartOperationResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Private operation receipts are never cached.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/streams/start-operations/clock": {
      "get": {
        "operationId": "getStreamStartOperationClock",
        "tags": [
          "Stream"
        ],
        "summary": "Read a fresh account-bound clock for exact Start UUIDv7",
        "description": "Returns effective server time under the same durable account retirement lock. Use immediately to create UUIDv7; do not cache or use the device wall clock. This does not reserve capacity or create a Start operation.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "description": "Must equal the current authenticated account session device. Legacy or omitted values are rejected.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful projection. Null and default values may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StreamStartOperationClockResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "description": "Private operation receipts are never cached.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/e2ee/recovery/time": {
      "get": {
        "operationId": "getE2eeRecoveryTime",
        "tags": [
          "Encryption"
        ],
        "description": "Authenticated account/session/device-bound current server time for creating the signed device-transfer transcript within the unchanged 60-second admission window. Private no-store; this clock does not grant transfer or account authority.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eeRecoveryTimeResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/history-grants/query": {
      "post": {
        "operationId": "querySecureHistoryGrants",
        "tags": [
          "Encryption"
        ],
        "description": "Query bounded encrypted archive-key grants for an admitted CHANNEL reader at the exact current MLS head. Missing grants request disclosure from an entitled, currently admitted holder. Owner-signed FULL_CHANNEL_HISTORY policy and current ACL, account session, device and identity generation are checked. No live MLS ratchet or plaintext is returned.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Bounded archive grants and pending recipients; private, no-store.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureHistoryGrantsResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuerySecureHistoryGrantsRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/history-grants": {
      "post": {
        "operationId": "publishSecureHistoryGrants",
        "tags": [
          "Encryption"
        ],
        "description": "Publish bounded exact device-signed historical archive-key grants for CHANNEL history. The grantor must be currently admitted and entitled by an immutable historical account-root capsule. Each grant binds the old epoch, authorizing head, current recipient account root and encrypted capsule under the owner-signed FULL_CHANNEL_HISTORY policy. No live MLS ratchet or plaintext is accepted.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Grants accepted; private, no-store.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishSecureHistoryGrantsRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/media/e2ee/rooms/epoch": {
      "post": {
        "operationId": "getE2eeRoomEpoch",
        "tags": [
          "Encryption"
        ],
        "description": "Fresh authenticated exact participation/device/lease observation with the identical full-state epoch and authorization checks. No roster or key envelope is returned. Transport failure conveys no continued authorization.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/E2eeRoomEpochResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "410": {
            "description": "The exact media lease or generation is no longer active."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/E2eeRoomStateRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/social/publications": {
      "post": {
        "operationId": "createSocialPublication",
        "tags": [
          "Social"
        ],
        "summary": "createSocialPublication",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "description": "Authenticated social content. Current friendship/block and group channel access apply. Publication links never confer access. Stories remain readable after the 24-hour highlight window. No chat plaintext is exposed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialPublicationResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "410": {
            "description": "The publication created by this operation was deleted."
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSocialPublicationRequest"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listSocialPublications",
        "tags": [
          "Social"
        ],
        "summary": "listSocialPublications",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "description": "Authenticated social content. Current friendship/block and group channel access apply. Publication links never confer access. Stories remain readable after the 24-hour highlight window. No chat plaintext is exposed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "author",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "$ref": "#/components/schemas/SocialPublicationKind"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialPublicationPageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/social/publications/{publicationId}": {
      "get": {
        "operationId": "getSocialPublication",
        "tags": [
          "Social"
        ],
        "summary": "getSocialPublication",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "description": "Authenticated social content. Current friendship/block and group channel access apply. Publication links never confer access. Stories remain readable after the 24-hour highlight window. No chat plaintext is exposed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "publicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialPublicationResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "put": {
        "operationId": "updateSocialPublication",
        "tags": [
          "Social"
        ],
        "summary": "updateSocialPublication",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "description": "Authenticated social content. Current friendship/block and group channel access apply. Publication links never confer access. Stories remain readable after the 24-hour highlight window. No chat plaintext is exposed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "publicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialPublicationResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSocialPublicationRequest"
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteSocialPublication",
        "tags": [
          "Social"
        ],
        "summary": "deleteSocialPublication",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "description": "Authenticated social content. Current friendship/block and group channel access apply. Publication links never confer access. Stories remain readable after the 24-hour highlight window. No chat plaintext is exposed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "publicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/social/publications/{publicationId}/seen": {
      "post": {
        "operationId": "markSocialStorySeen",
        "tags": [
          "Social"
        ],
        "summary": "markSocialStorySeen",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "description": "Authenticated social content. Current friendship/block and group channel access apply. Publication links never confer access. Stories remain readable after the 24-hour highlight window. No chat plaintext is exposed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "publicationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/social/feed": {
      "get": {
        "operationId": "getSocialFeed",
        "tags": [
          "Social"
        ],
        "summary": "getSocialFeed",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "description": "Authenticated social content. Current friendship/block and group channel access apply. Publication links never confer access. Stories remain readable after the 24-hour highlight window. No chat plaintext is exposed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialFeedPageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/social/stories/active": {
      "get": {
        "operationId": "getActiveSocialStories",
        "tags": [
          "Social"
        ],
        "summary": "getActiveSocialStories",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "description": "Authenticated social content. Current friendship/block and group channel access apply. Publication links never confer access. Stories remain readable after the 24-hour highlight window. No chat plaintext is exposed.",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "author",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success.",
            "headers": {
              "Cache-Control": {
                "$ref": "#/components/headers/NoStore"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SocialPublicationPageResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/scheduled": {
      "post": {
        "operationId": "scheduleSecureMessage",
        "tags": [
          "Encryption"
        ],
        "description": "Owner/device-authenticated opaque MLS scheduling. Exact request bytes are idempotent. Delivery rechecks the current roster, epoch, device certificate and write permissions without requiring the original login session to remain active. A changed audience fails closed; no plaintext fallback. List and cancellation use the existing owner-scoped chat scheduled endpoints.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/ChatScopeType"
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-XChat-MLS-Control",
            "in": "header",
            "required": false,
            "description": "Set to 2 to process v2 MLS control records. Missing or unsupported values receive 426 once the channel is activated; this is a capability hint, not authorization.",
            "schema": {
              "type": "string",
              "enum": [
                "2"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledChatMessageResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScheduleSecureMessageRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/scheduled/{scheduledId}": {
      "get": {
        "operationId": "getSecureScheduledMessage",
        "tags": [
          "Encryption"
        ],
        "description": "Returns one owned MLS scheduled message for authenticated editing. Both owner and current device are authenticated. The response contains only the encrypted application and account-private preview and is never cached. Another owner cannot read the scheduled item. List and cancellation use the existing owner-scoped chat scheduled endpoints.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scheduledId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledChatMessageResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      },
      "patch": {
        "operationId": "updateSecureScheduledMessage",
        "tags": [
          "Encryption"
        ],
        "description": "Owner/device-authenticated opaque MLS scheduling. Exact request bytes are idempotent. Delivery rechecks the current roster, epoch, device certificate and write permissions without requiring the original login session to remain active. A changed audience fails closed; no plaintext fallback. List and cancellation use the existing owner-scoped chat scheduled endpoints.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scheduledId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledChatMessageResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "description": "A newer MLS control reader is required before this operation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSecureScheduledMessageRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/media/transport/leases/{leaseId}/microphone-admission": {
      "post": {
        "operationId": "refreshVoiceMicrophoneAdmission",
        "tags": [
          "Encryption"
        ],
        "description": "",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "leaseId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceMicrophoneAdmissionResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MediaLeaseGenerationRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/voice/admission": {
      "post": {
        "operationId": "admitOrdinaryVoice",
        "tags": [
          "Encryption"
        ],
        "description": "Ordinary VOICE only. Exact authenticated account/device and participation are revalidated. Explicit encryptionProtocolVersion 0 returns a prepared lease before physical RTC binding; no presentation scene, attendance, media key or key leader is required. TLS/WebRTC transport protection remains, and the media server can process channel audio/video. microphoneAdmission.GRANTED is business authorization, not proof of active capture; the exact provider policy ACK remains required. mediaEncryptionVersion 0 is persisted on the returned lease; the optional recipient is absent. Missing/legacy media modes require a client update and cannot mix with mode 0 in an active room. X-XChat-Classroom: 1 is the retained admission wire marker, not the media version.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "X-XChat-Classroom",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoiceAdmissionResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoiceAdmissionRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/communities/{communityId}/channels": {
      "post": {
        "operationId": "createCommunityChannel",
        "tags": [
          "Communities"
        ],
        "description": "Canonical channelKind. Legacy channelType+speakerModeEnabled is adapted only when channelKind is omitted. An occupied room or live lease forbids kind conversion with 409 VOICE_ROOM_KIND_BUSY. An optional policy saves viewing and all applicable capability rules in the same transaction. Broadcasting is required for non-text channels, speaking only for speaker channels. Omitting policy preserves legacy create and update behavior.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "communityId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityChannelResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateChannelRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/channels/{channelId}": {
      "patch": {
        "operationId": "updateCommunityChannel",
        "tags": [
          "Communities"
        ],
        "description": "Canonical channelKind. Legacy channelType+speakerModeEnabled is adapted only when channelKind is omitted. An occupied room or live lease forbids kind conversion with 409 VOICE_ROOM_KIND_BUSY. An optional policy saves viewing and all applicable capability rules in the same transaction. Broadcasting is required for non-text channels, speaking only for speaker channels. Omitting policy preserves legacy create and update behavior.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityChannelResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateChannelRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/channels/{channelId}/speaker-access": {
      "patch": {
        "operationId": "updateCommunityChannelSpeakerAccess",
        "tags": [
          "Communities"
        ],
        "description": "Configures which members may receive speaking permission in a SPEAKER channel. Owner and administrators remain eligible. An empty selector is unrestricted. The policy is server authoritative and does not apply to ordinary VOICE channels.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "channelId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current server-authoritative speaker eligibility policy.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommunityAccessResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCommunityAccessRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/media/e2ee/voice/state": {
      "post": {
        "operationId": "POST_api_v1_media_e2ee_voice_state",
        "tags": [
          "Encryption"
        ],
        "summary": "POST /api/v1/media/e2ee/voice/state",
        "description": "Ordinary VOICE media protocol 2 only. Requires current authenticated account/device, exact live participation and lease/generation, and certified current roster. Server returns only authorized signed ciphertext heads. No room leader or all-members ACK.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource. Defaults/null fields may be omitted.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoicePublisherKeyStateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/voice/crypto/VoicePublisherKeyRoutes.kt",
          "line": 15,
          "routeBodySha256": "23edc8acd7f2be323eef62c49c8b8dc45bd79bfe2c6868f0f114507baa58ee44"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VoicePublisherKeyStateRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/media/e2ee/voice/publisher-key": {
      "post": {
        "operationId": "POST_api_v1_media_e2ee_voice_publisher_key",
        "tags": [
          "Encryption"
        ],
        "summary": "POST /api/v1/media/e2ee/voice/publisher-key",
        "description": "Ordinary VOICE media protocol 2 only. Requires current authenticated account/device, exact live participation and lease/generation, and certified current roster. Server returns only authorized signed ciphertext heads. No room leader or all-members ACK. Publish one signed publisher generation with exact rosterDigest and recipient set. INITIAL uses previousKeyGeneration=0; generation must advance by one. Pure additions use ADD_RATCHET; removal or replacement uses REMOVE_RESEED. The durable head and desired policy commit together; successful HTTP response also requires exact configured-provider ACK outside SQL and a fresh authorization check. 503/lost response may be reconciled by replaying the identical accepted envelope, not inventing a new generation. A moderator DENY is a legitimate acknowledged policy; this response does not override it.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource. Defaults/null fields may be omitted.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VoicePublisherKeyStateResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/voice/crypto/VoicePublisherKeyRoutes.kt",
          "line": 21,
          "routeBodySha256": "118bde001295a5ed40bb454b993f93c9a4676bb3ea4e97aa05bd0357e99cfcfa"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublishVoicePublisherKeyRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/classroom/sessions/{voiceSessionId}/attendance": {
      "post": {
        "operationId": "POST_api_v1_classroom_sessions_voiceSessionId_attendance",
        "tags": [
          "Media"
        ],
        "summary": "POST /api/v1/classroom/sessions/{voiceSessionId}/attendance",
        "description": "Optional board/screen attendance for an already admitted ordinary VOICE protocol 2 lease. Exact account/device/participation/session/lease/generation must match. Does not acquire a second media lease or own ordinary audio. Screen-only provider enrollment occurs outside SQL; failure leaves the main audio lease intact. Scope voiceSessionId must equal the path.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "voiceSessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          },
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "X-XChat-Classroom",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource. Defaults/null fields may be omitted.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClassroomAttendanceResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/classroom/ClassroomRoutes.kt",
          "line": 60,
          "routeBodySha256": "9f35f374e7f5e18204caa289754c1d2389a14d5223c88b86764326a9e1632839"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ClassroomAttendanceRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/chat/attachments/{attachmentId}/encrypted-poster": {
      "get": {
        "operationId": "GET_api_v1_chat_attachments_attachmentId_encrypted_poster",
        "tags": [
          "Media"
        ],
        "summary": "GET /api/v1/chat/attachments/{attachmentId}/encrypted-poster",
        "description": "Read optional immutable encrypted poster metadata after current original-message authorization. 404 means absent or unavailable; it does not invalidate the original attachment.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource. Defaults/null fields may be omitted.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EncryptedPosterResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/media/poster/EncryptedPosterRoutes.kt",
          "line": 17,
          "routeBodySha256": "d2af83b5885e466d191da63bc271d80f28e149b736aea97c4a5df96c23f24491"
        }
      },
      "put": {
        "operationId": "PUT_api_v1_chat_attachments_attachmentId_encrypted_poster",
        "tags": [
          "Media"
        ],
        "summary": "PUT /api/v1/chat/attachments/{attachmentId}/encrypted-poster",
        "description": "Publish one immutable supplemental poster for an existing encrypted original attachment. Only the current original message author can consume their own READY encrypted upload (1..524288 bytes, application/vnd.teamyfy.e2ee, inlineImage=false, no thumbnail). The original message envelope and attachment inventory are not edited. Identical upload+descriptor retries return the same poster after fresh authorization; another poster returns POSTER_ALREADY_PUBLISHED (409), unavailable upload POSTER_UPLOAD_UNAVAILABLE (409), invalid metadata POSTER_INVALID (400). A metadata hint is emitted after commit without creating a message or unread marker.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current authorized resource. Defaults/null fields may be omitted.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store"
                  ]
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EncryptedPosterResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "426": {
            "$ref": "#/components/responses/UpgradeRequired"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/media/poster/EncryptedPosterRoutes.kt",
          "line": 22,
          "routeBodySha256": "91fd236806508525f23ce278049060924ce2455af4fba1e7e61d05017e355ef7"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutEncryptedPosterRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/chat/attachments/{attachmentId}/encrypted-poster/download": {
      "get": {
        "operationId": "downloadEncryptedAttachmentPoster",
        "tags": [
          "Media"
        ],
        "summary": "Download an authorized encrypted poster",
        "description": "Read immutable ciphertext only after the exact original message authorization. Same single-range/If-Range behavior as attachment downloads; no shared cache and no plaintext image. The descriptor is obtained from the encrypted-poster metadata route. Size remains 1..524288 bytes.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "attachmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "Range",
            "in": "header",
            "description": "Single inclusive bytes=start-end, bytes=start- or bytes=-suffix-length. End clamps to EOF; large numeric bounds saturate safely. Supported single-range header is bounded to 4096 characters.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Range",
            "in": "header",
            "description": "Exact strong ETag from HEAD/GET. Mismatch yields full 200; range clients should inspect status/identity before reading the body.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full immutable representation, including existing full-download clients.",
            "headers": {
              "Content-Length": {
                "description": "Full representation size on HEAD/200; transferred byte count on 206.",
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                }
              },
              "Content-Type": {
                "description": "Opaque encrypted poster content type, never plaintext image MIME.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "Strong opaque identity, stable for unchanged bytes and representation metadata.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[0-9a-f]{64}\"$"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store, no-transform"
                  ]
                }
              },
              "Content-Encoding": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "identity"
                  ]
                }
              },
              "Content-Disposition": {
                "description": "Existing attachment download disposition and sanitized filename.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/vnd.teamyfy.e2ee": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "206": {
            "description": "Exact single range; Content-Length is range size, not full resource size.",
            "headers": {
              "Content-Length": {
                "description": "Full representation size on HEAD/200; transferred byte count on 206.",
                "schema": {
                  "type": "integer",
                  "format": "int64",
                  "minimum": 0
                }
              },
              "Content-Type": {
                "description": "Opaque encrypted poster content type, never plaintext image MIME.",
                "schema": {
                  "type": "string"
                }
              },
              "ETag": {
                "description": "Strong opaque identity, stable for unchanged bytes and representation metadata.",
                "schema": {
                  "type": "string",
                  "pattern": "^\"[0-9a-f]{64}\"$"
                }
              },
              "Accept-Ranges": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "bytes"
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store, no-transform"
                  ]
                }
              },
              "Content-Encoding": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "identity"
                  ]
                }
              },
              "Content-Disposition": {
                "description": "Existing attachment download disposition and sanitized filename.",
                "schema": {
                  "type": "string"
                }
              },
              "Content-Range": {
                "schema": {
                  "type": "string",
                  "pattern": "^bytes [0-9]+-[0-9]+/[0-9]+$"
                }
              }
            },
            "content": {
              "application/vnd.teamyfy.e2ee": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "416": {
            "description": "Invalid or unsatisfiable supported single byte range, after authorization. Empty body.",
            "headers": {
              "Content-Range": {
                "schema": {
                  "type": "string",
                  "pattern": "^bytes \\*/[0-9]+$"
                }
              },
              "Content-Length": {
                "schema": {
                  "type": "integer",
                  "enum": [
                    0
                  ]
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "enum": [
                    "private, no-store, no-transform"
                  ]
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/media/poster/EncryptedPosterRoutes.kt",
          "line": 28,
          "routeBodySha256": "2479b88268b970512ba53103fe2dcc6d1550ff7a31b20259d675a8743963cbe8"
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/public-cards": {
      "post": {
        "operationId": "publishSecurePublicChatCard",
        "tags": [
          "Encryption"
        ],
        "description": "Human-only atomic publication of public news or a public channel event and its encrypted MLS timeline token. Exactly one public record is required. Current certificate, enrolled leaf and write ACL precede receipt lookup. Retain exact cardId, public input and application across ambiguous outcomes. Only MLS_STALE_EPOCH_NOT_ACCEPTED permits reprepare; exact accepted retry returns the original receipt with inserted=false. Deleted content is not recreated. Legacy creation after cutover returns PUBLIC_CARD_ENCRYPTED_ANCHOR_REQUIRED; an encrypted event anchor cannot change channels (PUBLIC_CARD_CHANNEL_MOVE_UNSUPPORTED). This source contract does not establish deployment or device acceptance.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "name": "X-XChat-Device-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 128
            }
          },
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "CHANNEL"
              ]
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecurePublicChatCardResponse"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string"
                },
                "description": "private, no-store"
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "413": {
            "description": "Secure JSON body exceeds 8 MiB"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutSecurePublicChatCardRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/dm/conversations/page": {
      "get": {
        "operationId": "listDirectConversationPage",
        "tags": [
          "Direct messages"
        ],
        "summary": "Read an authorised conversation or call-directory page",
        "description": "ACTIVITY preserves existing paging. LAST_CALL excludes bot peers before LIMIT, orders persisted DIRECT call starts descending then conversation ID descending, and places no-call peers last by ID descending. Incoming/outgoing, audio/video and unanswered attempts share the persisted call identity. Call cursors are distinct from ACTIVITY cursors and explicitly encode the no-call tail. Response echoes LAST_CALL: clients reject an absent/default ACTIVITY echo for a LAST_CALL request, rather than treating an old server page as call-ordered. This read neither starts a call nor changes read state.",
        "security": [
          {
            "BearerAuth": []
          },
          {
            "WebSessionCookie": [],
            "WebSessionMode": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/WebSessionMode"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque nextCursor from a page using the same order."
          },
          {
            "name": "order",
            "in": "query",
            "required": false,
            "schema": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/DirectConversationOrder"
                }
              ],
              "default": "ACTIVITY"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Actor-owned page; null/default fields may be omitted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectConversationListPageResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid order or malformed/cross-directory cursor."
          },
          "401": {
            "description": "Authentication required."
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/applications/recording-card": {
      "post": {
        "operationId": "managedRecordingCardReserve",
        "tags": [
          "Chat"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Exact server-readable recording-card reservation/publication under current access and generation. Reservation is invisible until complete artifact finalization; receipt does not prove playable media.",
        "parameters": [
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "CHANNEL",
                "DIRECT"
              ]
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$"
            }
          },
          {
            "name": "X-Teamyfy-Content-Protocol",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            },
            "description": "Явный server-managed content protocol; не версия TLS, WebRTC или URL API."
          },
          {
            "name": "X-Teamyfy-Content-Generation",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Текущая historyGeneration из capability/bootstrap; несовпадение даёт 409 до выделения content-ресурсов."
          }
        ],
        "responses": {
          "200": {
            "description": "Exact reservation/publication receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureApplicationResponse"
                }
              }
            }
          },
          "409": {
            "description": "Current content generation or revision changed; retain exact operation custody and refresh negotiation. Never replay an old-generation intent as a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "426": {
            "description": "An explicitly supported managed content protocol is required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReserveManagedRecordingCardRequest"
              }
            }
          }
        }
      }
    },
    "/api/v1/e2ee/conversations/{scopeType}/{scopeId}/applications/recording-card/{messageId}": {
      "get": {
        "operationId": "managedRecordingCardReceipt",
        "tags": [
          "Chat"
        ],
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "description": "Exact server-readable recording-card reservation/publication under current access and generation. Reservation is invisible until complete artifact finalization; receipt does not prove playable media.",
        "parameters": [
          {
            "name": "scopeType",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "CHANNEL",
                "DIRECT"
              ]
            }
          },
          {
            "name": "scopeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$"
            }
          },
          {
            "name": "messageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[1-9][0-9]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exact reservation/publication receipt.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SecureApplicationResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "Native Android/Desktop access JWT. Never place this credential in a URL.",
        "x-sensitive": true
      },
      "WebSessionCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-xchat_session",
        "description": "Production HttpOnly Secure SameSite=Strict Web session cookie. Cookie authentication is ignored unless WebSessionMode is also present.",
        "x-sensitive": true
      },
      "WebSessionMode": {
        "type": "apiKey",
        "in": "header",
        "name": "X-XChat-Session",
        "description": "CSRF opt-in header. Its only supported value is cookie. Required together with WebSessionCookie.",
        "x-allowed-value": "cookie"
      }
    },
    "parameters": {
      "WebSessionMode": {
        "name": "X-XChat-Session",
        "in": "header",
        "required": false,
        "description": "Set to cookie to request or use the HttpOnly Web session. Any other value is rejected.",
        "schema": {
          "type": "string",
          "enum": [
            "cookie"
          ]
        }
      }
    },
    "headers": {
      "NoStore": {
        "description": "Authentication responses are never cacheable.",
        "schema": {
          "type": "string",
          "example": "no-store"
        }
      },
      "WebSessionSetCookie": {
        "description": "Present in cookie mode. The JWT value is sensitive and inaccessible to JavaScript.",
        "schema": {
          "type": "string",
          "example": "__Host-xchat_session=<redacted>; Path=/; Max-Age=86400; Secure; HttpOnly; SameSite=Strict",
          "x-sensitive": true
        }
      },
      "WebSessionClearCookie": {
        "description": "Present only when X-XChat-Session is cookie.",
        "schema": {
          "type": "string",
          "example": "__Host-xchat_session=; Path=/; Max-Age=0; Secure; HttpOnly; SameSite=Strict"
        }
      }
    },
    "schemas": {
      "BrowserPushSubscriptionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "endpoint",
          "p256dh",
          "auth"
        ],
        "properties": {
          "endpoint": {
            "type": "string",
            "maxLength": 4096
          },
          "p256dh": {
            "type": "string",
            "minLength": 40,
            "maxLength": 512
          },
          "auth": {
            "type": "string",
            "minLength": 8,
            "maxLength": 256
          },
          "userAgent": {
            "type": "string",
            "nullable": true
          },
          "bindingAttempt": {
            "type": "string",
            "nullable": true,
            "pattern": "^[A-Za-z0-9_-]{1,128}$",
            "description": "Opaque, client-selected identifier for this registration attempt, retained across retries."
          }
        }
      },
      "BrowserPushSubscriptionResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "endpoint"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "endpoint": {
            "type": "string"
          },
          "bindingId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Server-generated registration generation used to match subsequent Web Push deliveries. Older servers can omit it."
          }
        }
      },
      "DeleteBrowserPushSubscriptionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "endpoint"
        ],
        "properties": {
          "endpoint": {
            "type": "string"
          },
          "bindingId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        }
      },
      "NotificationScopeType": {
        "type": "string",
        "enum": [
          "GLOBAL",
          "DIRECT",
          "COMMUNITY",
          "CHANNEL"
        ]
      },
      "NotificationMode": {
        "type": "string",
        "enum": [
          "ALL",
          "MENTIONS",
          "MUTED"
        ]
      },
      "NotificationPreferenceResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "scopeType": {
            "$ref": "#/components/schemas/NotificationScopeType"
          },
          "scopeId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "mode": {
            "$ref": "#/components/schemas/NotificationMode"
          }
        },
        "required": [
          "scopeType",
          "mode"
        ]
      },
      "NotificationSettingsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "quietHoursEnabled": {
            "type": "boolean"
          },
          "quietStartMinutes": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "maximum": 1439
          },
          "quietEndMinutes": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "maximum": 1439
          },
          "quietTimezone": {
            "type": "string"
          },
          "mentionsEnabled": {
            "type": "boolean"
          },
          "repliesEnabled": {
            "type": "boolean"
          },
          "threadsEnabled": {
            "type": "boolean"
          },
          "quietTimezoneConfigured": {
            "type": "boolean",
            "description": "Whether the account has saved its quiet-hours timezone. An unset timezone follows the device when quiet hours are first enabled."
          }
        }
      },
      "NotificationPreferencesResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "defaultMode": {
            "$ref": "#/components/schemas/NotificationMode"
          },
          "overrides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NotificationPreferenceResponse"
            }
          },
          "settings": {
            "$ref": "#/components/schemas/NotificationSettingsResponse"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        },
        "required": [
          "defaultMode",
          "overrides"
        ]
      },
      "UpdateNotificationSettingsRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "quietHoursEnabled": {
            "type": "boolean"
          },
          "quietStartMinutes": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "maximum": 1439
          },
          "quietEndMinutes": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "maximum": 1439
          },
          "quietTimezone": {
            "type": "string"
          },
          "mentionsEnabled": {
            "type": "boolean"
          },
          "repliesEnabled": {
            "type": "boolean"
          },
          "threadsEnabled": {
            "type": "boolean"
          }
        },
        "required": [
          "quietHoursEnabled",
          "quietStartMinutes",
          "quietEndMinutes",
          "quietTimezone",
          "mentionsEnabled",
          "repliesEnabled",
          "threadsEnabled"
        ]
      },
      "UpdateNotificationPreferenceRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "scopeType": {
            "$ref": "#/components/schemas/NotificationScopeType"
          },
          "scopeId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "mode": {
            "$ref": "#/components/schemas/NotificationMode"
          }
        },
        "required": [
          "scopeType"
        ]
      },
      "ResolveMentionsRequest": {
        "type": "object",
        "required": [
          "identifiers"
        ],
        "properties": {
          "identifiers": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "maxLength": 32
            }
          }
        },
        "additionalProperties": false
      },
      "UserMentionResponse": {
        "type": "object",
        "required": [
          "identifier",
          "userId",
          "publicIdentifier"
        ],
        "properties": {
          "identifier": {
            "type": "string"
          },
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "publicIdentifier": {
            "type": "string"
          },
          "isBot": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ResolveMentionsResponse": {
        "type": "object",
        "required": [
          "users",
          "ownIdentifiers"
        ],
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserMentionResponse"
            }
          },
          "ownIdentifiers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "EmojiPackKind": {
        "type": "string",
        "enum": [
          "EMOJI",
          "STICKER"
        ]
      },
      "EmojiItemResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "packId",
          "shortcode",
          "imageUrl",
          "contentType",
          "animated"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "packId": {
            "type": "integer",
            "format": "int64"
          },
          "shortcode": {
            "type": "string"
          },
          "imageUrl": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "animated": {
            "type": "boolean"
          },
          "kind": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/EmojiPackKind"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Actual parent pack kind, including items from private personal packs. Absent on legacy servers."
          }
        }
      },
      "FeedbackPlatform": {
        "type": "string",
        "enum": [
          "WEB",
          "DESKTOP",
          "ANDROID"
        ]
      },
      "CreateFeedbackRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "clientRequestId",
          "description",
          "platform"
        ],
        "properties": {
          "clientRequestId": {
            "type": "string",
            "format": "uuid",
            "description": "Stable idempotency key for this submission; reuse on retries."
          },
          "description": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "description": "Required user-written description, trimmed; bound is Unicode code points."
          },
          "platform": {
            "$ref": "#/components/schemas/FeedbackPlatform"
          },
          "imageUploadId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Optional account-owned READY image upload UUID, not a message attachment ID."
          },
          "appVersion": {
            "type": "string",
            "maxLength": 64,
            "nullable": true
          }
        }
      },
      "FeedbackResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "clientRequestId",
          "createdAt",
          "hasImage"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "clientRequestId": {
            "type": "string",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "hasImage": {
            "type": "boolean",
            "description": "No image URL is exposed by this response."
          }
        }
      },
      "ResolveUserNamesRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userIds"
        ],
        "properties": {
          "userIds": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "description": "Raw list is bounded before deduplication. Resolves only the supplied identities; unknown IDs return null overrides."
          },
          "communityId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "nullable": true,
            "description": "Requires current joined, non-banned viewer membership."
          }
        }
      },
      "UserNameOverridesResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId"
        ],
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "privateAlias": {
            "type": "string",
            "nullable": true,
            "maxLength": 20,
            "description": "Omitted or null means no override; clear any cached value for this identity and scope.",
            "x-sensitive": true
          },
          "communityNickname": {
            "type": "string",
            "nullable": true,
            "maxLength": 20,
            "description": "Omitted or null means no override; clear any cached value for this identity and scope."
          }
        }
      },
      "UserNameOverridesListResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/UserNameOverridesResponse"
            }
          }
        }
      },
      "UpdateUserAliasRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "alias"
        ],
        "properties": {
          "alias": {
            "type": "string",
            "description": "Trimmed input must contain at most 20 Unicode code points. ISO control characters are rejected. Empty or whitespace-only input resets the value."
          }
        }
      },
      "UpdateCommunityNicknameRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "nickname"
        ],
        "properties": {
          "nickname": {
            "type": "string",
            "description": "Trimmed input must contain at most 20 Unicode code points. ISO control characters are rejected. Empty or whitespace-only input resets the value."
          }
        }
      },
      "UserAliasResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId"
        ],
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "privateAlias": {
            "type": "string",
            "nullable": true,
            "maxLength": 20,
            "description": "Omitted or null means no override; clear any cached value for this identity and scope.",
            "x-sensitive": true
          }
        }
      },
      "CommunityNicknameResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "communityId",
          "userId"
        ],
        "properties": {
          "communityId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "userId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "nickname": {
            "type": "string",
            "nullable": true,
            "maxLength": 20,
            "description": "Omitted or null means no override; clear any cached value for this identity and scope."
          }
        }
      },
      "RegisterRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "username",
          "password"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 255
          },
          "username": {
            "type": "string",
            "minLength": 3,
            "maxLength": 40,
            "description": "Immutable login; case-insensitive uniqueness. New names cannot contain @ or control characters. Existing duplicate names are not renamed."
          },
          "password": {
            "type": "string",
            "format": "password",
            "minLength": 12,
            "maxLength": 72,
            "description": "New passwords require at least 12 characters, at most 72 UTF-8 bytes, and must not be an obvious common password. Existing passwords still work at login.",
            "writeOnly": true,
            "x-sensitive": true
          },
          "displayName": {
            "type": "string",
            "minLength": 3,
            "maxLength": 15,
            "pattern": "\\S",
            "nullable": true
          },
          "clientName": {
            "type": "string",
            "nullable": true,
            "description": "Self-declared session display name, normalized and limited to 120 characters. Never used for authentication."
          },
          "clientPlatform": {
            "type": "string",
            "nullable": true,
            "description": "Self-declared client type WEB, ANDROID or DESKTOP. Missing or unrecognized values remain unknown; never an authorization claim."
          }
        }
      },
      "LoginRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "password"
        ],
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 255,
            "description": "Email address or immutable case-insensitive login name. Email syntax selects email lookup; ambiguous legacy names require email sign-in."
          },
          "password": {
            "type": "string",
            "format": "password",
            "minLength": 8,
            "maxLength": 72,
            "description": "Must contain 8 or more characters and encode to at most 72 UTF-8 bytes.",
            "writeOnly": true,
            "x-sensitive": true
          },
          "clientName": {
            "type": "string",
            "nullable": true,
            "description": "Self-declared session display name, normalized and limited to 120 characters. Never used for authentication."
          },
          "clientPlatform": {
            "type": "string",
            "nullable": true,
            "description": "Self-declared client type WEB, ANDROID or DESKTOP. Missing or unrecognized values remain unknown; never an authorization claim."
          }
        }
      },
      "AuthUserResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "publicIdentifier",
          "email",
          "username",
          "displayName"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "publicIdentifier": {
            "type": "string",
            "minLength": 1
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "username": {
            "type": "string",
            "minLength": 1
          },
          "displayName": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "AuthResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accessToken",
          "tokenType",
          "expiresAtEpochMillis",
          "user"
        ],
        "properties": {
          "accessToken": {
            "type": "string",
            "format": "password",
            "description": "Bearer JWT for native mode; exactly empty in cookie mode.",
            "x-sensitive": true
          },
          "tokenType": {
            "type": "string",
            "enum": [
              "Bearer",
              "Cookie"
            ]
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "user": {
            "$ref": "#/components/schemas/AuthUserResponse"
          },
          "refreshToken": {
            "type": "string",
            "nullable": true,
            "format": "password",
            "x-sensitive": true,
            "description": "Rotating device-bound refresh proof in native mode only; omitted for HttpOnly cookie transport."
          },
          "refreshExpiresAtEpochMillis": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 0,
            "description": "Absolute session expiry; rotation never extends this bound. Omitted for cookie transport."
          }
        }
      },
      "AccessTokenRefreshResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "accessToken",
          "tokenType",
          "expiresAtEpochMillis"
        ],
        "properties": {
          "accessToken": {
            "type": "string",
            "format": "password",
            "description": "Bearer JWT for native mode; exactly empty in cookie mode.",
            "x-sensitive": true
          },
          "tokenType": {
            "type": "string",
            "enum": [
              "Bearer",
              "Cookie"
            ]
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "refreshToken": {
            "type": "string",
            "nullable": true,
            "format": "password",
            "x-sensitive": true,
            "description": "Rotating device-bound refresh proof in native mode only; omitted for HttpOnly cookie transport."
          },
          "refreshExpiresAtEpochMillis": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 0,
            "description": "Absolute session expiry; rotation never extends this bound. Omitted for cookie transport."
          }
        }
      },
      "RealtimeTicketResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ticket",
          "expiresAtEpochMillis"
        ],
        "properties": {
          "ticket": {
            "type": "string",
            "format": "password",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "description": "Short-lived one-time credential for /api/v1/realtime/ws?ticket=...",
            "x-sensitive": true
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "UserProfileResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "publicIdentifier",
          "email",
          "username",
          "displayName"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "publicIdentifier": {
            "type": "string",
            "minLength": 1
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "username": {
            "type": "string",
            "minLength": 1,
            "readOnly": true
          },
          "displayName": {
            "type": "string",
            "minLength": 1
          },
          "bio": {
            "type": "string",
            "nullable": true
          },
          "avatarUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true
          },
          "emailVerified": {
            "type": "boolean",
            "default": false,
            "description": "Whether the current account email has been confirmed by a one-time code."
          },
          "isBot": {
            "type": "boolean"
          },
          "supportsPartialProfileUpdate": {
            "type": "boolean",
            "description": "The profile endpoint accepts preserveDisplayName and preserveBio."
          }
        }
      },
      "PublicUserProfileResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "publicIdentifier",
          "displayName"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "publicIdentifier": {
            "type": "string",
            "minLength": 1
          },
          "displayName": {
            "type": "string",
            "minLength": 1
          },
          "bio": {
            "type": "string",
            "nullable": true
          },
          "avatarUrl": {
            "type": "string",
            "format": "uri",
            "nullable": true
          },
          "isBot": {
            "type": "boolean"
          }
        }
      },
      "UpdateProfileRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "displayName"
        ],
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 3,
            "maxLength": 15,
            "pattern": "\\S"
          },
          "publicIdentifier": {
            "type": "string",
            "minLength": 6,
            "maxLength": 15,
            "pattern": "^[a-z0-9][a-z0-9._-]{5,14}$",
            "nullable": true
          },
          "bio": {
            "type": "string",
            "nullable": true
          },
          "preserveDisplayName": {
            "type": "boolean",
            "default": false
          },
          "preserveBio": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "AvatarUploadRequest": {
        "type": "object",
        "required": [
          "file"
        ],
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "description": "Image payload, at most 5 MiB."
          }
        }
      },
      "ExternalVideoProviderV1": {
        "type": "string",
        "enum": [
          "YOUTUBE",
          "VK_VIDEO",
          "RUTUBE"
        ]
      },
      "ExternalVideoMetadataV1": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "videoId",
          "canonicalUrl"
        ],
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/ExternalVideoProviderV1"
          },
          "videoId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32,
            "pattern": "^[A-Za-z0-9_-]+$"
          },
          "ownerId": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^-?[0-9]+$",
            "nullable": true
          },
          "startSeconds": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 86400,
            "nullable": true
          },
          "canonicalUrl": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000
          },
          "posterUrl": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000,
            "nullable": true
          },
          "sourceWidth": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 16384,
            "nullable": true,
            "description": "Provider-reported source video width. Absent when the source geometry was not independently verified."
          },
          "sourceHeight": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 16384,
            "nullable": true,
            "description": "Provider-reported source video height. Absent when the source geometry was not independently verified."
          }
        }
      },
      "VkPostImageV1": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url",
          "width",
          "height"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "minimum": 1
          },
          "height": {
            "type": "integer",
            "format": "int32",
            "minimum": 1
          }
        }
      },
      "VkPostMetadataV1": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "ownerId",
          "postId",
          "canonicalUrl",
          "authorName"
        ],
        "properties": {
          "ownerId": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^-?[0-9]+$"
          },
          "postId": {
            "type": "string",
            "maxLength": 20,
            "pattern": "^[0-9]+$"
          },
          "canonicalUrl": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000
          },
          "authorName": {
            "type": "string",
            "maxLength": 300
          },
          "authorAvatarUrl": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000,
            "nullable": true
          },
          "publishedAtEpochSeconds": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "nullable": true
          },
          "text": {
            "type": "string",
            "maxLength": 1200,
            "nullable": true
          },
          "images": {
            "type": "array",
            "maxItems": 4,
            "items": {
              "$ref": "#/components/schemas/VkPostImageV1"
            }
          },
          "likeCount": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "nullable": true
          },
          "commentCount": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "nullable": true
          },
          "shareCount": {
            "type": "integer",
            "format": "int32",
            "minimum": 0,
            "nullable": true
          }
        }
      },
      "LinkPreviewResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000
          },
          "title": {
            "type": "string",
            "maxLength": 300,
            "nullable": true
          },
          "description": {
            "type": "string",
            "maxLength": 300,
            "nullable": true
          },
          "imageUrl": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000,
            "nullable": true
          },
          "siteName": {
            "type": "string",
            "maxLength": 300,
            "nullable": true
          },
          "externalVideo": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ExternalVideoMetadataV1"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "vkPost": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/VkPostMetadataV1"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "message"
        ],
        "properties": {
          "message": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "FriendActivityType": {
        "type": "string",
        "enum": [
          "VOICE_CHANNEL",
          "STREAM"
        ]
      },
      "FriendActivityRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userIds"
        ],
        "properties": {
          "userIds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            }
          }
        }
      },
      "FriendActivityResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId"
        ],
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 9223372036854775807
          },
          "activityType": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/FriendActivityType"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "activityCommunityName": {
            "type": "string",
            "nullable": true
          },
          "activityChannelName": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "FriendActivityBatchResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/FriendActivityResponse"
            }
          }
        }
      },
      "VoiceChannelSummariesRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "channelIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64",
              "maximum": 9223372036854775807,
              "minimum": 1
            },
            "maxItems": 100,
            "minItems": 1
          }
        },
        "required": [
          "channelIds"
        ]
      },
      "VoiceMemberLocationsRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64",
              "maximum": 9223372036854775807,
              "minimum": 1
            },
            "maxItems": 100,
            "minItems": 1
          }
        },
        "required": [
          "userIds"
        ]
      },
      "VoiceOwnParticipantResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "joinedAt": {
            "type": "string",
            "format": "date-time"
          },
          "muted": {
            "type": "boolean"
          },
          "deafened": {
            "type": "boolean"
          },
          "stageRole": {
            "$ref": "#/components/schemas/VoiceParticipantRole"
          },
          "handRaised": {
            "type": "boolean"
          },
          "cameraEnabled": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "participationId": {
            "type": "string",
            "format": "uuid"
          },
          "microphoneBlocked": {
            "type": "boolean",
            "default": false,
            "description": "Independent server microphone restriction; muted remains the participant personal or AFK intent."
          },
          "microphoneBlockedRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "default": 0,
            "description": "Durable community microphone policy revision, ordered separately from participant and roster revisions; 0 means legacy or direct-call policy."
          },
          "stage": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/VoiceStageResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "SPEAKER room state only; absent/null for VOICE and direct calls. No stage authority exists in VOICE."
          }
        },
        "required": [
          "userId",
          "joinedAt",
          "muted",
          "deafened",
          "stageRole",
          "handRaised",
          "cameraEnabled",
          "revision",
          "participationId"
        ]
      },
      "VoiceHostPreviewResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "userIdentifier": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true
          },
          "isBot": {
            "type": "boolean"
          }
        },
        "required": [
          "userId",
          "userIdentifier",
          "displayName"
        ]
      },
      "VoiceSessionSummaryResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "createdBy": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "maxParticipants": {
            "type": "integer",
            "format": "int32"
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "participantsCount": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "canAcceptMoreParticipants": {
            "type": "boolean"
          },
          "videoParticipantCount": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "host": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/VoiceHostPreviewResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "speakerModeEnabled": {
            "type": "boolean"
          },
          "currentParticipant": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/VoiceOwnParticipantResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "currentUserJoined": {
            "type": "boolean"
          },
          "currentDeviceJoined": {
            "type": "boolean"
          },
          "joinedOnAnotherDevice": {
            "type": "boolean"
          },
          "currentUserCanModerateStage": {
            "type": "boolean"
          },
          "currentUserCanBroadcastVideo": {
            "type": "boolean"
          },
          "summaryRevision": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "rosterRevision": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "roomKind": {
            "$ref": "#/components/schemas/VoiceRoomKind"
          }
        },
        "required": [
          "id",
          "createdBy",
          "maxParticipants",
          "active",
          "createdAt",
          "participantsCount",
          "canAcceptMoreParticipants",
          "videoParticipantCount",
          "speakerModeEnabled",
          "currentUserJoined",
          "currentDeviceJoined",
          "joinedOnAnotherDevice",
          "currentUserCanModerateStage",
          "currentUserCanBroadcastVideo",
          "summaryRevision",
          "rosterRevision"
        ]
      },
      "VoiceChannelSummaryResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "channelId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "session": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/VoiceSessionSummaryResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        },
        "required": [
          "channelId"
        ]
      },
      "VoiceChannelSummariesResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VoiceChannelSummaryResponse"
            },
            "maxItems": 100
          }
        },
        "required": [
          "items"
        ]
      },
      "VoiceHeartbeatAckResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "channelId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "active": {
            "type": "boolean"
          },
          "speakerModeEnabled": {
            "type": "boolean"
          },
          "currentParticipant": {
            "$ref": "#/components/schemas/VoiceOwnParticipantResponse"
          },
          "currentUserJoined": {
            "type": "boolean"
          },
          "currentDeviceJoined": {
            "type": "boolean"
          },
          "joinedOnAnotherDevice": {
            "type": "boolean"
          },
          "currentUserCanModerateStage": {
            "type": "boolean"
          },
          "currentUserCanBroadcastVideo": {
            "type": "boolean"
          },
          "summaryRevision": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "rosterRevision": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "roomKind": {
            "$ref": "#/components/schemas/VoiceRoomKind"
          }
        },
        "required": [
          "id",
          "channelId",
          "active",
          "speakerModeEnabled",
          "currentParticipant",
          "currentUserJoined",
          "currentDeviceJoined",
          "joinedOnAnotherDevice",
          "currentUserCanModerateStage",
          "currentUserCanBroadcastVideo",
          "summaryRevision",
          "rosterRevision"
        ]
      },
      "VoiceParticipantsPageResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sessionId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "rosterRevision": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VoiceSessionParticipantResponse"
            },
            "maxItems": 100
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "minLength": 1,
            "maxLength": 512,
            "description": "Opaque continuation token. Do not parse or construct it on the client."
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "sessionId",
          "rosterRevision",
          "items"
        ]
      },
      "VoiceMemberLocationResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "channelId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "sessionId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          }
        },
        "required": [
          "userId",
          "channelId",
          "sessionId"
        ]
      },
      "VoiceMemberLocationsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VoiceMemberLocationResponse"
            },
            "maxItems": 100
          }
        },
        "required": [
          "items"
        ]
      },
      "VoiceSessionParticipantResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "userIdentifier": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "joinedAt": {
            "type": "string",
            "format": "date-time"
          },
          "muted": {
            "type": "boolean"
          },
          "deafened": {
            "type": "boolean"
          },
          "stageRole": {
            "$ref": "#/components/schemas/VoiceParticipantRole"
          },
          "handRaised": {
            "type": "boolean"
          },
          "cameraEnabled": {
            "type": "boolean"
          },
          "participationId": {
            "type": "string",
            "format": "uuid"
          },
          "cameraPublished": {
            "type": "boolean",
            "nullable": true,
            "description": "Active camera publication in a paged roster; omitted or null means unknown."
          },
          "screenSharePublished": {
            "type": "boolean",
            "nullable": true,
            "description": "Active screen-share video publication in a paged roster; omitted or null means unknown."
          },
          "microphoneBlocked": {
            "type": "boolean",
            "default": false,
            "description": "Independent server microphone restriction; muted remains the participant personal or AFK intent."
          },
          "microphoneBlockedRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "default": 0,
            "description": "Durable community microphone policy revision, ordered separately from participant and roster revisions; 0 means legacy or direct-call policy."
          },
          "isBot": {
            "type": "boolean"
          },
          "stage": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/VoiceStageResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "SPEAKER room state only; absent/null for VOICE and direct calls. No stage authority exists in VOICE."
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "default": 0,
            "description": "Durable participant-state revision for this exact participation. Zero is a legacy response without a participant-state watermark; it must not overwrite a newer typed realtime participant delta."
          }
        },
        "required": [
          "userId",
          "userIdentifier",
          "displayName",
          "joinedAt",
          "muted",
          "deafened",
          "participationId"
        ]
      },
      "VoiceSessionResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "sessionType": {
            "$ref": "#/components/schemas/VoiceSessionType"
          },
          "directConversationId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "nullable": true,
            "minimum": 1
          },
          "channelId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "nullable": true,
            "minimum": 1
          },
          "createdBy": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "maxParticipants": {
            "type": "integer",
            "format": "int32"
          },
          "active": {
            "type": "boolean"
          },
          "participantsCount": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "canAcceptMoreParticipants": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "endedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VoiceSessionParticipantResponse"
            }
          },
          "directCallState": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DirectCallState"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "incoming": {
            "type": "boolean"
          },
          "currentUserJoined": {
            "type": "boolean"
          },
          "currentDeviceJoined": {
            "type": "boolean"
          },
          "joinedOnAnotherDevice": {
            "type": "boolean"
          },
          "ringingExpiresAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "hadVideo": {
            "type": "boolean"
          },
          "currentUserCanModerateStage": {
            "type": "boolean"
          },
          "currentUserCanBroadcastVideo": {
            "type": "boolean"
          },
          "speakerModeEnabled": {
            "type": "boolean"
          },
          "videoParticipantCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "minimum": 0
          },
          "summaryRevision": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 0
          },
          "rosterRevision": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 0
          },
          "roomKind": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/VoiceRoomKind"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        },
        "required": [
          "id",
          "sessionType",
          "createdBy",
          "maxParticipants",
          "active",
          "participantsCount",
          "canAcceptMoreParticipants",
          "createdAt",
          "participants"
        ]
      },
      "StreamSessionSummaryResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "status": {
            "$ref": "#/components/schemas/StreamSessionStatus"
          },
          "title": {
            "type": "string"
          },
          "communityId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "communityName": {
            "type": "string"
          },
          "communityAvatarUrl": {
            "type": "string",
            "nullable": true
          },
          "channelId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "channelName": {
            "type": "string"
          },
          "videoSource": {
            "$ref": "#/components/schemas/VideoSourceType"
          },
          "videoQuality": {
            "$ref": "#/components/schemas/VideoQualitySettings"
          },
          "hostUserId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "hostDisplayName": {
            "type": "string"
          },
          "hostAvatarUrl": {
            "type": "string",
            "nullable": true
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "endedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "participantsCount": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "viewersCount": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "speakersCount": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "currentUserJoined": {
            "type": "boolean"
          },
          "currentUserRole": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/StreamParticipantRole"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "canPublishAudio": {
            "type": "boolean"
          },
          "canPublishVideo": {
            "type": "boolean"
          },
          "canManage": {
            "type": "boolean"
          },
          "canModerateSpeakers": {
            "type": "boolean"
          },
          "summaryRevision": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "rosterRevision": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "ownershipProtocolVersion": {
            "type": "integer",
            "description": "Advertised ownership capability; when absent, ownership commands are unsupported.",
            "format": "int32"
          },
          "currentUserParticipationId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Current or last inactive membership UUID. Read before explicit join; null only when no membership has existed."
          },
          "currentUserOwnerDeviceId": {
            "type": "string",
            "nullable": true,
            "description": "Only the authenticated user's device owner; null for legacy membership."
          }
        },
        "required": [
          "id",
          "status",
          "title",
          "communityId",
          "communityName",
          "channelId",
          "channelName",
          "videoSource",
          "videoQuality",
          "hostUserId",
          "hostDisplayName",
          "startedAt",
          "participantsCount",
          "viewersCount",
          "speakersCount",
          "currentUserJoined",
          "canPublishAudio",
          "canPublishVideo",
          "canManage",
          "canModerateSpeakers",
          "summaryRevision",
          "rosterRevision"
        ]
      },
      "StreamSummaryPageResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StreamSessionSummaryResponse"
            },
            "maxItems": 100
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "minLength": 1,
            "maxLength": 512,
            "description": "Opaque continuation token. Do not parse or construct it on the client."
          }
        },
        "required": [
          "items",
          "hasMore"
        ]
      },
      "StreamParticipantPageResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sessionId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "status": {
            "$ref": "#/components/schemas/StreamSessionStatus"
          },
          "rosterRevision": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "participantsCount": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StreamParticipantResponse"
            },
            "maxItems": 100
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "minLength": 1,
            "maxLength": 512,
            "description": "Opaque continuation token. Do not parse or construct it on the client."
          }
        },
        "required": [
          "sessionId",
          "status",
          "rosterRevision",
          "participantsCount",
          "items",
          "hasMore"
        ]
      },
      "StreamParticipantResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "userIdentifier": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true
          },
          "role": {
            "$ref": "#/components/schemas/StreamParticipantRole"
          },
          "joinedAt": {
            "type": "string",
            "format": "date-time"
          },
          "canPublishAudio": {
            "type": "boolean"
          },
          "canPublishVideo": {
            "type": "boolean"
          },
          "participationId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "isBot": {
            "type": "boolean"
          }
        },
        "required": [
          "userId",
          "userIdentifier",
          "displayName",
          "role",
          "joinedAt",
          "canPublishAudio",
          "canPublishVideo"
        ]
      },
      "StreamSessionResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "status": {
            "$ref": "#/components/schemas/StreamSessionStatus"
          },
          "title": {
            "type": "string"
          },
          "communityId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "communityName": {
            "type": "string"
          },
          "communityAvatarUrl": {
            "type": "string",
            "nullable": true
          },
          "channelId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "channelName": {
            "type": "string"
          },
          "videoSource": {
            "$ref": "#/components/schemas/VideoSourceType"
          },
          "videoQuality": {
            "$ref": "#/components/schemas/VideoQualitySettings"
          },
          "hostUserId": {
            "type": "integer",
            "format": "int64",
            "maximum": 9223372036854775807,
            "minimum": 1
          },
          "hostDisplayName": {
            "type": "string"
          },
          "hostAvatarUrl": {
            "type": "string",
            "nullable": true
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "endedAt": {
            "type": "string",
            "nullable": true,
            "format": "date-time"
          },
          "participantsCount": {
            "type": "integer",
            "format": "int32",
            "minimum": 0
          },
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StreamParticipantResponse"
            }
          },
          "currentUserJoined": {
            "type": "boolean"
          },
          "currentUserRole": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/StreamParticipantRole"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "canPublishAudio": {
            "type": "boolean"
          },
          "canPublishVideo": {
            "type": "boolean"
          },
          "canManage": {
            "type": "boolean"
          },
          "canModerateSpeakers": {
            "type": "boolean"
          },
          "ownershipProtocolVersion": {
            "type": "integer",
            "description": "Advertised ownership capability; when absent, ownership commands are unsupported.",
            "format": "int32"
          },
          "currentUserParticipationId": {
            "type": "string",
            "format": "uuid",
            "nullable": true,
            "description": "Current or last inactive membership UUID. Read before explicit join; null only when no membership has existed."
          },
          "currentUserOwnerDeviceId": {
            "type": "string",
            "nullable": true,
            "description": "Only the authenticated user's device owner; null for legacy membership."
          },
          "summaryRevision": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 0
          },
          "rosterRevision": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 0
          }
        },
        "required": [
          "id",
          "status",
          "title",
          "communityId",
          "communityName",
          "channelId",
          "channelName",
          "videoSource",
          "videoQuality",
          "hostUserId",
          "hostDisplayName",
          "startedAt",
          "participantsCount",
          "participants",
          "currentUserJoined",
          "canPublishAudio",
          "canPublishVideo",
          "canManage",
          "canModerateSpeakers"
        ]
      },
      "VideoQualitySettings": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/MediaQualityMode"
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "height": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "frameRate": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "bitrateKbps": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        }
      },
      "VoiceSessionType": {
        "type": "string",
        "enum": [
          "DIRECT",
          "CHANNEL"
        ]
      },
      "VoiceParticipantRole": {
        "type": "string",
        "enum": [
          "HOST",
          "SPEAKER",
          "AUDIENCE"
        ]
      },
      "DirectCallState": {
        "type": "string",
        "enum": [
          "RINGING",
          "ACTIVE"
        ]
      },
      "StreamSessionStatus": {
        "type": "string",
        "enum": [
          "LIVE",
          "ENDED"
        ]
      },
      "StreamParticipantRole": {
        "type": "string",
        "enum": [
          "HOST",
          "SPEAKER",
          "VIEWER"
        ]
      },
      "VideoSourceType": {
        "type": "string",
        "enum": [
          "CAMERA",
          "SCREEN",
          "WINDOW",
          "BROWSER_TAB"
        ]
      },
      "MediaQualityMode": {
        "type": "string",
        "enum": [
          "AUTO",
          "CUSTOM"
        ]
      },
      "CreateChatUploadRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "fileName",
          "sizeBytes"
        ],
        "properties": {
          "fileName": {
            "type": "string"
          },
          "contentType": {
            "type": "string",
            "nullable": true
          },
          "sizeBytes": {
            "type": "integer",
            "format": "int64"
          },
          "inlineImage": {
            "type": "boolean",
            "default": false,
            "description": "Explicit image presentation intent, default false for legacy/file uploads. Only FILE raster attachments may set true; MIME alone never changes presentation."
          }
        }
      },
      "ChatUploadSessionResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "fileName",
          "contentType",
          "sizeBytes",
          "chunkSize",
          "totalChunks",
          "uploadedChunks",
          "uploadedBytes",
          "status",
          "expiresAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer",
            "format": "int64"
          },
          "chunkSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalChunks": {
            "type": "integer",
            "format": "int32"
          },
          "uploadedChunks": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "uploadedBytes": {
            "type": "integer",
            "format": "int64"
          },
          "status": {
            "type": "string",
            "enum": [
              "UPLOADING",
              "READY",
              "RESERVED",
              "CONSUMED",
              "CANCELLED"
            ]
          },
          "mediaUrl": {
            "type": "string",
            "nullable": true
          },
          "thumbnailUrl": {
            "type": "string",
            "nullable": true
          },
          "expiresAt": {
            "type": "string"
          },
          "inlineImage": {
            "type": "boolean",
            "default": false,
            "description": "Explicit image presentation intent, default false for legacy/file uploads. Only FILE raster attachments may set true; MIME alone never changes presentation."
          },
          "previewWidth": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "minimum": 1,
            "maximum": 640,
            "description": "Width of the real decoded preview in pixels, paired with previewHeight; absent for legacy or generic placeholder previews."
          },
          "previewHeight": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "minimum": 1,
            "maximum": 420,
            "description": "Height of the real decoded preview in pixels, paired with previewWidth; absent for legacy or generic placeholder previews."
          }
        }
      },
      "ChatAttachmentResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "fileName",
          "contentType",
          "sizeBytes",
          "mediaUrl"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "fileName": {
            "type": "string"
          },
          "contentType": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer",
            "format": "int64"
          },
          "mediaUrl": {
            "type": "string"
          },
          "thumbnailUrl": {
            "type": "string",
            "nullable": true
          },
          "kind": {
            "type": "string",
            "enum": [
              "FILE",
              "VOICE",
              "VIDEO"
            ],
            "default": "FILE"
          },
          "durationMs": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "downloadUrl": {
            "type": "string"
          },
          "inlineImage": {
            "type": "boolean",
            "default": false,
            "description": "Explicit image presentation intent, default false for legacy/file uploads. Only FILE raster attachments may set true; MIME alone never changes presentation."
          },
          "previewWidth": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "minimum": 1,
            "maximum": 640,
            "description": "Width of the real decoded preview in pixels, paired with previewHeight; absent for legacy or generic placeholder previews."
          },
          "previewHeight": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "minimum": 1,
            "maximum": 420,
            "description": "Height of the real decoded preview in pixels, paired with previewWidth; absent for legacy or generic placeholder previews."
          },
          "sourceUploadId": {
            "type": "string",
            "nullable": true,
            "x-kotlin-default": "null"
          }
        }
      },
      "VoiceSessionCommandRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ownershipProtocolVersion": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "Required value 1 for commands; omission is rejected with 426."
          },
          "expectedSessionId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 1,
            "maximum": 9223372036854775807
          },
          "participationId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "livenessProtocolVersion": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "Direct start/join opt in only with value 1. Direct heartbeat requires 1. Omission or 0 preserves legacy participation policy."
          }
        }
      },
      "StartChannelVoiceSessionRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "maxParticipants": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "ownershipProtocolVersion": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "Required value 1 for commands; omission is rejected with 426."
          },
          "expectedSessionId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 1,
            "maximum": 9223372036854775807
          },
          "participationId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        }
      },
      "UpdateDirectVoiceParticipantStateRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "microphoneEnabled": {
            "type": "boolean"
          },
          "afk": {
            "type": "boolean"
          },
          "cameraEnabled": {
            "type": "boolean",
            "nullable": true
          },
          "expectedSessionId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 1,
            "maximum": 9223372036854775807
          },
          "participationId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        },
        "required": [
          "microphoneEnabled",
          "afk"
        ]
      },
      "UpdateVoiceHandRaisedRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "raised": {
            "type": "boolean"
          },
          "expectedSessionId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 1,
            "maximum": 9223372036854775807
          },
          "participationId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        },
        "required": [
          "raised"
        ]
      },
      "UpdateVoiceStageRoleRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "role": {
            "$ref": "#/components/schemas/VoiceParticipantRole"
          },
          "expectedSessionId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 1,
            "maximum": 9223372036854775807
          },
          "participationId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "targetParticipationId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        },
        "required": [
          "role"
        ]
      },
      "VoiceDirectHeartbeatAckResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 9223372036854775807
          },
          "active": {
            "type": "boolean"
          },
          "currentParticipant": {
            "$ref": "#/components/schemas/VoiceOwnParticipantResponse"
          }
        },
        "required": [
          "id",
          "active",
          "currentParticipant"
        ]
      },
      "VoiceIceServerResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "urls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "username": {
            "type": "string",
            "nullable": true
          },
          "credential": {
            "type": "string",
            "nullable": true,
            "format": "password",
            "x-sensitive": true
          }
        },
        "required": [
          "urls"
        ]
      },
      "VoiceIceConfigurationResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "iceServers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VoiceIceServerResponse"
            }
          },
          "expiresAt": {
            "type": "string",
            "nullable": true
          },
          "ownershipProtocolVersion": {
            "type": "integer",
            "format": "int32",
            "description": "Advertised ownership capability; when absent, ownership commands are unsupported."
          },
          "livenessProtocolVersion": {
            "type": "integer",
            "format": "int32",
            "description": "Advertised liveness capability; when absent, direct heartbeat is unsupported."
          },
          "directHeartbeatIntervalMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 5000,
            "maximum": 60000
          },
          "directReconnectGraceMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 60000,
            "maximum": 900000
          },
          "streamOwnershipProtocolVersion": {
            "type": "integer",
            "format": "int32",
            "description": "Must be checked before first stream Start. Missing capability means stream ownership commands are unsupported."
          },
          "diagnosticsDetailedEnabled": {
            "type": "boolean",
            "default": false,
            "description": "Manual server policy for detailed media diagnostics; absent means disabled. No automatic expiry. Disabled servers discard detailed observations immediately."
          },
          "streamStartOperationProtocolVersion": {
            "type": "integer",
            "format": "int32",
            "description": "Exact durable Start receipt and cancel protocol. Missing capability means this protocol is unsupported; never fall back after dispatch."
          }
        },
        "required": [
          "iceServers"
        ]
      },
      "ForwardMessageRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sourceScopeType",
          "sourceScopeId",
          "sourceMessageId",
          "targetScopeType",
          "targetScopeId",
          "clientMessageId"
        ],
        "properties": {
          "sourceScopeType": {
            "type": "string",
            "enum": [
              "DIRECT",
              "CHANNEL"
            ]
          },
          "sourceScopeId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "sourceMessageId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "targetScopeType": {
            "type": "string",
            "enum": [
              "DIRECT",
              "CHANNEL"
            ]
          },
          "targetScopeId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "clientMessageId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,63}$",
            "minLength": 8,
            "maxLength": 64
          },
          "decryptedContent": {
            "type": "string",
            "nullable": true,
            "maxLength": 2000,
            "description": "Explicit client-decrypted content only when forwarding an encrypted direct message into a channel."
          },
          "attachmentUploadIds": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string"
            },
            "description": "New owned plaintext uploads for explicit encrypted-direct-to-channel forwarding."
          }
        },
        "description": "Forward one visible root message into a writable direct conversation or TEXT channel. IDs name conversation/channel scopes; the stable clientMessageId binds retries to the exact source tuple and target. System messages and event/poll/news cards are rejected."
      },
      "ForwardedMessageAttribution": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "authorId",
          "authorDisplayName",
          "authorPublicIdentifier"
        ],
        "properties": {
          "authorId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "authorDisplayName": {
            "type": "string"
          },
          "authorPublicIdentifier": {
            "type": "string"
          },
          "communityId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "nullable": true
          },
          "communityName": {
            "type": "string",
            "nullable": true
          },
          "communityPublicIdentifier": {
            "type": "string",
            "nullable": true
          },
          "authorIsBot": {
            "type": "boolean"
          }
        },
        "description": "Immutable public identity snapshot from the original author and source community. Reforwarding preserves it. Private aliases, conversation ids and source message ids are never exposed."
      },
      "ForwardedDirectMessage": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "conversationId",
          "authorId",
          "content",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "conversationId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "authorId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "content": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "forwardedFrom": {
            "$ref": "#/components/schemas/ForwardedMessageAttribution"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatAttachmentResponse"
            }
          },
          "encryptedEnvelope": {
            "type": "string",
            "nullable": true,
            "maxLength": 262144,
            "x-sensitive": true
          },
          "encryptionRevision": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "minimum": 0
          }
        },
        "description": "Existing full timeline message DTO with additive forwardedFrom. The sender remains authorId. Media metadata and generated attachment download IDs belong to the new destination; no blob reupload occurs."
      },
      "ForwardedChannelMessage": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "channelId",
          "authorId",
          "content",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "channelId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "authorId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "content": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "forwardedFrom": {
            "$ref": "#/components/schemas/ForwardedMessageAttribution"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatAttachmentResponse"
            }
          }
        },
        "description": "Existing full timeline message DTO with additive forwardedFrom. The sender remains authorId. Media metadata and generated attachment download IDs belong to the new destination; no blob reupload occurs."
      },
      "ForwardMessageResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scopeType",
          "scopeId"
        ],
        "properties": {
          "scopeType": {
            "type": "string",
            "enum": [
              "DIRECT",
              "CHANNEL"
            ]
          },
          "scopeId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "directMessage": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ForwardedDirectMessage"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "channelMessage": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ForwardedChannelMessage"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        },
        "description": "Exactly the matching directMessage or channelMessage is present. Identical retries return the same persisted copy; conflicting reuse returns 409. Forwarded messages cannot be edited while carrying original attribution."
      },
      "DirectChatContentPage": {
        "type": "object",
        "required": [
          "items",
          "hasMore"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForwardedDirectMessage"
            }
          },
          "nextBeforeId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 1
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "description": "Bounded ascending-ID page of matching full timeline messages. Use nextBeforeId to load older matches when hasMore; omitted/null cursor means exhaustion."
      },
      "ChannelChatContentPage": {
        "type": "object",
        "required": [
          "items",
          "hasMore"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ForwardedChannelMessage"
            }
          },
          "nextBeforeId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 1
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "description": "Bounded ascending-ID page of matching full timeline messages. Use nextBeforeId to load older matches when hasMore; omitted/null cursor means exhaustion."
      },
      "PasswordResetRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 255
          }
        }
      },
      "AccountCodeRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "challengeId",
          "code"
        ],
        "properties": {
          "challengeId": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true,
            "x-sensitive": true
          }
        }
      },
      "PasswordResetCompleteRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "resetTicket",
          "newPassword"
        ],
        "properties": {
          "resetTicket": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "x-sensitive": true,
            "writeOnly": true
          },
          "newPassword": {
            "type": "string",
            "format": "password",
            "minLength": 12,
            "maxLength": 72,
            "description": "New passwords require at least 12 characters, at most 72 UTF-8 bytes, and must not be an obvious common password. Existing passwords still work at login.",
            "writeOnly": true,
            "x-sensitive": true
          }
        }
      },
      "EmailChangeRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "email",
          "currentPassword"
        ],
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "maxLength": 255
          },
          "currentPassword": {
            "type": "string",
            "format": "password",
            "minLength": 8,
            "maxLength": 72,
            "description": "Must contain 8 or more characters and encode to at most 72 UTF-8 bytes.",
            "writeOnly": true,
            "x-sensitive": true
          }
        }
      },
      "EmailChangeConfirmRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "challengeId",
          "code"
        ],
        "properties": {
          "challengeId": {
            "type": "string",
            "format": "uuid"
          },
          "code": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true,
            "x-sensitive": true
          },
          "currentEmailCode": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true,
            "x-sensitive": true,
            "nullable": true
          }
        }
      },
      "AccountChallengeResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "challengeId",
          "expiresAtEpochMillis",
          "resendAfterEpochMillis"
        ],
        "properties": {
          "challengeId": {
            "type": "string",
            "format": "uuid"
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "resendAfterEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "EmailChangeChallengeResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "challengeId",
          "expiresAtEpochMillis",
          "resendAfterEpochMillis",
          "currentEmailConfirmationRequired"
        ],
        "properties": {
          "challengeId": {
            "type": "string",
            "format": "uuid"
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "resendAfterEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "currentEmailConfirmationRequired": {
            "type": "boolean"
          }
        }
      },
      "PasswordResetTicketResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "resetTicket",
          "expiresAtEpochMillis"
        ],
        "properties": {
          "resetTicket": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$",
            "x-sensitive": true
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "AccessTokenRefreshRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "refreshToken": {
            "type": "string",
            "nullable": true
          },
          "clientName": {
            "type": "string",
            "nullable": true,
            "description": "Self-declared session display name, normalized and limited to 120 characters. Never used for authentication."
          },
          "clientPlatform": {
            "type": "string",
            "nullable": true,
            "description": "Self-declared client type WEB, ANDROID or DESKTOP. Missing or unrecognized values remain unknown; never an authorization claim."
          }
        }
      },
      "AccountSessionResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "deviceId",
          "createdAtEpochMillis",
          "lastSeenAtEpochMillis",
          "expiresAtEpochMillis",
          "current"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "createdAtEpochMillis": {
            "type": "integer",
            "format": "int64"
          },
          "lastSeenAtEpochMillis": {
            "type": "integer",
            "format": "int64"
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64"
          },
          "current": {
            "type": "boolean"
          },
          "clientName": {
            "type": "string",
            "nullable": true,
            "description": "Self-declared session display name, normalized and limited to 120 characters. Never used for authentication."
          },
          "clientPlatform": {
            "type": "string",
            "nullable": true,
            "description": "Self-declared client type WEB, ANDROID or DESKTOP. Missing or unrecognized values remain unknown; never an authorization claim."
          }
        }
      },
      "AccountSessionsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sessions"
        ],
        "properties": {
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccountSessionResponse"
            }
          }
        }
      },
      "MediaContextType": {
        "type": "string",
        "enum": [
          "STREAM",
          "VOICE_CHANNEL"
        ]
      },
      "MediaTransportProvider": {
        "type": "string",
        "enum": [
          "LIVEKIT"
        ]
      },
      "MediaPublicationKind": {
        "type": "string",
        "enum": [
          "AUDIO",
          "VIDEO"
        ]
      },
      "MediaPublicationSource": {
        "type": "string",
        "enum": [
          "MICROPHONE",
          "CAMERA",
          "SCREEN_SHARE",
          "SCREEN_SHARE_AUDIO"
        ]
      },
      "MediaPublicationStatus": {
        "type": "string",
        "enum": [
          "PREPARING",
          "ACTIVE",
          "MUTED",
          "ENDED",
          "FAILED"
        ]
      },
      "ChatScopeType": {
        "type": "string",
        "enum": [
          "DIRECT",
          "CHANNEL"
        ]
      },
      "ScheduledChatMessageStatus": {
        "type": "string",
        "enum": [
          "PENDING",
          "PROCESSING",
          "SENT",
          "FAILED",
          "CANCELLED"
        ]
      },
      "E2eeIdentityProof": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "rootSigningKey",
          "recoveryEncryptionKey"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "rootSigningKey": {
            "type": "string"
          },
          "recoveryEncryptionKey": {
            "type": "string"
          }
        }
      },
      "E2eeDeviceCertificate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "deviceId",
          "signingKey",
          "encryptionKey",
          "createdAtEpochMillis"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "deviceId": {
            "type": "string"
          },
          "signingKey": {
            "type": "string"
          },
          "encryptionKey": {
            "type": "string"
          },
          "createdAtEpochMillis": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "E2eeDeviceResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "deviceId",
          "certificate"
        ],
        "properties": {
          "deviceId": {
            "type": "string"
          },
          "certificate": {
            "type": "string"
          }
        }
      },
      "E2eeIdentityResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "rootSigningKey",
          "recoveryEncryptionKey",
          "identityProof",
          "devices"
        ],
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "rootSigningKey": {
            "type": "string"
          },
          "recoveryEncryptionKey": {
            "type": "string"
          },
          "identityProof": {
            "type": "string"
          },
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/E2eeDeviceResponse"
            }
          },
          "previousDeviceCertificates": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "RegisterE2eeIdentityRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "identityProof",
          "rootSigningKey",
          "recoveryEncryptionKey",
          "recoveryBackup",
          "deviceCertificate"
        ],
        "properties": {
          "identityProof": {
            "type": "string"
          },
          "rootSigningKey": {
            "type": "string"
          },
          "recoveryEncryptionKey": {
            "type": "string"
          },
          "recoveryBackup": {
            "type": "string",
            "maxLength": 65536,
            "x-sensitive": true
          },
          "deviceCertificate": {
            "type": "string"
          },
          "expectedPredecessorCertificateSha256": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{64}$",
            "description": "SHA-256 of the exact current certificate. Null or omitted permits creation only, or an exact retry of the current live certificate."
          }
        }
      },
      "RegisterE2eeDeviceRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "certificate"
        ],
        "properties": {
          "certificate": {
            "type": "string"
          },
          "expectedPredecessorCertificateSha256": {
            "type": "string",
            "nullable": true,
            "pattern": "^[0-9a-f]{64}$",
            "description": "SHA-256 of the exact current certificate. Null or omitted permits creation only, or an exact retry of the current live certificate."
          }
        }
      },
      "E2eeBackupResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "identity": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/E2eeIdentityResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "recoveryBackup": {
            "type": "string",
            "nullable": true,
            "maxLength": 65536,
            "x-sensitive": true
          }
        }
      },
      "E2eeAudienceResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "identities"
        ],
        "properties": {
          "identities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/E2eeIdentityResponse"
            }
          }
        }
      },
      "E2eeEnvelopeClaims": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "purpose",
          "scopeId",
          "senderId",
          "senderDeviceId",
          "clientMessageId",
          "ciphertext"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "scopeId": {
            "type": "integer",
            "format": "int64"
          },
          "senderId": {
            "type": "integer",
            "format": "int64"
          },
          "senderDeviceId": {
            "type": "string"
          },
          "clientMessageId": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "format": "int32"
          },
          "messageId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "rootMessageId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "ciphertext": {
            "type": "string",
            "maxLength": 262144,
            "x-sensitive": true
          },
          "attachmentUploadIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "E2eeRoomStateRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "contextType",
          "sessionId",
          "leaseId",
          "generation"
        ],
        "properties": {
          "contextType": {
            "$ref": "#/components/schemas/MediaContextType"
          },
          "sessionId": {
            "type": "integer",
            "format": "int64"
          },
          "leaseId": {
            "type": "integer",
            "format": "int64"
          },
          "generation": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "E2eeRoomMember": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "deviceId",
          "leaseId",
          "generation",
          "participationId",
          "identity"
        ],
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "deviceId": {
            "type": "string"
          },
          "leaseId": {
            "type": "integer",
            "format": "int64"
          },
          "generation": {
            "type": "integer",
            "format": "int32"
          },
          "participationId": {
            "type": "string"
          },
          "identity": {
            "$ref": "#/components/schemas/E2eeIdentityResponse"
          }
        }
      },
      "E2eeRoomStateResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "contextType",
          "sessionId",
          "epoch",
          "leaderUserId",
          "leaderDeviceId",
          "members"
        ],
        "properties": {
          "protocolVersion": {
            "type": "integer",
            "format": "int32"
          },
          "contextType": {
            "$ref": "#/components/schemas/MediaContextType"
          },
          "sessionId": {
            "type": "integer",
            "format": "int64"
          },
          "epoch": {
            "type": "string"
          },
          "leaderUserId": {
            "type": "integer",
            "format": "int64"
          },
          "leaderDeviceId": {
            "type": "string"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/E2eeRoomMember"
            }
          },
          "envelope": {
            "type": "string",
            "nullable": true,
            "maxLength": 262144,
            "x-sensitive": true
          }
        }
      },
      "PublishE2eeRoomKeyRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "contextType",
          "sessionId",
          "leaseId",
          "generation",
          "epoch",
          "envelope"
        ],
        "properties": {
          "contextType": {
            "$ref": "#/components/schemas/MediaContextType"
          },
          "sessionId": {
            "type": "integer",
            "format": "int64"
          },
          "leaseId": {
            "type": "integer",
            "format": "int64"
          },
          "generation": {
            "type": "integer",
            "format": "int32"
          },
          "epoch": {
            "type": "string"
          },
          "envelope": {
            "type": "string",
            "maxLength": 262144,
            "x-sensitive": true
          }
        }
      },
      "E2eeRoomKeyClaims": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "contextType",
          "sessionId",
          "epoch",
          "leaderUserId",
          "leaderDeviceId",
          "ciphertext"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "contextType": {
            "$ref": "#/components/schemas/MediaContextType"
          },
          "sessionId": {
            "type": "integer",
            "format": "int64"
          },
          "epoch": {
            "type": "string"
          },
          "leaderUserId": {
            "type": "integer",
            "format": "int64"
          },
          "leaderDeviceId": {
            "type": "string"
          },
          "ciphertext": {
            "type": "string",
            "maxLength": 262144,
            "x-sensitive": true
          }
        }
      },
      "AcquireMediaLeaseRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "contextType",
          "sessionId"
        ],
        "properties": {
          "contextType": {
            "$ref": "#/components/schemas/MediaContextType"
          },
          "sessionId": {
            "type": "integer",
            "format": "int64"
          },
          "streamParticipationId": {
            "type": "string",
            "nullable": true
          },
          "encryptionProtocolVersion": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "description": "Explicitly request 0 for VOICE, SPEAKER and STREAM channel audio/video without application E2EE. TLS/WebRTC protection and current access policy remain required. Missing/legacy values fail with MEDIA_TRANSPORT_ONLY_REQUIRED (426) before allocating credentials. An active legacy room must drain before mode 0 admission; do not negotiate a weaker mode as error recovery."
          }
        }
      },
      "MediaLeaseGenerationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "generation"
        ],
        "properties": {
          "generation": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "UpdateMediaPublicationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "generation",
          "kind",
          "source",
          "status"
        ],
        "properties": {
          "generation": {
            "type": "integer",
            "format": "int32"
          },
          "kind": {
            "$ref": "#/components/schemas/MediaPublicationKind"
          },
          "source": {
            "$ref": "#/components/schemas/MediaPublicationSource"
          },
          "status": {
            "$ref": "#/components/schemas/MediaPublicationStatus"
          },
          "codec": {
            "type": "string",
            "nullable": true
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "height": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "frameRate": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "bitrateKbps": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "spatialLayers": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        }
      },
      "MediaTransportCapabilitiesResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "canPublishAudio",
          "canPublishVideo",
          "canSubscribe",
          "allowedSources"
        ],
        "properties": {
          "canPublishAudio": {
            "type": "boolean"
          },
          "canPublishVideo": {
            "type": "boolean"
          },
          "canSubscribe": {
            "type": "boolean"
          },
          "allowedSources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaPublicationSource"
            }
          }
        }
      },
      "MediaTransportCredentialsResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "provider",
          "serverUrl",
          "roomName",
          "participantIdentity",
          "accessToken",
          "expiresAt"
        ],
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/MediaTransportProvider"
          },
          "serverUrl": {
            "type": "string"
          },
          "roomName": {
            "type": "string"
          },
          "participantIdentity": {
            "type": "string"
          },
          "accessToken": {
            "type": "string",
            "x-sensitive": true
          },
          "expiresAt": {
            "type": "string"
          }
        }
      },
      "MediaLeaseResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "generation",
          "contextType",
          "sessionId",
          "leaseExpiresAt",
          "capabilities",
          "credentials"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "generation": {
            "type": "integer",
            "format": "int32"
          },
          "contextType": {
            "$ref": "#/components/schemas/MediaContextType"
          },
          "sessionId": {
            "type": "integer",
            "format": "int64"
          },
          "leaseExpiresAt": {
            "type": "string"
          },
          "capabilities": {
            "$ref": "#/components/schemas/MediaTransportCapabilitiesResponse"
          },
          "credentials": {
            "$ref": "#/components/schemas/MediaTransportCredentialsResponse"
          },
          "microphoneAdmission": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/VoiceMicrophoneAdmissionResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "mediaEncryptionVersion": {
            "type": "integer",
            "format": "int32",
            "enum": [
              0,
              1,
              2
            ],
            "default": 1,
            "description": "Protocol persisted on this exact lease. Explicit 0 uses TLS/WebRTC without application media E2EE. Values 1/2 identify legacy leases and require an update; omission means 1 and must never enable mode 0."
          }
        }
      },
      "MediaLeaseHeartbeatResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "generation",
          "leaseExpiresAt"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "generation": {
            "type": "integer",
            "format": "int32"
          },
          "leaseExpiresAt": {
            "type": "string"
          },
          "credentials": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MediaTransportCredentialsResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Fresh credentials for the same authorized lease and generation; clients retain them for transport recovery."
          },
          "microphoneAdmission": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/VoiceMicrophoneAdmissionResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "mediaEncryptionVersion": {
            "type": "integer",
            "format": "int32",
            "enum": [
              0,
              1,
              2
            ],
            "default": 1,
            "description": "Protocol persisted on this exact lease. Explicit 0 uses TLS/WebRTC without application media E2EE. Values 1/2 identify legacy leases and require an update; omission means 1 and must never enable mode 0."
          }
        }
      },
      "MediaPublicationResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "leaseId",
          "generation",
          "kind",
          "source",
          "status",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "leaseId": {
            "type": "integer",
            "format": "int64"
          },
          "generation": {
            "type": "integer",
            "format": "int32"
          },
          "kind": {
            "$ref": "#/components/schemas/MediaPublicationKind"
          },
          "source": {
            "$ref": "#/components/schemas/MediaPublicationSource"
          },
          "status": {
            "$ref": "#/components/schemas/MediaPublicationStatus"
          },
          "codec": {
            "type": "string",
            "nullable": true
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "height": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "frameRate": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "bitrateKbps": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "spatialLayers": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "updatedAt": {
            "type": "string"
          }
        }
      },
      "SendPreparedAttachmentsRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "uploadIds"
        ],
        "properties": {
          "uploadIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "caption": {
            "type": "string",
            "nullable": true
          },
          "clientMessageId": {
            "type": "string",
            "nullable": true
          },
          "voiceDurationMs": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "videoDurationMs": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "encryptedEnvelope": {
            "type": "string",
            "nullable": true,
            "maxLength": 262144,
            "x-sensitive": true,
            "deprecated": true,
            "description": "Legacy encrypted-content field; managed writes omit it."
          },
          "managedBody": {
            "type": "object",
            "additionalProperties": true,
            "description": "Server-readable structured content, validated by the owning message operation. Managed writers omit legacy encryptedEnvelope; transport encryption and server ACL still apply.",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "replyToMessageId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "x-kotlin-default": "null"
          }
        }
      },
      "SaveChatDraftRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "string",
            "maxLength": 65536,
            "description": "Encrypted direct drafts use e2ee:v1: followed by a signed own-account draft envelope; legacy and channel plaintext stays bounded to 4000 characters."
          }
        }
      },
      "ChatDraftResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scopeType",
          "scopeId",
          "content",
          "updatedAt"
        ],
        "properties": {
          "scopeType": {
            "$ref": "#/components/schemas/ChatScopeType"
          },
          "scopeId": {
            "type": "integer",
            "format": "int64"
          },
          "content": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string"
          },
          "communityId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          }
        }
      },
      "ScheduleChatMessageRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scopeType",
          "scopeId",
          "content",
          "scheduledAt"
        ],
        "properties": {
          "scopeType": {
            "$ref": "#/components/schemas/ChatScopeType"
          },
          "scopeId": {
            "type": "integer",
            "format": "int64"
          },
          "content": {
            "type": "string",
            "description": "Empty string for encrypted direct schedules. User-visible text and attachment descriptors exist only in encryptedEnvelope."
          },
          "scheduledAt": {
            "type": "string"
          },
          "silent": {
            "type": "boolean"
          },
          "attachmentUploadIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "encryptedEnvelope": {
            "type": "string",
            "nullable": true,
            "maxLength": 262144,
            "x-sensitive": true,
            "deprecated": true,
            "description": "Legacy encrypted-content field; managed writes omit it."
          },
          "clientMessageId": {
            "type": "string",
            "nullable": true
          },
          "managedBody": {
            "type": "object",
            "additionalProperties": true,
            "description": "Server-readable structured content, validated by the owning message operation. Managed writers omit legacy encryptedEnvelope; transport encryption and server ACL still apply.",
            "nullable": true,
            "x-kotlin-default": "null"
          }
        }
      },
      "UpdateScheduledChatMessageRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "content": {
            "type": "string",
            "nullable": true
          },
          "scheduledAt": {
            "type": "string",
            "nullable": true
          },
          "silent": {
            "type": "boolean",
            "nullable": true
          },
          "encryptedEnvelope": {
            "type": "string",
            "nullable": true,
            "maxLength": 262144,
            "x-sensitive": true,
            "deprecated": true,
            "description": "Legacy encrypted-content field; managed writes omit it."
          },
          "clientMessageId": {
            "type": "string",
            "nullable": true
          },
          "managedBody": {
            "type": "object",
            "additionalProperties": true,
            "description": "Server-readable structured content, validated by the owning message operation. Managed writers omit legacy encryptedEnvelope; transport encryption and server ACL still apply.",
            "nullable": true,
            "x-kotlin-default": "null"
          }
        }
      },
      "ScheduledChatMessageResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "scopeType",
          "scopeId",
          "content",
          "scheduledAt",
          "silent",
          "status",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "scopeType": {
            "$ref": "#/components/schemas/ChatScopeType"
          },
          "scopeId": {
            "type": "integer",
            "format": "int64"
          },
          "content": {
            "type": "string",
            "description": "For MLS schedules, device-signed e2ee:draft:v2 ciphertext for the owner preview; never user-visible plaintext. Legacy schedules may have empty content."
          },
          "scheduledAt": {
            "type": "string"
          },
          "silent": {
            "type": "boolean"
          },
          "status": {
            "$ref": "#/components/schemas/ScheduledChatMessageStatus"
          },
          "sentMessageId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "lastError": {
            "type": "string",
            "nullable": true
          },
          "createdAt": {
            "type": "string"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatUploadSessionResponse"
            }
          },
          "encryptedEnvelope": {
            "type": "string",
            "nullable": true,
            "maxLength": 262144,
            "x-sensitive": true,
            "deprecated": true,
            "description": "Legacy encrypted-content field; managed writes omit it."
          },
          "clientMessageId": {
            "type": "string",
            "nullable": true
          },
          "managedBody": {
            "type": "object",
            "additionalProperties": true,
            "description": "Server-readable structured content, validated by the owning message operation. Managed writers omit legacy encryptedEnvelope; transport encryption and server ACL still apply.",
            "nullable": true,
            "x-kotlin-default": "null"
          }
        }
      },
      "ScheduledChatMessageListPageResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ScheduledChatMessageResponse"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true
          },
          "hasMore": {
            "type": "boolean"
          },
          "previousCursor": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "SendDirectMessageRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "string"
          },
          "clientMessageId": {
            "type": "string",
            "nullable": true
          },
          "replyToMessageId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "encryptedEnvelope": {
            "type": "string",
            "nullable": true,
            "maxLength": 262144,
            "x-sensitive": true,
            "deprecated": true,
            "description": "Legacy encrypted-content field; managed writes omit it."
          },
          "managedBody": {
            "type": "object",
            "additionalProperties": true,
            "description": "Server-readable structured content, validated by the owning message operation. Managed writers omit legacy encryptedEnvelope; transport encryption and server ACL still apply.",
            "nullable": true,
            "x-kotlin-default": "null"
          }
        }
      },
      "UpdateDirectMessageRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "string"
          },
          "encryptedEnvelope": {
            "type": "string",
            "nullable": true,
            "maxLength": 262144,
            "x-sensitive": true,
            "deprecated": true,
            "description": "Legacy encrypted-content field; managed writes omit it."
          },
          "managedBody": {
            "type": "object",
            "additionalProperties": true,
            "description": "Server-readable structured content, validated by the owning message operation. Managed writers omit legacy encryptedEnvelope; transport encryption and server ACL still apply.",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "expectedContentRevision": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "x-kotlin-default": "null"
          }
        }
      },
      "SendMessageThreadReplyRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "string"
          },
          "clientMessageId": {
            "type": "string",
            "nullable": true
          },
          "encryptedEnvelope": {
            "type": "string",
            "nullable": true,
            "maxLength": 262144,
            "x-sensitive": true,
            "deprecated": true,
            "description": "Legacy encrypted-content field; managed writes omit it."
          },
          "managedBody": {
            "type": "object",
            "additionalProperties": true,
            "description": "Server-readable structured content, validated by the owning message operation. Managed writers omit legacy encryptedEnvelope; transport encryption and server ACL still apply.",
            "nullable": true,
            "x-kotlin-default": "null"
          }
        }
      },
      "UpdateMessageThreadReplyRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "string"
          },
          "clientMessageId": {
            "type": "string",
            "nullable": true
          },
          "encryptedEnvelope": {
            "type": "string",
            "nullable": true,
            "maxLength": 262144,
            "x-sensitive": true,
            "deprecated": true,
            "description": "Legacy encrypted-content field; managed writes omit it."
          },
          "managedBody": {
            "type": "object",
            "additionalProperties": true,
            "description": "Server-readable structured content, validated by the owning message operation. Managed writers omit legacy encryptedEnvelope; transport encryption and server ACL still apply.",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "expectedContentRevision": {
            "type": "integer",
            "format": "int32",
            "nullable": true,
            "x-kotlin-default": "null"
          }
        }
      },
      "MessageThreadReplyResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "rootMessageId",
          "authorId",
          "content",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "rootMessageId": {
            "type": "integer",
            "format": "int64"
          },
          "authorId": {
            "type": "integer",
            "format": "int64"
          },
          "authorIdentifier": {
            "type": "string",
            "nullable": true
          },
          "authorDisplayName": {
            "type": "string",
            "nullable": true
          },
          "authorAvatarUrl": {
            "type": "string",
            "nullable": true
          },
          "content": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "editedAt": {
            "type": "string",
            "nullable": true
          },
          "encryptedEnvelope": {
            "type": "string",
            "nullable": true,
            "maxLength": 262144,
            "x-sensitive": true,
            "deprecated": true,
            "description": "Legacy encrypted-content field; managed writes omit it."
          },
          "encryptionRevision": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "authorIsBot": {
            "type": "boolean"
          },
          "managedBody": {
            "type": "object",
            "additionalProperties": true,
            "description": "Server-readable structured content, validated by the owning message operation. Managed writers omit legacy encryptedEnvelope; transport encryption and server ACL still apply.",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "contentRevision": {
            "type": "integer",
            "format": "int32",
            "default": 0,
            "x-kotlin-default": "0"
          }
        }
      },
      "MessageThreadPageResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "hasMore",
          "totalCount"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageThreadReplyResponse"
            }
          },
          "nextBeforeId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "hasMore": {
            "type": "boolean"
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "threadRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        }
      },
      "VoiceDiagnosticRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "sessionType": {
            "$ref": "#/components/schemas/VoiceSessionType"
          },
          "sessionId": {
            "type": "integer",
            "format": "int64"
          },
          "event": {
            "type": "string",
            "enum": [
              "CONNECTED",
              "DISCONNECTED",
              "FAILED",
              "STATS"
            ]
          },
          "mediaKind": {
            "type": "string",
            "nullable": true
          },
          "direction": {
            "type": "string",
            "nullable": true
          },
          "localCandidateType": {
            "type": "string",
            "nullable": true
          },
          "remoteCandidateType": {
            "type": "string",
            "nullable": true
          },
          "protocol": {
            "type": "string",
            "nullable": true
          },
          "relayProtocol": {
            "type": "string",
            "nullable": true
          },
          "roundTripTimeMs": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "jitterMs": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "packetsLost": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "packetsReceived": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "packetLossPercent": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "availableOutgoingBitrateKbps": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "qualityLevel": {
            "type": "string",
            "enum": [
              "EXCELLENT",
              "GOOD",
              "POOR",
              "SEVERE",
              null
            ],
            "nullable": true
          },
          "adaptationReason": {
            "type": "string",
            "enum": [
              "NONE",
              "NETWORK",
              "PACKET_LOSS",
              "JITTER",
              "LATENCY",
              "BANDWIDTH",
              "CONNECTION",
              "DEVICE",
              null
            ],
            "nullable": true
          },
          "audioTargetBitrateKbps": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "videoTargetBitrateKbps": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "maxVideoFrameRate": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "videoPreviewsEnabled": {
            "type": "boolean",
            "nullable": true
          },
          "videoPublishingEnabled": {
            "type": "boolean",
            "nullable": true
          },
          "videoSubscriptionsEnabled": {
            "type": "boolean",
            "nullable": true
          },
          "sampleCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "flowId": {
            "type": "string",
            "nullable": true
          },
          "framesPerSecond": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "framesEncoded": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "framesSent": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "framesReceived": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "framesDecoded": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "framesDropped": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "keyFrames": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "freezeCount": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "totalFreezeDurationMs": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "bytesTransferred": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "retransmittedPackets": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "nackCount": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "pliCount": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "firCount": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "frameWidth": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "frameHeight": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "targetBitrateKbps": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "codecImplementation": {
            "type": "string",
            "nullable": true
          },
          "details": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/VoiceDiagnosticDetails"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        },
        "required": [
          "sessionType",
          "sessionId",
          "event"
        ]
      },
      "VoiceDiagnosticDetails": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "platform": {
            "type": "string",
            "enum": [
              "desktop",
              "android",
              "web"
            ]
          },
          "appVersion": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9.+_-]{0,63}$"
          },
          "sampleTimestampMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 253402300799999
          },
          "protocolVersion": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 1,
            "default": 1
          },
          "roomEpoch": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 0,
            "maximum": 1000000000000000
          },
          "samplingEpoch": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 0,
            "maximum": 1000000000000000
          },
          "packetsSent": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 0,
            "maximum": 1000000000000000
          },
          "audioLevel": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "minimum": 0,
            "maximum": 1
          },
          "jitterBufferDelayMs": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "minimum": 0,
            "maximum": 60000
          },
          "qualityIntervalMillis": {
            "type": "number",
            "format": "double",
            "description": "Consecutive receive sample interval in milliseconds. When supplied, must be strictly positive. Required when an interval quality metric is supplied.",
            "nullable": true,
            "minimum": 0,
            "exclusiveMinimum": true,
            "maximum": 60000
          },
          "jitterBufferDelayMsInterval": {
            "type": "number",
            "format": "double",
            "description": "Mean jitter buffer delay during this interval, not end-to-end latency.",
            "nullable": true,
            "minimum": 0,
            "maximum": 60000
          },
          "concealedSampleRatioInterval": {
            "type": "number",
            "format": "double",
            "description": "Concealed audio samples divided by total received audio samples during this interval.",
            "nullable": true,
            "minimum": 0,
            "maximum": 1
          },
          "concealmentEventsPerSecondInterval": {
            "type": "number",
            "format": "double",
            "description": "Concealment events per second during this receive interval.",
            "nullable": true,
            "minimum": 0,
            "maximum": 1000000
          },
          "concealedSamples": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 0,
            "maximum": 1000000000000000
          },
          "concealmentEvents": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 0,
            "maximum": 1000000000000000
          },
          "microphoneRequested": {
            "type": "boolean",
            "nullable": true
          },
          "microphoneCommandEnabled": {
            "type": "boolean",
            "nullable": true
          },
          "afk": {
            "type": "boolean",
            "nullable": true
          },
          "outputEnabled": {
            "type": "boolean",
            "nullable": true
          },
          "captureActive": {
            "type": "boolean",
            "nullable": true
          },
          "publicationMuted": {
            "type": "boolean",
            "nullable": true
          },
          "audioProcessingStatus": {
            "type": "string",
            "nullable": true,
            "enum": [
              "applied",
              "rejected",
              "unsupported",
              "inactive",
              null
            ]
          },
          "audioPipeline": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VoiceAudioPipelineDiagnostic"
            },
            "nullable": true,
            "maxItems": 4
          }
        },
        "required": [
          "platform",
          "appVersion",
          "sampleTimestampMillis"
        ]
      },
      "VoiceAudioPipelineDiagnostic": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "stage": {
            "type": "string",
            "enum": [
              "capture",
              "inbound",
              "playout"
            ]
          },
          "flowAlias": {
            "type": "string",
            "pattern": "^(capture|inbound|playout)-[1-9][0-9]{0,5}$",
            "description": "Room and sampling epoch scoped counter alias whose prefix must equal stage. Never a device, SDK, track or participant identifier."
          },
          "sampleTimestampMillis": {
            "type": "number",
            "format": "double",
            "minimum": 0,
            "maximum": 253402300799999
          },
          "energyDelta": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "minimum": 0,
            "maximum": 1000000000000000
          },
          "durationSecondsDelta": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "minimum": 0,
            "maximum": 86400
          },
          "audioLevel": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "minimum": 0,
            "maximum": 1
          },
          "samplesDelta": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 0,
            "maximum": 1000000000000000
          },
          "interruptionEventsDelta": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "minimum": 0,
            "maximum": 1000000000000000
          },
          "interruptedDurationSecondsDelta": {
            "type": "number",
            "format": "double",
            "nullable": true,
            "minimum": 0,
            "maximum": 86400
          }
        },
        "required": [
          "stage",
          "flowAlias",
          "sampleTimestampMillis"
        ]
      },
      "E2eePassphraseBackupResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "revision"
        ],
        "properties": {
          "revision": {
            "type": "integer",
            "format": "int32"
          },
          "signedBackup": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "PutE2eePassphraseBackupRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedRevision",
          "signedBackup"
        ],
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "format": "int32"
          },
          "signedBackup": {
            "type": "string"
          }
        }
      },
      "E2eePassphraseBackupClaims": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "revision",
          "salt",
          "iterations",
          "rootFingerprint",
          "archiveFingerprint",
          "ciphertext",
          "ciphertextSha256"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "revision": {
            "type": "integer",
            "format": "int32"
          },
          "salt": {
            "type": "string"
          },
          "iterations": {
            "type": "integer",
            "format": "int32"
          },
          "rootFingerprint": {
            "type": "string"
          },
          "archiveFingerprint": {
            "type": "string"
          },
          "ciphertext": {
            "type": "string"
          },
          "ciphertextSha256": {
            "type": "string"
          }
        }
      },
      "E2eeDeviceTransferTranscript": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requestId",
          "userId",
          "recipientDeviceId",
          "recipientEncryptionKey",
          "createdAtEpochMillis",
          "expiresAtEpochMillis",
          "rootFingerprint",
          "archiveFingerprint"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "requestId": {
            "type": "string"
          },
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "recipientDeviceId": {
            "type": "string"
          },
          "recipientEncryptionKey": {
            "type": "string"
          },
          "createdAtEpochMillis": {
            "type": "integer",
            "format": "int64"
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64"
          },
          "rootFingerprint": {
            "type": "string"
          },
          "archiveFingerprint": {
            "type": "string"
          }
        }
      },
      "E2eeDeviceTransferClaims": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "userId",
          "approverDeviceId",
          "transcript",
          "ciphertext",
          "ciphertextSha256"
        ],
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "approverDeviceId": {
            "type": "string"
          },
          "transcript": {
            "type": "string"
          },
          "ciphertext": {
            "type": "string"
          },
          "ciphertextSha256": {
            "type": "string"
          }
        }
      },
      "CreateE2eeDeviceTransferRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "transcript"
        ],
        "properties": {
          "transcript": {
            "type": "string"
          }
        }
      },
      "ApproveE2eeDeviceTransferRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "signedTransfer"
        ],
        "properties": {
          "signedTransfer": {
            "type": "string"
          }
        }
      },
      "ConsumeE2eeDeviceTransferRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "signedTransferSha256"
        ],
        "properties": {
          "signedTransferSha256": {
            "type": "string"
          }
        }
      },
      "E2eeDeviceTransferResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "transcript",
          "status"
        ],
        "properties": {
          "transcript": {
            "type": "string"
          },
          "signedTransfer": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "APPROVED",
              "CONSUMED"
            ]
          },
          "serverTimeEpochMillis": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          }
        }
      },
      "DirectMessageResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "conversationId": {
            "type": "integer",
            "format": "int64"
          },
          "authorId": {
            "type": "integer",
            "format": "int64"
          },
          "content": {
            "type": "string"
          },
          "messageType": {
            "$ref": "#/components/schemas/DirectMessageTypeResponse"
          },
          "friendRequestId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "mediaContentType": {
            "type": "string",
            "nullable": true
          },
          "mediaThumbnailUrl": {
            "type": "string",
            "nullable": true
          },
          "friendRequestRequesterId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "friendRequestRequesterDisplayName": {
            "type": "string",
            "nullable": true
          },
          "friendRequestTargetUserId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "friendRequestStatus": {
            "type": "string",
            "nullable": true
          },
          "communityInviteId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "communityInviteIdentifier": {
            "type": "string",
            "nullable": true
          },
          "communityInviteName": {
            "type": "string",
            "nullable": true
          },
          "communityInviteDescription": {
            "type": "string",
            "nullable": true
          },
          "directCallSessionId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "directCallOutcome": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DirectCallOutcome"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "directCallDurationSeconds": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "directCallHadVideo": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string"
          },
          "editedAt": {
            "type": "string",
            "nullable": true
          },
          "clientMessageId": {
            "type": "string",
            "nullable": true
          },
          "reactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageReactionResponse"
            }
          },
          "pinned": {
            "type": "boolean"
          },
          "pinnedByUserId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "pinnedAt": {
            "type": "string",
            "nullable": true
          },
          "threadReplyCount": {
            "type": "integer",
            "format": "int32"
          },
          "threadRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatAttachmentResponse"
            }
          },
          "delivery": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MessageReceiptSummaryResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "forwardedFrom": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ForwardedMessageAttribution"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "encryptedEnvelope": {
            "type": "string",
            "nullable": true,
            "deprecated": true,
            "description": "Legacy encrypted-content field; managed writes omit it."
          },
          "encryptionRevision": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "replyToMessageId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "authorIsBot": {
            "type": "boolean"
          },
          "managedBody": {
            "type": "object",
            "additionalProperties": true,
            "description": "Server-readable structured content, validated by the owning message operation. Managed writers omit legacy encryptedEnvelope; transport encryption and server ACL still apply.",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "contentRevision": {
            "type": "integer",
            "format": "int32",
            "default": 0,
            "x-kotlin-default": "0"
          }
        },
        "required": [
          "id",
          "conversationId",
          "authorId",
          "content",
          "messageType",
          "createdAt"
        ]
      },
      "DirectMessageTypeResponse": {
        "type": "string",
        "enum": [
          "TEXT",
          "IMAGE",
          "ATTACHMENT",
          "FRIEND_REQUEST_SYSTEM",
          "VOICE_CALL_SYSTEM",
          "COMMUNITY_INVITE_SYSTEM"
        ]
      },
      "DirectCallOutcome": {
        "type": "string",
        "enum": [
          "RINGING",
          "COMPLETED",
          "NO_ANSWER",
          "DECLINED_BY_PEER",
          "CANCELLED_BY_CALLER"
        ]
      },
      "MessageReactionResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "emoji": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "reactedByMe": {
            "type": "boolean"
          },
          "reactors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageReactionUserResponse"
            }
          }
        },
        "required": [
          "emoji",
          "count",
          "reactedByMe"
        ]
      },
      "MessageReactionUserResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "displayName": {
            "type": "string"
          },
          "isBot": {
            "type": "boolean"
          }
        },
        "required": [
          "userId",
          "displayName"
        ]
      },
      "MessageReceiptSummaryResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "status": {
            "$ref": "#/components/schemas/MessageDeliveryStatus"
          },
          "recipientCount": {
            "type": "integer",
            "format": "int32"
          },
          "deliveredCount": {
            "type": "integer",
            "format": "int32"
          },
          "readCount": {
            "type": "integer",
            "format": "int32"
          }
        },
        "required": [
          "status",
          "recipientCount",
          "deliveredCount",
          "readCount"
        ]
      },
      "MessageDeliveryStatus": {
        "type": "string",
        "enum": [
          "SENT",
          "DELIVERED",
          "READ"
        ]
      },
      "ChannelMessageResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "channelId": {
            "type": "integer",
            "format": "int64"
          },
          "authorId": {
            "type": "integer",
            "format": "int64"
          },
          "content": {
            "type": "string"
          },
          "createdAt": {
            "type": "string"
          },
          "editedAt": {
            "type": "string",
            "nullable": true
          },
          "messageType": {
            "$ref": "#/components/schemas/ChannelMessageType"
          },
          "clientMessageId": {
            "type": "string",
            "nullable": true
          },
          "authorIdentifier": {
            "type": "string",
            "nullable": true
          },
          "authorDisplayName": {
            "type": "string",
            "nullable": true
          },
          "authorAvatarUrl": {
            "type": "string",
            "nullable": true
          },
          "authorCommunityRole": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CommunityRole"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "authorCustomRoleName": {
            "type": "string",
            "nullable": true
          },
          "authorRoleColorHex": {
            "type": "string",
            "nullable": true
          },
          "reactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MessageReactionResponse"
            }
          },
          "pinned": {
            "type": "boolean"
          },
          "pinnedByUserId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "pinnedAt": {
            "type": "string",
            "nullable": true
          },
          "threadReplyCount": {
            "type": "integer",
            "format": "int32"
          },
          "threadRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatAttachmentResponse"
            }
          },
          "delivery": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MessageReceiptSummaryResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "forwardedFrom": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ForwardedMessageAttribution"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "encryptedEnvelope": {
            "type": "string",
            "nullable": true,
            "deprecated": true,
            "description": "Legacy encrypted-content field; managed writes omit it."
          },
          "encryptionRevision": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "replyToMessageId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "authorIsBot": {
            "type": "boolean"
          },
          "managedBody": {
            "type": "object",
            "additionalProperties": true,
            "description": "Server-readable structured content, validated by the owning message operation. Managed writers omit legacy encryptedEnvelope; transport encryption and server ACL still apply.",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "contentRevision": {
            "type": "integer",
            "format": "int32",
            "default": 0,
            "x-kotlin-default": "0"
          }
        },
        "required": [
          "id",
          "channelId",
          "authorId",
          "content",
          "createdAt"
        ]
      },
      "ChannelMessageType": {
        "type": "string",
        "enum": [
          "TEXT",
          "ATTACHMENT",
          "SYSTEM"
        ]
      },
      "CommunityRole": {
        "type": "string",
        "enum": [
          "OWNER",
          "ADMIN",
          "MODERATOR",
          "MEMBER"
        ]
      },
      "ChatEventResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "creatorId": {
            "type": "integer",
            "format": "int64"
          },
          "scopeType": {
            "$ref": "#/components/schemas/ChatCardScopeType"
          },
          "conversationId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "channelId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "communityId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "communityName": {
            "type": "string",
            "nullable": true
          },
          "channelName": {
            "type": "string",
            "nullable": true
          },
          "messageId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "fullDescription": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "type": "string",
            "nullable": true
          },
          "startsAt": {
            "type": "string"
          },
          "endsAt": {
            "type": "string",
            "nullable": true
          },
          "headerImage": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChatEventHeaderImageResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "subscriberCount": {
            "type": "integer",
            "format": "int32"
          },
          "subscribedByMe": {
            "type": "boolean"
          },
          "goingCount": {
            "type": "integer",
            "format": "int32"
          },
          "maybeCount": {
            "type": "integer",
            "format": "int32"
          },
          "participationStatusByMe": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChatEventParticipationStatus"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "participants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatEventParticipantResponse"
            }
          },
          "sharingAllowed": {
            "type": "boolean"
          },
          "privateForChannel": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "creatorId",
          "scopeType",
          "title",
          "startsAt",
          "subscriberCount",
          "subscribedByMe"
        ]
      },
      "ChatCardScopeType": {
        "type": "string",
        "enum": [
          "DIRECT",
          "CHANNEL"
        ]
      },
      "ChatEventHeaderImageResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mediaUrl": {
            "type": "string"
          },
          "thumbnailUrl": {
            "type": "string",
            "nullable": true
          },
          "contentType": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer",
            "format": "int64"
          }
        },
        "required": [
          "mediaUrl",
          "contentType",
          "fileName",
          "sizeBytes"
        ]
      },
      "ChatEventParticipationStatus": {
        "type": "string",
        "enum": [
          "GOING",
          "MAYBE"
        ]
      },
      "ChatEventParticipantResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "displayName": {
            "type": "string"
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "$ref": "#/components/schemas/ChatEventParticipationStatus"
          }
        },
        "required": [
          "userId",
          "displayName",
          "status"
        ]
      },
      "UpcomingChatEventResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "communityId": {
            "type": "integer",
            "format": "int64"
          },
          "communityName": {
            "type": "string"
          },
          "channelId": {
            "type": "integer",
            "format": "int64"
          },
          "channelName": {
            "type": "string"
          },
          "messageId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "startsAt": {
            "type": "string"
          },
          "endsAt": {
            "type": "string",
            "nullable": true
          },
          "participationStatus": {
            "$ref": "#/components/schemas/ChatEventParticipationStatus"
          }
        },
        "required": [
          "id",
          "communityId",
          "communityName",
          "channelId",
          "channelName",
          "title",
          "startsAt",
          "participationStatus"
        ]
      },
      "CommunityCalendarEventResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "communityId": {
            "type": "integer",
            "format": "int64"
          },
          "communityName": {
            "type": "string"
          },
          "channelId": {
            "type": "integer",
            "format": "int64"
          },
          "channelName": {
            "type": "string"
          },
          "messageId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "startsAt": {
            "type": "string"
          },
          "endsAt": {
            "type": "string",
            "nullable": true
          },
          "participationStatus": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChatEventParticipationStatus"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        },
        "required": [
          "id",
          "communityId",
          "communityName",
          "channelId",
          "channelName",
          "title",
          "startsAt"
        ]
      },
      "ChatNewsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "creatorId": {
            "type": "integer",
            "format": "int64"
          },
          "creatorIdentifier": {
            "type": "string"
          },
          "creatorDisplayName": {
            "type": "string"
          },
          "creatorAvatarUrl": {
            "type": "string",
            "nullable": true
          },
          "communityId": {
            "type": "integer",
            "format": "int64"
          },
          "communityName": {
            "type": "string"
          },
          "channelId": {
            "type": "integer",
            "format": "int64"
          },
          "channelName": {
            "type": "string"
          },
          "messageId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "title": {
            "type": "string"
          },
          "shortDescription": {
            "type": "string"
          },
          "fullDescription": {
            "type": "string"
          },
          "publishedAt": {
            "type": "string"
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ChatNewsImageResponse"
            }
          },
          "sharingAllowed": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "creatorId",
          "creatorIdentifier",
          "creatorDisplayName",
          "communityId",
          "communityName",
          "channelId",
          "channelName",
          "title",
          "shortDescription",
          "fullDescription",
          "publishedAt"
        ]
      },
      "ChatNewsImageResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "mediaUrl": {
            "type": "string"
          },
          "thumbnailUrl": {
            "type": "string",
            "nullable": true
          },
          "contentType": {
            "type": "string"
          },
          "fileName": {
            "type": "string"
          },
          "sizeBytes": {
            "type": "integer",
            "format": "int64"
          }
        },
        "required": [
          "id",
          "position",
          "mediaUrl",
          "contentType",
          "fileName",
          "sizeBytes"
        ]
      },
      "SecureDeviceContentCapabilityClaims": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 1
          },
          "purpose": {
            "type": "string",
            "enum": [
              "mls-device-content-capability"
            ]
          },
          "userId": {
            "type": "string"
          },
          "deviceId": {
            "type": "string",
            "maxLength": 128
          },
          "certificateSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "media-renditions-v2"
              ]
            },
            "minItems": 0,
            "maxItems": 1
          },
          "issuedAtEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        },
        "required": [
          "userId",
          "deviceId",
          "certificateSha256",
          "revision",
          "features",
          "issuedAtEpochMillis",
          "expiresAtEpochMillis"
        ]
      },
      "PutSecureDeviceContentCapabilityRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signedCapability": {
            "type": "string"
          },
          "expectedRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          }
        },
        "required": [
          "signedCapability",
          "expectedRevision"
        ]
      },
      "SecureDeviceContentCapabilityResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "certificateSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "signedCapability": {
            "type": "string",
            "nullable": true
          },
          "serverTimeEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        },
        "required": [
          "certificateSha256",
          "revision",
          "serverTimeEpochMillis"
        ]
      },
      "QuerySecureContentCapabilitiesRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "requiredFeatures": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "media-renditions-v2"
              ]
            },
            "minItems": 1,
            "maxItems": 1
          }
        },
        "required": [
          "requiredFeatures"
        ]
      },
      "SecureContentCapabilityNotReadyReason": {
        "type": "string",
        "enum": [
          "NOT_ACTIVE",
          "AUDIENCE_TOO_LARGE",
          "DEVICE_NOT_READY",
          "CAPABILITY_NOT_READY"
        ]
      },
      "SecureDeviceContentCapabilityProof": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "string"
          },
          "deviceId": {
            "type": "string",
            "maxLength": 128
          },
          "certificateSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "signedCapability": {
            "type": "string"
          }
        },
        "required": [
          "userId",
          "deviceId",
          "certificateSha256",
          "revision",
          "signedCapability"
        ]
      },
      "SecureContentCapabilitySnapshot": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 1
          },
          "purpose": {
            "type": "string",
            "enum": [
              "mls-content-capability-snapshot"
            ]
          },
          "scopeType": {
            "$ref": "#/components/schemas/ChatScopeType"
          },
          "scopeId": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "historyGeneration": {
            "type": "string"
          },
          "epoch": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "commitHash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "rosterHash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "requiredFeatures": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "media-renditions-v2"
              ]
            },
            "minItems": 1,
            "maxItems": 1
          },
          "eligibleUserIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "maxItems": 512
          },
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecureDeviceContentCapabilityProof"
            },
            "minItems": 1,
            "maxItems": 512
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        },
        "required": [
          "scopeType",
          "scopeId",
          "conversationId",
          "historyGeneration",
          "epoch",
          "commitHash",
          "rosterHash",
          "requiredFeatures",
          "eligibleUserIds",
          "devices",
          "expiresAtEpochMillis"
        ]
      },
      "QuerySecureContentCapabilitiesResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "ready": {
            "type": "boolean"
          },
          "reason": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SecureContentCapabilityNotReadyReason"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "serverTimeEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "snapshot": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SecureContentCapabilitySnapshot"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "snapshotSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "nullable": true
          }
        },
        "required": [
          "ready",
          "serverTimeEpochMillis"
        ]
      },
      "SecureApplicationContentRequirementClaims": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32",
            "minimum": 1,
            "maximum": 1
          },
          "purpose": {
            "type": "string",
            "enum": [
              "mls-application-content-requirement"
            ]
          },
          "userId": {
            "type": "string"
          },
          "deviceId": {
            "type": "string",
            "maxLength": 128
          },
          "certificateSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "encryptedEnvelopeSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "capabilitySnapshotSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$"
          },
          "requiredFeatures": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "media-renditions-v2"
              ]
            },
            "minItems": 1,
            "maxItems": 1
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        },
        "required": [
          "userId",
          "deviceId",
          "certificateSha256",
          "encryptedEnvelopeSha256",
          "capabilitySnapshotSha256",
          "requiredFeatures",
          "expiresAtEpochMillis"
        ]
      },
      "SecureMessagingCapabilityResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "protocol": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "historyGeneration": {
            "type": "string"
          },
          "minimumContentProtocolVersion": {
            "type": "integer",
            "format": "int32",
            "x-kotlin-default": "com.xchat.server.message.CONTENT_PROTOCOL_VERSION",
            "minimum": 1
          }
        },
        "required": [
          "enabled",
          "historyGeneration"
        ],
        "description": "SERVER_MANAGED_1 with enabled=false selects server-managed content; historyGeneration and minimumContentProtocolVersion fence current writes. This does not disable HTTPS/WSS or WebRTC transport encryption."
      },
      "SecurePrivateDraftClaims": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "scopeType": {
            "$ref": "#/components/schemas/ChatScopeType"
          },
          "scopeId": {
            "type": "string"
          },
          "ownerUserId": {
            "type": "string"
          },
          "senderDeviceId": {
            "type": "string"
          },
          "ciphertext": {
            "type": "string"
          }
        },
        "required": [
          "scopeType",
          "scopeId",
          "ownerUserId",
          "senderDeviceId",
          "ciphertext"
        ]
      },
      "SecureKeyPackageClaims": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "certificateSha256": {
            "type": "string"
          },
          "credential": {
            "type": "string"
          },
          "keyPackage": {
            "type": "string"
          },
          "keyPackageSha256": {
            "type": "string"
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64"
          }
        },
        "required": [
          "userId",
          "deviceId",
          "certificateSha256",
          "credential",
          "keyPackage",
          "keyPackageSha256",
          "expiresAtEpochMillis"
        ]
      },
      "SecureCredentialClaims": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "rootFingerprint": {
            "type": "string"
          },
          "certificateSha256": {
            "type": "string"
          },
          "signingPublicKey": {
            "type": "string"
          },
          "cipherSuite": {
            "type": "integer",
            "format": "int32"
          }
        },
        "required": [
          "userId",
          "deviceId",
          "rootFingerprint",
          "certificateSha256",
          "signingPublicKey"
        ]
      },
      "PublishSecureKeyPackagesRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signedKeyPackages": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "signedKeyPackages"
        ]
      },
      "SecureKeyPackageResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signedKeyPackage": {
            "type": "string"
          }
        },
        "required": [
          "signedKeyPackage"
        ]
      },
      "SecureKeyPackageListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "keyPackages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecureKeyPackageResponse"
            }
          }
        },
        "required": [
          "keyPackages"
        ]
      },
      "SecureDeviceRef": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          }
        },
        "required": [
          "userId",
          "deviceId"
        ]
      },
      "ReserveSecureKeyPackagesRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "requestId": {
            "type": "string"
          },
          "devices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecureDeviceRef"
            }
          },
          "allowPartial": {
            "type": "boolean",
            "default": false,
            "description": "When true, return available certified target packages. No available packages returns MLS_KEY_PACKAGE_NOT_READY without saving a reservation. An initial DIRECT reservation must still cover both accounts including the creator. Retries with a successful requestId replay its original subset; use a new requestId to reserve additional packages that become available later."
          }
        },
        "required": [
          "requestId",
          "devices"
        ]
      },
      "SecureKeyPackageReservationResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "requestId": {
            "type": "string"
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64"
          },
          "keyPackages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecureKeyPackageResponse"
            }
          }
        },
        "required": [
          "requestId",
          "expiresAtEpochMillis",
          "keyPackages"
        ]
      },
      "SecureRosterMember": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "certificateSha256": {
            "type": "string"
          },
          "credential": {
            "type": "string"
          },
          "keyPackageSha256": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "userId",
          "deviceId",
          "certificateSha256",
          "credential"
        ]
      },
      "SecureWelcome": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "keyPackageSha256": {
            "type": "string"
          },
          "ciphertext": {
            "type": "string"
          }
        },
        "required": [
          "userId",
          "deviceId",
          "keyPackageSha256",
          "ciphertext"
        ]
      },
      "SecureArchiveCapsule": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "string"
          },
          "rootFingerprint": {
            "type": "string"
          },
          "ciphertext": {
            "type": "string"
          }
        },
        "required": [
          "userId",
          "rootFingerprint",
          "ciphertext"
        ]
      },
      "SecureTransitionManifest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "scopeType": {
            "$ref": "#/components/schemas/ChatScopeType"
          },
          "scopeId": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "historyGeneration": {
            "type": "string"
          },
          "authorityUserIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "requestId": {
            "type": "string"
          },
          "committerUserId": {
            "type": "string"
          },
          "committerDeviceId": {
            "type": "string"
          },
          "previousEpoch": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "previousCommitHash": {
            "type": "string",
            "nullable": true
          },
          "previousRosterHash": {
            "type": "string",
            "nullable": true
          },
          "nextEpoch": {
            "type": "integer",
            "format": "int64"
          },
          "commit": {
            "type": "string"
          },
          "nextRoster": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecureRosterMember"
            }
          },
          "welcomes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecureWelcome"
            }
          },
          "reservationRequestId": {
            "type": "string",
            "nullable": true
          },
          "archiveCapsules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecureArchiveCapsule"
            }
          },
          "transitionKind": {
            "type": "string",
            "nullable": true
          },
          "signedAdmissionPolicy": {
            "type": "string",
            "nullable": true
          },
          "nextExternalGroupInfo": {
            "type": "string",
            "nullable": true
          },
          "externalJoinBaseGroupInfoSha256": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "scopeType",
          "scopeId",
          "conversationId",
          "historyGeneration",
          "authorityUserIds",
          "requestId",
          "committerUserId",
          "committerDeviceId",
          "nextEpoch",
          "commit",
          "nextRoster",
          "welcomes",
          "archiveCapsules"
        ]
      },
      "SubmitSecureTransitionRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signedManifest": {
            "type": "string"
          },
          "membershipApprovals": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": [
          "signedManifest",
          "membershipApprovals"
        ]
      },
      "SecureTransitionResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "epoch": {
            "type": "integer",
            "format": "int64"
          },
          "commitHash": {
            "type": "string"
          },
          "rosterHash": {
            "type": "string"
          },
          "signedManifest": {
            "type": "string"
          },
          "membershipApprovals": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verificationIdentities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/E2eeIdentityResponse"
            }
          }
        },
        "required": [
          "epoch",
          "commitHash",
          "rosterHash",
          "signedManifest",
          "membershipApprovals",
          "verificationIdentities"
        ]
      },
      "SecureControlPageResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "transitions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecureTransitionResponse"
            }
          },
          "nextAfterEpoch": {
            "type": "integer",
            "format": "int64"
          },
          "hasMore": {
            "type": "boolean"
          }
        },
        "required": [
          "transitions",
          "nextAfterEpoch",
          "hasMore"
        ]
      },
      "SecureConversationStateResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "protocol": {
            "type": "string"
          },
          "scopeType": {
            "$ref": "#/components/schemas/ChatScopeType"
          },
          "scopeId": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "historyGeneration": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "communityId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "epoch": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "commitHash": {
            "type": "string",
            "nullable": true
          },
          "rosterHash": {
            "type": "string",
            "nullable": true
          },
          "roster": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecureRosterMember"
            }
          },
          "authorityUserIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "identities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/E2eeIdentityResponse"
            }
          },
          "openSelfJoinEligible": {
            "type": "boolean"
          }
        },
        "required": [
          "scopeType",
          "scopeId",
          "conversationId",
          "historyGeneration",
          "status",
          "roster",
          "authorityUserIds",
          "identities"
        ]
      },
      "SecureApplicationClaims": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "scopeType": {
            "$ref": "#/components/schemas/ChatScopeType"
          },
          "scopeId": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "historyGeneration": {
            "type": "string"
          },
          "epoch": {
            "type": "integer",
            "format": "int64"
          },
          "commitHash": {
            "type": "string"
          },
          "rosterHash": {
            "type": "string"
          },
          "senderUserId": {
            "type": "string"
          },
          "senderDeviceId": {
            "type": "string"
          },
          "clientMessageId": {
            "type": "string"
          },
          "revision": {
            "type": "integer",
            "format": "int32"
          },
          "messageId": {
            "type": "string",
            "nullable": true
          },
          "replyToMessageId": {
            "type": "string",
            "nullable": true
          },
          "rootMessageId": {
            "type": "string",
            "nullable": true
          },
          "attachmentUploadIds": {
            "type": "array",
            "maxItems": 30,
            "items": {
              "type": "string"
            }
          },
          "context": {
            "type": "string"
          },
          "ciphertext": {
            "type": "string"
          },
          "archiveCiphertext": {
            "type": "string"
          }
        },
        "required": [
          "scopeType",
          "scopeId",
          "conversationId",
          "historyGeneration",
          "epoch",
          "commitHash",
          "rosterHash",
          "senderUserId",
          "senderDeviceId",
          "clientMessageId",
          "revision",
          "attachmentUploadIds",
          "context",
          "ciphertext",
          "archiveCiphertext"
        ]
      },
      "SubmitSecureApplicationRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signedContentRequirement": {
            "type": "string",
            "nullable": true,
            "description": "Optional device-signed requirement bound to the exact encrypted envelope and current content-capability snapshot. Required for fresh inventories above ten resources and all future rendition writes; accepted exact replay is resolved before this admission proof."
          },
          "signedNotificationIntent": {
            "type": "string",
            "nullable": true,
            "description": "Optional device-signed collective mention intent bound to the exact encrypted envelope, sender, scope and client message ID. Notification routing only; existing MLS application bytes and recipient authority are unchanged."
          },
          "encryptedEnvelope": {
            "type": "string"
          }
        },
        "required": [
          "encryptedEnvelope"
        ]
      },
      "SecureGroupMentionTargets": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "everyone": {
            "type": "boolean",
            "default": false
          },
          "systemRoles": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "customRoleIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": []
          }
        }
      },
      "SecureNotificationIntentClaims": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32",
            "default": 1
          },
          "purpose": {
            "type": "string",
            "default": "message-notification-intent"
          },
          "senderUserId": {
            "type": "string"
          },
          "senderDeviceId": {
            "type": "string"
          },
          "scopeType": {
            "$ref": "#/components/schemas/ChatScopeType"
          },
          "scopeId": {
            "type": "string"
          },
          "clientMessageId": {
            "type": "string"
          },
          "encryptedEnvelopeSha256": {
            "type": "string"
          },
          "targets": {
            "$ref": "#/components/schemas/SecureGroupMentionTargets"
          }
        },
        "required": [
          "senderUserId",
          "senderDeviceId",
          "scopeType",
          "scopeId",
          "clientMessageId",
          "encryptedEnvelopeSha256",
          "targets"
        ]
      },
      "SecureApplicationResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "messageId": {
            "type": "integer",
            "format": "int64"
          },
          "revision": {
            "type": "integer",
            "format": "int32"
          },
          "inserted": {
            "type": "boolean"
          },
          "directMessage": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DirectMessageResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "channelMessage": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChannelMessageResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "threadReply": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MessageThreadReplyResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        },
        "required": [
          "messageId",
          "revision",
          "inserted"
        ]
      },
      "RevokeSecureDeviceRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "deviceId": {
            "type": "string"
          },
          "signedRevocation": {
            "type": "string"
          }
        },
        "required": [
          "deviceId",
          "signedRevocation"
        ]
      },
      "SecureDeviceRevocationClaims": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "deviceId": {
            "type": "string"
          },
          "certificateSha256": {
            "type": "string"
          }
        },
        "required": [
          "userId",
          "deviceId",
          "certificateSha256"
        ]
      },
      "CommunityMemberResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 9223372036854775807
          },
          "userIdentifier": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/CommunityRole"
          },
          "mutedUntil": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "banned": {
            "type": "boolean"
          },
          "joinedAt": {
            "type": "string",
            "format": "date-time"
          },
          "customRoleIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1,
              "maximum": 9223372036854775807
            },
            "uniqueItems": true
          },
          "avatarUrl": {
            "type": "string",
            "nullable": true
          },
          "online": {
            "type": "boolean",
            "default": false
          },
          "microphoneMuted": {
            "type": "boolean",
            "default": false,
            "description": "Persistent moderator microphone restriction within this community. Clearing it permits voluntary microphone activation; it never turns on the microphone."
          },
          "microphoneModerationRevision": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "default": 0
          },
          "isBot": {
            "type": "boolean"
          }
        },
        "required": [
          "userId",
          "userIdentifier",
          "displayName",
          "role",
          "banned",
          "joinedAt"
        ]
      },
      "UpdateCommunityMemberModerationRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "mutedMinutes": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "maximum": 525600,
            "nullable": true,
            "description": "Null or omitted preserves the chat mute. Zero clears it; positive minutes mute new messages, edits and replies."
          },
          "banned": {
            "type": "boolean",
            "nullable": true
          },
          "microphoneMuted": {
            "type": "boolean",
            "nullable": true,
            "description": "Null or omitted preserves microphone permission. True revokes this community voice/stream audio grants; false allows the user to enable their microphone voluntarily."
          }
        }
      },
      "CommunityAdministrationPermission": {
        "type": "string",
        "enum": [
          "MANAGE_STRUCTURE"
        ]
      },
      "CommunityCustomRoleResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "communityId",
          "name",
          "colorHex",
          "position"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 9223372036854775807
          },
          "communityId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 9223372036854775807
          },
          "name": {
            "type": "string"
          },
          "colorHex": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "permissions": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/CommunityAdministrationPermission"
            }
          },
          "showInMemberList": {
            "type": "boolean",
            "default": true,
            "description": "Display this role as a member-list category. Does not alter membership, role color or access."
          }
        }
      },
      "CreateCommunityCustomRoleRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "colorHex": {
            "type": "string",
            "description": "Defaults to #8FAECF when omitted."
          },
          "permissions": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/CommunityAdministrationPermission"
            }
          },
          "showInMemberList": {
            "type": "boolean",
            "default": true
          }
        }
      },
      "UpdateCommunityCustomRoleRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "colorHex",
          "position"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "colorHex": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "permissions": {
            "type": "array",
            "uniqueItems": true,
            "items": {
              "$ref": "#/components/schemas/CommunityAdministrationPermission"
            }
          },
          "showInMemberList": {
            "type": "boolean",
            "nullable": true,
            "description": "Omitted or null preserves the stored flag, including false. Display only; permissions are unchanged by this field."
          }
        }
      },
      "SecureCooperativeAdmissionClaims": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32",
            "default": 1
          },
          "purpose": {
            "type": "string",
            "default": "mls-cooperative-admission"
          },
          "requestId": {
            "type": "string"
          },
          "scopeType": {
            "$ref": "#/components/schemas/ChatScopeType"
          },
          "scopeId": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "historyGeneration": {
            "type": "string"
          },
          "authorityUserId": {
            "type": "string"
          },
          "authorityRootFingerprint": {
            "type": "string"
          },
          "targetDeviceId": {
            "type": "string"
          },
          "targetCertificateSha256": {
            "type": "string"
          },
          "baseEpoch": {
            "type": "integer",
            "format": "int64"
          },
          "baseCommitHash": {
            "type": "string"
          },
          "baseRosterHash": {
            "type": "string"
          },
          "createdAtEpochMillis": {
            "type": "integer",
            "format": "int64"
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64"
          }
        },
        "required": [
          "requestId",
          "scopeType",
          "scopeId",
          "conversationId",
          "historyGeneration",
          "authorityUserId",
          "authorityRootFingerprint",
          "targetDeviceId",
          "targetCertificateSha256",
          "baseEpoch",
          "baseCommitHash",
          "baseRosterHash",
          "createdAtEpochMillis",
          "expiresAtEpochMillis"
        ]
      },
      "CreateSecureCooperativeAdmissionRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signedRequest": {
            "type": "string"
          }
        },
        "required": [
          "signedRequest"
        ]
      },
      "ProposeSecureCooperativeAdmissionRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signedManifest": {
            "type": "string"
          }
        },
        "required": [
          "signedManifest"
        ]
      },
      "ApproveSecureCooperativeAdmissionRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signedApproval": {
            "type": "string"
          }
        },
        "required": [
          "signedApproval"
        ]
      },
      "SecureCooperativeAdmissionStatus": {
        "type": "string",
        "enum": [
          "REQUESTED",
          "CLAIMED",
          "PROPOSED",
          "APPROVED",
          "COMMITTED",
          "CANCELLED",
          "EXPIRED",
          "SUPERSEDED"
        ]
      },
      "SecureCooperativeAdmissionResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "requestId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/SecureCooperativeAdmissionStatus"
          },
          "signedRequest": {
            "type": "string"
          },
          "targetUserId": {
            "type": "string"
          },
          "targetDeviceId": {
            "type": "string"
          },
          "expiresAtEpochMillis": {
            "type": "integer",
            "format": "int64"
          },
          "serverTimeEpochMillis": {
            "type": "integer",
            "format": "int64"
          },
          "helperUserId": {
            "type": "string",
            "nullable": true
          },
          "helperDeviceId": {
            "type": "string",
            "nullable": true
          },
          "helperCertificateSha256": {
            "type": "string",
            "nullable": true
          },
          "signedManifest": {
            "type": "string",
            "nullable": true
          },
          "signedApproval": {
            "type": "string",
            "nullable": true
          },
          "verificationIdentities": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/E2eeIdentityResponse"
            }
          }
        },
        "required": [
          "requestId",
          "status",
          "signedRequest",
          "targetUserId",
          "targetDeviceId",
          "expiresAtEpochMillis",
          "serverTimeEpochMillis"
        ]
      },
      "SecureCooperativeAdmissionListResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "requests": {
            "type": "array",
            "maxItems": 8,
            "items": {
              "$ref": "#/components/schemas/SecureCooperativeAdmissionResponse"
            }
          }
        },
        "required": [
          "requests"
        ]
      },
      "SecureAdmissionPolicyClaims": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "scopeType": {
            "$ref": "#/components/schemas/ChatScopeType"
          },
          "scopeId": {
            "type": "string"
          },
          "communityId": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "historyGeneration": {
            "type": "string"
          },
          "authorityUserIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "authorityRootFingerprints": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "activationEpoch": {
            "type": "integer",
            "format": "int64"
          },
          "baseCommitHash": {
            "type": "string",
            "nullable": true
          },
          "baseRosterHash": {
            "type": "string",
            "nullable": true
          },
          "mode": {
            "type": "string"
          },
          "history": {
            "type": "string"
          },
          "policyRevision": {
            "type": "integer",
            "format": "int64"
          },
          "previousPolicySha256": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "scopeType",
          "scopeId",
          "communityId",
          "conversationId",
          "historyGeneration",
          "authorityUserIds",
          "authorityRootFingerprints",
          "activationEpoch"
        ]
      },
      "StartStreamSessionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 120
          },
          "videoSource": {
            "$ref": "#/components/schemas/VideoSourceType"
          },
          "videoQuality": {
            "$ref": "#/components/schemas/VideoQualitySettings"
          },
          "ownershipProtocolVersion": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        }
      },
      "StreamStartOperationStatus": {
        "type": "string",
        "enum": [
          "UNKNOWN",
          "STARTED",
          "CANCELLED",
          "REJECTED",
          "ENDED",
          "EXPIRED"
        ]
      },
      "StreamStartOperationResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "operationId",
          "channelId",
          "status"
        ],
        "properties": {
          "operationId": {
            "type": "string",
            "format": "uuid"
          },
          "channelId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "status": {
            "$ref": "#/components/schemas/StreamStartOperationStatus"
          },
          "sessionId": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "nullable": true
          },
          "participationId": {
            "type": "string",
            "nullable": true
          },
          "rejectionCode": {
            "type": "string",
            "nullable": true
          },
          "retiredThroughEpochMs": {
            "type": "integer",
            "format": "int64",
            "minimum": 0,
            "nullable": true,
            "description": "Required for EXPIRED. Durable monotonic account floor proving this UUID can never start and no LIVE exact receipt was retired."
          }
        }
      },
      "StreamStartOperationClockResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "serverTimeEpochMs",
          "validityMs"
        ],
        "properties": {
          "serverTimeEpochMs": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "validityMs": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      },
      "E2eeRecoveryTimeResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "serverTimeEpochMillis"
        ],
        "properties": {
          "serverTimeEpochMillis": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "SecureHistoryGrantClaims": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32"
          },
          "purpose": {
            "type": "string"
          },
          "scopeType": {
            "$ref": "#/components/schemas/ChatScopeType"
          },
          "scopeId": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "historyGeneration": {
            "type": "string"
          },
          "epoch": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "commitHash": {
            "type": "string"
          },
          "grantorUserId": {
            "type": "string"
          },
          "grantorDeviceId": {
            "type": "string"
          },
          "grantorCertificateSha256": {
            "type": "string"
          },
          "authorizedAtEpoch": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "authorizedAtCommitHash": {
            "type": "string"
          },
          "capsule": {
            "$ref": "#/components/schemas/SecureArchiveCapsule"
          }
        },
        "required": [
          "scopeType",
          "scopeId",
          "conversationId",
          "historyGeneration",
          "epoch",
          "commitHash",
          "grantorUserId",
          "grantorDeviceId",
          "grantorCertificateSha256",
          "authorizedAtEpoch",
          "authorizedAtCommitHash",
          "capsule"
        ]
      },
      "QuerySecureHistoryGrantsRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "epochs": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "minItems": 1,
            "maxItems": 8,
            "description": "Distinct historical epochs; duplicate values are rejected."
          },
          "expectedEpoch": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "expectedCommitHash": {
            "type": "string"
          }
        },
        "required": [
          "epochs",
          "expectedEpoch",
          "expectedCommitHash"
        ]
      },
      "SecureHistoryGrantResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "epoch": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "signedGrant": {
            "type": "string",
            "maxLength": 16384
          }
        },
        "required": [
          "epoch",
          "signedGrant"
        ]
      },
      "SecureHistoryGrantTarget": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "epoch": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "recipientUserIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "minItems": 1,
            "maxItems": 16
          }
        },
        "required": [
          "epoch",
          "recipientUserIds"
        ]
      },
      "SecureHistoryGrantsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecureHistoryGrantResponse"
            },
            "maxItems": 8
          },
          "pending": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecureHistoryGrantTarget"
            },
            "maxItems": 12,
            "description": "At most 16 recipients in total across these targets."
          }
        }
      },
      "PublishSecureHistoryGrantsRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "signedGrants": {
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 16384
            },
            "minItems": 1,
            "maxItems": 16
          }
        },
        "required": [
          "signedGrants"
        ]
      },
      "E2eeRoomEpochResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "contextType",
          "sessionId",
          "leaseId",
          "generation",
          "epoch"
        ],
        "properties": {
          "protocolVersion": {
            "type": "integer",
            "format": "int32"
          },
          "contextType": {
            "$ref": "#/components/schemas/MediaContextType"
          },
          "sessionId": {
            "type": "integer",
            "format": "int64"
          },
          "leaseId": {
            "type": "integer",
            "format": "int64"
          },
          "generation": {
            "type": "integer",
            "format": "int32"
          },
          "epoch": {
            "type": "string"
          }
        }
      },
      "SocialPublicationKind": {
        "type": "string",
        "enum": [
          "POST",
          "STORY"
        ]
      },
      "SocialAudience": {
        "type": "string",
        "enum": [
          "FRIENDS",
          "PUBLIC"
        ]
      },
      "SocialSlideRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "uploadId": {
            "type": "string",
            "nullable": true
          },
          "retainedSlideId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "caption": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "type": "string",
            "nullable": true
          },
          "people": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "event": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "CreateSocialPublicationRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "clientRequestId": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/SocialPublicationKind"
          },
          "audience": {
            "$ref": "#/components/schemas/SocialAudience"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "body": {
            "type": "string"
          },
          "slides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialSlideRequest"
            }
          },
          "metadata": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SocialPublicationMetadata"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        },
        "required": [
          "clientRequestId",
          "kind"
        ]
      },
      "UpdateSocialPublicationRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "expectedRevision": {
            "type": "integer",
            "format": "int64"
          },
          "audience": {
            "$ref": "#/components/schemas/SocialAudience"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "body": {
            "type": "string"
          },
          "slides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialSlideRequest"
            }
          },
          "metadata": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SocialPublicationMetadata"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        },
        "required": [
          "expectedRevision"
        ]
      },
      "SocialSlideResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "mediaUrl": {
            "type": "string"
          },
          "thumbnailUrl": {
            "type": "string",
            "nullable": true
          },
          "width": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "height": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "caption": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "type": "string",
            "nullable": true
          },
          "people": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "event": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "id",
          "position",
          "mediaUrl"
        ]
      },
      "SocialPublicationResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "authorUserId": {
            "type": "integer",
            "format": "int64"
          },
          "authorUserIdentifier": {
            "type": "string"
          },
          "authorDisplayName": {
            "type": "string"
          },
          "authorAvatarUrl": {
            "type": "string",
            "nullable": true
          },
          "kind": {
            "$ref": "#/components/schemas/SocialPublicationKind"
          },
          "audience": {
            "$ref": "#/components/schemas/SocialAudience"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "body": {
            "type": "string"
          },
          "slides": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialSlideResponse"
            }
          },
          "createdAt": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "nullable": true
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          },
          "highlightUntil": {
            "type": "string",
            "nullable": true
          },
          "seen": {
            "type": "boolean"
          },
          "canEdit": {
            "type": "boolean"
          },
          "metadata": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SocialPublicationMetadata"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        },
        "required": [
          "id",
          "authorUserId",
          "authorUserIdentifier",
          "authorDisplayName",
          "kind",
          "audience",
          "body",
          "slides",
          "createdAt",
          "revision"
        ]
      },
      "SocialPublicationPageResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialPublicationResponse"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "items"
        ]
      },
      "SocialFeedItemResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "key": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "sortAt": {
            "type": "string"
          },
          "publication": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/SocialPublicationResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "news": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChatNewsResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "event": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/UpcomingChatEventResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        },
        "required": [
          "key",
          "kind",
          "sortAt"
        ]
      },
      "SocialFeedPageResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialFeedItemResponse"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true
          }
        },
        "required": [
          "items"
        ]
      },
      "SocialPublicationMetadata": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "location": {
            "type": "string",
            "nullable": true,
            "maxLength": 160
          },
          "people": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          "event": {
            "type": "string",
            "nullable": true,
            "maxLength": 160
          }
        },
        "nullable": true
      },
      "ScheduleSecureMessageRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "requestId",
          "application",
          "privatePreview",
          "scheduledAt"
        ],
        "properties": {
          "requestId": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128
          },
          "application": {
            "$ref": "#/components/schemas/SubmitSecureApplicationRequest"
          },
          "privatePreview": {
            "type": "string",
            "maxLength": 65536,
            "x-sensitive": true,
            "description": "Device-signed e2ee:draft:v2 account-only encrypted editor preview. The plaintext contains the SHA-256 of the exact application envelope and its authenticated body."
          },
          "scheduledAt": {
            "type": "string",
            "description": "Future ISO-8601 instant, at most 365 days ahead."
          },
          "silent": {
            "type": "boolean"
          }
        }
      },
      "UpdateSecureScheduledMessageRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "expectedEnvelopeSha256",
          "replacement"
        ],
        "properties": {
          "expectedEnvelopeSha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "Compare-and-set against the currently queued envelope. An exact accepted retry is returned before checking this hash."
          },
          "replacement": {
            "$ref": "#/components/schemas/ScheduleSecureMessageRequest"
          }
        }
      },
      "VoiceRoomKind": {
        "type": "string",
        "enum": [
          "VOICE",
          "SPEAKER"
        ]
      },
      "VoiceStageResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "role": {
            "$ref": "#/components/schemas/VoiceParticipantRole"
          },
          "handRaised": {
            "type": "boolean"
          }
        },
        "required": [
          "role",
          "handRaised"
        ]
      },
      "VoiceMicrophoneAdmissionState": {
        "type": "string",
        "enum": [
          "PENDING",
          "GRANTED",
          "DENIED"
        ]
      },
      "VoiceMicrophoneAdmissionResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "leaseId": {
            "type": "integer",
            "format": "int64"
          },
          "generation": {
            "type": "integer",
            "format": "int32"
          },
          "participationId": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "$ref": "#/components/schemas/VoiceMicrophoneAdmissionState"
          },
          "revision": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        },
        "required": [
          "leaseId",
          "generation",
          "participationId",
          "state",
          "revision"
        ]
      },
      "CommunityChannelType": {
        "type": "string",
        "enum": [
          "TEXT",
          "VOICE",
          "SPEAKER",
          "STREAM"
        ]
      },
      "CommunityChannelSystemPurpose": {
        "type": "string",
        "enum": [
          "MEMBER_AUDIT",
          "MODERATION_AUDIT"
        ]
      },
      "CommunityAccessResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "restricted": {
            "type": "boolean"
          },
          "allowedSystemRoles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommunityRole"
            }
          },
          "allowedCustomRoleIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          },
          "allowedUserIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64"
            }
          }
        },
        "required": [
          "restricted"
        ]
      },
      "CommunityChannelPolicyRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "viewing"
        ],
        "properties": {
          "viewing": {
            "$ref": "#/components/schemas/UpdateCommunityAccessRequest"
          },
          "broadcasting": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UpdateCommunityAccessRequest"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "speaking": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UpdateCommunityAccessRequest"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        }
      },
      "CreateCommunitySectionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "access": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UpdateCommunityAccessRequest"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        }
      },
      "UpdateCommunitySectionRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "position"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "access": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/UpdateCommunityAccessRequest"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        }
      },
      "CommunitySectionResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "communityId",
          "name",
          "position",
          "access",
          "channels"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "communityId": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "systemPurpose": {
            "type": "string",
            "nullable": true,
            "enum": [
              "GENERAL",
              "MODERATION",
              null
            ]
          },
          "access": {
            "$ref": "#/components/schemas/CommunityAccessResponse"
          },
          "channels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommunityChannelResponse"
            }
          },
          "iconUrl": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "UpdateCommunityAccessRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "allowedSystemRoles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommunityRole"
            },
            "uniqueItems": true
          },
          "allowedCustomRoleIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "uniqueItems": true
          },
          "allowedUserIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int64",
              "minimum": 1
            },
            "uniqueItems": true
          }
        }
      },
      "CreateChannelRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CommunityChannelPolicyRequest"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "topic": {
            "type": "string",
            "nullable": true
          },
          "sectionId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "channelType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommunityChannelType"
              }
            ],
            "description": "Legacy wire adapter only; channelKind is canonical and explicit channelKind wins."
          },
          "speakerModeEnabled": {
            "type": "boolean",
            "description": "Legacy wire adapter only; channelKind is canonical and explicit channelKind wins."
          },
          "channelKind": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CommunityChannelType"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        },
        "required": [
          "name"
        ]
      },
      "UpdateChannelRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "policy": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CommunityChannelPolicyRequest"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "topic": {
            "type": "string",
            "nullable": true
          },
          "sectionId": {
            "type": "integer",
            "format": "int64"
          },
          "channelType": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CommunityChannelType"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Legacy wire adapter only; explicit channelKind wins. When both channelKind and channelType are absent or null, preserve the stored kind."
          },
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "speakerModeEnabled": {
            "type": "boolean",
            "description": "Legacy wire adapter only; channelKind is canonical and explicit channelKind wins."
          },
          "channelKind": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CommunityChannelType"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          }
        },
        "required": [
          "name",
          "sectionId"
        ]
      },
      "CommunityChannelResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "communityId": {
            "type": "integer",
            "format": "int64"
          },
          "name": {
            "type": "string"
          },
          "topic": {
            "type": "string",
            "nullable": true
          },
          "createdBy": {
            "type": "integer",
            "format": "int64"
          },
          "createdAt": {
            "type": "string"
          },
          "sectionId": {
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "channelType": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommunityChannelType"
              }
            ],
            "description": "Legacy wire adapter only; channelKind is canonical and explicit channelKind wins."
          },
          "position": {
            "type": "integer",
            "format": "int32"
          },
          "systemPurpose": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CommunityChannelSystemPurpose"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "access": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CommunityAccessResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "broadcastAccess": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CommunityAccessResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "canBroadcast": {
            "type": "boolean"
          },
          "speakerAccess": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CommunityAccessResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ]
          },
          "canBecomeSpeaker": {
            "type": "boolean"
          },
          "speakerModeEnabled": {
            "type": "boolean",
            "description": "Legacy wire adapter only; channelKind is canonical and explicit channelKind wins."
          },
          "iconUrl": {
            "type": "string",
            "nullable": true
          },
          "channelKind": {
            "$ref": "#/components/schemas/CommunityChannelType"
          }
        },
        "required": [
          "id",
          "communityId",
          "name",
          "createdBy",
          "createdAt"
        ]
      },
      "VoiceAdmissionRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/VoiceAdmissionScope"
          },
          "participationId": {
            "type": "string"
          },
          "request": {
            "$ref": "#/components/schemas/AcquireMediaLeaseRequest"
          }
        },
        "required": [
          "scope",
          "participationId",
          "request"
        ]
      },
      "VoiceAdmissionScope": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "channelId": {
            "type": "integer",
            "format": "int64"
          },
          "voiceSessionId": {
            "type": "integer",
            "format": "int64"
          },
          "incarnation": {
            "type": "string"
          }
        },
        "required": [
          "channelId",
          "voiceSessionId",
          "incarnation"
        ]
      },
      "VoiceAdmissionRecipient": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "attendanceId": {
            "type": "string"
          },
          "rootKeyThumbprint": {
            "type": "string",
            "nullable": true
          },
          "archiveKeyThumbprint": {
            "type": "string",
            "nullable": true
          },
          "contentProtocol": {
            "type": "string",
            "default": "E2EE_1",
            "x-kotlin-default": "\"E2EE_1\""
          }
        },
        "required": [
          "userId",
          "attendanceId"
        ]
      },
      "VoiceAdmissionResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "lease": {
            "$ref": "#/components/schemas/MediaLeaseResponse"
          },
          "recipient": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/VoiceAdmissionRecipient"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Optional feature attendance. Absent for prepared ordinary VOICE v2; acquire separately only when board/screen features are requested."
          }
        },
        "required": [
          "lease"
        ]
      },
      "VoicePublisherBinding": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "deviceId": {
            "type": "string"
          },
          "participationId": {
            "type": "string"
          },
          "leaseId": {
            "type": "integer",
            "format": "int64"
          },
          "leaseGeneration": {
            "type": "integer",
            "format": "int32"
          },
          "providerParticipantIdentity": {
            "type": "string"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/voice/crypto/VoicePublisherKeyModels.kt",
          "line": 8
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "userId",
          "deviceId",
          "participationId",
          "leaseId",
          "leaseGeneration",
          "providerParticipantIdentity"
        ],
        "additionalProperties": false
      },
      "VoicePublisherKeyTransition": {
        "type": "string",
        "enum": [
          "INITIAL",
          "ADD_RATCHET",
          "REMOVE_RESEED"
        ],
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/voice/crypto/VoicePublisherKeyModels.kt",
          "line": 24
        }
      },
      "PublishVoicePublisherKeyRequest": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "integer",
            "format": "int64"
          },
          "leaseId": {
            "type": "integer",
            "format": "int64"
          },
          "generation": {
            "type": "integer",
            "format": "int32"
          },
          "expectedRosterDigest": {
            "type": "string"
          },
          "keyGeneration": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "previousKeyGeneration": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "keyIndex": {
            "type": "integer",
            "format": "int32",
            "enum": [
              0
            ]
          },
          "transition": {
            "$ref": "#/components/schemas/VoicePublisherKeyTransition"
          },
          "envelope": {
            "type": "string"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/voice/crypto/VoicePublisherKeyModels.kt",
          "line": 52
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "sessionId",
          "leaseId",
          "generation",
          "expectedRosterDigest",
          "keyGeneration",
          "previousKeyGeneration",
          "keyIndex",
          "transition",
          "envelope"
        ],
        "additionalProperties": false
      },
      "EncryptedPosterResource": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string",
            "format": "uuid"
          },
          "contentType": {
            "type": "string",
            "enum": [
              "application/vnd.teamyfy.e2ee"
            ]
          },
          "sizeBytes": {
            "type": "integer",
            "format": "int64",
            "minimum": 1,
            "maximum": 524288
          },
          "mediaUrl": {
            "type": "string",
            "description": "Private ciphertext URL; authorization remains bound to the original current message."
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/media/poster/EncryptedPosterModels.kt",
          "line": 9
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "uploadId",
          "contentType",
          "sizeBytes",
          "mediaUrl"
        ],
        "additionalProperties": false
      },
      "VoicePublisherKeyStateResponse": {
        "type": "object",
        "properties": {
          "protocolVersion": {
            "type": "integer",
            "format": "int32",
            "default": 2,
            "x-kotlin-default": "2"
          },
          "sessionId": {
            "type": "integer",
            "format": "int64"
          },
          "receiverLeaseId": {
            "type": "integer",
            "format": "int64"
          },
          "receiverGeneration": {
            "type": "integer",
            "format": "int32"
          },
          "rosterDigest": {
            "type": "string"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VoicePublisherKeyMember"
            }
          },
          "publishers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VoicePublisherKeyHead"
            }
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/voice/crypto/VoicePublisherKeyModels.kt",
          "line": 41
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "sessionId",
          "receiverLeaseId",
          "receiverGeneration",
          "rosterDigest",
          "members",
          "publishers"
        ],
        "additionalProperties": false
      },
      "PutEncryptedPosterRequest": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32",
            "default": 1,
            "x-kotlin-default": "1",
            "enum": [
              1
            ]
          },
          "posterUploadId": {
            "type": "string",
            "format": "uuid"
          },
          "encryptedDescriptor": {
            "type": "string",
            "minLength": 40,
            "maxLength": 16384,
            "description": "Compact JWE descriptor sealed with the original attachment context. Exactly four period separators; no plaintext media key or image metadata."
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/media/poster/EncryptedPosterModels.kt",
          "line": 6
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "posterUploadId",
          "encryptedDescriptor"
        ],
        "additionalProperties": false
      },
      "LessonKeyScope": {
        "type": "object",
        "properties": {
          "channelId": {
            "type": "integer",
            "format": "int64"
          },
          "voiceSessionId": {
            "type": "integer",
            "format": "int64"
          },
          "incarnation": {
            "type": "string"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/board/LessonKeyModels.kt",
          "line": 10
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "channelId",
          "voiceSessionId",
          "incarnation"
        ],
        "additionalProperties": false
      },
      "VoicePublisherKeyStateRequest": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "integer",
            "format": "int64"
          },
          "leaseId": {
            "type": "integer",
            "format": "int64"
          },
          "generation": {
            "type": "integer",
            "format": "int32"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/voice/crypto/VoicePublisherKeyModels.kt",
          "line": 38
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "sessionId",
          "leaseId",
          "generation"
        ],
        "additionalProperties": false
      },
      "ClassroomAttendanceRequest": {
        "type": "object",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/LessonKeyScope"
          },
          "participationId": {
            "type": "string"
          },
          "leaseId": {
            "type": "integer",
            "format": "int64"
          },
          "leaseGeneration": {
            "type": "integer",
            "format": "int32"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/classroom/ClassroomAdmissionService.kt",
          "line": 29
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "scope",
          "participationId",
          "leaseId",
          "leaseGeneration"
        ],
        "additionalProperties": false
      },
      "EncryptedPosterResponse": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32",
            "default": 1,
            "x-kotlin-default": "1"
          },
          "originalAttachmentId": {
            "type": "integer",
            "format": "int64"
          },
          "poster": {
            "$ref": "#/components/schemas/EncryptedPosterResource"
          },
          "encryptedDescriptor": {
            "type": "string"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/media/poster/EncryptedPosterModels.kt",
          "line": 12
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "originalAttachmentId",
          "poster",
          "encryptedDescriptor"
        ],
        "additionalProperties": false
      },
      "VoicePublisherKeyClaims": {
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "format": "int32",
            "default": 2,
            "x-kotlin-default": "2"
          },
          "purpose": {
            "type": "string",
            "default": "voice-publisher-key",
            "x-kotlin-default": "\"voice-publisher-key\""
          },
          "sessionId": {
            "type": "integer",
            "format": "int64"
          },
          "publisher": {
            "$ref": "#/components/schemas/VoicePublisherBinding"
          },
          "keyGeneration": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "previousKeyGeneration": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "keyIndex": {
            "type": "integer",
            "format": "int32",
            "enum": [
              0
            ]
          },
          "transition": {
            "$ref": "#/components/schemas/VoicePublisherKeyTransition"
          },
          "rosterDigest": {
            "type": "string"
          },
          "ciphertext": {
            "type": "string"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/voice/crypto/VoicePublisherKeyModels.kt",
          "line": 65
        },
        "description": "Payload of the device-signed compact JWS envelope. ciphertext is recipient-qualified JWE for exactly the current certified roster; server never receives plaintext media keys.",
        "required": [
          "sessionId",
          "publisher",
          "keyGeneration",
          "previousKeyGeneration",
          "keyIndex",
          "transition",
          "rosterDigest",
          "ciphertext"
        ],
        "additionalProperties": false
      },
      "LessonAttendeeRecipient": {
        "type": "object",
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int64"
          },
          "attendanceId": {
            "type": "string"
          },
          "rootKeyThumbprint": {
            "type": "string",
            "nullable": true
          },
          "archiveKeyThumbprint": {
            "type": "string",
            "nullable": true
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/board/LessonKeyModels.kt",
          "line": 18
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "userId",
          "attendanceId"
        ],
        "additionalProperties": false
      },
      "VoicePublisherKeyMember": {
        "type": "object",
        "properties": {
          "publisher": {
            "$ref": "#/components/schemas/VoicePublisherBinding"
          },
          "identity": {
            "$ref": "#/components/schemas/E2eeIdentityResponse"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/voice/crypto/VoicePublisherKeyModels.kt",
          "line": 18
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "publisher",
          "identity"
        ],
        "additionalProperties": false
      },
      "VoicePublisherKeyHead": {
        "type": "object",
        "properties": {
          "publisher": {
            "$ref": "#/components/schemas/VoicePublisherBinding"
          },
          "keyGeneration": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          },
          "previousKeyGeneration": {
            "type": "integer",
            "format": "int64",
            "minimum": 0
          },
          "keyIndex": {
            "type": "integer",
            "format": "int32",
            "enum": [
              0
            ]
          },
          "transition": {
            "$ref": "#/components/schemas/VoicePublisherKeyTransition"
          },
          "rosterDigest": {
            "type": "string"
          },
          "envelope": {
            "type": "string"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/voice/crypto/VoicePublisherKeyModels.kt",
          "line": 27
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "publisher",
          "keyGeneration",
          "previousKeyGeneration",
          "keyIndex",
          "transition",
          "rosterDigest",
          "envelope"
        ],
        "additionalProperties": false
      },
      "ClassroomAttendanceResponse": {
        "type": "object",
        "properties": {
          "leaseId": {
            "type": "integer",
            "format": "int64"
          },
          "leaseGeneration": {
            "type": "integer",
            "format": "int32"
          },
          "recipient": {
            "$ref": "#/components/schemas/LessonAttendeeRecipient"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/classroom/ClassroomAdmissionService.kt",
          "line": 31
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "leaseId",
          "leaseGeneration",
          "recipient"
        ],
        "additionalProperties": false
      },
      "CreateChatNewsRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "shortDescription": {
            "type": "string"
          },
          "fullDescription": {
            "type": "string"
          },
          "imageUploadIds": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "default": [],
            "x-kotlin-default": "emptyList()"
          },
          "clientOperationId": {
            "type": "string",
            "nullable": true,
            "x-kotlin-default": "null",
            "minLength": 8,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,63}$",
            "description": "Stable operation identity for exact retries. Required for ordinary SERVER_MANAGED_1 card creation; the wire DTO retains its nullable legacy default. Reuse the same identity and unchanged request after an uncertain result; changed content returns CONTENT_OPERATION_CONFLICT."
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/chat/ChatCardDtos.kt",
          "line": 200
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "title",
          "shortDescription",
          "fullDescription"
        ],
        "additionalProperties": false
      },
      "CreateChatEventRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "fullDescription": {
            "type": "string",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "location": {
            "type": "string",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "startsAt": {
            "type": "string"
          },
          "endsAt": {
            "type": "string",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "headerImageUploadId": {
            "type": "string",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "privateForChannel": {
            "type": "boolean",
            "default": false,
            "x-kotlin-default": "false"
          },
          "clientOperationId": {
            "type": "string",
            "nullable": true,
            "x-kotlin-default": "null",
            "minLength": 8,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]{7,63}$",
            "description": "Stable operation identity for exact retries. Required for ordinary SERVER_MANAGED_1 card creation; the wire DTO retains its nullable legacy default. Reuse the same identity and unchanged request after an uncertain result; changed content returns CONTENT_OPERATION_CONFLICT."
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/chat/ChatCardDtos.kt",
          "line": 12
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "title",
          "startsAt"
        ],
        "additionalProperties": false
      },
      "PutSecurePublicChatCardRequest": {
        "type": "object",
        "properties": {
          "cardId": {
            "type": "integer",
            "format": "int64",
            "minimum": 4611686018427387904,
            "maximum": 9223372036854775807
          },
          "news": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CreateChatNewsRequest"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "x-kotlin-default": "null"
          },
          "event": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/CreateChatEventRequest"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "x-kotlin-default": "null"
          },
          "application": {
            "$ref": "#/components/schemas/SubmitSecureApplicationRequest"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/e2ee/SecurePublicChatCardDtos.kt",
          "line": 10
        },
        "description": "Exactly one of news or event, with the exact retained MLS application. Public event must have privateForChannel=false. Preserve cardId and ciphertext after a lost acknowledgement.",
        "required": [
          "cardId",
          "application"
        ],
        "additionalProperties": false
      },
      "SecurePublicChatCardResponse": {
        "type": "object",
        "properties": {
          "news": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChatNewsResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "x-kotlin-default": "null"
          },
          "event": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ChatEventResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "x-kotlin-default": "null"
          },
          "application": {
            "$ref": "#/components/schemas/SecureApplicationResponse"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/e2ee/SecurePublicChatCardDtos.kt",
          "line": 17
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "application"
        ],
        "additionalProperties": false
      },
      "DirectConversationResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "participantUserId": {
            "type": "integer",
            "format": "int64"
          },
          "participantUserIdentifier": {
            "type": "string"
          },
          "participantDisplayName": {
            "type": "string"
          },
          "participantAvatarUrl": {
            "type": "string",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "participantOnline": {
            "type": "boolean"
          },
          "relationStatus": {
            "$ref": "#/components/schemas/DirectFriendRelationStatus"
          },
          "activeFriendRequestId": {
            "type": "integer",
            "format": "int64",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "canSendMessages": {
            "type": "boolean"
          },
          "lastMessagePreview": {
            "type": "string",
            "nullable": true
          },
          "lastMessage": {
            "anyOf": [
              {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DirectMessageResponse"
                  }
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "x-kotlin-default": "null"
          },
          "participantIsBot": {
            "type": "boolean",
            "default": false,
            "x-kotlin-default": "false"
          },
          "lastCallAt": {
            "type": "string",
            "nullable": true,
            "x-kotlin-default": "null",
            "format": "date-time",
            "description": "Start of the latest persisted incoming or outgoing DIRECT audio/video call attempt; absent/null when no call is known. Text activity never changes it."
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/dm/DmDtos.kt",
          "line": 25
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "id",
          "participantUserId",
          "participantUserIdentifier",
          "participantDisplayName",
          "participantOnline",
          "relationStatus",
          "canSendMessages"
        ],
        "additionalProperties": false
      },
      "DirectConversationListPageResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DirectConversationResponse"
            }
          },
          "nextCursor": {
            "type": "string",
            "nullable": true,
            "x-kotlin-default": "null"
          },
          "hasMore": {
            "type": "boolean"
          },
          "order": {
            "allOf": [
              {
                "$ref": "#/components/schemas/DirectConversationOrder"
              }
            ],
            "x-kotlin-default": "DirectConversationOrder.ACTIVITY"
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/dm/DmDtos.kt",
          "line": 46
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "items",
          "hasMore"
        ],
        "additionalProperties": false
      },
      "DirectFriendRelationStatus": {
        "type": "string",
        "enum": [
          "NONE",
          "OUTGOING_REQUEST",
          "INCOMING_REQUEST",
          "FRIENDS",
          "BLOCKED_BY_ME",
          "BLOCKED_BY_OTHER"
        ],
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/dm/DmDtos.kt",
          "line": 15
        }
      },
      "DirectConversationOrder": {
        "type": "string",
        "enum": [
          "ACTIVITY",
          "LAST_CALL"
        ],
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/dm/DmDtos.kt",
          "line": 43
        }
      },
      "ReserveManagedRecordingCardRequest": {
        "type": "object",
        "properties": {
          "clientMessageId": {
            "type": "string"
          },
          "managedBody": {
            "type": "object",
            "additionalProperties": true,
            "description": "Explicit kotlinx.serialization JsonObject wire value; see the operation-specific content rules."
          },
          "attachmentUploadIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "x-source": {
          "path": "src/main/kotlin/com/xchat/server/e2ee/SecureConversationDtos.kt",
          "line": 174
        },
        "description": "Default-valued and null response fields may be omitted by the production JSON serializer.",
        "required": [
          "clientMessageId",
          "managedBody",
          "attachmentUploadIds"
        ],
        "additionalProperties": false
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid request or unsupported Web session mode.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Authentication is missing or invalid.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "NotFound": {
        "description": "The requested resource was not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Conflict": {
        "description": "Identity conflict, changed media permissions, device ownership conflict, or a stale roster cursor that requires restarting pagination.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "PayloadTooLarge": {
        "description": "The request or bounded upstream payload is too large.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "The public resource is not a supported HTML page or image.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "BadGateway": {
        "description": "The public provider or link origin returned an invalid response.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "GatewayTimeout": {
        "description": "The bounded public provider or link-origin read timed out.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "The operation rate limit or the per-user realtime ticket limit was reached. The Ktor route limiter may return an empty body; clients must not require ErrorResponse for 429."
      },
      "ServiceUnavailable": {
        "description": "A bounded database, media, or realtime capacity prevented the operation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Unexpected server failure.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Current membership, channel access or device ownership does not permit this operation.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "UpgradeRequired": {
        "description": "Voice ownership protocol or immutable identity missing. Update the client; no mutation is applied.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    }
  }
}
