{
  "openapi": "3.1.0",
  "info": {
    "title": "АИС «Школа» и Школа ID",
    "version": "1.0.0",
    "description": "Внешние интеграционные и клиентские методы. Браузерные сценарии описаны в документации.",
    "contact": {
      "email": "director@ais-soko.ru"
    }
  },
  "externalDocs": {
    "url": "https://api.ais-soko.ru/"
  },
  "servers": [
    {
      "url": "https://ais-soko.ru"
    },
    {
      "url": "https://id.ais-soko.ru"
    }
  ],
  "paths": {
    "/api/v1/auth/authorize/": {
      "get": {
        "summary": "Запросить код авторизации",
        "tags": [
          "Авторизация"
        ],
        "operationId": "get-api-v1-auth-authorize",
        "description": "Откройте адрес в браузере. После входа и согласия приложение получит code и state на callback. Одноразовый код действителен 5 минут. При отказе вернётся error=access_denied.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "302": {
            "description": "Found",
            "headers": {
              "Location": {
                "description": "Адрес следующего шага в браузере.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "description": "Идентификатор зарегистрированного приложения.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "CLIENT_ID"
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "description": "Точный зарегистрированный адрес возврата.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "https://app.example.org/callback"
          },
          {
            "name": "response_type",
            "in": "query",
            "description": "Поддерживается значение code.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "code"
          },
          {
            "name": "scope",
            "in": "query",
            "description": "school.read или school.write через пробел. По умолчанию school.read.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "school.read"
          },
          {
            "name": "state",
            "in": "query",
            "description": "Случайное значение, которое приложение сверяет на callback.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "RANDOM_STATE"
          },
          {
            "name": "code_challenge",
            "in": "query",
            "description": "SHA-256 от code_verifier в Base64URL без символов заполнения.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "BASE64URL_SHA256_OF_CODE_VERIFIER"
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "description": "Используйте S256.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "S256"
          }
        ]
      }
    },
    "/api/v1/auth/token/": {
      "post": {
        "summary": "Получить токен",
        "tags": [
          "Авторизация"
        ],
        "operationId": "post-api-v1-auth-token",
        "description": "Обмен кода OAuth, получение токена программы или обновление пары токенов мобильного клиента. Для authorization_code передайте client_id, redirect_uri, code и code_verifier. Для client_credentials передайте client_id и client_secret. Для обновления мобильной пары передайте grant_type=refresh_token, client_id и refresh_token.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "token_type": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "integer"
                    },
                    "program": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "user_id": {},
                    "school_id": {}
                  }
                },
                "example": {
                  "access_token": "ACCESS_TOKEN",
                  "token_type": "Bearer",
                  "expires_in": 3600,
                  "program": {
                    "id": 7,
                    "name": "Сайт школы"
                  },
                  "user_id": null,
                  "school_id": null
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "grant_type",
                      "client_id",
                      "client_secret"
                    ],
                    "properties": {
                      "grant_type": {
                        "const": "client_credentials"
                      },
                      "client_id": {
                        "type": "string"
                      },
                      "client_secret": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "client_id",
                      "redirect_uri",
                      "code",
                      "code_verifier"
                    ],
                    "properties": {
                      "grant_type": {
                        "const": "authorization_code"
                      },
                      "client_id": {
                        "type": "string"
                      },
                      "redirect_uri": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "code_verifier": {
                        "type": "string"
                      },
                      "device_name": {
                        "type": "string"
                      },
                      "platform": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "grant_type",
                      "client_id",
                      "refresh_token"
                    ],
                    "properties": {
                      "grant_type": {
                        "const": "refresh_token"
                      },
                      "client_id": {
                        "type": "string"
                      },
                      "refresh_token": {
                        "type": "string"
                      }
                    }
                  }
                ]
              },
              "example": {
                "grant_type": "client_credentials",
                "client_id": "CLIENT_ID",
                "client_secret": "CLIENT_SECRET"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/login/": {
      "post": {
        "summary": "Альтернативный адрес выдачи токена",
        "tags": [
          "Авторизация"
        ],
        "operationId": "post-api-v1-auth-login",
        "description": "Принимает те же параметры и возвращает тот же ответ, что /api/v1/auth/token/.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "token_type": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "integer"
                    },
                    "program": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "user_id": {},
                    "school_id": {}
                  }
                },
                "example": {
                  "access_token": "ACCESS_TOKEN",
                  "token_type": "Bearer",
                  "expires_in": 3600,
                  "program": {
                    "id": 7,
                    "name": "Сайт школы"
                  },
                  "user_id": null,
                  "school_id": null
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "grant_type",
                      "client_id",
                      "client_secret"
                    ],
                    "properties": {
                      "grant_type": {
                        "const": "client_credentials"
                      },
                      "client_id": {
                        "type": "string"
                      },
                      "client_secret": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "client_id",
                      "redirect_uri",
                      "code",
                      "code_verifier"
                    ],
                    "properties": {
                      "grant_type": {
                        "const": "authorization_code"
                      },
                      "client_id": {
                        "type": "string"
                      },
                      "redirect_uri": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "code_verifier": {
                        "type": "string"
                      },
                      "device_name": {
                        "type": "string"
                      },
                      "platform": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "required": [
                      "grant_type",
                      "client_id",
                      "refresh_token"
                    ],
                    "properties": {
                      "grant_type": {
                        "const": "refresh_token"
                      },
                      "client_id": {
                        "type": "string"
                      },
                      "refresh_token": {
                        "type": "string"
                      }
                    }
                  }
                ]
              },
              "example": {
                "grant_type": "client_credentials",
                "client_id": "CLIENT_ID",
                "client_secret": "CLIENT_SECRET"
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/me/": {
      "get": {
        "summary": "Проверить токен",
        "tags": [
          "Авторизация"
        ],
        "operationId": "get-api-v1-auth-me",
        "description": "Сведения о программе, пользователе и сроке действия.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "program": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "user": {},
                    "expires_at": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "program": {
                    "id": 7,
                    "name": "Сайт школы"
                  },
                  "user": null,
                  "expires_at": "2026-11-28T10:00:00+10:00"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/auth/profile/": {
      "get": {
        "summary": "Получить профиль пользователя",
        "tags": [
          "Авторизация"
        ],
        "operationId": "get-api-v1-auth-profile",
        "description": "Требуются доступ к школе и группа данных identity.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "username": {
                      "type": "string"
                    },
                    "first_name": {
                      "type": "string"
                    },
                    "last_name": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "position": {
                      "type": "string"
                    },
                    "role": {
                      "type": "string"
                    },
                    "school_id": {
                      "type": "integer"
                    },
                    "birth_date": {},
                    "gender": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "id": 42,
                  "username": "user",
                  "first_name": "Иван",
                  "last_name": "Иванов",
                  "email": "user@example.org",
                  "phone": "",
                  "position": "Учитель",
                  "role": "teacher",
                  "school_id": 10,
                  "birth_date": null,
                  "gender": ""
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/auth/revoke/": {
      "post": {
        "summary": "Отозвать текущий токен",
        "tags": [
          "Авторизация"
        ],
        "operationId": "post-api-v1-auth-revoke",
        "description": "Токен передаётся в Authorization. Успешный ответ без тела.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/auth/logo/{client_id}/": {
      "get": {
        "summary": "Получить логотип приложения",
        "tags": [
          "Авторизация"
        ],
        "operationId": "get-api-v1-auth-logo-client-id",
        "description": "Возвращает изображение, если у приложения задан логотип.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "description": "Идентификатор приложения.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "CLIENT_ID"
          }
        ]
      }
    },
    "/api/v1/school/": {
      "get": {
        "summary": "Получить карточку текущей школы",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "get-api-v1-school",
        "description": "Требуется группа structure.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/School"
                },
                "example": {
                  "id": 10,
                  "short_name": "Школа № 1"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "summary": "Изменить карточку текущей школы",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "patch-api-v1-school",
        "description": "Передайте поля, которые нужно изменить. Требуются structure и право записи.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/School"
                },
                "example": {
                  "id": 10,
                  "short_name": "Школа № 1"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SchoolPatch"
              },
              "example": {
                "short_name": "Школа № 1"
              }
            }
          }
        }
      }
    },
    "/api/v1/school/all/": {
      "get": {
        "summary": "Выгрузить данные текущей школы",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "get-api-v1-school-all",
        "description": "Возвращает доступные приложению ресурсы. Поле school добавляется при доступе к structure.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "school_id": {
                      "type": "integer"
                    },
                    "school": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "short_name": {
                          "type": "string"
                        }
                      }
                    },
                    "resources": {
                      "type": "object",
                      "properties": {
                        "subjects": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "school": {
                                "type": "integer"
                              },
                              "year": {
                                "type": "integer"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "school_id": 10,
                  "school": {
                    "id": 10,
                    "short_name": "Школа № 1"
                  },
                  "resources": {
                    "subjects": [
                      {
                        "id": 4,
                        "name": "Математика",
                        "school": 10,
                        "year": 1
                      }
                    ]
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/school/resources/": {
      "get": {
        "summary": "Получить каталог ресурсов текущей школы",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "get-api-v1-school-resources",
        "description": "В списке будут ресурсы из групп данных, разрешённых программе.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "school_id": {
                      "type": "integer"
                    },
                    "resources": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "school_id": 10,
                  "resources": [
                    "groups",
                    "subjects"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/school/resources/{resource}/": {
      "get": {
        "summary": "Получить список записей текущей школы",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "get-api-v1-school-resources-resource",
        "description": "Принимает фильтры по полям записи. Возвращает число совпадений, применённые фильтры и массив results. Подробнее о точных фильтрах и связанных полях в разделе «Ресурсы и фильтры».",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "resource": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "filters": {
                      "type": "object",
                      "properties": {
                        "id__in": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "school": {
                            "type": "integer"
                          },
                          "year": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "resource": "subjects",
                  "count": 1,
                  "filters": {
                    "id__in": [
                      "4",
                      "5"
                    ]
                  },
                  "results": [
                    {
                      "id": 4,
                      "name": "Математика",
                      "school": 10,
                      "year": 1
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "description": "Имя из каталога ресурсов.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "subjects"
          },
          {
            "name": "id__in",
            "in": "query",
            "description": "Список значений, разделённых запятыми.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "4,5"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "summary": "Создать запись текущей школы",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "post-api-v1-school-resources-resource",
        "description": "Передайте поля выбранного ресурса. Для прямой связи school значение подставляет сервер.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "school": {
                      "type": "integer"
                    },
                    "year": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "id": 4,
                  "name": "Математика",
                  "school": 10,
                  "year": 1
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "description": "Имя из каталога ресурсов.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "subjects"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "name": "Математика",
                "year": 1
              }
            }
          }
        }
      }
    },
    "/api/v1/school/resources/{resource}/{pk}/": {
      "get": {
        "summary": "Получить запись текущей школы",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "get-api-v1-school-resources-resource-pk",
        "description": "Запись выбирается по идентификатору в пределах школы.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "school": {
                      "type": "integer"
                    },
                    "year": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "id": 4,
                  "name": "Математика",
                  "school": 10,
                  "year": 1
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "description": "Имя из каталога ресурсов.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "subjects"
          },
          {
            "name": "pk",
            "in": "path",
            "description": "Идентификатор записи.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 4
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "summary": "Изменить запись текущей школы",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "patch-api-v1-school-resources-resource-pk",
        "description": "Передайте изменяемые поля. Принадлежность к школе сохраняется.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "school": {
                      "type": "integer"
                    },
                    "year": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "id": 4,
                  "name": "Алгебра",
                  "school": 10,
                  "year": 1
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "description": "Имя из каталога ресурсов.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "subjects"
          },
          {
            "name": "pk",
            "in": "path",
            "description": "Идентификатор записи.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 4
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "name": "Алгебра"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Удалить запись текущей школы",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "delete-api-v1-school-resources-resource-pk",
        "description": "Удаляет запись. Зависимые записи обрабатываются по правилам модели.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "resource",
            "in": "path",
            "description": "Имя из каталога ресурсов.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "subjects"
          },
          {
            "name": "pk",
            "in": "path",
            "description": "Идентификатор записи.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 4
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/schools/{school_id}/": {
      "get": {
        "summary": "Получить карточку школы по ID",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "get-api-v1-schools-school-id",
        "description": "Требуется группа structure.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/School"
                },
                "example": {
                  "id": 10,
                  "short_name": "Школа № 1"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "school_id",
            "in": "path",
            "description": "Целочисленный идентификатор школы.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 10
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "summary": "Изменить карточку школы по ID",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "patch-api-v1-schools-school-id",
        "description": "Передайте поля, которые нужно изменить. Требуются structure и право записи.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/School"
                },
                "example": {
                  "id": 10,
                  "short_name": "Школа № 1"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "school_id",
            "in": "path",
            "description": "Целочисленный идентификатор школы.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 10
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SchoolPatch"
              },
              "example": {
                "short_name": "Школа № 1"
              }
            }
          }
        }
      }
    },
    "/api/v1/schools/{school_id}/all/": {
      "get": {
        "summary": "Выгрузить данные школы по ID",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "get-api-v1-schools-school-id-all",
        "description": "Возвращает доступные приложению ресурсы. Поле school добавляется при доступе к structure.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "school_id": {
                      "type": "integer"
                    },
                    "school": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "short_name": {
                          "type": "string"
                        }
                      }
                    },
                    "resources": {
                      "type": "object",
                      "properties": {
                        "subjects": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "school": {
                                "type": "integer"
                              },
                              "year": {
                                "type": "integer"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "school_id": 10,
                  "school": {
                    "id": 10,
                    "short_name": "Школа № 1"
                  },
                  "resources": {
                    "subjects": [
                      {
                        "id": 4,
                        "name": "Математика",
                        "school": 10,
                        "year": 1
                      }
                    ]
                  }
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "school_id",
            "in": "path",
            "description": "Целочисленный идентификатор школы.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 10
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/schools/{school_id}/resources/": {
      "get": {
        "summary": "Получить каталог ресурсов школы по ID",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "get-api-v1-schools-school-id-resources",
        "description": "В списке будут ресурсы из групп данных, разрешённых программе.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "school_id": {
                      "type": "integer"
                    },
                    "resources": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                },
                "example": {
                  "school_id": 10,
                  "resources": [
                    "groups",
                    "subjects"
                  ]
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "school_id",
            "in": "path",
            "description": "Целочисленный идентификатор школы.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 10
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/schools/{school_id}/resources/{resource}/": {
      "get": {
        "summary": "Получить список записей школы по ID",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "get-api-v1-schools-school-id-resources-resource",
        "description": "Принимает фильтры по полям записи. Возвращает число совпадений, применённые фильтры и массив results. Подробнее о точных фильтрах и связанных полях в разделе «Ресурсы и фильтры».",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "resource": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "filters": {
                      "type": "object",
                      "properties": {
                        "id__in": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "school": {
                            "type": "integer"
                          },
                          "year": {
                            "type": "integer"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "resource": "subjects",
                  "count": 1,
                  "filters": {
                    "id__in": [
                      "4",
                      "5"
                    ]
                  },
                  "results": [
                    {
                      "id": 4,
                      "name": "Математика",
                      "school": 10,
                      "year": 1
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "school_id",
            "in": "path",
            "description": "Целочисленный идентификатор школы.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 10
          },
          {
            "name": "resource",
            "in": "path",
            "description": "Имя из каталога ресурсов.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "subjects"
          },
          {
            "name": "id__in",
            "in": "query",
            "description": "Список значений, разделённых запятыми.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "4,5"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "summary": "Создать запись школы по ID",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "post-api-v1-schools-school-id-resources-resource",
        "description": "Передайте поля выбранного ресурса. Для прямой связи school значение подставляет сервер.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "school": {
                      "type": "integer"
                    },
                    "year": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "id": 4,
                  "name": "Математика",
                  "school": 10,
                  "year": 1
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "school_id",
            "in": "path",
            "description": "Целочисленный идентификатор школы.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 10
          },
          {
            "name": "resource",
            "in": "path",
            "description": "Имя из каталога ресурсов.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "subjects"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "name": "Математика",
                "year": 1
              }
            }
          }
        }
      }
    },
    "/api/v1/schools/{school_id}/resources/{resource}/{pk}/": {
      "get": {
        "summary": "Получить запись школы по ID",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "get-api-v1-schools-school-id-resources-resource-pk",
        "description": "Запись выбирается по идентификатору в пределах школы.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "school": {
                      "type": "integer"
                    },
                    "year": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "id": 4,
                  "name": "Математика",
                  "school": 10,
                  "year": 1
                }
              }
            }
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "school_id",
            "in": "path",
            "description": "Целочисленный идентификатор школы.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 10
          },
          {
            "name": "resource",
            "in": "path",
            "description": "Имя из каталога ресурсов.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "subjects"
          },
          {
            "name": "pk",
            "in": "path",
            "description": "Идентификатор записи.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 4
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "summary": "Изменить запись школы по ID",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "patch-api-v1-schools-school-id-resources-resource-pk",
        "description": "Передайте изменяемые поля. Принадлежность к школе сохраняется.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "school": {
                      "type": "integer"
                    },
                    "year": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "id": 4,
                  "name": "Алгебра",
                  "school": 10,
                  "year": 1
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "school_id",
            "in": "path",
            "description": "Целочисленный идентификатор школы.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 10
          },
          {
            "name": "resource",
            "in": "path",
            "description": "Имя из каталога ресурсов.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "subjects"
          },
          {
            "name": "pk",
            "in": "path",
            "description": "Идентификатор записи.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 4
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              },
              "example": {
                "name": "Алгебра"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Удалить запись школы по ID",
        "tags": [
          "Школы и записи"
        ],
        "operationId": "delete-api-v1-schools-school-id-resources-resource-pk",
        "description": "Удаляет запись. Зависимые записи обрабатываются по правилам модели.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "school_id",
            "in": "path",
            "description": "Целочисленный идентификатор школы.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 10
          },
          {
            "name": "resource",
            "in": "path",
            "description": "Имя из каталога ресурсов.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "subjects"
          },
          {
            "name": "pk",
            "in": "path",
            "description": "Идентификатор записи.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 4
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/v1/reviews/": {
      "post": {
        "summary": "Отправить ответы на опрос",
        "tags": [
          "Опросы"
        ],
        "operationId": "post-api-v1-reviews",
        "description": "Требуются пользовательский токен, право записи и группа identity. Состав answers определяется активным опросом и ролью пользователя. survey_date необязателен. Новый ответ возвращает 201, повторная отправка в тот же опрос обновляет ответ и возвращает 200. rating — пример поля, фактический набор смотрите на /review.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "created": {
                      "type": "boolean"
                    },
                    "review_id": {
                      "type": "integer"
                    },
                    "survey_date": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "created": true,
                  "review_id": 12,
                  "survey_date": "2026-08-26"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "created": {
                      "type": "boolean"
                    },
                    "review_id": {
                      "type": "integer"
                    },
                    "survey_date": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "created": true,
                  "review_id": 12,
                  "survey_date": "2026-08-26"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "survey_date": {
                    "type": "string"
                  },
                  "answers": {
                    "type": "object",
                    "properties": {
                      "rating": {
                        "type": "integer"
                      }
                    }
                  }
                }
              },
              "example": {
                "survey_date": "2026-08-26",
                "answers": {
                  "rating": 5
                }
              }
            }
          }
        }
      }
    },
    "/api/app/v1/me/": {
      "get": {
        "summary": "Получить профиль дневника",
        "tags": [
          "Мобильный дневник"
        ],
        "operationId": "get-api-app-v1-me",
        "description": "Возвращает ученика или родителя, школу и список привязанных детей.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_version": {
                      "type": "integer"
                    },
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        },
                        "role": {
                          "type": "string"
                        }
                      }
                    },
                    "school": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "children": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "api_version": 1,
                  "user": {
                    "id": 42,
                    "name": "Иван Иванов",
                    "role": "student"
                  },
                  "school": {
                    "id": 10,
                    "name": "Школа № 1"
                  },
                  "children": []
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/app/v1/diary/": {
      "get": {
        "summary": "Получить дневник за учебный год",
        "tags": [
          "Мобильный дневник"
        ],
        "operationId": "get-api-app-v1-diary",
        "description": "Возвращает данные календаря, оценок, заданий и уведомлений выбранного ученика. В примере показаны основные поля. Ответ также включает student, calendar, bells, children, reps, viewer, ktp, rating, exams, debts, archive и links.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": {
                      "type": "integer"
                    },
                    "today": {
                      "type": "string"
                    },
                    "range": {
                      "type": "object",
                      "properties": {
                        "from": {
                          "type": "string"
                        },
                        "to": {
                          "type": "string"
                        }
                      }
                    },
                    "school": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "years": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "current": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "periods": {
                      "type": "array",
                      "items": {}
                    },
                    "subjects": {
                      "type": "array",
                      "items": {}
                    },
                    "lessons": {
                      "type": "array",
                      "items": {}
                    },
                    "events": {
                      "type": "array",
                      "items": {}
                    },
                    "homework": {
                      "type": "array",
                      "items": {}
                    },
                    "marks": {
                      "type": "array",
                      "items": {}
                    },
                    "attendance": {
                      "type": "array",
                      "items": {}
                    },
                    "finals": {
                      "type": "object",
                      "properties": {}
                    },
                    "notifications": {
                      "type": "array",
                      "items": {}
                    },
                    "stamp": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "version": 1,
                  "today": "2026-11-28",
                  "range": {
                    "from": "2026-09-01",
                    "to": "2027-05-31"
                  },
                  "school": {
                    "name": "Школа № 1"
                  },
                  "years": [
                    {
                      "id": "12",
                      "title": "2026/2027",
                      "current": true
                    }
                  ],
                  "periods": [],
                  "subjects": [],
                  "lessons": [],
                  "events": [],
                  "homework": [],
                  "marks": [],
                  "attendance": [],
                  "finals": {},
                  "notifications": [],
                  "stamp": "VERSION"
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not Modified",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "child",
            "in": "query",
            "description": "ID связанного ребёнка. При отсутствии выбирается первый ребёнок родителя.",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 42
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "description": "ETag предыдущего ответа. При совпадении получаете 304 без тела.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "\"PREVIOUS_ETAG\""
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/app/v1/diary/stamp/": {
      "get": {
        "summary": "Проверить изменения дневника",
        "tags": [
          "Мобильный дневник"
        ],
        "operationId": "get-api-app-v1-diary-stamp",
        "description": "Лёгкий запрос для проверки обновлений.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "stamp": {
                      "type": "string"
                    },
                    "etag": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "stamp": "VERSION",
                  "etag": "ETAG"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "child",
            "in": "query",
            "description": "ID связанного ребёнка. При отсутствии выбирается первый ребёнок родителя.",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 42
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/app/v1/marks/photos/{photo_id}/": {
      "get": {
        "summary": "Скачать фото проверенной работы",
        "tags": [
          "Мобильный дневник"
        ],
        "operationId": "get-api-app-v1-marks-photos-photo-id",
        "description": "Изображение доступно для самого ученика или его родителя.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "photo_id",
            "in": "path",
            "description": "ID фотографии.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 3
          },
          {
            "name": "child",
            "in": "query",
            "description": "ID связанного ребёнка. При отсутствии выбирается первый ребёнок родителя.",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 42
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/app/v1/homework/{homework_id}/done/": {
      "post": {
        "summary": "Отметить выполнение задания",
        "tags": [
          "Мобильный дневник"
        ],
        "operationId": "post-api-app-v1-homework-homework-id-done",
        "description": "Установить или снять отметку может ученик.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "done": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "done": true
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "name": "homework_id",
            "in": "path",
            "description": "Строковый идентификатор домашнего задания из дневника, например H4.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "H4"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "done": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "done"
                ]
              },
              "example": {
                "done": true
              }
            }
          }
        }
      }
    },
    "/api/app/v1/events/": {
      "post": {
        "summary": "Создать личное событие",
        "tags": [
          "Мобильный дневник"
        ],
        "operationId": "post-api-app-v1-events",
        "description": "Событие видит его автор. Дата в YYYY-MM-DD, время в HH:MM. Родитель может дополнительно передать child в JSON.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "date": {
                      "type": "string"
                    },
                    "start": {
                      "type": "string"
                    },
                    "end": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "place": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "personal": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "id": "P18",
                  "date": "2026-11-28",
                  "start": "14:30",
                  "end": "15:00",
                  "title": "Дополнительное занятие",
                  "place": "",
                  "kind": "Личное событие",
                  "personal": true
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string"
                  },
                  "start": {
                    "type": "string"
                  },
                  "end": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "place": {
                    "type": "string"
                  }
                },
                "required": [
                  "date",
                  "start",
                  "end",
                  "title"
                ]
              },
              "example": {
                "date": "2026-11-28",
                "start": "14:30",
                "end": "15:00",
                "title": "Дополнительное занятие",
                "place": ""
              }
            }
          }
        }
      }
    },
    "/api/app/v1/events/{event_id}/": {
      "put": {
        "summary": "Изменить личное событие",
        "tags": [
          "Мобильный дневник"
        ],
        "operationId": "put-api-app-v1-events-event-id",
        "description": "Передайте новый набор полей события.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "date": {
                      "type": "string"
                    },
                    "start": {
                      "type": "string"
                    },
                    "end": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "place": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "personal": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "id": "P18",
                  "date": "2026-11-28",
                  "start": "14:30",
                  "end": "15:00",
                  "title": "Дополнительное занятие",
                  "place": "",
                  "kind": "Личное событие",
                  "personal": true
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "description": "Числовая часть идентификатора события. Для P18 передайте 18.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 18
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "date": {
                    "type": "string"
                  },
                  "start": {
                    "type": "string"
                  },
                  "end": {
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "place": {
                    "type": "string"
                  }
                },
                "required": [
                  "date",
                  "start",
                  "end",
                  "title"
                ]
              },
              "example": {
                "date": "2026-11-28",
                "start": "14:30",
                "end": "15:00",
                "title": "Дополнительное занятие",
                "place": ""
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Удалить личное событие",
        "tags": [
          "Мобильный дневник"
        ],
        "operationId": "delete-api-app-v1-events-event-id",
        "description": "Возвращает 204 и при повторном вызове.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "event_id",
            "in": "path",
            "description": "Числовая часть идентификатора события. Для P18 передайте 18.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 18
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/app/v1/notifications/read/": {
      "post": {
        "summary": "Отметить уведомления прочитанными",
        "tags": [
          "Мобильный дневник"
        ],
        "operationId": "post-api-app-v1-notifications-read",
        "description": "Передайте id уведомления или all=true. Родитель может передать child в JSON.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "ok": true
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "all": {
                    "type": "boolean"
                  }
                }
              },
              "example": {
                "all": true
              }
            }
          }
        }
      }
    },
    "/api/app/v1/device/": {
      "post": {
        "summary": "Обновить устройство дневника",
        "tags": [
          "Мобильный дневник"
        ],
        "operationId": "post-api-app-v1-device",
        "description": "Сохраняет push_token и имя устройства, если они переданы.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "ok": true
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "device_id": {
                    "type": "integer"
                  },
                  "push_token": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "device_id"
                ]
              },
              "example": {
                "device_id": 5,
                "push_token": "PUSH_TOKEN",
                "name": "Android"
              }
            }
          }
        }
      }
    },
    "/api/app/v1/logout/": {
      "post": {
        "summary": "Выйти из дневника на устройстве",
        "tags": [
          "Мобильный дневник"
        ],
        "operationId": "post-api-app-v1-logout",
        "description": "Гасит текущий access token и отзывает продление на указанном устройстве.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "device_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "device_id"
                ]
              },
              "example": {
                "device_id": 5
              }
            }
          }
        }
      }
    },
    "/.well-known/assetlinks.json": {
      "get": {
        "summary": "Получить Android App Links",
        "tags": [
          "Мобильный дневник"
        ],
        "operationId": "get-well-known-assetlinks-json",
        "description": "Связывает домен АИС с приложением Android. Доступно, когда настроены отпечатки сертификатов приложения.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "relation": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "target": {
                        "type": "object",
                        "properties": {
                          "namespace": {
                            "type": "string"
                          },
                          "package_name": {
                            "type": "string"
                          },
                          "sha256_cert_fingerprints": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": [
                  {
                    "relation": [
                      "delegate_permission/common.handle_all_urls"
                    ],
                    "target": {
                      "namespace": "android_app",
                      "package_name": "ru.aisschool.diary",
                      "sha256_cert_fingerprints": [
                        "CERTIFICATE_SHA256"
                      ]
                    }
                  }
                ]
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/api/teacher/v1/me/": {
      "get": {
        "summary": "Получить профиль сотрудника",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "get-api-teacher-v1-me",
        "description": "Возвращает роли, школу, учебный год и классы под руководством сотрудника.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "api_version": {
                      "type": "integer"
                    },
                    "user": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        },
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "admin": {
                          "type": "boolean"
                        }
                      }
                    },
                    "school": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "year": {
                      "type": "string"
                    },
                    "homeroom": {
                      "type": "array",
                      "items": {}
                    }
                  }
                },
                "example": {
                  "api_version": 1,
                  "user": {
                    "id": 42,
                    "name": "Иван Иванов",
                    "roles": [
                      "teacher"
                    ],
                    "admin": false
                  },
                  "school": {
                    "id": 10,
                    "name": "Школа № 1"
                  },
                  "year": "2026/2027",
                  "homeroom": []
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/teacher/v1/room/": {
      "get": {
        "summary": "Получить данные учительской",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "get-api-teacher-v1-room",
        "description": "Расписание выбранного дня, обзор недели и журналы.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "today": {
                      "type": "string"
                    },
                    "selected_date": {
                      "type": "string"
                    },
                    "day_items": {
                      "type": "array",
                      "items": {}
                    },
                    "week_days": {
                      "type": "array",
                      "items": {}
                    },
                    "journal_groups": {
                      "type": "array",
                      "items": {}
                    },
                    "homeroom_classes": {
                      "type": "array",
                      "items": {}
                    },
                    "missing_topic_count": {
                      "type": "integer"
                    },
                    "missing_homework_count": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "today": "2026-11-28",
                  "selected_date": "2026-11-28",
                  "day_items": [],
                  "week_days": [],
                  "journal_groups": [],
                  "homeroom_classes": [],
                  "missing_topic_count": 0,
                  "missing_homework_count": 0
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "Дата в формате YYYY-MM-DD.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "2026-11-28"
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/teacher/v1/journals/": {
      "get": {
        "summary": "Получить список журналов",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "get-api-teacher-v1-journals",
        "description": "Учитель видит журналы своих классов и предметов. Администрация видит все журналы школы.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "journals": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "group": {
                            "type": "integer"
                          },
                          "subject": {
                            "type": "integer"
                          },
                          "group_name": {
                            "type": "string"
                          },
                          "subject_name": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "journals": [
                    {
                      "group": 2,
                      "subject": 4,
                      "group_name": "5А",
                      "subject_name": "Математика",
                      "label": "Математика 5А"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/teacher/v1/journal/": {
      "get": {
        "summary": "Получить классный журнал",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "get-api-teacher-v1-journal",
        "description": "Уроки и оценки по классу, предмету и выбранному периоду. В примере показаны основные поля. Ответ также включает forms, themes, sections, topicSections, thresholds, canAbsKind и journals.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "today": {
                      "type": "string"
                    },
                    "students": {
                      "type": "array",
                      "items": {}
                    },
                    "marks": {
                      "type": "object",
                      "properties": {}
                    },
                    "totals": {
                      "type": "object",
                      "properties": {}
                    },
                    "months": {
                      "type": "array",
                      "items": {}
                    },
                    "periods": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "current": {
                      "type": "object",
                      "properties": {
                        "group": {
                          "type": "integer"
                        },
                        "subject": {
                          "type": "integer"
                        },
                        "period": {
                          "type": "integer"
                        },
                        "label": {
                          "type": "string"
                        },
                        "year": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "today": "28.11.2026",
                  "students": [],
                  "marks": {},
                  "totals": {},
                  "months": [],
                  "periods": [
                    {
                      "id": 1,
                      "name": "Первая четверть"
                    }
                  ],
                  "current": {
                    "group": 2,
                    "subject": 4,
                    "period": 1,
                    "label": "Математика 5А",
                    "year": "2026/2027"
                  }
                }
              }
            },
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "304": {
            "description": "Not Modified",
            "headers": {
              "ETag": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "group",
            "in": "query",
            "description": "ID класса.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 2
          },
          {
            "name": "subject",
            "in": "query",
            "description": "ID предмета.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 4
          },
          {
            "name": "period",
            "in": "query",
            "description": "Идентификатор периода.",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 1
          },
          {
            "name": "If-None-Match",
            "in": "header",
            "description": "ETag предыдущего ответа. При совпадении получаете 304 без тела.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "\"PREVIOUS_ETAG\""
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/teacher/v1/journal/final/": {
      "get": {
        "summary": "Получить итоговые оценки",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "get-api-teacher-v1-journal-final",
        "description": "Отметки класса по предмету за все периоды и за год. rows содержит записи по ID ученика. Поле p хранит отметки по порядку periods, g — годовую, e — экзаменационную, i — аттестационную.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "periods": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "end": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "yearEnd": {
                      "type": "string"
                    },
                    "rows": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                },
                "example": {
                  "ok": true,
                  "periods": [
                    {
                      "id": 1,
                      "name": "Первая четверть",
                      "end": "2026-10-24"
                    }
                  ],
                  "yearEnd": "2027-05-31",
                  "rows": {}
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "group",
            "in": "query",
            "description": "ID класса.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 2
          },
          {
            "name": "subject",
            "in": "query",
            "description": "ID предмета.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 4
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/teacher/v1/journal/ops/": {
      "post": {
        "summary": "Применить изменения журнала",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "post-api-teacher-v1-journal-ops",
        "description": "Принимает до 300 операций. Результат проверки и применения приходит отдельно для каждой операции. При конфликте изменения оценки сервер возвращает conflict=true и актуальное значение cell. Список типов операций приведён ниже.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "ok": {
                            "type": "boolean"
                          },
                          "topic": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "results": [
                    {
                      "id": "change-1",
                      "ok": true,
                      "topic": "Дроби"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ops": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string"
                        },
                        "lesson": {
                          "type": "integer"
                        },
                        "topic": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "ops"
                ]
              },
              "example": {
                "ops": [
                  {
                    "id": "change-1",
                    "type": "topic",
                    "lesson": 25,
                    "topic": "Дроби"
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/api/teacher/v1/journal/homework/": {
      "get": {
        "summary": "Получить задания урока",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "get-api-teacher-v1-journal-homework",
        "description": "Возвращает задачи, список учеников и заголовок урока.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "tasks": {
                      "type": "array",
                      "items": {}
                    },
                    "students": {
                      "type": "array",
                      "items": {}
                    },
                    "title": {
                      "type": "string"
                    },
                    "error": {}
                  }
                },
                "example": {
                  "ok": true,
                  "tasks": [],
                  "students": [],
                  "title": "Домашнее задание",
                  "error": null
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "lesson",
            "in": "query",
            "description": "Идентификатор урока.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 25
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "summary": "Сохранить задания урока",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "post-api-teacher-v1-journal-homework",
        "description": "Передайте массив tasks. audience принимает all или selective, targets содержит идентификаторы учеников.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lesson": {
                    "type": "integer"
                  },
                  "tasks": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "audience": {
                          "type": "string"
                        },
                        "targets": {
                          "type": "array",
                          "items": {}
                        }
                      }
                    }
                  }
                },
                "required": [
                  "lesson",
                  "tasks"
                ]
              },
              "example": {
                "lesson": 25,
                "tasks": [
                  {
                    "description": "Задача 5",
                    "audience": "all",
                    "targets": []
                  }
                ]
              }
            }
          }
        }
      }
    },
    "/api/teacher/v1/journal/homework/file/": {
      "post": {
        "summary": "Загрузить файл к заданию",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "post-api-teacher-v1-journal-homework-file",
        "description": "Передайте ID домашнего задания и файл в multipart-запросе.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "homework": {
                    "type": "integer"
                  },
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                },
                "required": [
                  "homework",
                  "file"
                ]
              },
              "example": {
                "homework": 17,
                "file": "assignment.pdf"
              }
            }
          }
        }
      },
      "delete": {
        "summary": "Удалить вложение задания",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "delete-api-teacher-v1-journal-homework-file",
        "description": "Укажите attachment в строке запроса.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "attachment",
            "in": "query",
            "description": "ID вложения.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 3
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/teacher/v1/journal/work-type/": {
      "post": {
        "summary": "Изменить вид работы урока",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "post-api-teacher-v1-journal-work-type",
        "description": "Добавьте столбец с typesmark_id или передайте work_type_key для изменения. Для удаления столбца с оценками передайте его ключ и remove=true.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "lesson": {
                    "type": "integer"
                  },
                  "typesmark_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "lesson"
                ]
              },
              "example": {
                "lesson": 25,
                "typesmark_id": 3
              }
            }
          }
        }
      }
    },
    "/api/teacher/v1/homeroom/": {
      "get": {
        "summary": "Получить сводку классного руководителя",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "get-api-teacher-v1-homeroom",
        "description": "Состав класса, посещаемость, пропуски и сведения о родителях.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "group": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "name": {
                          "type": "string"
                        }
                      }
                    },
                    "year": {
                      "type": "string"
                    },
                    "weekOffset": {
                      "type": "integer"
                    },
                    "dates": {
                      "type": "array",
                      "items": {}
                    },
                    "students": {
                      "type": "array",
                      "items": {}
                    },
                    "expelled": {
                      "type": "array",
                      "items": {}
                    },
                    "attendance": {
                      "type": "object",
                      "properties": {}
                    },
                    "stats": {
                      "type": "object",
                      "properties": {}
                    },
                    "parents": {
                      "type": "object",
                      "properties": {}
                    },
                    "studentCabinetsEnabled": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "group": {
                    "id": 2,
                    "name": "5А"
                  },
                  "year": "2026/2027",
                  "weekOffset": 0,
                  "dates": [],
                  "students": [],
                  "expelled": [],
                  "attendance": {},
                  "stats": {},
                  "parents": {},
                  "studentCabinetsEnabled": true
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "description": "Идентификатор периода.",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 1
          },
          {
            "name": "month",
            "in": "query",
            "description": "Месяц в формате YYYY-MM.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "2026-11"
          },
          {
            "name": "week",
            "in": "query",
            "description": "Целочисленное смещение недели.",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 0
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/teacher/v1/student/": {
      "get": {
        "summary": "Получить успеваемость ученика",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "get-api-teacher-v1-student",
        "description": "Оценки по предметам и пропуски за период. Действуют права доступа к классу.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "card": {
                      "type": "object",
                      "properties": {}
                    },
                    "subjects_rows": {
                      "type": "array",
                      "items": {}
                    },
                    "skip_total": {
                      "type": "object",
                      "properties": {
                        "n": {
                          "type": "integer"
                        },
                        "p": {
                          "type": "integer"
                        },
                        "b": {
                          "type": "integer"
                        }
                      }
                    },
                    "overall_avg": {
                      "type": "string"
                    },
                    "periods": {
                      "type": "array",
                      "items": {}
                    },
                    "selected_period": {
                      "type": "integer"
                    }
                  }
                },
                "example": {
                  "card": {},
                  "subjects_rows": [],
                  "skip_total": {
                    "n": 0,
                    "p": 0,
                    "b": 0
                  },
                  "overall_avg": "",
                  "periods": [],
                  "selected_period": 1
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "description": "ID записи students.",
            "required": true,
            "schema": {
              "type": "integer"
            },
            "example": 12
          },
          {
            "name": "period",
            "in": "query",
            "description": "Идентификатор периода.",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "example": 1
          }
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/api/teacher/v1/device/": {
      "post": {
        "summary": "Обновить активность устройства журнала",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "post-api-teacher-v1-device",
        "description": "Обновляет время последней активности.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "ok": true
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "device_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "device_id"
                ]
              },
              "example": {
                "device_id": 5
              }
            }
          }
        }
      }
    },
    "/api/teacher/v1/logout/": {
      "post": {
        "summary": "Выйти из журнала на устройстве",
        "tags": [
          "Мобильный журнал"
        ],
        "operationId": "post-api-teacher-v1-logout",
        "description": "Гасит текущий access token и отзывает продление на указанном устройстве.",
        "servers": [
          {
            "url": "https://ais-soko.ru"
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "device_id": {
                    "type": "integer"
                  }
                },
                "required": [
                  "device_id"
                ]
              },
              "example": {
                "device_id": 5
              }
            }
          }
        }
      }
    },
    "/.well-known/openid-configuration": {
      "get": {
        "summary": "Обнаружить конфигурацию OpenID Connect",
        "tags": [
          "Методы OAuth и OIDC"
        ],
        "operationId": "get-well-known-openid-configuration",
        "description": "Получите issuer, адреса OAuth, JWKS, допустимые scope и методы аутентификации клиента.",
        "servers": [
          {
            "url": "https://id.ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "issuer": {
                      "type": "string"
                    },
                    "authorization_endpoint": {
                      "type": "string"
                    },
                    "token_endpoint": {
                      "type": "string"
                    },
                    "userinfo_endpoint": {
                      "type": "string"
                    },
                    "revocation_endpoint": {
                      "type": "string"
                    },
                    "jwks_uri": {
                      "type": "string"
                    },
                    "organization_token_endpoint": {
                      "type": "string"
                    },
                    "response_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "grant_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "subject_types_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "id_token_signing_alg_values_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "scopes_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "token_endpoint_auth_methods_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "code_challenge_methods_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "prompt_values_supported": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "authorization_response_iss_parameter_supported": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "issuer": "https://id.ais-soko.ru",
                  "authorization_endpoint": "https://id.ais-soko.ru/oauth/authorize",
                  "token_endpoint": "https://id.ais-soko.ru/oauth/token",
                  "userinfo_endpoint": "https://id.ais-soko.ru/oauth/userinfo",
                  "revocation_endpoint": "https://id.ais-soko.ru/oauth/revoke",
                  "jwks_uri": "https://id.ais-soko.ru/oauth/jwks",
                  "organization_token_endpoint": "https://id.ais-soko.ru/organization/token",
                  "response_types_supported": [
                    "code"
                  ],
                  "grant_types_supported": [
                    "authorization_code"
                  ],
                  "subject_types_supported": [
                    "public"
                  ],
                  "id_token_signing_alg_values_supported": [
                    "RS256"
                  ],
                  "scopes_supported": [
                    "openid",
                    "profile",
                    "email",
                    "organizations"
                  ],
                  "token_endpoint_auth_methods_supported": [
                    "client_secret_basic",
                    "client_secret_post",
                    "none"
                  ],
                  "code_challenge_methods_supported": [
                    "S256"
                  ],
                  "prompt_values_supported": [
                    "none",
                    "login",
                    "consent"
                  ],
                  "authorization_response_iss_parameter_supported": true
                }
              }
            }
          }
        }
      }
    },
    "/oauth/authorize": {
      "get": {
        "summary": "Начать вход через Школа ID",
        "tags": [
          "Методы OAuth и OIDC"
        ],
        "operationId": "get-oauth-authorize",
        "description": "Перенаправьте браузер пользователя. На зарегистрированный callback придут code, state и iss. При ошибке после проверки redirect_uri callback получает error и state. Возможные значения: unsupported_response_type, invalid_scope, invalid_request, login_required, consent_required, access_denied.",
        "servers": [
          {
            "url": "https://id.ais-soko.ru"
          }
        ],
        "responses": {
          "302": {
            "description": "Found",
            "headers": {
              "Location": {
                "description": "Адрес следующего шага в браузере.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          }
        },
        "parameters": [
          {
            "name": "client_id",
            "in": "query",
            "description": "Идентификатор зарегистрированного приложения.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "CLIENT_ID"
          },
          {
            "name": "redirect_uri",
            "in": "query",
            "description": "Точный зарегистрированный адрес возврата.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "https://app.example.org/callback"
          },
          {
            "name": "response_type",
            "in": "query",
            "description": "Поддерживается значение code.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "code"
          },
          {
            "name": "scope",
            "in": "query",
            "description": "Разрешения через пробел. По умолчанию openid.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "openid profile email"
          },
          {
            "name": "state",
            "in": "query",
            "description": "Случайное значение, которое приложение сверяет на callback.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "RANDOM_STATE"
          },
          {
            "name": "code_challenge",
            "in": "query",
            "description": "SHA-256 от code_verifier в Base64URL без символов заполнения.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "BASE64URL_SHA256_OF_CODE_VERIFIER"
          },
          {
            "name": "code_challenge_method",
            "in": "query",
            "description": "Используйте S256.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "S256"
          },
          {
            "name": "nonce",
            "in": "query",
            "description": "Одноразовое значение для проверки ID Token.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "RANDOM_NONCE"
          },
          {
            "name": "prompt",
            "in": "query",
            "description": "none, login или consent. Без параметра используется обычный интерактивный вход.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "consent"
          }
        ]
      }
    },
    "/oauth/token": {
      "post": {
        "summary": "Обменять код на токены",
        "tags": [
          "Методы OAuth и OIDC"
        ],
        "operationId": "post-oauth-token",
        "description": "Отправьте форму. Конфиденциальный клиент аутентифицируется через HTTP Basic или client_secret в форме. Публичному клиенту достаточно client_id. В режиме Basic идентификатор приходит в заголовке. id_token выдаётся со scope openid. Ошибки: invalid_client, invalid_request, invalid_grant и unsupported_grant_type.",
        "servers": [
          {
            "url": "https://id.ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "token_type": {
                      "type": "string"
                    },
                    "expires_in": {
                      "type": "integer"
                    },
                    "scope": {
                      "type": "string"
                    },
                    "id_token": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "access_token": "ACCESS_TOKEN",
                  "token_type": "Bearer",
                  "expires_in": 3600,
                  "scope": "email openid profile",
                  "id_token": "SIGNED_ID_TOKEN"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "clientSecretBasic": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "grant_type": {
                    "type": "string"
                  },
                  "redirect_uri": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "code_verifier": {
                    "type": "string"
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  }
                },
                "required": [
                  "grant_type",
                  "redirect_uri",
                  "code",
                  "code_verifier"
                ]
              },
              "example": {
                "grant_type": "authorization_code",
                "redirect_uri": "https://app.example.org/callback",
                "code": "ONE_TIME_CODE",
                "code_verifier": "ORIGINAL_CODE_VERIFIER",
                "client_id": "CLIENT_ID"
              }
            }
          }
        }
      }
    },
    "/oauth/userinfo": {
      "get": {
        "summary": "Получить утверждения о пользователе",
        "tags": [
          "Методы OAuth и OIDC"
        ],
        "operationId": "get-oauth-userinfo",
        "description": "Передайте access_token Школа ID. sub присутствует всегда. Поля имени, email и организаций зависят от scope. Если источник недоступен, ответ может содержать organizations_unavailable. При недоступности всех нужных источников поле organizations может отсутствовать.",
        "servers": [
          {
            "url": "https://id.ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sub": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "family_name": {
                      "type": "string"
                    },
                    "given_name": {
                      "type": "string"
                    },
                    "middle_name": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "integer"
                    },
                    "email": {
                      "type": "string"
                    },
                    "email_verified": {
                      "type": "boolean"
                    },
                    "organizations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "system": {
                            "type": "string"
                          },
                          "system_title": {
                            "type": "string"
                          },
                          "account_id": {
                            "type": "string"
                          },
                          "org_id": {
                            "type": "string"
                          },
                          "org_name": {
                            "type": "string"
                          },
                          "roles": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "sub": "USER_SUB",
                  "name": "Иван Иванов",
                  "family_name": "Иванов",
                  "given_name": "Иван",
                  "middle_name": "",
                  "updated_at": 1735689600,
                  "email": "user@example.org",
                  "email_verified": true,
                  "organizations": [
                    {
                      "system": "ais",
                      "system_title": "АИС «Школа»",
                      "account_id": "42",
                      "org_id": "10",
                      "org_name": "Школа № 1",
                      "roles": [
                        "director"
                      ]
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "summary": "Получить профиль запросом POST",
        "tags": [
          "Методы OAuth и OIDC"
        ],
        "operationId": "post-oauth-userinfo",
        "description": "Поддерживает заголовок Authorization: Bearer или поле access_token в форме.",
        "servers": [
          {
            "url": "https://id.ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "sub": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "family_name": {
                      "type": "string"
                    },
                    "given_name": {
                      "type": "string"
                    },
                    "middle_name": {
                      "type": "string"
                    },
                    "updated_at": {
                      "type": "integer"
                    },
                    "email": {
                      "type": "string"
                    },
                    "email_verified": {
                      "type": "boolean"
                    }
                  }
                },
                "example": {
                  "sub": "USER_SUB",
                  "name": "Иван Иванов",
                  "family_name": "Иванов",
                  "given_name": "Иван",
                  "middle_name": "",
                  "updated_at": 1735689600,
                  "email": "user@example.org",
                  "email_verified": true
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "access_token": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "access_token": "ACCESS_TOKEN"
              }
            }
          }
        }
      }
    },
    "/oauth/revoke": {
      "post": {
        "summary": "Отозвать токен Школа ID",
        "tags": [
          "Методы OAuth и OIDC"
        ],
        "operationId": "post-oauth-revoke",
        "description": "Передайте token в форме. Для конфиденциального клиента используйте Basic или client_secret. Ответ 200 с пустым объектом.",
        "servers": [
          {
            "url": "https://id.ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {}
                },
                "example": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "clientSecretBasic": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "token": {
                    "type": "string"
                  }
                },
                "required": [
                  "token"
                ]
              },
              "example": {
                "client_id": "CLIENT_ID",
                "token": "ACCESS_TOKEN"
              }
            }
          }
        }
      }
    },
    "/oauth/jwks": {
      "get": {
        "summary": "Получить ключи для проверки ID Token",
        "tags": [
          "Методы OAuth и OIDC"
        ],
        "operationId": "get-oauth-jwks",
        "description": "Получите набор открытых JWK. Выберите ключ по kid из заголовка токена и проверьте подпись RS256.",
        "servers": [
          {
            "url": "https://id.ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "kty": {
                            "type": "string"
                          },
                          "alg": {
                            "type": "string"
                          },
                          "use": {
                            "type": "string"
                          },
                          "kid": {
                            "type": "string"
                          },
                          "n": {
                            "type": "string"
                          },
                          "e": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "keys": [
                    {
                      "kty": "RSA",
                      "alg": "RS256",
                      "use": "sig",
                      "kid": "KEY_ID",
                      "n": "RSA_MODULUS",
                      "e": "AQAB"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/oauth/logo/{client_id}": {
      "get": {
        "summary": "Получить логотип OAuth-клиента",
        "tags": [
          "Методы OAuth и OIDC"
        ],
        "operationId": "get-oauth-logo-client-id",
        "description": "Возвращает сохранённое изображение. Параметр v позволяет обновить кэш при смене версии логотипа.",
        "servers": [
          {
            "url": "https://id.ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        },
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "description": "Идентификатор сервиса.",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "CLIENT_ID"
          },
          {
            "name": "v",
            "in": "query",
            "description": "Версия изображения для кэша.",
            "required": false,
            "schema": {
              "type": "string"
            },
            "example": "VERSION"
          }
        ]
      }
    },
    "/organization/token": {
      "post": {
        "summary": "Обменять код привязки организации",
        "tags": [
          "Обмен кода привязки"
        ],
        "operationId": "post-organization-token",
        "description": "Серверный обмен для конфиденциального клиента с включённой привязкой организаций. Используйте Basic или client_id и client_secret в форме. redirect_uri должен совпасть с адресом для привязки. Код одноразовый, срок действия 300 секунд. Отзыв привязки делает неиспользованный код недействительным. Возвращается карточка связи. Поле ais_account_id присутствует для system=ais.",
        "servers": [
          {
            "url": "https://id.ais-soko.ru"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "binding_id": {
                      "type": "integer"
                    },
                    "organization": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "system": {
                          "type": "string"
                        }
                      }
                    },
                    "authorized_by": {
                      "type": "object",
                      "properties": {
                        "sub": {
                          "type": "string"
                        },
                        "account_id": {
                          "type": "string"
                        },
                        "ais_account_id": {
                          "type": "string"
                        },
                        "roles": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    },
                    "created_at": {
                      "type": "string"
                    }
                  }
                },
                "example": {
                  "binding_id": 15,
                  "organization": {
                    "id": "10",
                    "name": "Школа № 1",
                    "system": "ais"
                  },
                  "authorized_by": {
                    "sub": "USER_SUB",
                    "account_id": "42",
                    "ais_account_id": "42",
                    "roles": [
                      "director"
                    ]
                  },
                  "created_at": "2026-11-28T10:00:00+10:00"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "clientSecretBasic": []
          },
          {}
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "grant_type": {
                    "type": "string"
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "redirect_uri": {
                    "type": "string"
                  }
                },
                "required": [
                  "grant_type",
                  "code",
                  "redirect_uri"
                ]
              },
              "example": {
                "grant_type": "organization_binding",
                "client_id": "CLIENT_ID",
                "client_secret": "CLIENT_SECRET",
                "code": "ONE_TIME_BINDING_CODE",
                "redirect_uri": "https://app.example.org/organization/callback"
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Авторизация"
    },
    {
      "name": "Школы и записи"
    },
    {
      "name": "Опросы"
    },
    {
      "name": "Мобильный дневник"
    },
    {
      "name": "Мобильный журнал"
    },
    {
      "name": "Методы OAuth и OIDC"
    },
    {
      "name": "Обмен кода привязки"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "clientSecretBasic": {
        "type": "http",
        "scheme": "basic"
      }
    },
    "schemas": {
      "academicyear": {
        "title": "Учебные годы",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "year": {
            "type": "string"
          },
          "school": {
            "type": "integer"
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "agent": {
        "title": "Профили специалистов",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "user": {
            "type": "integer"
          },
          "balance": {
            "type": "number"
          },
          "rating": {
            "type": "number"
          }
        }
      },
      "attendance": {
        "title": "Посещаемость",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "student": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "mark": {
            "type": "string"
          },
          "is_full_day": {
            "type": "boolean"
          },
          "lesson_numbers": {},
          "comment": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "building": {
        "title": "Корпуса",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": "string"
          }
        }
      },
      "callscheduleentry": {
        "title": "Звонки",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "template": {
            "type": "integer"
          },
          "start_time": {
            "type": "string",
            "format": "time"
          },
          "end_time": {
            "type": "string",
            "format": "time"
          },
          "order": {
            "type": "integer"
          },
          "day_of_week": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "callscheduletemplate": {
        "title": "Шаблоны звонков",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "is_published": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "curriculumitem": {
        "title": "Позиции учебного плана",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "plan": {
            "type": "integer"
          },
          "part": {
            "type": "string"
          },
          "subject_area": {
            "type": "string"
          },
          "subject": {
            "type": "integer"
          },
          "grade": {
            "type": "integer"
          },
          "hours_per_week": {
            "type": "number"
          },
          "attestation_form": {
            "type": "string"
          },
          "order": {
            "type": "integer"
          }
        }
      },
      "curriculumplan": {
        "title": "Учебные планы",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "level": {
            "type": "string"
          },
          "week_days": {
            "type": "integer"
          },
          "study_weeks": {
            "type": "integer"
          },
          "is_approved": {
            "type": "boolean"
          },
          "approved_note": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "debtretake": {
        "title": "Пересдачи",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "student": {
            "type": "integer"
          },
          "subject": {
            "type": "integer"
          },
          "period": {
            "type": [
              "integer",
              "null"
            ]
          },
          "attempt": {
            "type": "integer"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "form": {
            "type": "string"
          },
          "commission": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "new_mark": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "groups": {
        "title": "Классы",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "school": {
            "type": "integer"
          },
          "tutor": {
            "type": [
              "integer",
              "null"
            ]
          },
          "year": {
            "type": "integer"
          }
        }
      },
      "homework": {
        "title": "Домашние задания",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "lesson": {
            "type": "integer"
          },
          "order": {
            "type": "integer"
          },
          "description": {
            "type": "string"
          },
          "check_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "check_lesson_order": {
            "type": [
              "integer",
              "null"
            ]
          },
          "audience": {
            "type": "string"
          },
          "created_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "homeworkattachment": {
        "title": "Вложения заданий",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "homework": {
            "type": "integer"
          },
          "file": {
            "type": "string"
          },
          "original_name": {
            "type": "string"
          },
          "size": {
            "type": "integer"
          },
          "uploaded_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "homeworkcompletion": {
        "title": "Выполнение заданий",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "homework": {
            "type": "integer"
          },
          "student": {
            "type": "integer"
          },
          "done_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "homeworktarget": {
        "title": "Назначение заданий",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "homework": {
            "type": "integer"
          },
          "student": {
            "type": "integer"
          }
        }
      },
      "ktptemplate": {
        "title": "Шаблоны КТП",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "grade": {
            "type": "integer"
          },
          "subject": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "weekly_hours": {
            "type": "integer"
          },
          "level": {
            "type": "string"
          },
          "education_level": {
            "type": "string"
          },
          "audience": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "author": {
            "type": [
              "integer",
              "null"
            ]
          },
          "textbook": {
            "type": "string"
          },
          "is_system": {
            "type": "boolean"
          },
          "based_on": {
            "type": [
              "integer",
              "null"
            ]
          },
          "note": {
            "type": "string"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ktptemplategroup": {
        "title": "Классы КТП",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "ktp_data": {},
          "ktp_published": {
            "type": "boolean"
          },
          "template": {
            "type": "integer"
          },
          "group": {
            "type": "integer"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ktptemplateitem": {
        "title": "Уроки КТП",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "template": {
            "type": "integer"
          },
          "lesson_number": {
            "type": "integer"
          },
          "topic": {
            "type": "string"
          },
          "homework": {
            "type": [
              "string",
              "null"
            ]
          },
          "theme": {
            "type": "string"
          },
          "theme_order": {
            "type": "integer"
          },
          "is_control": {
            "type": "boolean"
          },
          "is_repeat": {
            "type": "boolean"
          },
          "editor_data": {}
        }
      },
      "kugschedule": {
        "title": "Расписание внеурочных занятий",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "academic_year": {
            "type": [
              "integer",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "comment": {
            "type": "string"
          },
          "periods": {
            "type": "string"
          },
          "year_label": {
            "type": "string"
          },
          "is_published": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "marks": {
        "title": "Оценки",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "student": {
            "type": "integer"
          },
          "schedule": {
            "type": "integer"
          },
          "mark": {},
          "comment": {
            "type": [
              "string",
              "null"
            ]
          },
          "work_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "typemark": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "parentlink": {
        "title": "Связи с родителями",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "parent": {
            "type": "integer"
          },
          "student": {
            "type": "integer"
          },
          "relation": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "period": {
        "title": "Учебные периоды",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "periodscheme": {
        "title": "Схемы периодов",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "is_published": {
            "type": "boolean"
          }
        }
      },
      "periodschemeitem": {
        "title": "Элементы схемы периодов",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "scheme": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "order": {
            "type": "integer"
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          }
        }
      },
      "room": {
        "title": "Кабинеты",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "building": {
            "type": [
              "integer",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "capacity": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "schedule": {
        "title": "Расписание уроков",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "group": {
            "type": "integer"
          },
          "subject": {
            "type": "integer"
          },
          "teacher": {
            "type": "integer"
          },
          "period": {
            "type": "integer"
          },
          "date": {
            "type": "string",
            "format": "date"
          },
          "order": {
            "type": "integer"
          },
          "day_of_week": {
            "type": "integer"
          },
          "template": {
            "type": [
              "integer",
              "null"
            ]
          },
          "room": {
            "type": [
              "integer",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "original_teacher": {
            "type": [
              "integer",
              "null"
            ]
          },
          "original_subject": {
            "type": [
              "integer",
              "null"
            ]
          },
          "topic": {
            "type": [
              "string",
              "null"
            ]
          },
          "topic_color": {
            "type": "string"
          },
          "homework": {
            "type": [
              "string",
              "null"
            ]
          },
          "homework_next": {
            "type": "boolean"
          },
          "homework_none": {
            "type": "boolean"
          },
          "work_types": {}
        }
      },
      "scheduletemplate": {
        "title": "Шаблоны расписания",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "group": {
            "type": "integer"
          },
          "template_name": {
            "type": "string"
          },
          "is_published": {
            "type": "boolean"
          },
          "published_scopes": {},
          "published_week_dates": {}
        }
      },
      "scheduletemplateinfo": {
        "title": "Позиции шаблона расписания",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "group": {
            "type": "integer"
          },
          "subject": {
            "type": "integer"
          },
          "teacher": {
            "type": "integer"
          },
          "period": {
            "type": "integer"
          },
          "order": {
            "type": "integer"
          },
          "day_of_week": {
            "type": "integer"
          },
          "room": {
            "type": [
              "integer",
              "null"
            ]
          },
          "template": {
            "type": "integer"
          }
        }
      },
      "schooldocument": {
        "title": "Документы школы",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "title": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "file": {
            "type": "string"
          },
          "is_published": {
            "type": "boolean"
          },
          "uploaded_by": {
            "type": [
              "integer",
              "null"
            ]
          },
          "uploaded_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "School": {
        "title": "Карточка школы",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "short_name": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "director": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "registration_ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": "string"
          },
          "legal_address": {
            "type": "string"
          },
          "actual_address": {
            "type": "string"
          },
          "inn": {
            "type": "string"
          },
          "ogrn": {
            "type": "string"
          },
          "kpp": {
            "type": "string"
          },
          "license_no": {
            "type": "string"
          },
          "license_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "license_authority": {
            "type": "string"
          },
          "accreditation_no": {
            "type": "string"
          },
          "accreditation_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "info_published": {
            "type": "boolean"
          },
          "reg_date": {
            "type": "string",
            "format": "date-time"
          },
          "tarrif": {
            "type": "string"
          },
          "subscription_modules": {},
          "subscribeto": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "next_tariff": {
            "type": "string"
          },
          "next_tariff_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "retention_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "current_year": {
            "type": [
              "integer",
              "null"
            ]
          },
          "grade_thresholds": {},
          "mark_days_before": {
            "type": [
              "integer",
              "null"
            ]
          },
          "mark_days_after": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "SchoolPatch": {
        "type": "object",
        "properties": {
          "short_name": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "director": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "registration_ip": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": "string"
          },
          "legal_address": {
            "type": "string"
          },
          "actual_address": {
            "type": "string"
          },
          "inn": {
            "type": "string"
          },
          "ogrn": {
            "type": "string"
          },
          "kpp": {
            "type": "string"
          },
          "license_no": {
            "type": "string"
          },
          "license_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "license_authority": {
            "type": "string"
          },
          "accreditation_no": {
            "type": "string"
          },
          "accreditation_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "info_published": {
            "type": "boolean"
          },
          "tarrif": {
            "type": "string"
          },
          "subscription_modules": {},
          "subscribeto": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "next_tariff": {
            "type": "string"
          },
          "next_tariff_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "retention_until": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "current_year": {
            "type": [
              "integer",
              "null"
            ]
          },
          "grade_thresholds": {},
          "mark_days_before": {
            "type": [
              "integer",
              "null"
            ]
          },
          "mark_days_after": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "staymode": {
        "title": "Режимы пребывания",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "school": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "building": {
            "type": "string"
          },
          "bells": {
            "type": "string"
          },
          "events": {
            "type": "string"
          },
          "legacy_classes": {
            "type": "string"
          },
          "period_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "period_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "status": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "students": {
        "title": "Ученики",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "user": {
            "type": "integer"
          },
          "group": {
            "type": "integer"
          },
          "school_at": {
            "type": "string",
            "format": "date"
          },
          "admitted_note": {
            "type": "string"
          },
          "graduated": {
            "type": "boolean"
          },
          "left_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "left_reason": {
            "type": "string"
          },
          "left_note": {
            "type": "string"
          }
        }
      },
      "subjects": {
        "title": "Предметы",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "school": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          }
        }
      },
      "totalmarks": {
        "title": "Итоговые отметки",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "student": {
            "type": "integer"
          },
          "subject": {
            "type": "integer"
          },
          "period": {
            "type": "integer"
          },
          "total_mark": {
            "type": "string"
          },
          "is_manual": {
            "type": "boolean"
          }
        }
      },
      "typemark": {
        "title": "Виды работы урока",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "typemark": {
            "type": "integer"
          },
          "lesson": {
            "type": "integer"
          }
        }
      },
      "typesmark": {
        "title": "Справочник видов работы",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "short": {
            "type": "string"
          },
          "full": {
            "type": "string"
          },
          "school": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "weight": {
            "type": "number"
          },
          "is_control": {
            "type": "boolean"
          }
        }
      },
      "user": {
        "title": "Пользователи",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "username": {
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "is_active": {
            "type": "boolean"
          },
          "date_joined": {
            "type": "string",
            "format": "date-time"
          },
          "role": {
            "type": "string"
          },
          "school": {
            "type": [
              "integer",
              "null"
            ]
          },
          "blocked": {
            "type": "boolean"
          },
          "birth_date": {
            "type": [
              "string",
              "null"
            ],
            "format": "date"
          },
          "gender": {
            "type": "string"
          },
          "snils": {
            "type": [
              "string",
              "null"
            ]
          },
          "identity_document": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "position": {
            "type": "string"
          }
        }
      },
      "workload": {
        "title": "Нагрузка",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "teacher": {
            "type": "integer"
          },
          "subject": {
            "type": "integer"
          },
          "group": {
            "type": "integer"
          },
          "room": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "yearfinalmark": {
        "title": "Годовые отметки",
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "student": {
            "type": "integer"
          },
          "subject": {
            "type": "integer"
          },
          "year": {
            "type": "integer"
          },
          "mark": {
            "type": "string"
          },
          "exam_mark": {
            "type": "string"
          },
          "cert_mark": {
            "type": "string"
          }
        }
      }
    }
  }
}
