{
  "x-generator": "NSwag v14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))",
  "openapi": "3.0.0",
  "info": {
    "title": "Timetable.Api",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://2025-26.timetable.cam.ac.uk"
    }
  ],
  "paths": {
    "/api/users/admin/{userId}": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Update user details as admin.",
        "description": "Updates user details for the specified user ID. Only admins can update users. Returns the updated user details.",
        "operationId": "UpdateUserEndpoint",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "UpdateUserRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesUsersUpdateUserUpdateUserRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "User updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesUsersGetUserAsAdminGetUserAsAdminResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not admin."
          },
          "404": {
            "description": "User not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to update user.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      },
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get user details as admin.",
        "description": "Returns user details for the specified user ID. Only admins can access. Returns 404 if user not found.",
        "operationId": "GetUserAsAdminEndpoint",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesUsersGetUserAsAdminGetUserAsAdminResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not admin."
          },
          "404": {
            "description": "User not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to fetch user.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/users/admin/{userId}/permissions": {
      "post": {
        "tags": [
          "Users"
        ],
        "summary": "Update user group permissions.",
        "description": "Adds or removes group permissions for the specified user. Only admins can update permissions. Returns success if update is completed.",
        "operationId": "UpdateUserPermissionsEndpoint",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "UpdateUserPremissionsRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesUsersUpdatePermissionsUpdateUserPremissionsRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "User permissions updated successfully."
          },
          "401": {
            "description": "Unauthorized: User is not admin."
          },
          "404": {
            "description": "User not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to update permissions.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      },
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get user group permissions.",
        "description": "Returns all group permissions for the specified user. Only admins can access. Returns an empty list if user is an admin or has no group memberships.",
        "operationId": "GetUserPermissionsEndpoint",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User group permissions returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesUsersGetPermissionsGetUserPremissionsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not admin."
          },
          "404": {
            "description": "User not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to fetch permissions.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/users/search": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Search for users by name or email.",
        "description": "Searches for users by name or email. Only admins and group admins can search users. Returns a list of matching users.",
        "operationId": "SearchUsersEndpoint",
        "parameters": [
          {
            "name": "searchTerm",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Users returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesUsersSearchUsersSearchUsersResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not admin or group admin."
          },
          "500": {
            "description": "Internal server error: Failed to search users.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Get user by email.",
        "description": "Returns user details for the specified email address. Only Organisation admins are allowed to access this endpoint. Returns 404 if user not found.",
        "operationId": "GetUserEndpoint",
        "parameters": [
          {
            "name": "email",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesUsersGetUserGetUserResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not an organisation admin."
          },
          "404": {
            "description": "User not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to fetch user.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/series/{seriesId}": {
      "post": {
        "tags": [
          "Series"
        ],
        "summary": "Update a series.",
        "description": "Updates the specified series. Only admins or permitted group admins can update series. Returns the updated series details.",
        "operationId": "UpdateSeriesEndpoint",
        "parameters": [
          {
            "name": "seriesId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "UpdateSeriesRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesUpdateUpdateSeriesRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Series updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetSeriesSeriesDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not admin or group admin."
          },
          "404": {
            "description": "Series not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to update series.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      },
      "get": {
        "tags": [
          "Series"
        ],
        "summary": "Get a series by ID.",
        "description": "Returns details for the specified series. Only admins or permitted group admins can access. Optionally includes linked org units.",
        "operationId": "GetSeriesEndpoint",
        "parameters": [
          {
            "name": "seriesId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeOrgUnits",
            "in": "query",
            "schema": {
              "type": "boolean",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Series returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetSeriesSeriesDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not admin or group admin."
          },
          "404": {
            "description": "Series not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to fetch series.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Series"
        ],
        "summary": "Delete a series.",
        "description": "Deletes the specified series. Only admins or permitted group admins can delete series. Returns success if the series was deleted.",
        "operationId": "DeleteSeriesEndpoint",
        "parameters": [
          {
            "name": "seriesId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Series deleted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesDeleteDeleteSeriesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not admin or group admin."
          },
          "404": {
            "description": "Series not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to delete series.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/series/{seriesId}/unsubscribe": {
      "post": {
        "tags": [
          "Series"
        ],
        "summary": "Unsubscribe a user from a series.",
        "description": "Unsubscribes the specified user from the series. Returns success if unsubscription is completed.",
        "operationId": "UnsubscribeFromSeriesEndpoint",
        "parameters": [
          {
            "name": "seriesId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "UnsubscribeSeriesRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesUnsbuscribeUnsubscribeSeriesRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "User unsubscribed from series successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesUnsbuscribeUnsubscribeSeriesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "User or series not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to unsubscribe user.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/series/{seriesId}/subscribe": {
      "post": {
        "tags": [
          "Series"
        ],
        "summary": "Subscribe a user to a series.",
        "description": "Subscribes the specified user to the series. Returns success if subscription is completed.",
        "operationId": "SubscribeToSeriesEndpoint",
        "parameters": [
          {
            "name": "seriesId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "SubscribeToSeriesRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesSubscribeSubscribeToSeriesRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "User subscribed to series successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesSubscribeSubscribeToSeriesResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "User, org unit, or series not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to subscribe user.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/series/{seriesId}/parents": {
      "get": {
        "tags": [
          "Series"
        ],
        "summary": "Get parent org units for a series.",
        "description": "Returns all parent org units for the specified series. Anonymous access is allowed. Returns an empty list if no parents found.",
        "operationId": "GetParentsEndpoint",
        "parameters": [
          {
            "name": "seriesId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Parent org units returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetParentsGetParentsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Series not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to fetch parent org units.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/series/{seriesId}/events-with-admin-info": {
      "get": {
        "tags": [
          "Series"
        ],
        "summary": "Get all events for a series (admin only).",
        "description": "Returns all events for the specified series. Only admins or permitted group admins can access. Returns an empty list if no events found.",
        "operationId": "GetEventsForAdminEndpoint",
        "parameters": [
          {
            "name": "seriesId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Events returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetEventsForAdminEndpointGetEventsForAdminResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not admin or group admin."
          },
          "404": {
            "description": "Series not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to fetch events.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/series/{seriesId}/events": {
      "get": {
        "tags": [
          "Series"
        ],
        "summary": "Get all events for a series.",
        "description": "Returns all events for the specified series. Anonymous access is allowed. Returns an empty list if no events found.",
        "operationId": "GetEventsEndpoint",
        "parameters": [
          {
            "name": "seriesId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "nullable": true
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "nullable": true
            }
          },
          {
            "name": "upcoming",
            "in": "query",
            "schema": {
              "type": "boolean",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Events returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetEventsGetEventsResponse"
                }
              }
            }
          },
          "404": {
            "description": "Series not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to fetch events.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/modules/{moduleId}/series": {
      "post": {
        "tags": [
          "Modules"
        ],
        "summary": "Create a new series.",
        "description": "Creates a new series and links it to the specified module (org unit). Only admins or permitted group admins can create series. Returns the created series details.",
        "operationId": "CreateSeriesEndpoint",
        "parameters": [
          {
            "name": "moduleId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "CreateSeriesRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesCreateCreateSeriesRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Series created and linked to module successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetSeriesSeriesDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not admin or group admin."
          },
          "404": {
            "description": "Module not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to create or link series.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/series/all/updated": {
      "post": {
        "tags": [
          "Series"
        ],
        "operationId": "AllUpdatedEndpoint",
        "requestBody": {
          "x-name": "AllUpdatedSeriesRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesAllUpdatedAllUpdatedSeriesRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/reports/user-permissions": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Gets a list of current user permissions for all org units.",
        "description": "Get a list of admin users and their permissions, detailing which org units they have access to",
        "operationId": "GetUserPermissionListEndpoint",
        "responses": {
          "200": {
            "description": "User permissions list retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TimetableApplicationContractsDataUserPermissionDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not organisation admin."
          },
          "500": {
            "description": "Internal server error: Failed to retrieve user permission list.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/reports/orgunit-hierarchy": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Gets a tabular org unit hierarchy report.",
        "description": "Get all org units in the current app with hierarchy columns (course/subject/part/module) for reporting.",
        "operationId": "GetOrgUnitHierarchyReportEndpoint",
        "parameters": [
          {
            "name": "includeModules",
            "in": "query",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Org unit hierarchy report retrieved successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TimetableApplicationContractsDataOrgUnitHierarchyReportRowDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not organisation admin."
          },
          "404": {
            "description": "Org unit hierarchy report not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to retrieve org unit hierarchy report.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/reports/user-permissions/export/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Exports admin permissions as CSV for Excel.",
        "description": "Download a tabular admin permissions report with one row per permission in CSV format.",
        "operationId": "ExportUserPermissionListCsvEndpoint",
        "responses": {
          "200": {
            "description": "Admin permissions report exported successfully."
          },
          "401": {
            "description": "Unauthorized: User is not organisation admin."
          },
          "500": {
            "description": "Internal server error: Failed to export admin permissions report.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/reports/orgunit-hierarchy/export/csv": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Exports the org unit hierarchy report as CSV for Excel.",
        "description": "Download a tabular org unit hierarchy report in CSV format that can be opened in Excel.",
        "operationId": "ExportOrgUnitHierarchyCsvEndpoint",
        "parameters": [
          {
            "name": "includeModules",
            "in": "query",
            "required": true,
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Org unit hierarchy report exported successfully."
          },
          "401": {
            "description": "Unauthorized: User is not organisation admin."
          },
          "404": {
            "description": "Org unit hierarchy report not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to export org unit hierarchy report.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/orgunit/{orgUnitId}": {
      "put": {
        "tags": [
          "Orgunit"
        ],
        "summary": "Update an organisation unit.",
        "description": "Updates an organisation unit by ID. Organisation admins can update all supported fields. Group admins can update org units in groups they have permission to manage, including ExcludeEventsFromRollover.",
        "operationId": "UpdateOrgUnitEndpoint",
        "parameters": [
          {
            "name": "orgUnitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "UpdateOrgUnitRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitUpdateUpdateOrgUnitRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Org unit updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetOrgUnitsOrgUnitDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not authenticated."
          },
          "404": {
            "description": "Org unit not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to update org unit.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      },
      "get": {
        "tags": [
          "Orgunit"
        ],
        "summary": "Get organisation unit by ID.",
        "description": "Retrieves detailed information about a specific organisation unit. Only admins or permitted group admins can view org units.",
        "operationId": "GetOrgUnitEndpoint",
        "parameters": [
          {
            "name": "orgUnitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "includeSeries",
            "in": "query",
            "schema": {
              "type": "boolean",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "organisation unit found and returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetOrgUnitsOrgUnitDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not authenticated."
          },
          "404": {
            "description": "organisation unit not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to retrieve org unit.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Orgunit"
        ],
        "summary": "Delete an organisation unit.",
        "description": "Deletes an organisation unit by ID. Only admins or permitted group admins can delete org units. Group admins must have authority for the org unit's group.",
        "operationId": "DeleteOrgUnitEndpoint",
        "parameters": [
          {
            "name": "orgUnitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Org unit deleted successfully."
          },
          "401": {
            "description": "Unauthorized: User is not authenticated."
          },
          "404": {
            "description": "Org unit not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to delete org unit.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/orgunit/{orgUnitId}/unsubscribe": {
      "post": {
        "tags": [
          "Orgunit"
        ],
        "summary": "Unsubscribe a user from an organisation unit.",
        "description": "Unsubscribes the specified user from all events in the organisation unit. Returns success if unsubscription is completed.",
        "operationId": "UnsubscribeFromOrgUnitEndpoint",
        "parameters": [
          {
            "name": "orgUnitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "UnsubscribeOrgUnitRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitUnsubscribeUnsubscribeOrgUnitRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "User unsubscribed from org unit events successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitUnsubscribeUnsubscribeOrgUnitResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "User or org unit not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to unsubscribe user.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/orgunit/{orgUnitId}/subscribe": {
      "post": {
        "tags": [
          "Orgunit"
        ],
        "summary": "Subscribe a user to an organisation unit.",
        "description": "Subscribes the specified user to all events in the organisation unit and its children. Returns success if subscription is completed.",
        "operationId": "SubscribeToOrgUnitEndpoint",
        "parameters": [
          {
            "name": "orgUnitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "SubscribeOrgUnitRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitSubscribeSubscribeOrgUnitRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "User subscribed to org unit and child events successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitSubscribeSubscribeOrgUnitResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "User or org unit not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to subscribe user.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/orgunit/{orgUnitId}/series": {
      "delete": {
        "tags": [
          "Orgunit"
        ],
        "summary": "Remove a borrowed series from an organisation unit.",
        "description": "Removes a borrowed series from an organisation unit. Only admins or permitted group admins can remove series. Group admins must have authority for the org unit's group.",
        "operationId": "RemoveBorrowedSeriesEndpoint",
        "parameters": [
          {
            "name": "orgUnitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "RemoveBorrowedSeriesRequest",
          "description": "",
          "content": {
            "*/*": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitRemoveBorrowedSeriesRemoveBorrowedSeriesRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitRemoveBorrowedSeriesRemoveBorrowedSeriesRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Series removed successfully."
          },
          "401": {
            "description": "Unauthorized: User is not authenticated."
          },
          "404": {
            "description": "Series not found or not linked to org unit.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to remove series.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Orgunit"
        ],
        "summary": "Borrow series for an organisation unit.",
        "description": "Allows an admin or permitted group admin to borrow series from other modules for this org unit (module). Returns the number of series successfully linked and any failures.",
        "operationId": "OrgUnitBorrowSeriesEndpoint",
        "parameters": [
          {
            "name": "orgUnitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "OrgUnitBorrowSeriesRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitBorrowSeriesOrgUnitBorrowSeriesRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Series linked to org unit successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitBorrowSeriesOrgUnitBorrowSeriesResponse"
                },
                "example": {
                  "successCount": 2,
                  "failureCount": 0
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not authenticated."
          },
          "404": {
            "description": "Org unit not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to link series.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/orgunit/{orgUnitId}/parents": {
      "get": {
        "tags": [
          "Orgunit"
        ],
        "summary": "Get parent hierarchy of a given org unit",
        "operationId": "GetParentEndpoint",
        "parameters": [
          {
            "name": "orgUnitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetParentsGetParentsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/orgunit": {
      "get": {
        "tags": [
          "Orgunit"
        ],
        "summary": "Get all organisation units.",
        "description": "Returns all organisation units for the current app and tenant. Optionally includes series and permissions. Anonymous users can view public org units.",
        "operationId": "Organisation Units",
        "parameters": [
          {
            "name": "parent",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "nullable": true
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            }
          },
          {
            "name": "includeSeries",
            "in": "query",
            "schema": {
              "type": "boolean",
              "nullable": true
            }
          },
          {
            "name": "includePermissions",
            "in": "query",
            "schema": {
              "type": "boolean",
              "nullable": true
            }
          },
          {
            "name": "userId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "organisation units returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetOrgUnitsGetOrgUnitsResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to fetch org units.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Orgunit"
        ],
        "summary": "Create a new organisation unit.",
        "description": "Creates a new organisation unit. Only admins or permitted group admins can create org units. Group admins can only create org units under their group.",
        "operationId": "CreateOrgUnitEndpoint",
        "requestBody": {
          "x-name": "CreateOrgUnitRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitCreateCreateOrgUnitRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Org unit created successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetOrgUnitsOrgUnitDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not admin or group admin."
          },
          "404": {
            "description": "Parent org unit not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to create org unit or group.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/orgunit/{orgUnitId}/calendar": {
      "get": {
        "tags": [
          "Orgunit"
        ],
        "summary": "Get events for an organisation unit.",
        "description": "Returns all events for the specified organisation unit. Only admins or permitted group admins can access. Optionally filter by start/end date.",
        "operationId": "GetOrgUnitCalendarEndpoint",
        "parameters": [
          {
            "name": "orgUnitId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "start",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time",
              "nullable": true
            }
          },
          {
            "name": "end",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "date-time",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Events returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetOrgUnitCalendarGetOrgUnitCalendarResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not admin or group admin."
          },
          "404": {
            "description": "Org unit or events not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to fetch events.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/me": {
      "get": {
        "tags": [
          "Me"
        ],
        "summary": "Get information about the current user and app context.",
        "description": "Returns information about the current user, including admin and group admin status, permitted group IDs, and app context. If the user is not logged in, returns anonymous status and app info only.",
        "operationId": "GetMeEndpoint",
        "responses": {
          "200": {
            "description": "User and app information returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesMyInfoGetMeGetMeResponse"
                }
              }
            }
          },
          "404": {
            "description": "App or tenant not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: User not found or other error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/group/{groupId}/lock": {
      "post": {
        "tags": [
          "Group"
        ],
        "summary": "Lock a group for editing.",
        "description": "Locks a group for editing, preventing other users from making changes for a short duration. Only admin users or permitted group admins can lock a group. Returns the lock status and information about who holds the lock.",
        "operationId": "LockGroupEndpoint",
        "parameters": [
          {
            "name": "groupId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "LockGroupRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesGroupLockGroupLockGroupRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Group locked or lock status returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesGroupLockGroupLockGroupResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not an admin or permitted group admin."
          },
          "404": {
            "description": "Group not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/events/{eventId}": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Update an existing event.",
        "description": "Updates the details of an existing event. Only users with admin or group admin permissions for the event's series can update events. Returns the updated event details.",
        "operationId": "UpdateEventEndpoint",
        "parameters": [
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "x-name": "UpdateEventRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesEventsUpdateUpdateEventRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Event updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetEventsForAdminEndpointSeriesEventForAdminDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not an admin or group admin."
          },
          "404": {
            "description": "Event or series not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to update event.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Events"
        ],
        "summary": "Delete an event.",
        "description": "Deletes the specified event. Only users with admin or group admin permissions for the event's group can delete events. Returns success if the event was deleted.",
        "operationId": "DeleteEventEndpoint",
        "parameters": [
          {
            "name": "eventId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Event deleted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesEventsDeleteDeleteEventResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not an admin or group admin."
          },
          "404": {
            "description": "Event not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to delete event.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/events/batch": {
      "put": {
        "tags": [
          "Events"
        ],
        "summary": "Update multiple events in a series.",
        "description": "Updates multiple events in the specified series. Only users with admin or group admin permissions for the series can update events. All events must belong to the same series. Returns the updated events.",
        "operationId": "UpdateMultipleEventsEndpoint",
        "requestBody": {
          "x-name": "UpdateMultipleEventsRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesEventsUpdateUpdateMultipleEventsRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Events updated successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesEventsUpdateUpdateMultipleEventsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not an admin or group admin."
          },
          "404": {
            "description": "Series not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to update events.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Create multiple events and link them to a series.",
        "description": "Creates multiple events and links them to the specified series. Only users with admin or group admin permissions for the series can create events. All events must belong to the same series. Returns the created events.",
        "operationId": "CreateMultipleEventsEndpoint",
        "requestBody": {
          "x-name": "CreateMultipleEventsRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesEventsCreateCreateMultipleEventsRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Events created and linked to series successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesEventsCreateCreateMultipleEventsResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not an admin or group admin."
          },
          "404": {
            "description": "Series not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to create events.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/events": {
      "post": {
        "tags": [
          "Events"
        ],
        "summary": "Create a new event and link it to a series.",
        "description": "Creates a new event and links it to the specified series. Only users with admin or group admin permissions for the series can create events. Returns the created event details.",
        "operationId": "CreateEventEndpoint",
        "requestBody": {
          "x-name": "CreateEventRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesEventsCreateCreateEventRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Event created and linked to series successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetEventsForAdminEndpointSeriesEventForAdminDto"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User is not an admin or group admin."
          },
          "404": {
            "description": "Series not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to create event.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/config": {
      "get": {
        "tags": [
          "Config"
        ],
        "summary": "Get configuration for the current app and tenant.",
        "description": "Returns the configuration settings for the current app and tenant, including feature flags, academic terms, authentication settings, and more. The response is cached for performance. Returns 404 if configuration is not found.",
        "operationId": "GetConfigEndpoint",
        "responses": {
          "200": {
            "description": "Configuration returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesConfigGetConfigGetConfigResponse"
                }
              }
            }
          },
          "404": {
            "description": "Configuration not found for the current app/tenant.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/users/{userId}/{token}/calendar.ical": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Serve a legacy dynamic iCal (.ics) response for compatibility-only calendar subscriptions.",
        "description": "Returns a dynamically generated calendar for existing compatibility subscriptions that still hit the API route directly. New subscription URLs are issued as stable tokenized links backed by published static artifacts. Requires a valid calendar token. If the user or token is invalid, returns 401 Unauthorized. If the calendar is empty, returns a valid iCal file with no events.",
        "operationId": "GetCalendarIcalFileEndpoint",
        "parameters": [
          {
            "name": "userId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "iCal file returned successfully.",
            "content": {
              "text/calendar": {
                "schema": {
                  "type": "string",
                  "format": "byte"
                }
              }
            }
          }
        }
      }
    },
    "/api/calendars": {
      "get": {
        "tags": [
          "Calendars"
        ],
        "summary": "Get a user's calendar and events.",
        "description": "Returns the calendar and all events for the specified user. If the calendar does not exist, a new one is created automatically. Returns 404 if the user is not found.",
        "operationId": "GetCalendarEndpoint",
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Calendar and events returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesCalendarsGetCalendarGetCalendarResponse"
                },
                "example": {
                  "events": [
                    {
                      "id": 101,
                      "context": "todo",
                      "description": "Math class",
                      "displayName": "Maths 101",
                      "end": "2026-11-25T11:20:41.5353125+00:00",
                      "location": "Room 12",
                      "notes": "Bring calculator",
                      "organisers": [
                        "Dr. Smith"
                      ],
                      "otherOrganisers": "Prof. Guest",
                      "start": "2026-11-25T10:20:41.5353341+00:00",
                      "seriesId": 1,
                      "type": "Lecture",
                      "updatedAt": "2026-11-25T10:20:41.5354023+00:00"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: User does not have permission to access this calendar."
          },
          "404": {
            "description": "User not found.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Failed to create or update calendar.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          {
            "JWTBearerAuth": []
          }
        ]
      }
    },
    "/api/auth/refresh": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Exchange a refresh token for a new access token.",
        "description": "Validates and rotates the presented refresh token, returning a new short-lived access token and a new refresh token. Returns 401 if the refresh token is unknown, expired, revoked (including reuse-detection), or was issued for a different app than the requesting host's.",
        "operationId": "RefreshEndpoint",
        "requestBody": {
          "x-name": "RefreshRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesAuthRefreshRefreshRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesAuthRefreshRefreshResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/auth/logout": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Log out by revoking a refresh token.",
        "description": "Revokes the presented refresh token (optionally all sessions for the same user + app). Idempotent — always returns 204.",
        "operationId": "LogoutEndpoint",
        "requestBody": {
          "x-name": "LogoutRequest",
          "description": "",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesAuthLogoutLogoutRequest"
              }
            }
          },
          "required": true,
          "x-position": 1
        },
        "responses": {
          "200": {
            "description": "Success",
            "content": {
              "text/plain": {
                "schema": {}
              },
              "application/json": {
                "schema": {}
              }
            }
          },
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/api/auth/token": {
      "get": {
        "tags": [
          "Auth"
        ],
        "summary": "Exchange OAuth code for an access token.",
        "description": "Exchanges an OAuth authorization code for a JWT access token and user information. If the user does not exist, a new user is created. Returns the access token, id token, and user email.",
        "operationId": "GetAccessTokenEndpoint",
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": true,
            "description": "The authorization code received from Google after user consent",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "verifier",
            "in": "query",
            "schema": {
              "type": "string",
              "nullable": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Access token and user info returned successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TimetableEndpointsFeaturesAuthGetAccessTokenGetAccessTokenResponse"
                },
                "example": {
                  "accessToken": "jwt-token",
                  "refreshToken": null,
                  "idToken": "provider-id-token",
                  "email": "user@example.com",
                  "firstName": "John",
                  "lastName": "Doe"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: Identity provider authentication failed or user could not be created.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error: Missing signing key or other server error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/FastEndpointsProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "TimetableEndpointsFeaturesUsersGetUserAsAdminGetUserAsAdminResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "tenantSsoUserId": {
            "type": "string",
            "nullable": true
          },
          "isAdmin": {
            "type": "boolean",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesUsersUpdateUserUpdateUserRequest": {
        "type": "object",
        "example": {
          "displayName": "John Doe",
          "email": "john@example.com",
          "tenantSsoUserId": "shib123",
          "isAdmin": true
        },
        "additionalProperties": false,
        "properties": {
          "displayName": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "tenantSsoUserId": {
            "type": "string",
            "nullable": true
          },
          "isAdmin": {
            "type": "boolean",
            "nullable": true
          }
        }
      },
      "FastEndpointsProblemDetails": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "default": "https://www.rfc-editor.org/rfc/rfc7231#section-6.5.1"
          },
          "title": {
            "type": "string",
            "default": "One or more validation errors occurred."
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "default": 400
          },
          "instance": {
            "type": "string",
            "default": "/api/route"
          },
          "traceId": {
            "type": "string",
            "default": "0HMPNHL0JHL76:00000001"
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FastEndpointsProblemDetails_Error"
            }
          }
        }
      },
      "FastEndpointsProblemDetails_Error": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "default": "Error or field name"
          },
          "reason": {
            "type": "string",
            "default": "Error reason"
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "severity": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesUsersUpdatePermissionsUpdateUserPremissionsRequest": {
        "type": "object",
        "example": {
          "groupId": 2,
          "isPermitted": true
        },
        "additionalProperties": false,
        "properties": {
          "groupId": {
            "type": "integer",
            "format": "int32"
          },
          "isPermitted": {
            "type": "boolean"
          }
        }
      },
      "TimetableEndpointsFeaturesUsersSearchUsersSearchUsersResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableApplicationContractsDataSearchedUserDto"
            }
          }
        }
      },
      "TimetableApplicationContractsDataSearchedUserDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "isAdmin": {
            "type": "boolean",
            "nullable": true
          },
          "searchRank": {
            "type": "number",
            "format": "float"
          }
        }
      },
      "TimetableEndpointsFeaturesUsersSearchUsersSearchUsersRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesUsersGetUserAsAdminGetUserAsAdminRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesUsersGetUserGetUserResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "email": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "webCalUri": {
            "type": "string"
          },
          "calendarToken": {
            "type": "string"
          }
        }
      },
      "TimetableEndpointsFeaturesUsersGetUserGetUserRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesUsersGetPermissionsGetUserPremissionsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "result": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesUsersGetPermissionsGroupMembershipsDto"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesUsersGetPermissionsGroupMembershipsDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "groupId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "appId": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesUsersGetPermissionsGetUserPremissionsRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesSeriesGetSeriesSeriesDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "appId": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "groupId": {
            "type": "integer",
            "format": "int32"
          },
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "parentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "metaData": {
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "app": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetSeriesAppDto"
              }
            ]
          },
          "group": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetSeriesGroupDto"
              }
            ]
          },
          "orgUnits": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetSeriesSeriesOrgUnitDto"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesGetSeriesAppDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string"
          },
          "host": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "tenantId": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesGetSeriesGroupDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "appId": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "isLocked": {
            "type": "boolean"
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesGetSeriesSeriesOrgUnitDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "metadata": {
            "type": "string",
            "nullable": true
          },
          "published": {
            "type": "boolean",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "appId": {
            "type": "integer",
            "format": "int32"
          },
          "groupId": {
            "type": "integer",
            "format": "int32"
          },
          "parentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesUpdateUpdateSeriesRequest": {
        "type": "object",
        "example": {
          "displayName": "Maths 101 Updated",
          "description": "Updated description",
          "groupId": 2
        },
        "additionalProperties": false,
        "properties": {
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "groupId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesUnsbuscribeUnsubscribeSeriesResponse": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesSeriesUnsbuscribeUnsubscribeSeriesRequest": {
        "type": "object",
        "example": {
          "userId": 2
        },
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesSubscribeSubscribeToSeriesResponse": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesSeriesSubscribeSubscribeToSeriesRequest": {
        "type": "object",
        "example": {
          "userId": 2,
          "orgUnitId": 3
        },
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int32"
          },
          "orgUnitId": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesGetSeriesGetSeriesRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesSeriesGetParentsGetParentsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "parents": {
            "type": "array",
            "nullable": true,
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetParentsParentOrgUnit"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesGetParentsParentOrgUnit": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "parent": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetParentsParentOrgUnit"
              }
            ]
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesGetParentsGetParentsRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesSeriesGetEventsForAdminEndpointGetEventsForAdminResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetEventsForAdminEndpointSeriesEventForAdminDto"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesGetEventsForAdminEndpointSeriesEventForAdminDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "image": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "appId": {
            "type": "integer",
            "format": "int32"
          },
          "groupId": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "organisers": {
            "type": "string",
            "nullable": true
          },
          "lecturers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetEventsForAdminEndpointSeriesEventForAdminDto_SeriesEventLecturerDetails"
            }
          },
          "otherOrganisers": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesGetEventsForAdminEndpointSeriesEventForAdminDto_SeriesEventLecturerDetails": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesGetEventsForAdminEndpointGetEventsForAdminRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesSeriesGetEventsGetEventsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetEventsSeriesEventDto"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesGetEventsSeriesEventDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "image": {
            "type": "string",
            "nullable": true
          },
          "location": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "appId": {
            "type": "integer",
            "format": "int32"
          },
          "groupId": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "organisers": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesGetEventsGetEventsRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesSeriesDeleteDeleteSeriesResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "success": {
            "type": "boolean"
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesDeleteDeleteSeriesRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesSeriesCreateCreateSeriesRequest": {
        "type": "object",
        "example": {
          "displayName": "Maths 101",
          "description": "Maths series"
        },
        "additionalProperties": false,
        "properties": {
          "displayName": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesSeriesAllUpdatedAllUpdatedSeriesRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "series": {
            "type": "string"
          }
        }
      },
      "TimetableApplicationContractsDataUserPermissionDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "isAdmin": {
            "type": "boolean"
          },
          "permittedOrgUnits": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableApplicationContractsDataPermittedOrgUnitsDto"
            }
          }
        }
      },
      "TimetableApplicationContractsDataPermittedOrgUnitsDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "parentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "displayName": {
            "type": "string"
          },
          "parentDisplayName": {
            "type": "string",
            "nullable": true
          },
          "type": {
            "type": "string"
          }
        }
      },
      "TimetableApplicationContractsDataOrgUnitHierarchyReportRowDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "parentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "parentDisplayName": {
            "type": "string",
            "nullable": true
          },
          "depth": {
            "type": "integer",
            "format": "int32"
          },
          "courseId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "courseDisplayName": {
            "type": "string",
            "nullable": true
          },
          "subjectId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "subjectDisplayName": {
            "type": "string",
            "nullable": true
          },
          "partId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "partDisplayName": {
            "type": "string",
            "nullable": true
          },
          "partStatus": {
            "type": "string",
            "nullable": true
          },
          "partExternalUrl": {
            "type": "string",
            "nullable": true
          },
          "moduleId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "moduleDisplayName": {
            "type": "string",
            "nullable": true
          },
          "excludeEventsFromRollover": {
            "type": "boolean"
          }
        }
      },
      "TimetableEndpointsFeaturesReportsGetOrgUnitHierarchyReportGetOrgUnitHierarchyReportRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesReportsExportOrgUnitHierarchyCsvExportOrgUnitHierarchyCsvRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesOrgUnitGetOrgUnitsOrgUnitDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "appId": {
            "type": "integer",
            "format": "int32"
          },
          "canManage": {
            "type": "boolean",
            "nullable": true
          },
          "canManageChild": {
            "type": "boolean",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "excludeEventsFromRollover": {
            "type": "boolean"
          },
          "externalId": {
            "type": "string"
          },
          "metadata": {
            "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetOrgUnitsOrgUnitMetadataDto"
          },
          "groupId": {
            "type": "integer",
            "format": "int32"
          },
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "parentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "published": {
            "type": "boolean",
            "nullable": true
          },
          "type": {
            "type": "string"
          },
          "series": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetOrgUnitsOrgUnitSeriesDto"
            }
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitGetOrgUnitsOrgUnitMetadataDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "external": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitGetOrgUnitsOrgUnitSeriesDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "appId": {
            "type": "integer",
            "format": "int32"
          },
          "canManage": {
            "type": "boolean",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "externalId": {
            "type": "string",
            "nullable": true
          },
          "groupId": {
            "type": "integer",
            "format": "int32"
          },
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "parentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "metaData": {
            "nullable": true
          },
          "subscribed": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "orgUnitsAssociated": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetOrgUnitsAssociatedOrgUnit"
            }
          },
          "borrowedFrom": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetOrgUnitsBorrowedFromSeries"
              }
            ]
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitGetOrgUnitsAssociatedOrgUnit": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "orgId": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitGetOrgUnitsBorrowedFromSeries": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string"
          },
          "parentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitUpdateUpdateOrgUnitRequest": {
        "type": "object",
        "example": {
          "displayName": "Physics Updated",
          "excludeEventsFromRollover": true,
          "published": true
        },
        "additionalProperties": false,
        "required": [
          "displayName"
        ],
        "properties": {
          "displayName": {
            "type": "string",
            "maxLength": 200,
            "minLength": 0,
            "nullable": false
          },
          "excludeEventsFromRollover": {
            "type": "boolean",
            "nullable": true
          },
          "published": {
            "type": "boolean",
            "nullable": true
          }
        }
      },
      "FastEndpointsErrorResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "statusCode": {
            "type": "integer",
            "format": "int32",
            "default": 400
          },
          "message": {
            "type": "string",
            "default": "One or more errors occurred!"
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitUnsubscribeUnsubscribeOrgUnitResponse": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesOrgUnitUnsubscribeUnsubscribeOrgUnitRequest": {
        "type": "object",
        "example": {
          "userId": 2
        },
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitSubscribeSubscribeOrgUnitResponse": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesOrgUnitSubscribeSubscribeOrgUnitRequest": {
        "type": "object",
        "example": {
          "userId": 2
        },
        "additionalProperties": false,
        "properties": {
          "userId": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitRemoveBorrowedSeriesRemoveBorrowedSeriesRequest": {
        "type": "object",
        "example": {
          "seriesId": 2
        },
        "additionalProperties": false,
        "properties": {
          "seriesId": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitGetParentsGetParentsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "orgUnitInfo": {
            "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetParentsOrgUnitInfo"
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitGetParentsOrgUnitInfo": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string"
          },
          "parent": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetParentsOrgUnitInfo"
              }
            ]
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitGetParentsGetParentsRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesOrgUnitGetOrgUnitsGetOrgUnitsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesOrgUnitGetOrgUnitsOrgUnitDto"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitGetOrgUnitsGetOrgUnitRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesOrgUnitGetOrgUnitCalendarGetOrgUnitCalendarResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesCalendarsCalendarEvent"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesCalendarsCalendarEvent": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "context": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "location": {
            "type": "string"
          },
          "notes": {
            "type": "string"
          },
          "organisers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "otherOrganisers": {
            "type": "string",
            "nullable": true
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "seriesId": {
            "type": "integer",
            "format": "int32"
          },
          "type": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitGetOrgUnitCalendarGetOrgUnitCalendarRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesOrgUnitGetOrgUnitGetOrgUnitRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesOrgUnitDeleteDeleteOrgUnitRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesOrgUnitCreateCreateOrgUnitRequest": {
        "type": "object",
        "example": {
          "displayName": "Physics",
          "type": "module",
          "parentId": 1,
          "published": true,
          "description": "Physics module"
        },
        "additionalProperties": false,
        "properties": {
          "displayName": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "parentId": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "published": {
            "type": "boolean"
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitBorrowSeriesOrgUnitBorrowSeriesResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "successCount": {
            "type": "integer",
            "format": "int32"
          },
          "failureCount": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "TimetableEndpointsFeaturesOrgUnitBorrowSeriesOrgUnitBorrowSeriesRequest": {
        "type": "object",
        "example": {
          "seriesIds": [
            1,
            2
          ]
        },
        "additionalProperties": false,
        "properties": {
          "seriesIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesMyInfoGetMeGetMeResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "anon": {
            "type": "boolean"
          },
          "app": {
            "$ref": "#/components/schemas/TimetableEndpointsFeaturesMyInfoGetMeApp"
          },
          "appId": {
            "type": "integer",
            "format": "int32"
          },
          "calendarToken": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "displayName": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "emailPreference": {
            "type": "string"
          },
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "isAdmin": {
            "type": "boolean"
          },
          "isGlobalAdmin": {
            "type": "boolean"
          },
          "isGroupAdmin": {
            "type": "boolean"
          },
          "groupAdminPermittedGroupIds": {
            "type": "array",
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "tenantSsoUserId": {
            "type": "string"
          },
          "termsAndConditions": {
            "$ref": "#/components/schemas/TimetableEndpointsFeaturesMyInfoGetMeTermsAndConditions"
          },
          "type": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "webCalUri": {
            "type": "string",
            "description": "Tokenized subscription URL for the user's calendar feed."
          }
        }
      },
      "TimetableEndpointsFeaturesMyInfoGetMeApp": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "displayName": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "enabled": {
            "type": "boolean"
          },
          "host": {
            "type": "string"
          },
          "tenantId": {
            "type": "integer",
            "format": "int32"
          },
          "tenant": {
            "$ref": "#/components/schemas/TimetableEndpointsFeaturesMyInfoGetMeTenant"
          },
          "type": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TimetableEndpointsFeaturesMyInfoGetMeTenant": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "displayName": {
            "type": "string"
          },
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "customCss": {
            "type": "string"
          },
          "logoDarkUrl": {
            "type": "string"
          },
          "logoLightUrl": {
            "type": "string"
          },
          "primaryBackgroundColour": {
            "type": "string"
          },
          "primaryTextColour": {
            "type": "string"
          },
          "secondaryBackgroundColour": {
            "type": "string"
          },
          "secondaryTextColour": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "tertiaryBackgroundColour": {
            "type": "string"
          },
          "tertiaryTextColour": {
            "type": "string"
          }
        }
      },
      "TimetableEndpointsFeaturesMyInfoGetMeTermsAndConditions": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "accepted": {
            "type": "boolean",
            "nullable": true
          },
          "needsToAccept": {
            "type": "boolean"
          }
        }
      },
      "TimetableEndpointsFeaturesGroupLockGroupLockGroupResponse": {
        "type": "object",
        "description": "Response DTO for LockGroupEndpoint that includes lock expiry information.",
        "additionalProperties": false,
        "properties": {
          "isLocked": {
            "type": "boolean",
            "description": "Gets or sets a value indicating whether the group is locked."
          },
          "lockExpiresAt": {
            "type": "string",
            "description": "Gets or sets the timestamp when the lock expires.\nNull if the group is not locked.",
            "format": "date-time",
            "nullable": true
          },
          "lockedById": {
            "type": "integer",
            "description": "Gets or sets the ID of the user who locked the group.\nNull if the group is not locked.",
            "format": "int32",
            "nullable": true
          },
          "lockedByWhom": {
            "type": "string"
          }
        }
      },
      "TimetableEndpointsFeaturesGroupLockGroupLockGroupRequest": {
        "type": "object",
        "example": {
          "newLockState": true
        },
        "additionalProperties": false,
        "properties": {
          "newLockState": {
            "type": "boolean",
            "description": "Set to true to lock the group, false to just request the current lock state."
          }
        }
      },
      "TimetableEndpointsFeaturesEventsUpdateUpdateEventRequest": {
        "type": "object",
        "example": {
          "start": "2026-11-25T10:20:41.4394391+00:00",
          "end": "2026-11-25T11:20:41.4394568+00:00",
          "displayName": "Maths 101 - Updated",
          "type": "Lecture",
          "seriesId": 1,
          "groupId": 2,
          "location": "Room 12",
          "organiserUsers": [
            2,
            3
          ],
          "otherOrganisers": "Dr. Smith"
        },
        "additionalProperties": false,
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "displayName": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "seriesId": {
            "type": "integer",
            "format": "int32"
          },
          "groupId": {
            "type": "integer",
            "format": "int32"
          },
          "location": {
            "type": "string"
          },
          "organiserUsers": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "otherOrganisers": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesEventsUpdateUpdateMultipleEventsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetEventsForAdminEndpointSeriesEventForAdminDto"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesEventsUpdateUpdateMultipleEventsRequest": {
        "type": "object",
        "example": {
          "events": [
            {
              "eventId": 123,
              "start": "2026-11-25T10:20:41.448623+00:00",
              "end": "2026-11-25T11:20:41.4486231+00:00",
              "displayName": "Maths 101 - Updated",
              "type": "Lecture",
              "seriesId": 1,
              "groupId": 2,
              "location": "Room 12",
              "organiserUsers": [
                2,
                3
              ],
              "otherOrganisers": "Dr. Smith"
            },
            {
              "eventId": 124,
              "start": "2026-11-26T10:20:41.4486302+00:00",
              "end": "2026-11-26T11:20:41.4486306+00:00",
              "displayName": "Physics 101 - Updated",
              "type": "Seminar",
              "seriesId": 1,
              "groupId": 2,
              "location": "Room 15",
              "organiserUsers": [
                4
              ],
              "otherOrganisers": "Prof. Johnson"
            }
          ]
        },
        "additionalProperties": false,
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesEventsUpdateUpdateEventRequest"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesEventsDeleteDeleteEventResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "success": {
            "type": "boolean"
          }
        }
      },
      "TimetableEndpointsFeaturesEventsDeleteDeleteEventRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesEventsCreateCreateEventRequest": {
        "type": "object",
        "example": {
          "start": "2026-11-25T10:20:41.4592575+00:00",
          "end": "2026-11-25T11:20:41.4592755+00:00",
          "displayName": "Maths 101",
          "type": "Lecture",
          "seriesId": 1,
          "location": "Room 12",
          "organiserUsers": [
            2,
            3
          ],
          "otherOrganisers": "Dr. Smith"
        },
        "additionalProperties": false,
        "properties": {
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "displayName": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "seriesId": {
            "type": "integer",
            "format": "int32"
          },
          "location": {
            "type": "string",
            "nullable": true
          },
          "organiserUsers": {
            "type": "array",
            "nullable": true,
            "items": {
              "type": "integer",
              "format": "int32"
            }
          },
          "otherOrganisers": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesEventsCreateCreateMultipleEventsResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesSeriesGetEventsForAdminEndpointSeriesEventForAdminDto"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesEventsCreateCreateMultipleEventsRequest": {
        "type": "object",
        "example": {
          "events": [
            {
              "start": "2026-11-25T10:20:41.4683255+00:00",
              "end": "2026-11-25T11:20:41.4683255+00:00",
              "displayName": "Maths 101",
              "type": "Lecture",
              "seriesId": 1,
              "location": "Room 12",
              "organiserUsers": [
                2,
                3
              ],
              "otherOrganisers": "Dr. Smith"
            },
            {
              "start": "2026-11-26T10:20:41.468333+00:00",
              "end": "2026-11-26T11:20:41.4683334+00:00",
              "displayName": "Physics 101",
              "type": "Seminar",
              "seriesId": 1,
              "location": "Room 15",
              "organiserUsers": [
                4
              ],
              "otherOrganisers": "Prof. Johnson"
            }
          ]
        },
        "additionalProperties": false,
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesEventsCreateCreateEventRequest"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesConfigGetConfigGetConfigResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "academicYear": {
            "type": "integer",
            "description": "The current academic year, e.g. 2023 for the 2023/2024 academic year.",
            "format": "int32"
          },
          "allowLocalAccountCreation": {
            "type": "boolean",
            "description": "Whether new user accounts can be created using local authentication (i.e. username/password)."
          },
          "allowUserEventCreation": {
            "type": "boolean",
            "description": "Whether new user accounts can be created using Shibboleth authentication."
          },
          "allowUserSerieCreation": {
            "type": "boolean"
          },
          "analyticsTrackingId": {
            "type": "string"
          },
          "appId": {
            "type": "integer",
            "format": "int32"
          },
          "loginUrl": {
            "type": "string"
          },
          "logoutUrl": {
            "type": "string"
          },
          "enableAnalytics": {
            "type": "boolean"
          },
          "enableLocalAuth": {
            "type": "boolean"
          },
          "termsAndConditionsText": {
            "type": "string"
          },
          "termsAndConditionsEnabled": {
            "type": "boolean"
          },
          "termsAndConditionsLastUpdated": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "academicTerms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesConfigGetConfigAcademicTerm"
            }
          },
          "enableAdminSeriesEditAutoFill": {
            "type": "boolean"
          },
          "deleteSeriesNotification": {
            "nullable": true,
            "oneOf": [
              {
                "$ref": "#/components/schemas/TimetableEndpointsFeaturesConfigGetConfigDeleteSeriesNotificationDto"
              }
            ]
          },
          "clientTelemetryConnectionString": {
            "type": "string",
            "description": "Application Insights connection string the web UI uses to report client errors, or null when\nclient telemetry is disabled. Resolved from configuration on every request (never cached with\nthe rest of the response) — see ClientTelemetryConfig.",
            "nullable": true
          }
        }
      },
      "TimetableEndpointsFeaturesConfigGetConfigAcademicTerm": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "start": {
            "type": "string",
            "format": "date-time"
          },
          "end": {
            "type": "string",
            "format": "date-time"
          },
          "termWeekStart": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TimetableEndpointsFeaturesConfigGetConfigDeleteSeriesNotificationDto": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "informGroupAdmins": {
            "type": "boolean"
          },
          "informOrgAdmins": {
            "type": "boolean"
          }
        }
      },
      "TimetableEndpointsFeaturesCalendarsGetCalendarIcalFileGetUserIcalFileRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesCalendarsGetCalendarGetCalendarResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TimetableEndpointsFeaturesCalendarsCalendarEvent"
            }
          }
        }
      },
      "TimetableEndpointsFeaturesCalendarsGetCalendarGetCalendarRequest": {
        "type": "object",
        "additionalProperties": false
      },
      "TimetableEndpointsFeaturesAuthRefreshRefreshResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "accessToken": {
            "type": "string",
            "description": "A new short-lived JWT access token."
          },
          "refreshToken": {
            "type": "string",
            "description": "A new refresh token; the presented one has been consumed and must be discarded."
          }
        }
      },
      "TimetableEndpointsFeaturesAuthRefreshRefreshRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "refreshToken": {
            "type": "string",
            "description": "The opaque refresh token previously issued by the server."
          }
        }
      },
      "TimetableEndpointsFeaturesAuthLogoutLogoutRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "refreshToken": {
            "type": "string",
            "description": "The refresh token to revoke.",
            "nullable": true
          },
          "allSessions": {
            "type": "boolean",
            "description": "When true, revoke every active refresh token for the same user + app."
          }
        }
      },
      "TimetableEndpointsFeaturesAuthGetAccessTokenGetAccessTokenResponse": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "accessToken": {
            "type": "string",
            "description": "A JWT access token to be used in Authorization header of subsequent requests to authenticate the user"
          },
          "refreshToken": {
            "type": "string",
            "description": "An opaque refresh token used to obtain a new access token via /api/auth/refresh once the\nshort-lived access token expires. Null only in flows where a refresh token was not issued.",
            "nullable": true
          },
          "idToken": {
            "type": "string",
            "description": "Id token received from Google, can be used by client app to verify user identity"
          },
          "email": {
            "type": "string",
            "description": "The user's email address"
          },
          "firstName": {
            "type": "string",
            "description": "The user's first name"
          },
          "lastName": {
            "type": "string",
            "description": "The user's last name"
          }
        }
      },
      "TimetableEndpointsFeaturesAuthGetAccessTokenGetAccessTokenRequest": {
        "type": "object",
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "JWTBearerAuth": {
        "type": "http",
        "description": "Enter a JWT token to authorize the requests...",
        "scheme": "Bearer",
        "bearerFormat": "JWT"
      }
    }
  }
}