{
  "openapi": "3.1.0",
  "info": {
    "title": "AgentOS API",
    "version": "contract-r1-v2",
    "description": "Публичный REST-контракт кабинета AgentOS. Документация: https://aos.edgelab.space/docs. MCP: https://aos.edgelab.space/mcp."
  },
  "servers": [
    {
      "url": "https://aos.edgelab.space",
      "description": "production"
    }
  ],
  "tags": [
    {
      "name": "ops"
    },
    {
      "name": "auth"
    },
    {
      "name": "keys"
    },
    {
      "name": "me"
    },
    {
      "name": "onboarding"
    },
    {
      "name": "plan"
    },
    {
      "name": "content"
    },
    {
      "name": "progress"
    },
    {
      "name": "dictation"
    },
    {
      "name": "tutor"
    },
    {
      "name": "mentoring"
    }
  ],
  "paths": {
    "/api/v1/auth/link/inspect": {
      "post": {
        "operationId": "authLinkInspect",
        "tags": [
          "auth"
        ],
        "summary": "Read-only: who this bot link logs in as",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkIdentity"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: VALIDATION_FAILED, LINK_INVALID, ORIGIN_REJECTED, RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [],
        "x-credentials": [
          "none"
        ]
      }
    },
    "/api/v1/auth/link/redeem": {
      "post": {
        "operationId": "authLinkRedeem",
        "tags": [
          "auth"
        ],
        "summary": "Consume the bot link once and start a web session (Set-Cookie __Host-aos_sess)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK (sets or clears a cookie)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: VALIDATION_FAILED, ORIGIN_REJECTED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, LINK_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [],
        "x-credentials": [
          "none"
        ]
      }
    },
    "/api/v1/auth/logout": {
      "post": {
        "operationId": "authLogout",
        "tags": [
          "auth"
        ],
        "summary": "Revoke the presented credential (cookie or TMA token)",
        "responses": {
          "204": {
            "description": "OK (sets or clears a cookie)"
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, ORIGIN_REJECTED, CREDENTIAL_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/auth/oidc": {
      "post": {
        "operationId": "authOidc",
        "tags": [
          "auth"
        ],
        "summary": "Finish Telegram Login: code + state → web session; NOT_FOUND while desktop login is disabled",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OidcCallbackRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK (sets or clears a cookie)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: VALIDATION_FAILED, ORIGIN_REJECTED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, LOGIN_STATE_INVALID, LOGIN_INVALID, METHOD_NOT_ALLOWED, NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [],
        "x-credentials": [
          "none"
        ]
      }
    },
    "/api/v1/auth/oidc/start": {
      "post": {
        "operationId": "authOidcStart",
        "tags": [
          "auth"
        ],
        "summary": "Start Telegram Login (OIDC): state cookie + authorization URL; NOT_FOUND while desktop login is disabled",
        "responses": {
          "200": {
            "description": "OK (sets or clears a cookie)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OidcStartResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: ORIGIN_REJECTED, RATE_LIMITED, NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [],
        "x-credentials": [
          "none"
        ]
      }
    },
    "/api/v1/auth/password": {
      "get": {
        "operationId": "authPasswordStatus",
        "tags": [
          "auth"
        ],
        "summary": "Login email and whether a password is set",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasswordStatus"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/auth/password/change": {
      "post": {
        "operationId": "authPasswordChange",
        "tags": [
          "auth"
        ],
        "summary": "Change the password (current one re-checked); other sessions revoked; NOT_FOUND when none is set",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordChangeRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "OK"
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, LOGIN_INVALID, NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/auth/password/forgot": {
      "post": {
        "operationId": "authPasswordForgot",
        "tags": [
          "auth"
        ],
        "summary": "Email a one-time reset link if the address has an account; always 204 (no enumeration); NOT_FOUND while mail is disabled",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordForgotRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "OK"
          },
          "default": {
            "description": "Error; codes: VALIDATION_FAILED, ORIGIN_REJECTED, RATE_LIMITED, NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [],
        "x-credentials": [
          "none"
        ]
      }
    },
    "/api/v1/auth/password/login": {
      "post": {
        "operationId": "authPasswordLogin",
        "tags": [
          "auth"
        ],
        "summary": "Email + password → web session (Set-Cookie __Host-aos_sess); LOGIN_INVALID for any wrong pair",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordLoginRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK (sets or clears a cookie)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: VALIDATION_FAILED, ORIGIN_REJECTED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, LOGIN_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [],
        "x-credentials": [
          "none"
        ]
      }
    },
    "/api/v1/auth/password/reset": {
      "post": {
        "operationId": "authPasswordReset",
        "tags": [
          "auth"
        ],
        "summary": "Redeem a set/reset link once: new password, every session revoked",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordResetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasswordResetResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: VALIDATION_FAILED, ORIGIN_REJECTED, RATE_LIMITED, LINK_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [],
        "x-credentials": [
          "none"
        ]
      }
    },
    "/api/v1/auth/password/setup": {
      "post": {
        "operationId": "authPasswordSetup",
        "tags": [
          "auth"
        ],
        "summary": "Email a set-password link to an address (verified on redeem); 204. Needs fresh Telegram auth (bot link / desktop login or Mini App initData within 10 min; a TMA refresh does not renew it) or, once a password is set, the right currentPassword (LOGIN_INVALID); without a password and without fresh Telegram auth REAUTH_REQUIRED; VERSION_CONFLICT when the password changed meanwhile; UNAUTHENTICATED when a revoke-all landed meanwhile (revoke-all also voids open set-password links); NOT_FOUND while mail is disabled. With orderEmail: true the link goes to the full address behind PasswordStatus.orderEmailMasked, resolved server-side from the paid order (never returned); NOT_FOUND when there is none any more, ENTITLEMENT_UNAVAILABLE when it cannot be resolved now",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordSetupRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "OK"
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, LOGIN_INVALID, REAUTH_REQUIRED, VERSION_CONFLICT, NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/auth/sessions": {
      "get": {
        "operationId": "authSessions",
        "tags": [
          "auth"
        ],
        "summary": "List the student's sessions (web session only)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionList"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, CREDENTIAL_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-credentials": [
          "session"
        ]
      }
    },
    "/api/v1/auth/sessions/revoke-all": {
      "post": {
        "operationId": "authSessionsRevokeAll",
        "tags": [
          "auth"
        ],
        "summary": "Revoke every session and TMA token (web session with fresh auth)",
        "responses": {
          "200": {
            "description": "OK (sets or clears a cookie)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RevokeAllResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, CREDENTIAL_NOT_ALLOWED, REAUTH_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-fresh-auth": true,
        "x-credentials": [
          "session"
        ]
      }
    },
    "/api/v1/auth/tma": {
      "post": {
        "operationId": "authTma",
        "tags": [
          "auth"
        ],
        "summary": "Exchange Mini App initData for a 15-min TMA token",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TmaExchangeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmaExchangeResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: VALIDATION_FAILED, ORIGIN_REJECTED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, LOGIN_INVALID",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [],
        "x-credentials": [
          "none"
        ]
      }
    },
    "/api/v1/auth/tma/refresh": {
      "post": {
        "operationId": "authTmaRefresh",
        "tags": [
          "auth"
        ],
        "summary": "Slide the TMA token (≤ 12 h absolute)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TmaToken"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, CREDENTIAL_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "tma"
        ]
      }
    },
    "/api/v1/efirs": {
      "get": {
        "operationId": "efirs",
        "tags": [
          "content"
        ],
        "summary": "Efirs (always open)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EfirList"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "course:read"
            ]
          }
        ],
        "x-agent-key-scope": "course:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/files": {
      "post": {
        "operationId": "filesUpload",
        "tags": [
          "tutor"
        ],
        "summary": "Upload one file for a tutor message: the raw bytes as the body (≤ 10 MB; PNG, JPEG, WebP, PDF, .txt, .md), the name in `name`. The type is sniffed from the bytes; a declared Content-Type that disagrees, an unsupported file, a PDF over 20 pages, an image over 3.75 MB, 4096 px a side or 7.45 MP are refused (VALIDATION_FAILED). 20 uploads per Moscow day (DAILY_LIMIT), 200 MB of unattached files plus files of the last 30 days (STORAGE_LIMIT); a PDF while the parser is busy → RATE_LIMITED with Retry-After (not counted against the day). Attach it within 55 minutes; an unattached upload is deleted after an hour",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "image/png": {
              "schema": {
                "type": "string",
                "contentMediaType": "image/png"
              }
            },
            "image/jpeg": {
              "schema": {
                "type": "string",
                "contentMediaType": "image/jpeg"
              }
            },
            "image/webp": {
              "schema": {
                "type": "string",
                "contentMediaType": "image/webp"
              }
            },
            "application/pdf": {
              "schema": {
                "type": "string",
                "contentMediaType": "application/pdf"
              }
            },
            "text/plain": {
              "schema": {
                "type": "string",
                "contentMediaType": "text/plain"
              }
            },
            "text/markdown": {
              "schema": {
                "type": "string",
                "contentMediaType": "text/markdown"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, DAILY_LIMIT, STORAGE_LIMIT, RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/files/{id}": {
      "get": {
        "operationId": "filesGet",
        "tags": [
          "tutor"
        ],
        "summary": "Download the student's own file (Content-Disposition: attachment, never rendered inline); NOT_FOUND for any id that is not a ready upload of this student",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "image/png": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "image/png"
                }
              },
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "image/jpeg"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "image/webp"
                }
              },
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "application/pdf"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "text/plain"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "text/markdown"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not Modified (If-None-Match matched the ETag)"
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      },
      "delete": {
        "operationId": "filesDelete",
        "tags": [
          "tutor"
        ],
        "summary": "Remove an upload that is not attached to a message yet (the composer's «×»); NOT_FOUND when it is not the student's, already attached or gone",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "OK"
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/keys": {
      "get": {
        "operationId": "keysList",
        "tags": [
          "keys"
        ],
        "summary": "The student's agent key history (active, revoked, expired), active first, then newest first, at most 50: prefix, name, scopes, expiry, revocation, last use (never the secret)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyList"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, CREDENTIAL_NOT_ALLOWED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-credentials": [
          "session"
        ]
      },
      "post": {
        "operationId": "keysCreate",
        "tags": [
          "keys"
        ],
        "summary": "Create an agent key (90 days; at most 3 active, 10 creations per Moscow day); the secret is in this response only",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyCreateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreated"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, CREDENTIAL_NOT_ALLOWED, REAUTH_REQUIRED, KEY_LIMIT, KEY_RATE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-fresh-auth": true,
        "x-credentials": [
          "session"
        ]
      }
    },
    "/api/v1/keys/calls": {
      "get": {
        "operationId": "keysCalls",
        "tags": [
          "keys"
        ],
        "summary": "«Последние вызовы»: the last 20 calls per key (route or tool, target, status, latency, client); arguments are never stored",
        "parameters": [
          {
            "name": "keyId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiCallList"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, CREDENTIAL_NOT_ALLOWED, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-credentials": [
          "session"
        ]
      }
    },
    "/api/v1/keys/{id}": {
      "delete": {
        "operationId": "keysRevoke",
        "tags": [
          "keys"
        ],
        "summary": "Revoke a key; it is refused (401) from the next call on",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "OK"
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, CREDENTIAL_NOT_ALLOWED, REAUTH_REQUIRED, NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-fresh-auth": true,
        "x-credentials": [
          "session"
        ]
      }
    },
    "/api/v1/keys/{id}/rotate": {
      "post": {
        "operationId": "keysRotate",
        "tags": [
          "keys"
        ],
        "summary": "Replace a live key by a new one with the same name and scopes (the old one is revoked in the same transaction); the new secret is in this response only",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyCreated"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, CREDENTIAL_NOT_ALLOWED, REAUTH_REQUIRED, NOT_FOUND, KEY_LIMIT, KEY_RATE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "x-fresh-auth": true,
        "x-credentials": [
          "session"
        ]
      }
    },
    "/api/v1/lessons": {
      "get": {
        "operationId": "lessons",
        "tags": [
          "content"
        ],
        "summary": "Flat lesson list",
        "parameters": [
          {
            "name": "sectionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "lesson",
                "tech",
                "stream"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LessonList"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "course:read"
            ]
          }
        ],
        "x-agent-key-scope": "course:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/lessons/{id}": {
      "get": {
        "operationId": "lessonGet",
        "tags": [
          "content"
        ],
        "summary": "Lesson with video, konspekt, timecodes, prompts, links",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/LessonCode"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LessonDetail"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, NOT_FOUND, ONBOARDING_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "course:read"
            ]
          }
        ],
        "x-agent-key-scope": "course:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/lessons/{id}/transcript": {
      "get": {
        "operationId": "lessonTranscript",
        "tags": [
          "content"
        ],
        "summary": "Transcript segments with second offsets",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/LessonCode"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transcript"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, NOT_FOUND, ONBOARDING_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "course:read"
            ]
          }
        ],
        "x-agent-key-scope": "course:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/me": {
      "get": {
        "operationId": "me",
        "tags": [
          "me"
        ],
        "summary": "Current student, tier, access, onboarding state, limits",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "course:read"
            ]
          }
        ],
        "x-agent-key-scope": "course:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/me/avatar": {
      "get": {
        "operationId": "meAvatar",
        "tags": [
          "me"
        ],
        "summary": "The student's own cached Telegram profile photo (image bytes, ETag, private cache 24 h; 304 on If-None-Match); NOT_FOUND when there is none (show initials)",
        "parameters": [
          {
            "name": "v",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "image/jpeg": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "image/jpeg"
                }
              },
              "image/webp": {
                "schema": {
                  "type": "string",
                  "contentMediaType": "image/webp"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not Modified (If-None-Match matched the ETag)"
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/mentoring/chat/digests": {
      "get": {
        "operationId": "mentoringDigests",
        "tags": [
          "mentoring"
        ],
        "summary": "Read your published mentoring digests",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MentoringDigests"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, CREDENTIAL_NOT_ALLOWED, INSUFFICIENT_SCOPE, MENTORING_NOT_AVAILABLE, NOT_FOUND, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "mentoring:read"
            ]
          }
        ],
        "x-agent-key-scope": "mentoring:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/mentoring/chat/messages": {
      "get": {
        "operationId": "mentoringMessages",
        "tags": [
          "mentoring"
        ],
        "summary": "Read your published mentoring messages",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MentoringMessages"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, CREDENTIAL_NOT_ALLOWED, INSUFFICIENT_SCOPE, MENTORING_NOT_AVAILABLE, NOT_FOUND, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "mentoring:read"
            ]
          }
        ],
        "x-agent-key-scope": "mentoring:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/mentoring/decisions": {
      "get": {
        "operationId": "mentoringDecisions",
        "tags": [
          "mentoring"
        ],
        "summary": "Read your published mentoring decisions",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "proposed",
                "unconfirmed",
                "confirmed",
                "superseded",
                "cancelled"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MentoringDecisions"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, CREDENTIAL_NOT_ALLOWED, INSUFFICIENT_SCOPE, MENTORING_NOT_AVAILABLE, NOT_FOUND, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "mentoring:read"
            ]
          }
        ],
        "x-agent-key-scope": "mentoring:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/mentoring/homework": {
      "get": {
        "operationId": "mentoringHomework",
        "tags": [
          "mentoring"
        ],
        "summary": "Read your published mentoring homework",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "sessionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "in_progress",
                "done",
                "cancelled"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MentoringStudentHomework"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, CREDENTIAL_NOT_ALLOWED, INSUFFICIENT_SCOPE, MENTORING_NOT_AVAILABLE, NOT_FOUND, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "mentoring:read"
            ]
          }
        ],
        "x-agent-key-scope": "mentoring:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/mentoring/sessions": {
      "get": {
        "operationId": "mentoringSessions",
        "tags": [
          "mentoring"
        ],
        "summary": "Read your published mentoring sessions",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MentoringSessions"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, CREDENTIAL_NOT_ALLOWED, INSUFFICIENT_SCOPE, MENTORING_NOT_AVAILABLE, NOT_FOUND, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "mentoring:read"
            ]
          }
        ],
        "x-agent-key-scope": "mentoring:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/mentoring/sessions/{sessionId}": {
      "get": {
        "operationId": "mentoringSession",
        "tags": [
          "mentoring"
        ],
        "summary": "Read your published mentoring session",
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          },
          {
            "name": "view",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "summary",
                "transcript"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MentoringSessionRead"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, CREDENTIAL_NOT_ALLOWED, INSUFFICIENT_SCOPE, MENTORING_NOT_AVAILABLE, NOT_FOUND, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "mentoring:read"
            ]
          }
        ],
        "x-agent-key-scope": "mentoring:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/mentoring/track": {
      "get": {
        "operationId": "mentoringTrack",
        "tags": [
          "mentoring"
        ],
        "summary": "Read your published mentoring track",
        "parameters": [
          {
            "name": "versionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MentoringPersonalTrack"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, CREDENTIAL_NOT_ALLOWED, INSUFFICIENT_SCOPE, MENTORING_NOT_AVAILABLE, NOT_FOUND, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "mentoring:read"
            ]
          }
        ],
        "x-agent-key-scope": "mentoring:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/mentoring/track/versions": {
      "get": {
        "operationId": "mentoringVersions",
        "tags": [
          "mentoring"
        ],
        "summary": "Read your published mentoring versions",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2048,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MentoringVersions"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, CREDENTIAL_NOT_ALLOWED, INSUFFICIENT_SCOPE, MENTORING_NOT_AVAILABLE, NOT_FOUND, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "mentoring:read"
            ]
          }
        ],
        "x-agent-key-scope": "mentoring:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/next": {
      "get": {
        "operationId": "next",
        "tags": [
          "content"
        ],
        "summary": "What to watch next",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextLesson"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "course:read"
            ]
          }
        ],
        "x-agent-key-scope": "course:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/onboarding": {
      "get": {
        "operationId": "onboardingGet",
        "tags": [
          "onboarding"
        ],
        "summary": "Saved intake answers and step",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Onboarding"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "profile:read"
            ]
          }
        ],
        "x-agent-key-scope": "profile:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      },
      "patch": {
        "operationId": "onboardingPatch",
        "tags": [
          "onboarding"
        ],
        "summary": "Save a step (resumable); allowed only while status = draft",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingPatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Onboarding"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/onboarding/setup": {
      "put": {
        "operationId": "onboardingSetup",
        "tags": [
          "onboarding"
        ],
        "summary": "Change the chosen setup (answers.setup) in any onboarding status",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OnboardingSetupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Onboarding"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/onboarding/submit": {
      "post": {
        "operationId": "onboardingSubmit",
        "tags": [
          "onboarding"
        ],
        "summary": "Submit: validates the required answers (schema v2: setup and socials optional, «Другое» needs its text), unlocks lessons, status → in_review",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Onboarding"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, ONBOARDING_INCOMPLETE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/plan": {
      "get": {
        "operationId": "planGet",
        "tags": [
          "plan"
        ],
        "summary": "«Мой план»: the published plan or the status",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "profile:read"
            ]
          }
        ],
        "x-agent-key-scope": "profile:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/plan/milestones": {
      "put": {
        "operationId": "planMilestonesPut",
        "tags": [
          "plan"
        ],
        "summary": "Replace the set of ticked plan milestones; returns Progress",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanMilestonesUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Progress"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, NOT_FOUND, VERSION_CONFLICT",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "progress:write"
            ]
          }
        ],
        "x-agent-key-scope": "progress:write",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/progress": {
      "get": {
        "operationId": "progressGet",
        "tags": [
          "progress"
        ],
        "summary": "Completed lessons, positions, homework, ticked plan milestones",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Progress"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "course:read"
            ]
          }
        ],
        "x-agent-key-scope": "course:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      },
      "put": {
        "operationId": "progressPut",
        "tags": [
          "progress"
        ],
        "summary": "Save position / mark complete / save homework for one lesson",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProgressUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Progress"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, NOT_FOUND, ONBOARDING_REQUIRED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "progress:write"
            ]
          }
        ],
        "x-agent-key-scope": "progress:write",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/search": {
      "get": {
        "operationId": "search",
        "tags": [
          "content"
        ],
        "summary": "Full-text search over lessons and transcripts (gating applied)",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResults"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "course:read"
            ]
          }
        ],
        "x-agent-key-scope": "course:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/sections": {
      "get": {
        "operationId": "sections",
        "tags": [
          "content"
        ],
        "summary": "Course map: sections with lesson cards (locked flags per student)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SectionList"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          },
          {
            "agentKey": [
              "course:read"
            ]
          }
        ],
        "x-agent-key-scope": "course:read",
        "x-credentials": [
          "session",
          "tma",
          "agentKey"
        ]
      }
    },
    "/api/v1/transcribe": {
      "post": {
        "operationId": "transcribe",
        "tags": [
          "dictation"
        ],
        "summary": "Speech to text for a free-text field: the raw audio clip (≤ 120 s, ≤ 2 MB, WebM/Ogg/MP4) → Russian text for the caller only; audio is never stored. One clip at a time per student (BUSY), a daily allowance in seconds per Moscow day (DAILY_LIMIT); DICTATION_UNAVAILABLE when not configured or the provider failed",
        "requestBody": {
          "required": true,
          "content": {
            "audio/webm": {
              "schema": {
                "type": "string",
                "contentMediaType": "audio/webm"
              }
            },
            "audio/ogg": {
              "schema": {
                "type": "string",
                "contentMediaType": "audio/ogg"
              }
            },
            "audio/mp4": {
              "schema": {
                "type": "string",
                "contentMediaType": "audio/mp4"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TranscribeResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, BUSY, DAILY_LIMIT, DICTATION_UNAVAILABLE",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/tutor/facts": {
      "get": {
        "operationId": "tutorFacts",
        "tags": [
          "tutor"
        ],
        "summary": "What the tutor remembers about the student («Тьютор знает · N»)",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TutorFacts"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/tutor/facts/{id}": {
      "delete": {
        "operationId": "tutorFactDelete",
        "tags": [
          "tutor"
        ],
        "summary": "Forget one fact for good; NOT_FOUND when it is not the student's or already gone",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "OK"
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/api/v1/tutor/messages": {
      "get": {
        "operationId": "tutorMessages",
        "tags": [
          "tutor"
        ],
        "summary": "The student's tutor thread, newest page first (cursor `before`), messages oldest first within a page",
        "parameters": [
          {
            "name": "before",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TutorMessagesPage"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, VALIDATION_FAILED",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      },
      "post": {
        "operationId": "tutorSend",
        "tags": [
          "tutor"
        ],
        "summary": "Ask the tutor: stores the message and returns the whole reply. Idempotent by requestId. One run at a time per student (BUSY); DAILY_LIMIT when today's messages or USD are used up (Moscow day), GLOBAL_BUDGET when the day's tutor budget is used up (UTC day); TUTOR_UNAVAILABLE when switched off or the model failed. `attachments`: up to 4 of the student's own unattached uploads (NOT_FOUND otherwise); images of one message ≤ 10k model tokens in total, and a message that cannot fit the tutor's context even without history (VALIDATION_FAILED)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TutorSendRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TutorSendResponse"
                }
              }
            }
          },
          "default": {
            "description": "Error; codes: UNAUTHENTICATED, NO_ENTITLEMENT, ENTITLEMENT_UNAVAILABLE, RATE_LIMITED, ORIGIN_REJECTED, VALIDATION_FAILED, BUSY, DAILY_LIMIT, GLOBAL_BUDGET, TUTOR_UNAVAILABLE, NOT_FOUND",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "session": []
          },
          {
            "tmaToken": []
          }
        ],
        "x-credentials": [
          "session",
          "tma"
        ]
      }
    },
    "/healthz": {
      "get": {
        "operationId": "healthz",
        "tags": [
          "ops"
        ],
        "summary": "Liveness + deployed git SHA",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        },
        "security": [],
        "x-credentials": [
          "none"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ApiCall": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "keyId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "surface": {
            "type": "string",
            "enum": [
              "rest",
              "mcp"
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "target": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "latencyMs": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "client": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "id",
          "keyId",
          "surface",
          "name",
          "target",
          "status",
          "latencyMs",
          "client",
          "at"
        ],
        "additionalProperties": false
      },
      "ApiCallList": {
        "type": "object",
        "properties": {
          "calls": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiCall"
            }
          }
        },
        "required": [
          "calls"
        ],
        "additionalProperties": false
      },
      "ApiKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "prefix": {
            "type": "string",
            "pattern": "^aos3\\.sk_[A-Za-z0-9_-]{6}$"
          },
          "scopes": {
            "minItems": 1,
            "maxItems": 5,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyScope"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "lastUsedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "revokedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "status": {
            "$ref": "#/components/schemas/ApiKeyStatus"
          }
        },
        "required": [
          "id",
          "name",
          "prefix",
          "scopes",
          "createdAt",
          "expiresAt",
          "lastUsedAt",
          "revokedAt",
          "status"
        ],
        "additionalProperties": false
      },
      "ApiKeyCreateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[^\\p{C}\\p{Zl}\\p{Zp}]+$"
          },
          "scopes": {
            "minItems": 1,
            "maxItems": 5,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyScope"
            }
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "ApiKeyCreated": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/ApiKey"
          },
          "secret": {
            "type": "string",
            "pattern": "^aos3\\.sk_[A-Za-z0-9_-]{43}$"
          }
        },
        "required": [
          "key",
          "secret"
        ],
        "additionalProperties": false
      },
      "ApiKeyList": {
        "type": "object",
        "properties": {
          "keys": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKey"
            }
          }
        },
        "required": [
          "keys"
        ],
        "additionalProperties": false
      },
      "ApiKeyStatus": {
        "type": "string",
        "enum": [
          "active",
          "expired",
          "revoked"
        ]
      },
      "Attachment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "mime": {
            "type": "string",
            "enum": [
              "image/png",
              "image/jpeg",
              "image/webp",
              "application/pdf",
              "text/plain",
              "text/markdown"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "pdf",
              "text"
            ]
          },
          "size": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 10485760
          }
        },
        "required": [
          "id",
          "name",
          "mime",
          "kind",
          "size"
        ],
        "additionalProperties": false
      },
      "CatalogId": {
        "type": "string",
        "maxLength": 64,
        "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
      },
      "Citation": {
        "type": "object",
        "properties": {
          "source": {
            "type": "integer",
            "minimum": 0,
            "maximum": 19
          },
          "start": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "end": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "source",
          "start",
          "end"
        ],
        "additionalProperties": false
      },
      "Efir": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/LessonCode"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "day": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "upcoming": {
            "type": "boolean"
          },
          "startsAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "lessonId": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LessonCode"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "title",
          "day",
          "minutes",
          "upcoming",
          "startsAt",
          "lessonId"
        ],
        "additionalProperties": false
      },
      "EfirList": {
        "type": "object",
        "properties": {
          "efirs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Efir"
            }
          }
        },
        "required": [
          "efirs"
        ],
        "additionalProperties": false
      },
      "ErrorBody": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "$ref": "#/components/schemas/ErrorCode"
              },
              "message": {
                "type": "string",
                "minLength": 1,
                "maxLength": 500
              },
              "retryAfterSec": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "issues": {
                "maxItems": 50,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "path": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "path",
                    "message"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "code",
              "message"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false
      },
      "ErrorCode": {
        "type": "string",
        "enum": [
          "BAD_REQUEST",
          "VALIDATION_FAILED",
          "ONBOARDING_INCOMPLETE",
          "UNAUTHENTICATED",
          "LOGIN_INVALID",
          "LINK_INVALID",
          "REAUTH_REQUIRED",
          "CREDENTIAL_NOT_ALLOWED",
          "INSUFFICIENT_SCOPE",
          "ORIGIN_REJECTED",
          "LOGIN_STATE_INVALID",
          "NO_ENTITLEMENT",
          "MENTORING_NOT_AVAILABLE",
          "ONBOARDING_REQUIRED",
          "NOT_FOUND",
          "VERSION_CONFLICT",
          "BUSY",
          "METHOD_NOT_ALLOWED",
          "RATE_LIMITED",
          "DAILY_LIMIT",
          "GLOBAL_BUDGET",
          "KEY_LIMIT",
          "KEY_RATE",
          "STORAGE_LIMIT",
          "ENTITLEMENT_UNAVAILABLE",
          "DICTATION_UNAVAILABLE",
          "TUTOR_UNAVAILABLE",
          "INTERNAL"
        ]
      },
      "Health": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "ok"
          },
          "sha": {
            "type": "string",
            "pattern": "^[0-9a-f]{7,40}$"
          }
        },
        "required": [
          "status",
          "sha"
        ],
        "additionalProperties": false
      },
      "KeyScope": {
        "type": "string",
        "enum": [
          "course:read",
          "profile:read",
          "progress:write",
          "tutor:read",
          "mentoring:read"
        ]
      },
      "LessonCard": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/LessonCode"
          },
          "week": {
            "type": "integer",
            "minimum": 0,
            "maximum": 52
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 32
            }
          },
          "summary": {
            "type": "string"
          },
          "task": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/LessonKind"
          },
          "sectionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "gated": {
            "type": "boolean"
          },
          "locked": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "week",
          "title",
          "minutes",
          "tools",
          "summary",
          "task",
          "kind",
          "sectionId",
          "gated",
          "locked"
        ],
        "additionalProperties": false
      },
      "LessonCode": {
        "type": "string",
        "maxLength": 32,
        "pattern": "^[a-z0-9]+(\\.[a-z0-9]+)*$"
      },
      "LessonDeck": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "url": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 300,
                "pattern": "^\\/(?!\\/)[A-Za-z0-9._~/-]+$"
              },
              {
                "type": "string",
                "format": "uri"
              }
            ]
          }
        },
        "required": [
          "title",
          "url"
        ],
        "additionalProperties": false
      },
      "LessonDetail": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/LessonCode"
          },
          "week": {
            "type": "integer",
            "minimum": 0,
            "maximum": 52
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "minutes": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 32
            }
          },
          "summary": {
            "type": "string"
          },
          "task": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/LessonKind"
          },
          "sectionId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "gated": {
            "type": "boolean"
          },
          "locked": {
            "type": "boolean"
          },
          "video": {
            "$ref": "#/components/schemas/LessonVideo"
          },
          "konspekt": {
            "type": "string"
          },
          "timecodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Timecode"
            }
          },
          "prompts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LessonPrompt"
            }
          },
          "links": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LessonLink"
            }
          },
          "plan": {
            "maxItems": 30,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LessonPlanStep"
            }
          },
          "theory": {
            "maxItems": 30,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1000
            }
          },
          "deck": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LessonDeck"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "week",
          "title",
          "minutes",
          "tools",
          "summary",
          "task",
          "kind",
          "sectionId",
          "gated",
          "locked",
          "video",
          "konspekt",
          "timecodes",
          "prompts",
          "links",
          "plan",
          "theory",
          "deck"
        ],
        "additionalProperties": false
      },
      "LessonKind": {
        "type": "string",
        "enum": [
          "lesson",
          "tech",
          "stream"
        ]
      },
      "LessonLink": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "title",
          "url",
          "description"
        ],
        "additionalProperties": false
      },
      "LessonList": {
        "type": "object",
        "properties": {
          "lessons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LessonCard"
            }
          }
        },
        "required": [
          "lessons"
        ],
        "additionalProperties": false
      },
      "LessonPlanStep": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 300
          },
          "body": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "title",
          "body"
        ],
        "additionalProperties": false
      },
      "LessonPrompt": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 4000
          }
        },
        "required": [
          "title",
          "text"
        ],
        "additionalProperties": false
      },
      "LessonSource": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "lesson": {
            "$ref": "#/components/schemas/LessonCode"
          },
          "seconds": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "kind": {
            "type": "string",
            "const": "lesson"
          }
        },
        "required": [
          "label",
          "lesson",
          "seconds",
          "kind"
        ],
        "additionalProperties": false
      },
      "LessonVideo": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32
          },
          "url": {
            "anyOf": [
              {
                "type": "string",
                "format": "uri"
              },
              {
                "type": "null"
              }
            ]
          },
          "durationSec": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "provider",
          "url",
          "durationSec"
        ],
        "additionalProperties": false
      },
      "LinkIdentity": {
        "type": "object",
        "properties": {
          "target": {
            "type": "object",
            "properties": {
              "displayName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 128
              },
              "username": {
                "anyOf": [
                  {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_]{4,32}$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "avatar": {
                "anyOf": [
                  {
                    "type": "string",
                    "maxLength": 87407,
                    "pattern": "^data:image\\/(jpeg|webp);base64,(?:[A-Za-z0-9+/]{4})+(?:[A-Za-z0-9+/][AQgw]==|[A-Za-z0-9+/]{2}[AEIMQUYcgkosw048]=)?$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "displayName",
              "username",
              "avatar"
            ],
            "additionalProperties": false
          },
          "current": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "displayName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "username": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_]{4,32}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "displayName",
                  "username"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "target",
          "current",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "LinkTokenRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          }
        },
        "required": [
          "token"
        ],
        "additionalProperties": false
      },
      "MaterialSource": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "material"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "id": {
            "$ref": "#/components/schemas/CatalogId"
          }
        },
        "required": [
          "kind",
          "label",
          "id"
        ],
        "additionalProperties": false
      },
      "Me": {
        "type": "object",
        "properties": {
          "student": {
            "$ref": "#/components/schemas/Student"
          },
          "flow": {
            "type": "string",
            "const": "agentos3"
          },
          "tier": {
            "$ref": "#/components/schemas/Tier"
          },
          "mentoring": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MentoringKind"
              },
              {
                "type": "null"
              }
            ]
          },
          "offer": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Offer"
              },
              {
                "type": "null"
              }
            ]
          },
          "access": {
            "type": "object",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "active",
                  "grace"
                ]
              },
              "checkedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              }
            },
            "required": [
              "state",
              "checkedAt"
            ],
            "additionalProperties": false
          },
          "onboarding": {
            "type": "object",
            "properties": {
              "status": {
                "$ref": "#/components/schemas/OnboardingStatus"
              },
              "done": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "done"
            ],
            "additionalProperties": false
          },
          "planReady": {
            "type": "boolean"
          },
          "authKind": {
            "type": "string",
            "enum": [
              "cookie",
              "tma"
            ]
          },
          "features": {
            "type": "object",
            "properties": {
              "tutor": {
                "type": "boolean"
              },
              "agentKeys": {
                "type": "boolean"
              },
              "dictation": {
                "type": "boolean"
              }
            },
            "required": [
              "tutor",
              "agentKeys",
              "dictation"
            ],
            "additionalProperties": false
          },
          "limits": {
            "type": "object",
            "properties": {
              "tutorMessagesPerDay": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "tutorUsdPerDay": {
                "type": "number",
                "minimum": 0
              }
            },
            "required": [
              "tutorMessagesPerDay",
              "tutorUsdPerDay"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "student",
          "flow",
          "tier",
          "access",
          "onboarding",
          "planReady",
          "authKind",
          "features",
          "limits"
        ],
        "additionalProperties": false
      },
      "MentoringCoverage": {
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "gaps": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "from": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "to": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "before_collection",
                    "stopped",
                    "unavailable_voice",
                    "sync_error",
                    "redacted"
                  ]
                }
              },
              "required": [
                "from",
                "to",
                "reason"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "from",
          "to",
          "gaps"
        ],
        "additionalProperties": false
      },
      "MentoringDecisions": {
        "type": "object",
        "properties": {
          "items": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MentoringStudentDecision"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "nextCursor",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "MentoringDigests": {
        "type": "object",
        "properties": {
          "items": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MentoringStudentDigest"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "nextCursor",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "MentoringHomeworkDetails": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32768
          },
          "assigneeRole": {
            "type": "string",
            "enum": [
              "student",
              "mentor"
            ]
          },
          "assigneeName": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[^\\p{Cc}\\p{Cf}\\p{Cs}@<>]*$",
                "description": "Plain display name of the responsible person when the task is not the student's own. Absent or null means the student."
              },
              {
                "type": "null"
              }
            ]
          },
          "dueAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "doneCriteria": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32768
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "in_progress",
              "done",
              "cancelled"
            ]
          },
          "stage": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "text",
          "assigneeRole",
          "dueAt",
          "doneCriteria",
          "status",
          "stage"
        ],
        "additionalProperties": false
      },
      "MentoringHomeworkTask": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "refs": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "document",
                    "message",
                    "segment",
                    "recording"
                  ]
                },
                "position": {
                  "type": "object",
                  "properties": {
                    "startSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "endSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "ordinal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "revision": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false
            }
          },
          "details": {
            "$ref": "#/components/schemas/MentoringHomeworkDetails"
          },
          "sessionId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "decisionId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "dependencies": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        },
        "required": [
          "id",
          "updatedAt",
          "refs",
          "details",
          "sessionId",
          "decisionId",
          "dependencies"
        ],
        "additionalProperties": false
      },
      "MentoringKind": {
        "type": "string",
        "enum": [
          "curator",
          "dashi"
        ]
      },
      "MentoringMessages": {
        "type": "object",
        "properties": {
          "items": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MentoringStudentMessage"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "nextCursor",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "MentoringPersonalTrack": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "title": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "version": {
            "$ref": "#/components/schemas/MentoringVersion"
          }
        },
        "required": [
          "id",
          "title",
          "updatedAt",
          "version"
        ],
        "additionalProperties": false
      },
      "MentoringSegment": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "refs": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "document",
                    "message",
                    "segment",
                    "recording"
                  ]
                },
                "position": {
                  "type": "object",
                  "properties": {
                    "startSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "endSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "ordinal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "revision": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false
            }
          },
          "details": {
            "type": "object",
            "properties": {
              "ordinal": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "startSeconds": {
                "type": "number",
                "minimum": 0
              },
              "endSeconds": {
                "type": "number",
                "minimum": 0
              },
              "speakerRole": {
                "type": "string",
                "enum": [
                  "student",
                  "mentor"
                ]
              },
              "text": {
                "type": "string",
                "maxLength": 8192
              },
              "status": {
                "$ref": "#/components/schemas/MentoringTranscriptStatus"
              },
              "quality": {
                "type": "string",
                "enum": [
                  "verified",
                  "uncertain",
                  "redacted"
                ]
              }
            },
            "required": [
              "ordinal",
              "startSeconds",
              "endSeconds",
              "speakerRole",
              "text",
              "status"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "updatedAt",
          "refs",
          "details"
        ],
        "additionalProperties": false
      },
      "MentoringSessionRead": {
        "type": "object",
        "properties": {
          "view": {
            "type": "string",
            "enum": [
              "summary",
              "transcript"
            ]
          },
          "session": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "updatedAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "refs": {
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "type": "string",
                      "enum": [
                        "document",
                        "message",
                        "segment",
                        "recording"
                      ]
                    },
                    "position": {
                      "type": "object",
                      "properties": {
                        "startSeconds": {
                          "type": "number",
                          "minimum": 0
                        },
                        "endSeconds": {
                          "type": "number",
                          "minimum": 0
                        },
                        "ordinal": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "revision": {
                          "type": "integer",
                          "exclusiveMinimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "kind"
                  ],
                  "additionalProperties": false
                }
              },
              "details": {
                "type": "object",
                "properties": {
                  "startsAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "call",
                      "consultation"
                    ]
                  },
                  "durationSeconds": {
                    "anyOf": [
                      {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "scheduled",
                      "completed",
                      "cancelled"
                    ]
                  },
                  "summary": {
                    "type": "string",
                    "maxLength": 32768
                  },
                  "transcriptStatus": {
                    "$ref": "#/components/schemas/MentoringTranscriptStatus"
                  },
                  "hostName": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[^\\p{Cc}\\p{Cf}\\p{Cs}@<>]*$"
                  },
                  "recordingUrl": {
                    "description": "HTTPS recording link. Allowed exact hosts: kinescope.io.",
                    "type": "string",
                    "maxLength": 2048,
                    "format": "uri"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120,
                    "pattern": "^[^\\p{Cc}\\p{Cf}\\p{Cs}<>]*$"
                  },
                  "brief": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 400,
                    "pattern": "^[^\\p{Cc}\\p{Cf}\\p{Cs}<>]*$"
                  }
                },
                "required": [
                  "startsAt",
                  "kind",
                  "durationSeconds",
                  "status",
                  "transcriptStatus"
                ],
                "additionalProperties": false
              },
              "trackVersionId": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "updatedAt",
              "refs",
              "details",
              "trackVersionId"
            ],
            "additionalProperties": false
          },
          "transcriptStatus": {
            "$ref": "#/components/schemas/MentoringTranscriptStatus"
          },
          "oversizedSegment": {
            "type": "boolean"
          },
          "items": {
            "maxItems": 200,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MentoringSegment"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "view",
          "session"
        ],
        "additionalProperties": false
      },
      "MentoringSessions": {
        "type": "object",
        "properties": {
          "items": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MentoringStudentSession"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "nextCursor",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "MentoringStudentDecision": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "refs": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "document",
                    "message",
                    "segment",
                    "recording"
                  ]
                },
                "position": {
                  "type": "object",
                  "properties": {
                    "startSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "endSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "ordinal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "revision": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false
            }
          },
          "details": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32768
              },
              "authorRole": {
                "type": "string",
                "enum": [
                  "student",
                  "mentor"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "proposed",
                  "unconfirmed",
                  "confirmed",
                  "superseded",
                  "cancelled"
                ]
              },
              "dueAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "text",
              "authorRole",
              "status",
              "dueAt"
            ],
            "additionalProperties": false
          },
          "sessionId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          },
          "supersedesId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "updatedAt",
          "refs",
          "details",
          "sessionId",
          "supersedesId"
        ],
        "additionalProperties": false
      },
      "MentoringStudentDigest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "refs": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "document",
                    "message",
                    "segment",
                    "recording"
                  ]
                },
                "position": {
                  "type": "object",
                  "properties": {
                    "startSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "endSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "ordinal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "revision": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false
            }
          },
          "details": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))$"
              },
              "timezone": {
                "type": "string",
                "const": "Europe/Moscow"
              },
              "summary": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32768
              },
              "coverage": {
                "$ref": "#/components/schemas/MentoringCoverage"
              }
            },
            "required": [
              "date",
              "timezone",
              "summary",
              "coverage"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "updatedAt",
          "refs",
          "details"
        ],
        "additionalProperties": false
      },
      "MentoringStudentHomework": {
        "type": "object",
        "properties": {
          "items": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MentoringHomeworkTask"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "nextCursor",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "MentoringStudentMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "refs": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "document",
                    "message",
                    "segment",
                    "recording"
                  ]
                },
                "position": {
                  "type": "object",
                  "properties": {
                    "startSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "endSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "ordinal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "revision": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false
            }
          },
          "details": {
            "type": "object",
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "speakerRole": {
                "type": "string",
                "enum": [
                  "student",
                  "mentor"
                ]
              },
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 32768
              },
              "revision": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": [
              "at",
              "speakerRole",
              "text",
              "revision"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "updatedAt",
          "refs",
          "details"
        ],
        "additionalProperties": false
      },
      "MentoringStudentSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "refs": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "document",
                    "message",
                    "segment",
                    "recording"
                  ]
                },
                "position": {
                  "type": "object",
                  "properties": {
                    "startSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "endSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "ordinal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "revision": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false
            }
          },
          "details": {
            "type": "object",
            "properties": {
              "startsAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "call",
                  "consultation"
                ]
              },
              "durationSeconds": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "scheduled",
                  "completed",
                  "cancelled"
                ]
              },
              "summary": {
                "type": "string",
                "maxLength": 32768
              },
              "transcriptStatus": {
                "$ref": "#/components/schemas/MentoringTranscriptStatus"
              },
              "hostName": {
                "type": "string",
                "minLength": 1,
                "maxLength": 64,
                "pattern": "^[^\\p{Cc}\\p{Cf}\\p{Cs}@<>]*$"
              },
              "recordingUrl": {
                "description": "HTTPS recording link. Allowed exact hosts: kinescope.io.",
                "type": "string",
                "maxLength": 2048,
                "format": "uri"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120,
                "pattern": "^[^\\p{Cc}\\p{Cf}\\p{Cs}<>]*$"
              },
              "brief": {
                "type": "string",
                "minLength": 1,
                "maxLength": 400,
                "pattern": "^[^\\p{Cc}\\p{Cf}\\p{Cs}<>]*$"
              }
            },
            "required": [
              "startsAt",
              "kind",
              "durationSeconds",
              "status",
              "summary",
              "transcriptStatus"
            ],
            "additionalProperties": false
          },
          "trackVersionId": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "updatedAt",
          "refs",
          "details",
          "trackVersionId"
        ],
        "additionalProperties": false
      },
      "MentoringTranscriptStatus": {
        "type": "string",
        "enum": [
          "not_provided",
          "consent_required",
          "processing",
          "ready",
          "failed",
          "redacted"
        ]
      },
      "MentoringVersion": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "refs": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": [
                    "document",
                    "message",
                    "segment",
                    "recording"
                  ]
                },
                "position": {
                  "type": "object",
                  "properties": {
                    "startSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "endSeconds": {
                      "type": "number",
                      "minimum": 0
                    },
                    "ordinal": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "revision": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "additionalProperties": false
                }
              },
              "required": [
                "kind"
              ],
              "additionalProperties": false
            }
          },
          "details": {
            "type": "object",
            "properties": {
              "markdown": {
                "type": "string",
                "maxLength": 262144
              },
              "sections": {
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": "string",
                      "maxLength": 256
                    },
                    "markdown": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 32768
                    }
                  },
                  "required": [
                    "title",
                    "markdown"
                  ],
                  "additionalProperties": false
                }
              },
              "stages": {
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 256,
                      "pattern": "^[A-Za-z0-9_.:-]+$"
                    },
                    "title": {
                      "type": "string",
                      "maxLength": 256
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "planned",
                        "active",
                        "done"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "title",
                    "status"
                  ],
                  "additionalProperties": false
                }
              },
              "metrics": {
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "label": {
                      "type": "string",
                      "maxLength": 256
                    },
                    "value": {
                      "type": "string",
                      "maxLength": 256
                    }
                  },
                  "required": [
                    "label",
                    "value"
                  ],
                  "additionalProperties": false
                }
              },
              "changes": {
                "type": "string",
                "maxLength": 32768
              }
            },
            "required": [
              "markdown",
              "sections",
              "stages",
              "metrics",
              "changes"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "updatedAt",
          "refs",
          "details"
        ],
        "additionalProperties": false
      },
      "MentoringVersions": {
        "type": "object",
        "properties": {
          "items": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MentoringVersion"
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2048,
                "pattern": "^[A-Za-z0-9_-]+$"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "items",
          "nextCursor",
          "updatedAt"
        ],
        "additionalProperties": false
      },
      "NextLesson": {
        "type": "object",
        "properties": {
          "lesson": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LessonCard"
              },
              {
                "type": "null"
              }
            ]
          },
          "reason": {
            "type": "string",
            "enum": [
              "continue",
              "next",
              "onboarding",
              "done"
            ]
          }
        },
        "required": [
          "lesson",
          "reason"
        ],
        "additionalProperties": false
      },
      "Offer": {
        "type": "string",
        "enum": [
          "tutoring"
        ]
      },
      "OidcCallbackRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "state": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          }
        },
        "required": [
          "code",
          "state"
        ],
        "additionalProperties": false
      },
      "OidcStartResponse": {
        "type": "object",
        "properties": {
          "authorizeUrl": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "authorizeUrl"
        ],
        "additionalProperties": false
      },
      "Onboarding": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "number",
            "const": 2
          },
          "status": {
            "$ref": "#/components/schemas/OnboardingStatus"
          },
          "step": {
            "type": "integer",
            "minimum": 0,
            "maximum": 12
          },
          "answers": {
            "$ref": "#/components/schemas/OnboardingDraft"
          },
          "completedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "schemaVersion",
          "status",
          "step",
          "answers",
          "completedAt"
        ],
        "additionalProperties": false
      },
      "OnboardingDraft": {
        "type": "object",
        "properties": {
          "role": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "Основатель бизнеса",
                  "Руководитель команды",
                  "Эксперт / фрилансер",
                  "Работаю в найме"
                ]
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "business": {
            "type": "string",
            "maxLength": 2000
          },
          "scenario": {
            "maxItems": 13,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "Продажи и заявки",
                "Контент и маркетинг",
                "Поддержка клиентов",
                "Аналитика бизнеса",
                "Личный помощник",
                "Документы и отчёты",
                "Операции и задачи команды",
                "Найм и HR",
                "Финансы и учёт",
                "Исследования и поиск информации",
                "Обучение команды",
                "Разработка и автоматизация",
                "Другое"
              ]
            }
          },
          "scenarioOther": {
            "type": "string",
            "maxLength": 200
          },
          "level": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "Только пробую нейросети",
                  "Пользуюсь ChatGPT/Claude каждый день",
                  "Писал промпты, настраивал GPTs или проекты",
                  "Собирал ботов и автоматизации (n8n, Make, Zapier)",
                  "Пишу код или работал с Claude Code / Cursor / Codex"
                ]
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "aiTools": {
            "maxItems": 14,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "ChatGPT",
                "Claude",
                "Gemini",
                "Perplexity",
                "DeepSeek",
                "GigaChat",
                "YandexGPT / Алиса",
                "Cursor",
                "Claude Code",
                "Codex",
                "n8n / Make / Zapier",
                "Telegram-боты",
                "Пока ничего не использую",
                "Другое"
              ]
            }
          },
          "aiToolsOther": {
            "type": "string",
            "maxLength": 200
          },
          "setup": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "hermes",
                  "codex",
                  "claude",
                  "plugin"
                ]
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "budget": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "lt50",
                  "50_100",
                  "100_200",
                  "200_500",
                  "500p"
                ]
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "tools": {
            "maxItems": 49,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "Telegram",
                "WhatsApp",
                "VK",
                "Max",
                "Instagram",
                "YouTube",
                "Дзен",
                "amoCRM",
                "Битрикс24",
                "RetailCRM",
                "YCLIENTS",
                "1С",
                "МойСклад",
                "Контур",
                "Т-Бизнес",
                "СберБизнес",
                "Точка",
                "Эвотор",
                "Google Docs и Sheets",
                "Яндекс Документы и Диск",
                "Excel",
                "Notion",
                "Yonote",
                "Miro",
                "Trello",
                "Яндекс Трекер",
                "Kaiten",
                "WEEEK",
                "Wildberries",
                "Ozon",
                "Яндекс Маркет",
                "Авито",
                "Тильда",
                "WordPress",
                "Яндекс Директ",
                "Яндекс Метрика",
                "VK Реклама",
                "GetCourse",
                "Unisender",
                "Gmail",
                "Яндекс 360",
                "Google Календарь",
                "Zoom",
                "Телемост",
                "n8n",
                "Make",
                "Zapier",
                "Albato",
                "Другое"
              ]
            }
          },
          "toolsOther": {
            "type": "string",
            "maxLength": 200
          },
          "time": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "1–3 часа в неделю",
                  "3–5 часов в неделю",
                  "5–10 часов в неделю",
                  "Больше 10 часов"
                ]
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "hardware": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "Есть сервер (VPS)",
                "Платный публичный VPN",
                "Свой VPN",
                "Есть только компьютер",
                "Нужна помощь с настройкой"
              ]
            }
          },
          "os": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "macOS",
                  "Windows",
                  "Linux"
                ]
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          },
          "goal": {
            "type": "string",
            "maxLength": 2000
          },
          "about": {
            "type": "string",
            "maxLength": 2000
          },
          "socialsPersonal": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialLink"
            }
          },
          "socialsBusiness": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SocialLink"
            }
          },
          "website": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Website"
              },
              {
                "type": "string",
                "const": ""
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "OnboardingDraftPatch": {
        "type": "object",
        "properties": {
          "role": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "Основатель бизнеса",
                      "Руководитель команды",
                      "Эксперт / фрилансер",
                      "Работаю в найме"
                    ]
                  },
                  {
                    "type": "string",
                    "const": ""
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "business": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "scenario": {
            "anyOf": [
              {
                "maxItems": 13,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "Продажи и заявки",
                    "Контент и маркетинг",
                    "Поддержка клиентов",
                    "Аналитика бизнеса",
                    "Личный помощник",
                    "Документы и отчёты",
                    "Операции и задачи команды",
                    "Найм и HR",
                    "Финансы и учёт",
                    "Исследования и поиск информации",
                    "Обучение команды",
                    "Разработка и автоматизация",
                    "Другое"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "scenarioOther": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "level": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "Только пробую нейросети",
                      "Пользуюсь ChatGPT/Claude каждый день",
                      "Писал промпты, настраивал GPTs или проекты",
                      "Собирал ботов и автоматизации (n8n, Make, Zapier)",
                      "Пишу код или работал с Claude Code / Cursor / Codex"
                    ]
                  },
                  {
                    "type": "string",
                    "const": ""
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "aiTools": {
            "anyOf": [
              {
                "maxItems": 14,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "ChatGPT",
                    "Claude",
                    "Gemini",
                    "Perplexity",
                    "DeepSeek",
                    "GigaChat",
                    "YandexGPT / Алиса",
                    "Cursor",
                    "Claude Code",
                    "Codex",
                    "n8n / Make / Zapier",
                    "Telegram-боты",
                    "Пока ничего не использую",
                    "Другое"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "aiToolsOther": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "setup": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "hermes",
                      "codex",
                      "claude",
                      "plugin"
                    ]
                  },
                  {
                    "type": "string",
                    "const": ""
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "budget": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "lt50",
                      "50_100",
                      "100_200",
                      "200_500",
                      "500p"
                    ]
                  },
                  {
                    "type": "string",
                    "const": ""
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "tools": {
            "anyOf": [
              {
                "maxItems": 49,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "Telegram",
                    "WhatsApp",
                    "VK",
                    "Max",
                    "Instagram",
                    "YouTube",
                    "Дзен",
                    "amoCRM",
                    "Битрикс24",
                    "RetailCRM",
                    "YCLIENTS",
                    "1С",
                    "МойСклад",
                    "Контур",
                    "Т-Бизнес",
                    "СберБизнес",
                    "Точка",
                    "Эвотор",
                    "Google Docs и Sheets",
                    "Яндекс Документы и Диск",
                    "Excel",
                    "Notion",
                    "Yonote",
                    "Miro",
                    "Trello",
                    "Яндекс Трекер",
                    "Kaiten",
                    "WEEEK",
                    "Wildberries",
                    "Ozon",
                    "Яндекс Маркет",
                    "Авито",
                    "Тильда",
                    "WordPress",
                    "Яндекс Директ",
                    "Яндекс Метрика",
                    "VK Реклама",
                    "GetCourse",
                    "Unisender",
                    "Gmail",
                    "Яндекс 360",
                    "Google Календарь",
                    "Zoom",
                    "Телемост",
                    "n8n",
                    "Make",
                    "Zapier",
                    "Albato",
                    "Другое"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "toolsOther": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "time": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "1–3 часа в неделю",
                      "3–5 часов в неделю",
                      "5–10 часов в неделю",
                      "Больше 10 часов"
                    ]
                  },
                  {
                    "type": "string",
                    "const": ""
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "hardware": {
            "anyOf": [
              {
                "maxItems": 5,
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "Есть сервер (VPS)",
                    "Платный публичный VPN",
                    "Свой VPN",
                    "Есть только компьютер",
                    "Нужна помощь с настройкой"
                  ]
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "os": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": [
                      "macOS",
                      "Windows",
                      "Linux"
                    ]
                  },
                  {
                    "type": "string",
                    "const": ""
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "goal": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "about": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          },
          "socialsPersonal": {
            "anyOf": [
              {
                "maxItems": 10,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SocialLink"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "socialsBusiness": {
            "anyOf": [
              {
                "maxItems": 10,
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SocialLink"
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "website": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/Website"
                  },
                  {
                    "type": "string",
                    "const": ""
                  }
                ]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "OnboardingPatchRequest": {
        "type": "object",
        "properties": {
          "step": {
            "type": "integer",
            "minimum": 0,
            "maximum": 12
          },
          "answers": {
            "$ref": "#/components/schemas/OnboardingDraftPatch"
          }
        },
        "required": [
          "step",
          "answers"
        ],
        "additionalProperties": false
      },
      "OnboardingSetupRequest": {
        "type": "object",
        "properties": {
          "setup": {
            "$ref": "#/components/schemas/SetupId"
          }
        },
        "required": [
          "setup"
        ],
        "additionalProperties": false
      },
      "OnboardingStatus": {
        "type": "string",
        "enum": [
          "draft",
          "in_review",
          "plan_ready"
        ]
      },
      "PasswordChangeRequest": {
        "type": "object",
        "properties": {
          "currentPassword": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "newPassword": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128
          }
        },
        "required": [
          "currentPassword",
          "newPassword"
        ],
        "additionalProperties": false
      },
      "PasswordForgotRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      },
      "PasswordLoginRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "password": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "required": [
          "email",
          "password"
        ],
        "additionalProperties": false
      },
      "PasswordResetRequest": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "password": {
            "type": "string",
            "minLength": 8,
            "maxLength": 128
          }
        },
        "required": [
          "token",
          "password"
        ],
        "additionalProperties": false
      },
      "PasswordResetResponse": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          }
        },
        "required": [
          "email"
        ],
        "additionalProperties": false
      },
      "PasswordSetupRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "maxLength": 254,
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "orderEmail": {
            "type": "boolean",
            "const": true
          },
          "currentPassword": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          }
        },
        "additionalProperties": false
      },
      "PasswordStatus": {
        "type": "object",
        "properties": {
          "email": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254,
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "hasPassword": {
            "type": "boolean"
          },
          "mailEnabled": {
            "type": "boolean"
          },
          "orderEmail": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 254,
                "format": "email",
                "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "orderEmailMasked": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 80,
                "pattern": "^[^@\\s*]{0,2}\\*\\*\\*@[^@\\s*.]{0,2}\\*\\*\\*\\.[^@\\s*.]{1,63}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "email",
          "hasPassword",
          "mailEnabled",
          "orderEmail",
          "orderEmailMasked"
        ],
        "additionalProperties": false
      },
      "PlanContent": {
        "type": "object",
        "properties": {
          "letter": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              },
              "paragraphs": {
                "minItems": 1,
                "maxItems": 10,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 3000
                }
              }
            },
            "required": [
              "title",
              "paragraphs"
            ],
            "additionalProperties": false
          },
          "stack": {
            "minItems": 1,
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "setup": {
                  "$ref": "#/components/schemas/SetupId"
                },
                "recommended": {
                  "type": "boolean"
                },
                "note": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 3000
                }
              },
              "required": [
                "setup",
                "recommended",
                "note"
              ],
              "additionalProperties": false
            }
          },
          "dashboards": {
            "maxItems": 6,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "value": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 20
                },
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                }
              },
              "required": [
                "name",
                "value",
                "label"
              ],
              "additionalProperties": false
            }
          },
          "repos": {
            "maxItems": 10,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 3000
                }
              },
              "required": [
                "title",
                "url",
                "description"
              ],
              "additionalProperties": false
            }
          },
          "skills": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 300
                },
                "description": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 3000
                },
                "url": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "title",
                "description",
                "url"
              ],
              "additionalProperties": false
            }
          },
          "project": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 300
              },
              "description": {
                "type": "string",
                "minLength": 1,
                "maxLength": 3000
              }
            },
            "required": [
              "title",
              "description"
            ],
            "additionalProperties": false
          },
          "milestones": {
            "minItems": 1,
            "maxItems": 12,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 300
            }
          }
        },
        "required": [
          "letter",
          "stack",
          "dashboards",
          "repos",
          "skills",
          "project",
          "milestones"
        ],
        "additionalProperties": false
      },
      "PlanMilestonesUpdateRequest": {
        "type": "object",
        "properties": {
          "milestonesDone": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 11
            }
          },
          "expectedVersion": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "milestonesDone",
          "expectedVersion"
        ],
        "additionalProperties": false
      },
      "PlanResponse": {
        "type": "object",
        "properties": {
          "status": {
            "$ref": "#/components/schemas/OnboardingStatus"
          },
          "plan": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PlanContent"
              },
              {
                "type": "null"
              }
            ]
          },
          "version": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "publishedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "status",
          "plan",
          "version",
          "publishedAt"
        ],
        "additionalProperties": false
      },
      "Progress": {
        "type": "object",
        "properties": {
          "completed": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LessonCode"
            }
          },
          "positions": {
            "type": "object",
            "propertyNames": {
              "$ref": "#/components/schemas/LessonCode"
            },
            "additionalProperties": {
              "type": "number",
              "minimum": 0
            }
          },
          "homework": {
            "type": "object",
            "propertyNames": {
              "$ref": "#/components/schemas/LessonCode"
            },
            "additionalProperties": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string",
                  "maxLength": 4000
                },
                "sent": {
                  "type": "boolean"
                }
              },
              "required": [
                "text",
                "sent"
              ],
              "additionalProperties": false
            }
          },
          "milestonesDone": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 11
            }
          }
        },
        "required": [
          "completed",
          "positions",
          "homework",
          "milestonesDone"
        ],
        "additionalProperties": false
      },
      "ProgressUpdateRequest": {
        "type": "object",
        "properties": {
          "lessonId": {
            "$ref": "#/components/schemas/LessonCode"
          },
          "positionSec": {
            "type": "number",
            "minimum": 0,
            "maximum": 86400
          },
          "completed": {
            "type": "boolean"
          },
          "homework": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string",
                "maxLength": 4000
              },
              "sent": {
                "type": "boolean"
              }
            },
            "required": [
              "text",
              "sent"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "lessonId"
        ],
        "additionalProperties": false
      },
      "RevokeAllResponse": {
        "type": "object",
        "properties": {
          "revoked": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "revoked"
        ],
        "additionalProperties": false
      },
      "SearchResults": {
        "type": "object",
        "properties": {
          "query": {
            "type": "string"
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 200
                },
                "lesson": {
                  "$ref": "#/components/schemas/LessonCode"
                },
                "seconds": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "title": {
                  "type": "string"
                },
                "snippet": {
                  "type": "string",
                  "maxLength": 500
                }
              },
              "required": [
                "label",
                "lesson",
                "seconds",
                "title",
                "snippet"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "query",
          "results"
        ],
        "additionalProperties": false
      },
      "Section": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64
          },
          "kind": {
            "type": "string",
            "enum": [
              "efirs",
              "pretraining",
              "week",
              "tech",
              "skills"
            ]
          },
          "number": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "lessons": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LessonCard"
            }
          }
        },
        "required": [
          "id",
          "kind",
          "number",
          "title",
          "lessons"
        ],
        "additionalProperties": false
      },
      "SectionList": {
        "type": "object",
        "properties": {
          "sections": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Section"
            }
          }
        },
        "required": [
          "sections"
        ],
        "additionalProperties": false
      },
      "SessionInfo": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "kind": {
            "type": "string",
            "enum": [
              "cookie",
              "tma"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "lastSeenAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "device": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ]
          },
          "current": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "kind",
          "createdAt",
          "lastSeenAt",
          "device",
          "current"
        ],
        "additionalProperties": false
      },
      "SessionList": {
        "type": "object",
        "properties": {
          "sessions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionInfo"
            }
          }
        },
        "required": [
          "sessions"
        ],
        "additionalProperties": false
      },
      "SetupId": {
        "type": "string",
        "enum": [
          "hermes",
          "codex",
          "claude",
          "plugin"
        ]
      },
      "SkillSource": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "const": "skill"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "id": {
            "$ref": "#/components/schemas/CatalogId"
          }
        },
        "required": [
          "kind",
          "label",
          "id"
        ],
        "additionalProperties": false
      },
      "SocialLink": {
        "anyOf": [
          {
            "$ref": "#/components/schemas/Website"
          },
          {
            "type": "string",
            "pattern": "^@(?=[A-Za-z0-9_.]*[A-Za-z])(?![A-Za-z0-9_.]*\\d{7})[A-Za-z0-9_.]{2,64}$"
          }
        ]
      },
      "Source": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/LessonSource"
          },
          {
            "$ref": "#/components/schemas/SkillSource"
          },
          {
            "$ref": "#/components/schemas/MaterialSource"
          }
        ]
      },
      "Student": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "tgId": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "username": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_]{4,32}$"
              },
              {
                "type": "null"
              }
            ]
          },
          "avatarUrl": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^\\/api\\/v1\\/me\\/avatar\\?v=[0-9a-f]{32}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "tgId",
          "name",
          "username",
          "avatarUrl"
        ],
        "additionalProperties": false
      },
      "Tier": {
        "type": "string",
        "enum": [
          "group",
          "personal"
        ]
      },
      "Timecode": {
        "type": "object",
        "properties": {
          "t": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "text": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "t",
          "label",
          "text"
        ],
        "additionalProperties": false
      },
      "TmaExchangeRequest": {
        "type": "object",
        "properties": {
          "initData": {
            "type": "string",
            "minLength": 1,
            "maxLength": 8192
          }
        },
        "required": [
          "initData"
        ],
        "additionalProperties": false
      },
      "TmaExchangeResponse": {
        "type": "object",
        "properties": {
          "session": {
            "$ref": "#/components/schemas/TmaToken"
          },
          "me": {
            "$ref": "#/components/schemas/Me"
          }
        },
        "required": [
          "session",
          "me"
        ],
        "additionalProperties": false
      },
      "TmaToken": {
        "type": "object",
        "properties": {
          "token": {
            "type": "string",
            "pattern": "^aos3\\.tt_[A-Za-z0-9_-]{43}$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "absoluteExpiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "token",
          "expiresAt",
          "absoluteExpiresAt"
        ],
        "additionalProperties": false
      },
      "TranscribeResponse": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 20000
          },
          "durationSec": {
            "type": "number",
            "minimum": 0
          },
          "remainingSecToday": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "text",
          "durationSec",
          "remainingSecToday"
        ],
        "additionalProperties": false
      },
      "Transcript": {
        "type": "object",
        "properties": {
          "lessonId": {
            "$ref": "#/components/schemas/LessonCode"
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "t": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "t",
                "text"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "lessonId",
          "segments"
        ],
        "additionalProperties": false
      },
      "TutorFact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "fact": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "category": {
            "type": "string",
            "enum": [
              "goal",
              "setup",
              "preference",
              "progress",
              "other"
            ]
          },
          "createdBy": {
            "type": "string",
            "enum": [
              "tutor",
              "student"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "id",
          "fact",
          "category",
          "createdBy",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "TutorFacts": {
        "type": "object",
        "properties": {
          "facts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TutorFact"
            }
          }
        },
        "required": [
          "facts"
        ],
        "additionalProperties": false
      },
      "TutorMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ]
          },
          "text": {
            "type": "string",
            "maxLength": 65536
          },
          "sources": {
            "maxItems": 20,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Source"
            }
          },
          "parts": {
            "maxItems": 8,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TutorPart"
            }
          },
          "citations": {
            "default": [],
            "maxItems": 100,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Citation"
            }
          },
          "error": {
            "type": "boolean"
          },
          "feedback": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "up",
                  "down"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "attachments": {
            "maxItems": 4,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Attachment"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "id",
          "role",
          "text",
          "sources",
          "citations",
          "error",
          "feedback",
          "attachments",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "TutorMessagesPage": {
        "type": "object",
        "properties": {
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TutorMessage"
            }
          },
          "nextBefore": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "messages",
          "nextBefore"
        ],
        "additionalProperties": false
      },
      "TutorPart": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "progress"
              },
              "lessonsDone": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              },
              "lessonsTotal": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              },
              "milestonesDone": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              },
              "milestonesTotal": {
                "type": "integer",
                "minimum": 0,
                "maximum": 10000
              }
            },
            "required": [
              "type",
              "lessonsDone",
              "lessonsTotal",
              "milestonesDone",
              "milestonesTotal"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "lesson"
              },
              "code": {
                "$ref": "#/components/schemas/LessonCode"
              },
              "label": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "positionSec": {
                "type": "integer",
                "minimum": 0,
                "maximum": 86400
              },
              "durationSec": {
                "type": "integer",
                "minimum": 0,
                "maximum": 86400
              }
            },
            "required": [
              "type",
              "code",
              "title",
              "positionSec",
              "durationSec"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "checklist"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "items": {
                "minItems": 1,
                "maxItems": 20,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 300
                    },
                    "done": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "text",
                    "done"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type",
              "title",
              "items"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "compare"
              },
              "title": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "options": {
                "minItems": 2,
                "maxItems": 4,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 80
                    },
                    "points": {
                      "minItems": 1,
                      "maxItems": 8,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 300
                      }
                    }
                  },
                  "required": [
                    "name",
                    "points"
                  ],
                  "additionalProperties": false
                }
              }
            },
            "required": [
              "type",
              "title",
              "options"
            ],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "const": "chips"
              },
              "questions": {
                "minItems": 2,
                "maxItems": 3,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                }
              }
            },
            "required": [
              "type",
              "questions"
            ],
            "additionalProperties": false
          }
        ]
      },
      "TutorSendRequest": {
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "text": {
            "type": "string",
            "maxLength": 4000
          },
          "attachments": {
            "maxItems": 4,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          }
        },
        "required": [
          "requestId",
          "text"
        ],
        "additionalProperties": false
      },
      "TutorSendResponse": {
        "type": "object",
        "properties": {
          "userMessage": {
            "$ref": "#/components/schemas/TutorMessage"
          },
          "reply": {
            "$ref": "#/components/schemas/TutorMessage"
          },
          "messagesLeftToday": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "userMessage",
          "reply",
          "messagesLeftToday"
        ],
        "additionalProperties": false
      },
      "Upload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "mime": {
            "type": "string",
            "enum": [
              "image/png",
              "image/jpeg",
              "image/webp",
              "application/pdf",
              "text/plain",
              "text/markdown"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "pdf",
              "text"
            ]
          },
          "size": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 10485760
          },
          "width": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 4096
              },
              {
                "type": "null"
              }
            ]
          },
          "height": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 4096
              },
              {
                "type": "null"
              }
            ]
          },
          "pages": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 20
              },
              {
                "type": "null"
              }
            ]
          },
          "textTruncated": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": [
          "id",
          "name",
          "mime",
          "kind",
          "size",
          "width",
          "height",
          "pages",
          "textTruncated",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "Website": {
        "type": "string",
        "maxLength": 500,
        "format": "uri"
      }
    },
    "securitySchemes": {
      "session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-aos_sess",
        "description": "Web session (bot link or Telegram Login)"
      },
      "tmaToken": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "aos3.tt_",
        "description": "Mini App token, 15 min sliding / 12 h absolute"
      },
      "agentKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "aos3.sk_",
        "description": "Персональный API-ключ из кабинета (90 дней) или OAuth access token; права – scopes ключа"
      }
    }
  }
}
