{
  "openapi": "3.1.0",
  "info": {
    "title": "INSTAT Survey Platform",
    "description": "Digital Platform for Managing Statistical Activities",
    "version": "1.0.0"
  },
  "paths": {
    "/v1/api/auth/token": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Login For Access Token",
        "description": "OAuth2 compatible token login, get an access token for future requests",
        "operationId": "login_for_access_token_v1_api_auth_token_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_login_for_access_token_v1_api_auth_token_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Token"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/auth/me": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Read Users Me",
        "description": "Get current user profile",
        "operationId": "read_users_me_v1_api_auth_me_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserProfile"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ]
      }
    },
    "/v1/api/auth/refresh": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Refresh Access Token",
        "description": "Refresh access token",
        "operationId": "refresh_access_token_v1_api_auth_refresh_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Token"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ]
      }
    },
    "/v1/api/auth/change-password": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Change Password",
        "description": "Change user password",
        "operationId": "change_password_v1_api_auth_change_password_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasswordChange"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ]
      }
    },
    "/v1/api/auth/scopes": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Get Available Scopes",
        "description": "Get all available OAuth2 scopes",
        "operationId": "get_available_scopes_v1_api_auth_scopes_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/api/auth/roles": {
      "get": {
        "tags": [
          "Authentication"
        ],
        "summary": "Get Available Roles",
        "description": "Get all available user roles (admin only)",
        "operationId": "get_available_roles_v1_api_auth_roles_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ]
      }
    },
    "/v1/api/admin/audit-logs": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Get Audit Logs",
        "description": "Get audit logs with filtering (Admin only)",
        "operationId": "get_audit_logs_v1_api_admin_audit_logs_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "user_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "User Id"
            }
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Action"
            }
          },
          {
            "name": "resource",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Resource"
            }
          },
          {
            "name": "success",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Success"
            }
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Start Date"
            }
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End Date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/admin/audit-logs/statistics": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Get Audit Statistics",
        "description": "Get audit log statistics (Admin only)",
        "operationId": "get_audit_statistics_v1_api_admin_audit_logs_statistics_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditStatistics"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ]
      }
    },
    "/v1/api/admin/audit-logs/recent": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Get Recent Audit Logs",
        "description": "Get most recent audit logs (Admin only)",
        "operationId": "get_recent_audit_logs_v1_api_admin_audit_logs_recent_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "default": 50,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AuditLogResponse"
                  },
                  "title": "Response Get Recent Audit Logs V1 Api Admin Audit Logs Recent Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/admin/audit-logs/failed": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Get Failed Audit Logs",
        "description": "Get failed audit actions (Admin only)",
        "operationId": "get_failed_audit_logs_v1_api_admin_audit_logs_failed_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AuditLogResponse"
                  },
                  "title": "Response Get Failed Audit Logs V1 Api Admin Audit Logs Failed Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/admin/users": {
      "get": {
        "tags": [
          "Administration"
        ],
        "summary": "Get All Users",
        "description": "Get all users (Admin only)",
        "operationId": "get_all_users_v1_api_admin_users_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "role",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Role"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Administration"
        ],
        "summary": "Create User",
        "description": "Create a new user (Admin only)",
        "operationId": "create_user_v1_api_admin_users_post",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/admin/users/{user_id}": {
      "put": {
        "tags": [
          "Administration"
        ],
        "summary": "Update User",
        "description": "Update a user (Admin only)",
        "operationId": "update_user_v1_api_admin_users__user_id__put",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "User Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Administration"
        ],
        "summary": "Delete User",
        "description": "Delete a user (Admin only)",
        "operationId": "delete_user_v1_api_admin_users__user_id__delete",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "User Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/surveys/{schema_name}": {
      "post": {
        "tags": [
          "Surveys"
        ],
        "summary": "Create Survey",
        "description": "Create a new survey",
        "operationId": "create_survey_v1_api_surveys__schema_name__post",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "schema_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Schema Name"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseResponse_Survey_"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      },
      "get": {
        "tags": [
          "Surveys"
        ],
        "summary": "Read Surveys",
        "description": "Get all surveys",
        "operationId": "read_surveys_v1_api_surveys__schema_name__get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "schema_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Schema Name"
            }
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_Survey_"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/api/surveys/{schema_name}/{survey_id}": {
      "get": {
        "tags": [
          "Surveys"
        ],
        "summary": "Read Survey",
        "description": "Get survey by ID",
        "operationId": "read_survey_v1_api_surveys__schema_name___survey_id__get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "schema_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Schema Name"
            }
          },
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Survey Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseResponse_Survey_"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      },
      "put": {
        "tags": [
          "Surveys"
        ],
        "summary": "Update Survey",
        "description": "Update a survey",
        "operationId": "update_survey_v1_api_surveys__schema_name___survey_id__put",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "schema_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Schema Name"
            }
          },
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Survey Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyCreate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseResponse_Survey_"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      },
      "delete": {
        "tags": [
          "Surveys"
        ],
        "summary": "Delete Survey",
        "description": "Delete a survey",
        "operationId": "delete_survey_v1_api_surveys__schema_name___survey_id__delete",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "schema_name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Schema Name"
            }
          },
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Survey Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/api/files/upload-excel-and-create-survey": {
      "post": {
        "tags": [
          "File Upload"
        ],
        "summary": "Upload Excel And Create Survey",
        "operationId": "upload_excel_and_create_survey_v1_api_files_upload_excel_and_create_survey_post",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "create_template",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Automatically create template from survey structure",
              "default": true,
              "title": "Create Template"
            },
            "description": "Automatically create template from survey structure"
          },
          {
            "name": "template_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Name for the template (defaults to filename)",
              "title": "Template Name"
            },
            "description": "Name for the template (defaults to filename)"
          },
          {
            "name": "schema_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Override auto-detected schema",
              "title": "Schema Name"
            },
            "description": "Override auto-detected schema"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_excel_and_create_survey_v1_api_files_upload_excel_and_create_survey_post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileUploadResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "401": {
            "description": "Not authenticated"
          },
          "403": {
            "description": "Not enough permissions"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/api/files/upload-excel-and-create-survey-with-template": {
      "post": {
        "tags": [
          "File Upload"
        ],
        "summary": "Upload Excel And Create Survey With Template",
        "description": "Upload Excel file, create survey, and optionally create reusable template",
        "operationId": "upload_excel_and_create_survey_with_template_v1_api_files_upload_excel_and_create_survey_with_template_post",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "create_template",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Create template from survey structure",
              "default": true,
              "title": "Create Template"
            },
            "description": "Create template from survey structure"
          },
          {
            "name": "template_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Name for the template (defaults to filename)",
              "title": "Template Name"
            },
            "description": "Name for the template (defaults to filename)"
          },
          {
            "name": "schema_name",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Override auto-detected schema",
              "title": "Schema Name"
            },
            "description": "Override auto-detected schema"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_upload_excel_and_create_survey_with_template_v1_api_files_upload_excel_and_create_survey_with_template_post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileUploadResponse"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BadRequestErrorResponse"
                }
              }
            },
            "description": "Bad Request"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidationErrorResponse"
                }
              }
            },
            "description": "Unprocessable Entity"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InternalErrorResponse"
                }
              }
            },
            "description": "Internal Server Error"
          }
        }
      }
    },
    "/v1/api/instat/surveys": {
      "post": {
        "tags": [
          "INSTAT"
        ],
        "summary": "Create INSTAT Survey",
        "description": "Create a new INSTAT survey with domain-specific metadata",
        "operationId": "create_instat_survey_v1_api_instat_surveys_post",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/INSTATSurveyCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseResponse_INSTATSurveyResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "INSTAT"
        ],
        "summary": "List INSTAT Surveys",
        "description": "List all INSTAT surveys with optional filtering",
        "operationId": "list_instat_surveys_v1_api_instat_surveys_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of records to skip",
              "default": 0,
              "title": "Skip"
            },
            "description": "Number of records to skip"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "description": "Number of records to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Number of records to return"
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/INSTATDomain"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by survey domain",
              "title": "Domain"
            },
            "description": "Filter by survey domain"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SurveyCategory"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by survey category",
              "title": "Category"
            },
            "description": "Filter by survey category"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SurveyStatus"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by survey status",
              "title": "Status"
            },
            "description": "Filter by survey status"
          },
          {
            "name": "fiscal_year",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by fiscal year",
              "title": "Fiscal Year"
            },
            "description": "Filter by fiscal year"
          },
          {
            "name": "reporting_cycle",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ReportingCycle"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by reporting cycle",
              "title": "Reporting Cycle"
            },
            "description": "Filter by reporting cycle"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_INSTATSurveyResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/instat/surveys/{survey_id}": {
      "get": {
        "tags": [
          "INSTAT"
        ],
        "summary": "Get INSTAT Survey",
        "description": "Retrieve a specific INSTAT survey by ID",
        "operationId": "get_instat_survey_v1_api_instat_surveys__survey_id__get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Survey Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseResponse_INSTATSurveyResponse_"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "INSTAT"
        ],
        "summary": "Update INSTAT Survey",
        "description": "Update an existing INSTAT survey",
        "operationId": "update_instat_survey_v1_api_instat_surveys__survey_id__put",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Survey Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/INSTATSurveyUpdate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseResponse_INSTATSurveyResponse_"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "INSTAT"
        ],
        "summary": "Delete INSTAT Survey",
        "description": "Delete an INSTAT survey",
        "operationId": "delete_instat_survey_v1_api_instat_surveys__survey_id__delete",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Survey Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResponse"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/instat/templates": {
      "post": {
        "tags": [
          "INSTAT"
        ],
        "summary": "Create Survey Template",
        "description": "Create a new reusable survey template",
        "operationId": "create_survey_template_v1_api_instat_templates_post",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SurveyTemplateCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseResponse_SurveyTemplateResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "INSTAT"
        ],
        "summary": "List Survey Templates",
        "description": "List all survey templates with optional filtering",
        "operationId": "list_survey_templates_v1_api_instat_templates_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of records to skip",
              "default": 0,
              "title": "Skip"
            },
            "description": "Number of records to skip"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "description": "Number of records to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Number of records to return"
          },
          {
            "name": "domain",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/INSTATDomain"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by domain",
              "title": "Domain"
            },
            "description": "Filter by domain"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/SurveyCategory"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by category",
              "title": "Category"
            },
            "description": "Filter by category"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_SurveyTemplateResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/instat/templates/dashboard": {
      "get": {
        "tags": [
          "INSTAT"
        ],
        "summary": "Get Template Dashboard",
        "description": "Get template statistics and overview for dashboard display",
        "operationId": "get_template_dashboard_v1_api_instat_templates_dashboard_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of records to skip",
              "default": 0,
              "title": "Skip"
            },
            "description": "Number of records to skip"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 100,
              "minimum": 1,
              "description": "Number of recent templates to return",
              "default": 10,
              "title": "Limit"
            },
            "description": "Number of recent templates to return"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Template Dashboard V1 Api Instat Templates Dashboard Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/instat/templates/{template_id}": {
      "get": {
        "tags": [
          "INSTAT"
        ],
        "summary": "Get Survey Template",
        "description": "Retrieve a specific survey template by ID",
        "operationId": "get_survey_template_v1_api_instat_templates__template_id__get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Template Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseResponse_SurveyTemplateResponse_"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/instat/templates/{template_id}/details": {
      "get": {
        "tags": [
          "INSTAT"
        ],
        "summary": "Get Template with Section Details",
        "description": "Get template with detailed section and question analysis for display",
        "operationId": "get_template_details_v1_api_instat_templates__template_id__details_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "template_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Template Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Get Template Details V1 Api Instat Templates  Template Id  Details Get"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/instat/surveys/{survey_id}/metrics": {
      "get": {
        "tags": [
          "INSTAT"
        ],
        "summary": "Get Survey Metrics",
        "description": "Get performance metrics for a specific survey",
        "operationId": "get_survey_metrics_v1_api_instat_surveys__survey_id__metrics_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Survey Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseResponse_SurveyMetricsResponse_"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFoundErrorResponse"
                }
              }
            },
            "description": "Not Found"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "INSTAT"
        ],
        "summary": "Update Survey Metrics",
        "description": "Update or create performance metrics for a survey",
        "operationId": "update_survey_metrics_v1_api_instat_surveys__survey_id__metrics_put",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "survey_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Survey Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "title": "Metrics Data"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseResponse_SurveyMetricsResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/instat/exports": {
      "post": {
        "tags": [
          "INSTAT"
        ],
        "summary": "Create Export Configuration",
        "description": "Create a new data export configuration",
        "operationId": "create_export_config_v1_api_instat_exports_post",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DataExportCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BaseResponse_DataExportResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "INSTAT"
        ],
        "summary": "List Export Configurations",
        "description": "List all export configurations with optional filtering",
        "operationId": "list_export_configs_v1_api_instat_exports_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "survey_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Filter by survey ID",
              "title": "Survey Id"
            },
            "description": "Filter by survey ID"
          },
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of records to skip",
              "default": 0,
              "title": "Skip"
            },
            "description": "Number of records to skip"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "description": "Number of records to return",
              "default": 100,
              "title": "Limit"
            },
            "description": "Number of records to return"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedResponse_DataExportResponse_"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/instat/dashboard/summary": {
      "get": {
        "tags": [
          "INSTAT"
        ],
        "summary": "Get Dashboard Summary",
        "description": "Get summary statistics for INSTAT dashboard",
        "operationId": "get_dashboard_summary_v1_api_instat_dashboard_summary_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Get Dashboard Summary V1 Api Instat Dashboard Summary Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ]
      }
    },
    "/v1/api/mali-references/test": {
      "get": {
        "tags": [
          "Mali Reference Tables"
        ],
        "summary": "Test Endpoint",
        "description": "Test endpoint without authentication",
        "operationId": "test_endpoint_v1_api_mali_references_test_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/v1/api/mali-references/lookup": {
      "post": {
        "tags": [
          "Mali Reference Tables"
        ],
        "summary": "Lookup Table Reference",
        "description": "Generic table reference lookup endpoint\nSupports all TableRef:01 through TableRef:09",
        "operationId": "lookup_table_reference_v1_api_mali_references_lookup_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TableRefLookupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TableRefLookupResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ]
      }
    },
    "/v1/api/mali-references/strategic-results": {
      "get": {
        "tags": [
          "Mali Reference Tables"
        ],
        "summary": "Get Strategic Results",
        "description": "Get strategic axis results (TableRef:01)",
        "operationId": "get_strategic_results_v1_api_mali_references_strategic_results_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/StrategicAxisResult"
                  },
                  "title": "Response Get Strategic Results V1 Api Mali References Strategic Results Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/mali-references/structures": {
      "get": {
        "tags": [
          "Mali Reference Tables"
        ],
        "summary": "Get Instat Structures",
        "description": "Get INSTAT structures (TableRef:02)",
        "operationId": "get_instat_structures_v1_api_mali_references_structures_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          },
          {
            "name": "responsible_for_collection",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Responsible For Collection"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/INSTATStructure"
                  },
                  "title": "Response Get Instat Structures V1 Api Mali References Structures Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/mali-references/cmr-indicators": {
      "get": {
        "tags": [
          "Mali Reference Tables"
        ],
        "summary": "Get Cmr Indicators",
        "description": "Get CMR indicators (TableRef:03)",
        "operationId": "get_cmr_indicators_v1_api_mali_references_cmr_indicators_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Category"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/CMRIndicator"
                  },
                  "title": "Response Get Cmr Indicators V1 Api Mali References Cmr Indicators Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/mali-references/monitoring-indicators": {
      "get": {
        "tags": [
          "Mali Reference Tables"
        ],
        "summary": "Get Monitoring Indicators",
        "description": "Get monitoring indicators (TableRef:06)",
        "operationId": "get_monitoring_indicators_v1_api_mali_references_monitoring_indicators_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Category"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MonitoringIndicator"
                  },
                  "title": "Response Get Monitoring Indicators V1 Api Mali References Monitoring Indicators Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/mali-references/financing-sources": {
      "get": {
        "tags": [
          "Mali Reference Tables"
        ],
        "summary": "Get Financing Sources",
        "description": "Get financing sources (TableRef:07)",
        "operationId": "get_financing_sources_v1_api_mali_references_financing_sources_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          },
          {
            "name": "source_type",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Source Type"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FinancingSource"
                  },
                  "title": "Response Get Financing Sources V1 Api Mali References Financing Sources Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/mali-references/regions": {
      "get": {
        "tags": [
          "Mali Reference Tables"
        ],
        "summary": "Get Mali Regions",
        "description": "Get Mali regions (TableRef:08)",
        "operationId": "get_mali_regions_v1_api_mali_references_regions_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MaliRegion"
                  },
                  "title": "Response Get Mali Regions V1 Api Mali References Regions Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/mali-references/cercles": {
      "get": {
        "tags": [
          "Mali Reference Tables"
        ],
        "summary": "Get Mali Cercles",
        "description": "Get Mali cercles (TableRef:09)",
        "operationId": "get_mali_cercles_v1_api_mali_references_cercles_get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "skip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0,
              "title": "Skip"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Search"
            }
          },
          {
            "name": "region_code",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Region Code"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MaliCercle"
                  },
                  "title": "Response Get Mali Cercles V1 Api Mali References Cercles Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/api/mali-references/table-mappings": {
      "get": {
        "tags": [
          "Mali Reference Tables"
        ],
        "summary": "Get Table Mappings",
        "description": "Get all table reference mappings",
        "operationId": "get_table_mappings_v1_api_mali_references_table_mappings_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  "type": "object",
                  "title": "Response Get Table Mappings V1 Api Mali References Table Mappings Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ]
      }
    },
    "/v1/api/mali-references/validate-reference/{table_ref}/{reference_code}": {
      "get": {
        "tags": [
          "Mali Reference Tables"
        ],
        "summary": "Validate Table Reference",
        "description": "Validate if a reference code exists in the specified table",
        "operationId": "validate_table_reference_v1_api_mali_references_validate_reference__table_ref___reference_code__get",
        "security": [
          {
            "OAuth2PasswordBearer": []
          }
        ],
        "parameters": [
          {
            "name": "table_ref",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Table Ref"
            }
          },
          {
            "name": "reference_code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Reference Code"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AnswerOption": {
        "properties": {
          "OptionText": {
            "type": "string",
            "title": "Optiontext"
          },
          "OptionID": {
            "type": "integer",
            "title": "Optionid"
          },
          "QuestionID": {
            "type": "integer",
            "title": "Questionid"
          }
        },
        "type": "object",
        "required": [
          "OptionText",
          "OptionID",
          "QuestionID"
        ],
        "title": "AnswerOption"
      },
      "AnswerOptionCreate": {
        "properties": {
          "OptionText": {
            "type": "string",
            "title": "Optiontext"
          }
        },
        "type": "object",
        "required": [
          "OptionText"
        ],
        "title": "AnswerOptionCreate"
      },
      "AuditLogResponse": {
        "properties": {
          "LogID": {
            "type": "integer",
            "title": "Logid"
          },
          "UserID": {
            "type": "integer",
            "title": "Userid"
          },
          "Username": {
            "type": "string",
            "title": "Username"
          },
          "Action": {
            "type": "string",
            "title": "Action"
          },
          "Resource": {
            "type": "string",
            "title": "Resource"
          },
          "ResourceID": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Resourceid"
          },
          "Details": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          },
          "IPAddress": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Ipaddress"
          },
          "UserAgent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Useragent"
          },
          "Timestamp": {
            "type": "string",
            "format": "date-time",
            "title": "Timestamp"
          },
          "Success": {
            "type": "boolean",
            "title": "Success"
          },
          "ErrorMessage": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Errormessage"
          }
        },
        "type": "object",
        "required": [
          "LogID",
          "UserID",
          "Username",
          "Action",
          "Resource",
          "Timestamp",
          "Success"
        ],
        "title": "AuditLogResponse",
        "description": "Schema for audit log responses"
      },
      "AuditStatistics": {
        "properties": {
          "total_actions": {
            "type": "integer",
            "title": "Total Actions"
          },
          "successful_actions": {
            "type": "integer",
            "title": "Successful Actions"
          },
          "failed_actions": {
            "type": "integer",
            "title": "Failed Actions"
          },
          "success_rate": {
            "type": "number",
            "title": "Success Rate"
          },
          "action_types": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Action Types"
          },
          "resource_types": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Resource Types"
          }
        },
        "type": "object",
        "required": [
          "total_actions",
          "successful_actions",
          "failed_actions",
          "success_rate",
          "action_types",
          "resource_types"
        ],
        "title": "AuditStatistics",
        "description": "Schema for audit log statistics"
      },
      "BadRequestErrorResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": false
          },
          "error_type": {
            "$ref": "#/components/schemas/ErrorType",
            "default": "bad_request"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErrorDetail"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "BadRequestErrorResponse",
        "description": "Bad request error response",
        "example": {
          "details": [
            {
              "field": "title",
              "message": "Title is required",
              "type": "missing"
            }
          ],
          "error_type": "validation_error",
          "message": "Validation failed",
          "path": "/v1/surveys/survey_program",
          "request_id": "req_12345",
          "success": false,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "BaseResponse_DataExportResponse_": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/DataExportResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          }
        },
        "type": "object",
        "title": "BaseResponse[DataExportResponse]",
        "example": {
          "data": {},
          "message": "Operation completed successfully",
          "success": true,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "BaseResponse_INSTATSurveyResponse_": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/INSTATSurveyResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          }
        },
        "type": "object",
        "title": "BaseResponse[INSTATSurveyResponse]",
        "example": {
          "data": {},
          "message": "Operation completed successfully",
          "success": true,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "BaseResponse_SurveyMetricsResponse_": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyMetricsResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          }
        },
        "type": "object",
        "title": "BaseResponse[SurveyMetricsResponse]",
        "example": {
          "data": {},
          "message": "Operation completed successfully",
          "success": true,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "BaseResponse_SurveyTemplateResponse_": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyTemplateResponse"
              },
              {
                "type": "null"
              }
            ]
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          }
        },
        "type": "object",
        "title": "BaseResponse[SurveyTemplateResponse]",
        "example": {
          "data": {},
          "message": "Operation completed successfully",
          "success": true,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "BaseResponse_Survey_": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "data": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Survey"
              },
              {
                "type": "null"
              }
            ]
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          }
        },
        "type": "object",
        "title": "BaseResponse[Survey]",
        "example": {
          "data": {},
          "message": "Operation completed successfully",
          "success": true,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "Body_login_for_access_token_v1_api_auth_token_post": {
        "properties": {
          "grant_type": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^password$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Grant Type"
          },
          "username": {
            "type": "string",
            "title": "Username"
          },
          "password": {
            "type": "string",
            "format": "password",
            "title": "Password"
          },
          "scope": {
            "type": "string",
            "title": "Scope",
            "default": ""
          },
          "client_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Client Id"
          },
          "client_secret": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "format": "password",
            "title": "Client Secret"
          }
        },
        "type": "object",
        "required": [
          "username",
          "password"
        ],
        "title": "Body_login_for_access_token_v1_api_auth_token_post"
      },
      "Body_upload_excel_and_create_survey_v1_api_files_upload_excel_and_create_survey_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File",
            "description": "Excel file to upload and parse"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_excel_and_create_survey_v1_api_files_upload_excel_and_create_survey_post"
      },
      "Body_upload_excel_and_create_survey_with_template_v1_api_files_upload_excel_and_create_survey_with_template_post": {
        "properties": {
          "file": {
            "type": "string",
            "format": "binary",
            "title": "File"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_upload_excel_and_create_survey_with_template_v1_api_files_upload_excel_and_create_survey_with_template_post"
      },
      "CMRIndicator": {
        "properties": {
          "indicator_id": {
            "type": "string",
            "title": "Indicator Id",
            "description": "Code de l'indicateur"
          },
          "indicator_name": {
            "type": "string",
            "title": "Indicator Name",
            "description": "Nom de l'indicateur"
          },
          "category": {
            "type": "string",
            "title": "Category",
            "description": "Catégorie"
          },
          "measurement_unit": {
            "type": "string",
            "title": "Measurement Unit",
            "description": "Unité de mesure"
          },
          "data_source": {
            "type": "string",
            "title": "Data Source",
            "description": "Source des données"
          },
          "collection_frequency": {
            "type": "string",
            "title": "Collection Frequency",
            "description": "Fréquence de collecte"
          },
          "responsible_structure": {
            "type": "string",
            "title": "Responsible Structure",
            "description": "Structure responsable"
          }
        },
        "type": "object",
        "required": [
          "indicator_id",
          "indicator_name",
          "category",
          "measurement_unit",
          "data_source",
          "collection_frequency",
          "responsible_structure"
        ],
        "title": "CMRIndicator",
        "description": "TableRef 03: CMR Performance Measurement Framework Indicators"
      },
      "DataExportCreate": {
        "properties": {
          "SurveyID": {
            "type": "integer",
            "title": "Surveyid"
          },
          "ExportFormat": {
            "type": "string",
            "title": "Exportformat"
          },
          "ExportType": {
            "type": "string",
            "title": "Exporttype"
          },
          "ExportConfig": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exportconfig"
          },
          "IsScheduled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Isscheduled",
            "default": false
          },
          "ScheduleFrequency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedulefrequency"
          },
          "NextExport": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nextexport"
          },
          "DeliveryMethod": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deliverymethod"
          },
          "Recipients": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipients"
          },
          "CreatedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Createdby"
          }
        },
        "type": "object",
        "required": [
          "SurveyID",
          "ExportFormat",
          "ExportType"
        ],
        "title": "DataExportCreate",
        "description": "Model for creating data export configurations"
      },
      "DataExportResponse": {
        "properties": {
          "SurveyID": {
            "type": "integer",
            "title": "Surveyid"
          },
          "ExportFormat": {
            "type": "string",
            "title": "Exportformat"
          },
          "ExportType": {
            "type": "string",
            "title": "Exporttype"
          },
          "ExportConfig": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exportconfig"
          },
          "IsScheduled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Isscheduled",
            "default": false
          },
          "ScheduleFrequency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Schedulefrequency"
          },
          "NextExport": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Nextexport"
          },
          "DeliveryMethod": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deliverymethod"
          },
          "Recipients": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Recipients"
          },
          "CreatedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Createdby"
          },
          "ExportID": {
            "type": "integer",
            "title": "Exportid"
          },
          "CreatedDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Createddate"
          },
          "LastExported": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lastexported"
          },
          "ExportCount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exportcount"
          }
        },
        "type": "object",
        "required": [
          "SurveyID",
          "ExportFormat",
          "ExportType",
          "ExportID"
        ],
        "title": "DataExportResponse",
        "description": "Response model for data export configurations"
      },
      "DeleteResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "message": {
            "type": "string",
            "title": "Message",
            "default": "Resource deleted successfully"
          },
          "deleted_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Deleted Id"
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          }
        },
        "type": "object",
        "title": "DeleteResponse",
        "description": "Delete operation response model",
        "example": {
          "deleted_id": 123,
          "message": "Survey deleted successfully",
          "success": true,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "ErrorDetail": {
        "properties": {
          "field": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Field"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Type"
          },
          "context": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "message",
          "type"
        ],
        "title": "ErrorDetail",
        "description": "Individual error detail",
        "example": {
          "context": {
            "min_length": 1
          },
          "field": "title",
          "message": "Title is required",
          "type": "missing"
        }
      },
      "ErrorType": {
        "type": "string",
        "enum": [
          "validation_error",
          "not_found",
          "permission_denied",
          "internal_error",
          "bad_request",
          "conflict",
          "unauthorized"
        ],
        "title": "ErrorType",
        "description": "Error types for categorizing different kinds of errors"
      },
      "FileUploadResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "file_path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "File Path"
          },
          "survey_structure": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Survey Structure"
          },
          "created_survey": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created Survey"
          },
          "created_template": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created Template"
          },
          "issues": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Issues"
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "FileUploadResponse",
        "description": "File upload response model",
        "example": {
          "created_survey": {
            "Status": "Draft",
            "SurveyID": 1,
            "Title": "Sample Survey"
          },
          "file_path": "/uploads/survey.xlsx",
          "message": "File uploaded, parsed, and survey created successfully",
          "success": true,
          "survey_structure": {
            "description": "A sample survey",
            "sections": [],
            "title": "Sample Survey"
          },
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "FinancingSource": {
        "properties": {
          "source_code": {
            "type": "string",
            "title": "Source Code",
            "description": "Code de la source"
          },
          "source_name": {
            "type": "string",
            "title": "Source Name",
            "description": "Nom de la source de financement"
          },
          "source_type": {
            "type": "string",
            "title": "Source Type",
            "description": "Type de source"
          },
          "currency": {
            "type": "string",
            "title": "Currency",
            "description": "Devise",
            "default": "FCFA"
          },
          "min_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Amount",
            "description": "Montant minimum"
          },
          "max_amount": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Amount",
            "description": "Montant maximum"
          },
          "financing_conditions": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Financing Conditions",
            "description": "Conditions de financement"
          }
        },
        "type": "object",
        "required": [
          "source_code",
          "source_name",
          "source_type"
        ],
        "title": "FinancingSource",
        "description": "TableRef 07: Financing Sources"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "INSTATDomain": {
        "type": "string",
        "enum": [
          "ssn",
          "sds",
          "des",
          "program_review",
          "activity_report",
          "diagnostic",
          "development"
        ],
        "title": "INSTATDomain",
        "description": "INSTAT Statistical Domains"
      },
      "INSTATQuestion": {
        "properties": {
          "QuestionText": {
            "type": "string",
            "title": "Questiontext"
          },
          "QuestionType": {
            "$ref": "#/components/schemas/INSTATQuestionType"
          },
          "IsRequired": {
            "type": "boolean",
            "title": "Isrequired",
            "default": false
          },
          "IndicatorCode": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Indicatorcode"
          },
          "DataSource": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Datasource"
          },
          "CollectionMethod": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Collectionmethod"
          },
          "QualityRequirements": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Qualityrequirements",
            "default": {}
          },
          "ValidationRules": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validationrules",
            "default": {}
          },
          "DependsOnQuestion": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dependsonquestion"
          },
          "QuestionTextEN": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Questiontexten"
          },
          "QuestionTextFR": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Questiontextfr"
          },
          "Tags": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tags",
            "default": []
          },
          "Priority": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Priority",
            "default": "medium"
          }
        },
        "type": "object",
        "required": [
          "QuestionText",
          "QuestionType"
        ],
        "title": "INSTATQuestion",
        "description": "Enhanced question model for INSTAT surveys"
      },
      "INSTATQuestionType": {
        "type": "string",
        "enum": [
          "single_choice",
          "multiple_choice",
          "text",
          "number",
          "date",
          "percentage_distribution",
          "budget_allocation",
          "geographic_selection",
          "stakeholder_matrix",
          "timeline_chart",
          "performance_scale",
          "compliance_checklist",
          "resource_allocation",
          "indicator_tracking",
          "vulnerability_assessment"
        ],
        "title": "INSTATQuestionType",
        "description": "INSTAT-specific question types"
      },
      "INSTATStructure": {
        "properties": {
          "structure_id": {
            "type": "string",
            "title": "Structure Id",
            "description": "Code de la structure"
          },
          "structure_name": {
            "type": "string",
            "title": "Structure Name",
            "description": "Nom de la structure"
          },
          "abbreviation": {
            "type": "string",
            "title": "Abbreviation",
            "description": "Abréviation"
          },
          "structure_type": {
            "type": "string",
            "title": "Structure Type",
            "description": "Type de structure"
          },
          "responsible_for_collection": {
            "type": "boolean",
            "title": "Responsible For Collection",
            "description": "Structure en charge de collecte",
            "default": false
          }
        },
        "type": "object",
        "required": [
          "structure_id",
          "structure_name",
          "abbreviation",
          "structure_type"
        ],
        "title": "INSTATStructure",
        "description": "TableRef 02: List of Structures for SDS reviews"
      },
      "INSTATSurveyCreate": {
        "properties": {
          "Title": {
            "type": "string",
            "title": "Title"
          },
          "Description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "Domain": {
            "$ref": "#/components/schemas/INSTATDomain"
          },
          "Category": {
            "$ref": "#/components/schemas/SurveyCategory"
          },
          "ReportingCycle": {
            "type": "null",
            "title": "Reportingcycle"
          },
          "FiscalYear": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fiscalyear"
          },
          "TargetAudience": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Targetaudience",
            "default": []
          },
          "GeographicScope": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Geographicscope",
            "default": []
          },
          "ImplementingUnit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Implementingunit"
          },
          "ComplianceFramework": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Complianceframework",
            "default": []
          },
          "InternationalStandards": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Internationalstandards",
            "default": []
          },
          "EstimatedDuration": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimatedduration"
          },
          "RequiredSkills": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requiredskills",
            "default": []
          },
          "BudgetCategory": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budgetcategory"
          }
        },
        "type": "object",
        "required": [
          "Title",
          "Domain",
          "Category"
        ],
        "title": "INSTATSurveyCreate",
        "description": "Model for creating INSTAT surveys"
      },
      "INSTATSurveyResponse": {
        "properties": {
          "Title": {
            "type": "string",
            "title": "Title"
          },
          "Description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "Domain": {
            "$ref": "#/components/schemas/INSTATDomain"
          },
          "Category": {
            "$ref": "#/components/schemas/SurveyCategory"
          },
          "ReportingCycle": {
            "type": "null",
            "title": "Reportingcycle"
          },
          "FiscalYear": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fiscalyear"
          },
          "TargetAudience": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Targetaudience",
            "default": []
          },
          "GeographicScope": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Geographicscope",
            "default": []
          },
          "ImplementingUnit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Implementingunit"
          },
          "ComplianceFramework": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Complianceframework",
            "default": []
          },
          "InternationalStandards": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Internationalstandards",
            "default": []
          },
          "EstimatedDuration": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimatedduration"
          },
          "RequiredSkills": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requiredskills",
            "default": []
          },
          "BudgetCategory": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budgetcategory"
          },
          "SurveyID": {
            "type": "integer",
            "title": "Surveyid"
          },
          "CreatedDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Createddate"
          },
          "UpdatedDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updateddate"
          },
          "Status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status"
          },
          "CreatedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Createdby"
          },
          "ReviewedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewedby"
          },
          "ApprovedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approvedby"
          },
          "PublishedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publishedby"
          },
          "ReviewDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewdate"
          },
          "ApprovalDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approvaldate"
          },
          "PublicationDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publicationdate"
          },
          "Language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language"
          },
          "Version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version"
          },
          "IsTemplate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Istemplate"
          },
          "DomainSpecificFields": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domainspecificfields"
          }
        },
        "type": "object",
        "required": [
          "Title",
          "Domain",
          "Category",
          "SurveyID"
        ],
        "title": "INSTATSurveyResponse",
        "description": "Model for INSTAT survey responses"
      },
      "INSTATSurveyUpdate": {
        "properties": {
          "Title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "Description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "Domain": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/INSTATDomain"
              },
              {
                "type": "null"
              }
            ]
          },
          "Category": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/SurveyCategory"
              },
              {
                "type": "null"
              }
            ]
          },
          "ReportingCycle": {
            "type": "null",
            "title": "Reportingcycle"
          },
          "FiscalYear": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Fiscalyear"
          },
          "TargetAudience": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Targetaudience"
          },
          "GeographicScope": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Geographicscope"
          },
          "ImplementingUnit": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Implementingunit"
          },
          "ComplianceFramework": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Complianceframework"
          },
          "InternationalStandards": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Internationalstandards"
          },
          "EstimatedDuration": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Estimatedduration"
          },
          "RequiredSkills": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Requiredskills"
          },
          "BudgetCategory": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Budgetcategory"
          }
        },
        "type": "object",
        "title": "INSTATSurveyUpdate",
        "description": "Model for updating INSTAT surveys"
      },
      "InternalErrorResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": false
          },
          "error_type": {
            "$ref": "#/components/schemas/ErrorType",
            "default": "internal_error"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErrorDetail"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "InternalErrorResponse",
        "description": "Internal server error response",
        "example": {
          "details": [
            {
              "field": "title",
              "message": "Title is required",
              "type": "missing"
            }
          ],
          "error_type": "validation_error",
          "message": "Validation failed",
          "path": "/v1/surveys/survey_program",
          "request_id": "req_12345",
          "success": false,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "MaliCercle": {
        "properties": {
          "cercle_code": {
            "type": "string",
            "title": "Cercle Code",
            "description": "Code du cercle"
          },
          "cercle_name": {
            "type": "string",
            "title": "Cercle Name",
            "description": "Nom du cercle"
          },
          "region_code": {
            "type": "string",
            "title": "Region Code",
            "description": "Code de la région"
          },
          "cercle_capital": {
            "type": "string",
            "title": "Cercle Capital",
            "description": "Chef-lieu de cercle"
          },
          "population": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Population",
            "description": "Population"
          },
          "surface": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Surface",
            "description": "Superficie en km²"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status",
            "description": "Statut",
            "default": "active"
          }
        },
        "type": "object",
        "required": [
          "cercle_code",
          "cercle_name",
          "region_code",
          "cercle_capital"
        ],
        "title": "MaliCercle",
        "description": "TableRef 09: List of circles according to Mali's administrative division"
      },
      "MaliRegion": {
        "properties": {
          "region_code": {
            "type": "string",
            "title": "Region Code",
            "description": "Code de la région"
          },
          "region_name": {
            "type": "string",
            "title": "Region Name",
            "description": "Nom de la région"
          },
          "region_capital": {
            "type": "string",
            "title": "Region Capital",
            "description": "Chef-lieu de région"
          },
          "population": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Population",
            "description": "Population"
          },
          "surface": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Surface",
            "description": "Superficie en km²"
          },
          "status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status",
            "description": "Statut",
            "default": "active"
          }
        },
        "type": "object",
        "required": [
          "region_code",
          "region_name",
          "region_capital"
        ],
        "title": "MaliRegion",
        "description": "TableRef 08: List of regions according to Mali's administrative division"
      },
      "MonitoringIndicator": {
        "properties": {
          "indicator_code": {
            "type": "string",
            "title": "Indicator Code",
            "description": "Code de l'indicateur"
          },
          "indicator_name": {
            "type": "string",
            "title": "Indicator Name",
            "description": "Nom de l'indicateur"
          },
          "category": {
            "type": "string",
            "title": "Category",
            "description": "Catégorie"
          },
          "measurement_method": {
            "type": "string",
            "title": "Measurement Method",
            "description": "Méthode de mesure"
          },
          "reporting_frequency": {
            "type": "string",
            "title": "Reporting Frequency",
            "description": "Fréquence de rapportage"
          },
          "target_value": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Target Value",
            "description": "Valeur cible"
          },
          "data_collection_method": {
            "type": "string",
            "title": "Data Collection Method",
            "description": "Méthode de collecte des données"
          }
        },
        "type": "object",
        "required": [
          "indicator_code",
          "indicator_name",
          "category",
          "measurement_method",
          "reporting_frequency",
          "data_collection_method"
        ],
        "title": "MonitoringIndicator",
        "description": "TableRef 06: Monitoring and Evaluation Indicators"
      },
      "NotFoundErrorResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": false
          },
          "error_type": {
            "$ref": "#/components/schemas/ErrorType",
            "default": "not_found"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErrorDetail"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "NotFoundErrorResponse",
        "description": "Not found error response",
        "example": {
          "details": [
            {
              "field": "title",
              "message": "Title is required",
              "type": "missing"
            }
          ],
          "error_type": "validation_error",
          "message": "Validation failed",
          "path": "/v1/surveys/survey_program",
          "request_id": "req_12345",
          "success": false,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "PaginatedResponse": {
        "properties": {
          "data": {
            "items": {},
            "type": "array",
            "title": "Data"
          },
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "message": {
            "type": "string",
            "title": "Message",
            "default": "Request successful"
          },
          "pagination": {
            "additionalProperties": {
              "type": "integer"
            },
            "type": "object",
            "title": "Pagination"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "PaginatedResponse",
        "description": "Schema for paginated responses"
      },
      "PaginatedResponse_DataExportResponse_": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/DataExportResponse"
            },
            "type": "array",
            "title": "Data",
            "default": []
          },
          "pagination": {
            "additionalProperties": true,
            "type": "object",
            "title": "Pagination",
            "default": {}
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          }
        },
        "type": "object",
        "title": "PaginatedResponse[DataExportResponse]",
        "example": {
          "data": [],
          "message": "Data retrieved successfully",
          "pagination": {
            "has_next": true,
            "has_prev": false,
            "limit": 20,
            "page": 1,
            "pages": 5,
            "total": 100
          },
          "success": true,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "PaginatedResponse_INSTATSurveyResponse_": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/INSTATSurveyResponse"
            },
            "type": "array",
            "title": "Data",
            "default": []
          },
          "pagination": {
            "additionalProperties": true,
            "type": "object",
            "title": "Pagination",
            "default": {}
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          }
        },
        "type": "object",
        "title": "PaginatedResponse[INSTATSurveyResponse]",
        "example": {
          "data": [],
          "message": "Data retrieved successfully",
          "pagination": {
            "has_next": true,
            "has_prev": false,
            "limit": 20,
            "page": 1,
            "pages": 5,
            "total": 100
          },
          "success": true,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "PaginatedResponse_SurveyTemplateResponse_": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/SurveyTemplateResponse"
            },
            "type": "array",
            "title": "Data",
            "default": []
          },
          "pagination": {
            "additionalProperties": true,
            "type": "object",
            "title": "Pagination",
            "default": {}
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          }
        },
        "type": "object",
        "title": "PaginatedResponse[SurveyTemplateResponse]",
        "example": {
          "data": [],
          "message": "Data retrieved successfully",
          "pagination": {
            "has_next": true,
            "has_prev": false,
            "limit": 20,
            "page": 1,
            "pages": 5,
            "total": 100
          },
          "success": true,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "PaginatedResponse_Survey_": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": true
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "data": {
            "items": {
              "$ref": "#/components/schemas/Survey"
            },
            "type": "array",
            "title": "Data",
            "default": []
          },
          "pagination": {
            "additionalProperties": true,
            "type": "object",
            "title": "Pagination",
            "default": {}
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          }
        },
        "type": "object",
        "title": "PaginatedResponse[Survey]",
        "example": {
          "data": [],
          "message": "Data retrieved successfully",
          "pagination": {
            "has_next": true,
            "has_prev": false,
            "limit": 20,
            "page": 1,
            "pages": 5,
            "total": 100
          },
          "success": true,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      },
      "PasswordChange": {
        "properties": {
          "current_password": {
            "type": "string",
            "title": "Current Password"
          },
          "new_password": {
            "type": "string",
            "title": "New Password"
          }
        },
        "type": "object",
        "required": [
          "current_password",
          "new_password"
        ],
        "title": "PasswordChange",
        "description": "Schema for password change request"
      },
      "Question": {
        "properties": {
          "QuestionText": {
            "type": "string",
            "title": "Questiontext"
          },
          "QuestionType": {
            "type": "string",
            "title": "Questiontype"
          },
          "QuestionID": {
            "type": "integer",
            "title": "Questionid"
          },
          "SectionID": {
            "type": "integer",
            "title": "Sectionid"
          },
          "SubsectionID": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subsectionid"
          },
          "AnswerOptions": {
            "items": {
              "$ref": "#/components/schemas/AnswerOption"
            },
            "type": "array",
            "title": "Answeroptions",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "QuestionText",
          "QuestionType",
          "QuestionID",
          "SectionID"
        ],
        "title": "Question"
      },
      "QuestionCreate": {
        "properties": {
          "QuestionText": {
            "type": "string",
            "title": "Questiontext"
          },
          "QuestionType": {
            "type": "string",
            "title": "Questiontype"
          },
          "AnswerOptions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/AnswerOptionCreate"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Answeroptions",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "QuestionText",
          "QuestionType"
        ],
        "title": "QuestionCreate"
      },
      "ReportingCycle": {
        "type": "string",
        "enum": [
          "monthly",
          "quarterly",
          "semi_annual",
          "annual",
          "ad_hoc"
        ],
        "title": "ReportingCycle",
        "description": "Reporting Cycles"
      },
      "Section": {
        "properties": {
          "Title": {
            "type": "string",
            "title": "Title"
          },
          "SectionID": {
            "type": "integer",
            "title": "Sectionid"
          },
          "SurveyID": {
            "type": "integer",
            "title": "Surveyid"
          },
          "Subsections": {
            "items": {
              "$ref": "#/components/schemas/Subsection"
            },
            "type": "array",
            "title": "Subsections",
            "default": []
          },
          "Questions": {
            "items": {
              "$ref": "#/components/schemas/Question"
            },
            "type": "array",
            "title": "Questions",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "Title",
          "SectionID",
          "SurveyID"
        ],
        "title": "Section"
      },
      "SectionCreate": {
        "properties": {
          "Title": {
            "type": "string",
            "title": "Title"
          },
          "Subsections": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/SubsectionCreate"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subsections",
            "default": []
          },
          "Questions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/QuestionCreate"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Questions",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "Title"
        ],
        "title": "SectionCreate"
      },
      "StrategicAxisResult": {
        "properties": {
          "result_id": {
            "type": "string",
            "title": "Result Id",
            "description": "Code du résultat"
          },
          "strategic_axis": {
            "type": "string",
            "title": "Strategic Axis",
            "description": "Axe stratégique"
          },
          "operational_objective": {
            "type": "string",
            "title": "Operational Objective",
            "description": "Objectifs opérationnels"
          },
          "expected_result": {
            "type": "string",
            "title": "Expected Result",
            "description": "Résultats attendus"
          },
          "activity": {
            "type": "string",
            "title": "Activity",
            "description": "Activité"
          }
        },
        "type": "object",
        "required": [
          "result_id",
          "strategic_axis",
          "operational_objective",
          "expected_result",
          "activity"
        ],
        "title": "StrategicAxisResult",
        "description": "TableRef 01: Strategic Axis/Operational Objectives/Expected Results SDS"
      },
      "Subsection": {
        "properties": {
          "Title": {
            "type": "string",
            "title": "Title"
          },
          "SubsectionID": {
            "type": "integer",
            "title": "Subsectionid"
          },
          "SectionID": {
            "type": "integer",
            "title": "Sectionid"
          },
          "Questions": {
            "items": {
              "$ref": "#/components/schemas/Question"
            },
            "type": "array",
            "title": "Questions",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "Title",
          "SubsectionID",
          "SectionID"
        ],
        "title": "Subsection"
      },
      "SubsectionCreate": {
        "properties": {
          "Title": {
            "type": "string",
            "title": "Title"
          },
          "Questions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/QuestionCreate"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Questions",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "Title"
        ],
        "title": "SubsectionCreate"
      },
      "Survey": {
        "properties": {
          "Title": {
            "type": "string",
            "title": "Title"
          },
          "Description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "Status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status",
            "default": "draft"
          },
          "Language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language",
            "default": "fr"
          },
          "IsTemplate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Istemplate",
            "default": false
          },
          "SurveyID": {
            "type": "integer",
            "title": "Surveyid"
          },
          "CreatedDate": {
            "type": "string",
            "format": "date-time",
            "title": "Createddate"
          },
          "UpdatedDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updateddate"
          },
          "CreatedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Createdby"
          },
          "ReviewedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewedby"
          },
          "ApprovedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approvedby"
          },
          "PublishedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publishedby"
          },
          "ReviewDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reviewdate"
          },
          "ApprovalDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approvaldate"
          },
          "PublicationDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Publicationdate"
          },
          "Version": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Version",
            "default": 1
          },
          "Sections": {
            "items": {
              "$ref": "#/components/schemas/Section"
            },
            "type": "array",
            "title": "Sections",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "Title",
          "SurveyID",
          "CreatedDate"
        ],
        "title": "Survey"
      },
      "SurveyCategory": {
        "type": "string",
        "enum": [
          "diagnostic",
          "program_review",
          "activity_report",
          "development_assessment",
          "statistical_planning",
          "monitoring_evaluation"
        ],
        "title": "SurveyCategory",
        "description": "Survey Categories for INSTAT"
      },
      "SurveyCreate": {
        "properties": {
          "Title": {
            "type": "string",
            "title": "Title"
          },
          "Description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "Status": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status",
            "default": "draft"
          },
          "Language": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Language",
            "default": "fr"
          },
          "IsTemplate": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Istemplate",
            "default": false
          },
          "Sections": {
            "items": {
              "$ref": "#/components/schemas/SectionCreate"
            },
            "type": "array",
            "title": "Sections",
            "default": []
          },
          "CreatedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Createdby"
          }
        },
        "type": "object",
        "required": [
          "Title"
        ],
        "title": "SurveyCreate"
      },
      "SurveyMetricsResponse": {
        "properties": {
          "MetricID": {
            "type": "integer",
            "title": "Metricid"
          },
          "SurveyID": {
            "type": "integer",
            "title": "Surveyid"
          },
          "TotalResponses": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Totalresponses"
          },
          "CompletionRate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completionrate"
          },
          "AverageCompletionTime": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Averagecompletiontime"
          },
          "DataQualityScore": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dataqualityscore"
          },
          "ValidationErrorRate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Validationerrorrate"
          },
          "IncompleteResponses": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Incompleteresponses"
          },
          "ResponseByRegion": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Responsebyregion"
          },
          "ResponseTrend": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Responsetrend"
          },
          "DataCollectionCost": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Datacollectioncost"
          },
          "TimeToComplete": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timetocomplete"
          },
          "CoverageRate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Coveragerate"
          },
          "LastUpdated": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lastupdated"
          }
        },
        "type": "object",
        "required": [
          "MetricID",
          "SurveyID"
        ],
        "title": "SurveyMetricsResponse",
        "description": "Response model for survey metrics"
      },
      "SurveyStatus": {
        "type": "string",
        "enum": [
          "draft",
          "review",
          "approved",
          "published",
          "archived",
          "rejected"
        ],
        "title": "SurveyStatus",
        "description": "Survey workflow states"
      },
      "SurveyTemplateCreate": {
        "properties": {
          "TemplateName": {
            "type": "string",
            "title": "Templatename"
          },
          "Domain": {
            "$ref": "#/components/schemas/INSTATDomain"
          },
          "Category": {
            "$ref": "#/components/schemas/SurveyCategory"
          },
          "Version": {
            "type": "string",
            "title": "Version",
            "default": "1.0.0"
          },
          "CreatedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Createdby"
          },
          "Sections": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sections",
            "default": []
          },
          "DefaultQuestions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/INSTATQuestion"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Defaultquestions",
            "default": []
          },
          "UsageGuidelines": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Usageguidelines"
          },
          "ExampleImplementations": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exampleimplementations",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "TemplateName",
          "Domain",
          "Category"
        ],
        "title": "SurveyTemplateCreate",
        "description": "Model for creating survey templates"
      },
      "SurveyTemplateResponse": {
        "properties": {
          "TemplateID": {
            "type": "integer",
            "title": "Templateid"
          },
          "TemplateName": {
            "type": "string",
            "title": "Templatename"
          },
          "Domain": {
            "$ref": "#/components/schemas/INSTATDomain"
          },
          "Category": {
            "$ref": "#/components/schemas/SurveyCategory"
          },
          "Version": {
            "type": "string",
            "title": "Version",
            "default": "1.0.0"
          },
          "CreatedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Createdby"
          },
          "CreatedDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Createddate"
          },
          "LastModified": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lastmodified"
          },
          "ApprovedBy": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approvedby"
          },
          "ApprovalDate": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Approvaldate"
          },
          "Sections": {
            "anyOf": [
              {
                "items": {
                  "additionalProperties": true,
                  "type": "object"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sections",
            "default": []
          },
          "DefaultQuestions": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/INSTATQuestion"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Defaultquestions",
            "default": []
          },
          "UsageCount": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Usagecount",
            "default": 0
          },
          "LastUsed": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lastused"
          },
          "UsageGuidelines": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Usageguidelines"
          },
          "ExampleImplementations": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Exampleimplementations",
            "default": []
          }
        },
        "type": "object",
        "required": [
          "TemplateID",
          "TemplateName",
          "Domain",
          "Category"
        ],
        "title": "SurveyTemplateResponse",
        "description": "Response model for survey templates"
      },
      "TableRefLookupRequest": {
        "properties": {
          "table_ref": {
            "type": "string",
            "title": "Table Ref",
            "description": "Table reference (e.g., 'TableRef:08')"
          },
          "search_term": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Search Term",
            "description": "Search term for filtering"
          },
          "limit": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Limit",
            "description": "Limit results",
            "default": 100
          }
        },
        "type": "object",
        "required": [
          "table_ref"
        ],
        "title": "TableRefLookupRequest",
        "description": "Request model for table reference lookup"
      },
      "TableRefLookupResponse": {
        "properties": {
          "table_ref": {
            "type": "string",
            "title": "Table Ref"
          },
          "results": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Results"
          },
          "total_found": {
            "type": "integer",
            "title": "Total Found"
          },
          "filtered": {
            "type": "boolean",
            "title": "Filtered"
          }
        },
        "type": "object",
        "required": [
          "table_ref",
          "results",
          "total_found",
          "filtered"
        ],
        "title": "TableRefLookupResponse",
        "description": "Response model for table reference lookup"
      },
      "Token": {
        "properties": {
          "access_token": {
            "type": "string",
            "title": "Access Token"
          },
          "token_type": {
            "type": "string",
            "title": "Token Type"
          },
          "expires_in": {
            "type": "integer",
            "title": "Expires In"
          },
          "scope": {
            "type": "string",
            "title": "Scope"
          }
        },
        "type": "object",
        "required": [
          "access_token",
          "token_type",
          "expires_in",
          "scope"
        ],
        "title": "Token"
      },
      "UserCreate": {
        "properties": {
          "username": {
            "type": "string",
            "title": "Username"
          },
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "password": {
            "type": "string",
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "username",
          "email",
          "role",
          "password"
        ],
        "title": "UserCreate",
        "description": "Schema for creating a new user"
      },
      "UserProfile": {
        "properties": {
          "username": {
            "type": "string",
            "title": "Username"
          },
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "user_id": {
            "type": "integer",
            "title": "User Id"
          },
          "scopes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Scopes"
          }
        },
        "type": "object",
        "required": [
          "username",
          "email",
          "role",
          "user_id",
          "scopes"
        ],
        "title": "UserProfile",
        "description": "Schema for user profile information"
      },
      "UserResponse": {
        "properties": {
          "username": {
            "type": "string",
            "title": "Username"
          },
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "role": {
            "type": "string",
            "title": "Role"
          },
          "user_id": {
            "type": "integer",
            "title": "User Id"
          }
        },
        "type": "object",
        "required": [
          "username",
          "email",
          "role",
          "user_id"
        ],
        "title": "UserResponse",
        "description": "Schema for user response (without password)"
      },
      "UserUpdate": {
        "properties": {
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "role": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Role"
          }
        },
        "type": "object",
        "title": "UserUpdate",
        "description": "Schema for updating user information"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "ValidationErrorResponse": {
        "properties": {
          "success": {
            "type": "boolean",
            "title": "Success",
            "default": false
          },
          "error_type": {
            "$ref": "#/components/schemas/ErrorType",
            "default": "validation_error"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "details": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/ErrorDetail"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Details"
          },
          "timestamp": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Timestamp"
          },
          "path": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Path"
          },
          "request_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Request Id"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "ValidationErrorResponse",
        "description": "Validation error response",
        "example": {
          "details": [
            {
              "field": "title",
              "message": "Title is required",
              "type": "missing"
            }
          ],
          "error_type": "validation_error",
          "message": "Validation failed",
          "path": "/v1/surveys/survey_program",
          "request_id": "req_12345",
          "success": false,
          "timestamp": "2025-08-05T21:23:40Z"
        }
      }
    },
    "securitySchemes": {
      "OAuth2PasswordBearer": {
        "type": "oauth2",
        "flows": {
          "password": {
            "scopes": {
              "upload:write": "Upload and manage files",
              "templates:write": "Create and manage templates",
              "context:write": "Modify backend context",
              "context:read": "Read survey data",
              "users:admin": "Manage users",
              "surveys:read": "Read surveys",
              "surveys:write": "Create and update surveys",
              "surveys:delete": "Delete surveys",
              "mali_reference:read": "Read Mali reference tables",
              "admin": "Full administrative access"
            },
            "tokenUrl": "api/v1/auth/token"
          }
        }
      }
    }
  }
}