{
  "openapi": "3.1.0",
  "info": {
    "title": "libreserv",
    "description": "Middleware and queue service between authenticated clients and headless LibreOffice. Submit document-conversion jobs, poll their status, download results, receive signed webhooks.\n\nAll `/api/v1` endpoints require `Authorization: Bearer <api-key>` (keys are issued by admins and look like `lsv_<prefix>_<secret>`). `/api/v1/admin/*` additionally requires the key's user to be an admin. Full reference with examples: `docs/API.md`.",
    "version": "1.0.1.dev18"
  },
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "Liveness: process is up (no auth)",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Health Health Get"
                }
              }
            }
          }
        }
      }
    },
    "/ready": {
      "get": {
        "tags": [
          "health"
        ],
        "summary": "Readiness: database, queue, and pool checks (no auth)",
        "operationId": "ready_ready_get",
        "responses": {
          "200": {
            "description": "All critical dependencies reachable.",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Ready Ready Get"
                }
              }
            }
          },
          "503": {
            "description": "Database or queue unreachable \u2014 body lists per-check status."
          }
        }
      }
    },
    "/api/v1/me": {
      "get": {
        "tags": [
          "meta"
        ],
        "summary": "Calling app's identity, quotas, restrictions, and webhook secret",
        "operationId": "me_api_v1_me_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeOut"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/v1/formats": {
      "get": {
        "tags": [
          "meta"
        ],
        "summary": "Supported target formats",
        "operationId": "formats_api_v1_formats_get",
        "responses": {
          "200": {
            "description": "Mapping of target format name to output file extension.",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Formats Api V1 Formats Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/v1/me/usage": {
      "get": {
        "tags": [
          "meta"
        ],
        "summary": "Calling app's own usage report (daily rows + totals)",
        "operationId": "my_usage_api_v1_me_usage_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReportOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs": {
      "post": {
        "tags": [
          "jobs"
        ],
        "summary": "Submit a conversion job",
        "operationId": "create_job_api_v1_jobs_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_create_job_api_v1_jobs_post"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Job accepted and queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobCreatedOut"
                }
              }
            }
          },
          "401": {
            "description": "Missing, malformed, revoked, or unknown API key."
          },
          "413": {
            "description": "Upload exceeds the caller's file-size limit."
          },
          "422": {
            "description": "Unsupported target_format or invalid form fields."
          },
          "429": {
            "description": "Daily or concurrent job quota exceeded."
          },
          "503": {
            "description": "Queue (valkey) unreachable."
          },
          "507": {
            "description": "Spool disk below the configured free-space floor."
          }
        }
      },
      "get": {
        "tags": [
          "jobs"
        ],
        "summary": "List your jobs",
        "operationId": "list_jobs_api_v1_jobs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/JobStatus"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Newest first; capped at 200 per page.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JobOut"
                  },
                  "title": "Response List Jobs Api V1 Jobs Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{job_id}": {
      "get": {
        "tags": [
          "jobs"
        ],
        "summary": "Job status with event timeline",
        "operationId": "get_job_api_v1_jobs__job_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobDetailOut"
                }
              }
            }
          },
          "404": {
            "description": "No such job, or it belongs to another user."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "jobs"
        ],
        "summary": "Cancel a queued/running job, or delete a finished job's artifacts",
        "description": "Cancel a queued/running job; for finished jobs, delete the artifacts.",
        "operationId": "cancel_or_cleanup_job_api_v1_jobs__job_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Updated job state after the cancel/cleanup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/JobOut"
                }
              }
            }
          },
          "404": {
            "description": "No such job, or it belongs to another user."
          },
          "409": {
            "description": "Running job could not be aborted."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{job_id}/result": {
      "get": {
        "tags": [
          "jobs"
        ],
        "summary": "Download the converted document",
        "operationId": "download_result_api_v1_jobs__job_id__result_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The converted document.",
            "content": {
              "application/octet-stream": {}
            }
          },
          "404": {
            "description": "No such job, or it belongs to another user."
          },
          "409": {
            "description": "Job has not succeeded (still queued/running, failed, or canceled)."
          },
          "410": {
            "description": "Artifacts expired or already deleted."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{job_id}/source": {
      "get": {
        "tags": [
          "jobs"
        ],
        "summary": "Download the original uploaded document",
        "operationId": "download_source_api_v1_jobs__job_id__source_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The original document.",
            "content": {
              "application/octet-stream": {}
            }
          },
          "404": {
            "description": "No such job, or it belongs to another user."
          },
          "410": {
            "description": "Source document no longer on disk (retention expired)."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/jobs/{job_id}/log": {
      "get": {
        "tags": [
          "jobs"
        ],
        "summary": "Download the job log (plain text)",
        "operationId": "download_log_api_v1_jobs__job_id__log_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Job Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Timestamped job log.",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "No such job, or it belongs to another user."
          },
          "410": {
            "description": "Log no longer on disk (retention expired)."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/convert": {
      "post": {
        "tags": [
          "jobs"
        ],
        "summary": "Convert synchronously: upload, wait, download in one request",
        "operationId": "convert_sync_api_v1_convert_post",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_convert_sync_api_v1_convert_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The converted document (X-Libreserv-Job header carries the job id).",
            "content": {
              "application/json": {
                "schema": {}
              },
              "application/octet-stream": {}
            }
          },
          "202": {
            "description": "Server-side wait timed out; job continues \u2014 poll GET /api/v1/jobs/{id}."
          },
          "401": {
            "description": "Missing, malformed, revoked, or unknown API key."
          },
          "409": {
            "description": "Job was canceled while waiting."
          },
          "413": {
            "description": "Upload exceeds the caller's file-size limit."
          },
          "422": {
            "description": "Unsupported target_format, invalid fields, or the conversion failed (body carries error_code/error_msg)."
          },
          "429": {
            "description": "Daily or concurrent job quota exceeded."
          },
          "503": {
            "description": "Queue (valkey) unreachable."
          },
          "507": {
            "description": "Spool disk below the configured free-space floor."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/v1/admin/apps": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List all apps",
        "operationId": "list_apps_api_v1_admin_apps_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AppOut"
                  },
                  "type": "array",
                  "title": "Response List Apps Api V1 Admin Apps Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Create an app (webhook secret is generated automatically)",
        "operationId": "create_app_api_v1_admin_apps_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppOut"
                }
              }
            }
          },
          "409": {
            "description": "App name already exists."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/v1/admin/apps/{app_id}": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Get one app",
        "operationId": "get_app_api_v1_admin_apps__app_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "App Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppOut"
                }
              }
            }
          },
          "404": {
            "description": "App not found."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "admin"
        ],
        "summary": "Update an app (quotas, restrictions, active/admin flags)",
        "operationId": "patch_app_api_v1_admin_apps__app_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "App Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppOut"
                }
              }
            }
          },
          "404": {
            "description": "App not found."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "admin"
        ],
        "summary": "Delete an app and everything owned by it (keys, jobs, usage)",
        "operationId": "delete_app_api_v1_admin_apps__app_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "App Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "400": {
            "description": "Refused: an app cannot delete itself."
          },
          "404": {
            "description": "App not found."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/apps/{app_id}/keys": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Issue an API key \u2014 the plaintext token is returned exactly once",
        "operationId": "issue_key_api_v1_admin_apps__app_id__keys_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "App Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyCreate"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyIssued"
                }
              }
            }
          },
          "404": {
            "description": "App not found."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List an app's API keys (hashes never leave the server)",
        "operationId": "list_keys_api_v1_admin_apps__app_id__keys_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "App Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ApiKeyOut"
                  },
                  "title": "Response List Keys Api V1 Admin Apps  App Id  Keys Get"
                }
              }
            }
          },
          "404": {
            "description": "App not found."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/keys/{key_id}": {
      "delete": {
        "tags": [
          "admin"
        ],
        "summary": "Revoke an API key (idempotent)",
        "operationId": "revoke_key_api_v1_admin_keys__key_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "key_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Key Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "404": {
            "description": "Key not found."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/admins": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List web-UI admin accounts",
        "operationId": "list_admins_api_v1_admin_admins_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdminOut"
                  },
                  "type": "array",
                  "title": "Response List Admins Api V1 Admin Admins Get"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Create a web-UI admin account (name and email are unique)",
        "operationId": "create_admin_api_v1_admin_admins_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminOut"
                }
              }
            }
          },
          "409": {
            "description": "Admin name or email already exists."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/v1/admin/admins/{admin_id}": {
      "patch": {
        "tags": [
          "admin"
        ],
        "summary": "Update a web-UI admin (name, email, active flag, password)",
        "operationId": "patch_admin_api_v1_admin_admins__admin_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "admin_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Admin Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminPatch"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminOut"
                }
              }
            }
          },
          "404": {
            "description": "Admin not found."
          },
          "409": {
            "description": "New name or email already taken."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "admin"
        ],
        "summary": "Delete a web-UI admin account",
        "operationId": "delete_admin_api_v1_admin_admins__admin_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "admin_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Admin Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "404": {
            "description": "Admin not found."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/jobs": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List jobs across all apps (filter by status and/or app)",
        "operationId": "list_all_jobs_api_v1_admin_jobs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/JobStatus"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "name": "app_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "App Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "title": "Limit"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 0,
              "title": "Offset"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/JobOut"
                  },
                  "title": "Response List All Jobs Api V1 Admin Jobs Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/usage": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Usage report across apps (daily rows + totals)",
        "operationId": "usage_api_v1_admin_usage_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "app_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "integer"
                },
                {
                  "type": "null"
                }
              ],
              "title": "App Id"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "From"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "To"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageReportOut"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/pool": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "LibreOffice pool status as published by the worker",
        "operationId": "pool_status_api_v1_admin_pool_get",
        "responses": {
          "200": {
            "description": "Pool snapshot, or {available: false} when none published.",
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": true,
                  "type": "object",
                  "title": "Response Pool Status Api V1 Admin Pool Get"
                }
              }
            }
          },
          "503": {
            "description": "Queue (valkey) unreachable."
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/api/v1/admin/pool/{slot_index}/restart": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Request a pool slot restart (picked up by the worker's health loop)",
        "operationId": "restart_pool_slot_api_v1_admin_pool__slot_index__restart_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slot_index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Slot Index"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Restart Pool Slot Api V1 Admin Pool  Slot Index  Restart Post"
                }
              }
            }
          },
          "503": {
            "description": "Queue (valkey) unreachable."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/admin/pool/{slot_index}/ping": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Actively ping a pool slot and wait for the worker's live result",
        "operationId": "ping_pool_slot_api_v1_admin_pool__slot_index__ping_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "slot_index",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "title": "Slot Index"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The slot's liveness result, or a timeout if the worker did not answer.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true,
                  "title": "Response Ping Pool Slot Api V1 Admin Pool  Slot Index  Ping Post"
                }
              }
            }
          },
          "503": {
            "description": "Queue (valkey) unreachable."
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AdminCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "password": {
            "type": "string",
            "minLength": 8,
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "name",
          "password"
        ],
        "title": "AdminCreate"
      },
      "AdminOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "email",
          "is_active",
          "created_at"
        ],
        "title": "AdminOut"
      },
      "AdminPatch": {
        "properties": {
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Name"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "password": {
            "anyOf": [
              {
                "type": "string",
                "minLength": 8
              },
              {
                "type": "null"
              }
            ],
            "title": "Password"
          }
        },
        "type": "object",
        "title": "AdminPatch"
      },
      "ApiKeyCreate": {
        "properties": {
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          }
        },
        "type": "object",
        "title": "ApiKeyCreate"
      },
      "ApiKeyIssued": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "prefix": {
            "type": "string",
            "title": "Prefix"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "last_user_agent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last User Agent"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          },
          "token": {
            "type": "string",
            "title": "Token"
          }
        },
        "type": "object",
        "required": [
          "id",
          "prefix",
          "label",
          "created_at",
          "created_by",
          "last_used_at",
          "last_user_agent",
          "revoked_at",
          "token"
        ],
        "title": "ApiKeyIssued"
      },
      "ApiKeyOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "prefix": {
            "type": "string",
            "title": "Prefix"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "last_used_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Used At"
          },
          "last_user_agent": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last User Agent"
          },
          "revoked_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Revoked At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "prefix",
          "label",
          "created_at",
          "created_by",
          "last_used_at",
          "last_user_agent",
          "revoked_at"
        ],
        "title": "ApiKeyOut"
      },
      "AppCreate": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_admin": {
            "type": "boolean",
            "title": "Is Admin",
            "default": false
          },
          "max_file_mb": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max File Mb"
          },
          "max_jobs_per_day": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Jobs Per Day"
          },
          "max_jobs_per_minute": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Jobs Per Minute"
          },
          "max_concurrent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Concurrent"
          },
          "allowed_sources": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Sources",
            "description": "One entry per line: IP, CIDR range, or hostname. Empty = unrestricted."
          },
          "allowed_referers": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Referers",
            "description": "One entry per line: substring, or ~regex. Empty = unrestricted."
          }
        },
        "type": "object",
        "required": [
          "name"
        ],
        "title": "AppCreate"
      },
      "AppOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_admin": {
            "type": "boolean",
            "title": "Is Admin"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "max_file_mb": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max File Mb"
          },
          "max_jobs_per_day": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Jobs Per Day"
          },
          "max_jobs_per_minute": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Jobs Per Minute"
          },
          "max_concurrent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Concurrent"
          },
          "allowed_sources": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Sources"
          },
          "allowed_referers": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Referers"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "updated_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated By"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "is_admin",
          "is_active",
          "max_file_mb",
          "max_jobs_per_day",
          "max_jobs_per_minute",
          "max_concurrent",
          "allowed_sources",
          "allowed_referers",
          "created_at",
          "created_by",
          "updated_by",
          "updated_at"
        ],
        "title": "AppOut"
      },
      "AppPatch": {
        "properties": {
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_admin": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Admin"
          },
          "is_active": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Is Active"
          },
          "max_file_mb": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max File Mb"
          },
          "max_jobs_per_day": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Jobs Per Day"
          },
          "max_jobs_per_minute": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Jobs Per Minute"
          },
          "max_concurrent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Concurrent"
          },
          "allowed_sources": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Sources"
          },
          "allowed_referers": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Referers"
          }
        },
        "type": "object",
        "title": "AppPatch"
      },
      "Body_convert_sync_api_v1_convert_post": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          },
          "target_format": {
            "type": "string",
            "title": "Target Format"
          },
          "filter_options": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filter Options"
          }
        },
        "type": "object",
        "required": [
          "file",
          "target_format"
        ],
        "title": "Body_convert_sync_api_v1_convert_post"
      },
      "Body_create_job_api_v1_jobs_post": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          },
          "target_format": {
            "type": "string",
            "title": "Target Format"
          },
          "filter_options": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filter Options"
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url"
          }
        },
        "type": "object",
        "required": [
          "file",
          "target_format"
        ],
        "title": "Body_create_job_api_v1_jobs_post"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "JobCreatedOut": {
        "properties": {
          "job_id": {
            "type": "string",
            "format": "uuid",
            "title": "Job Id"
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus",
            "default": "queued"
          }
        },
        "type": "object",
        "required": [
          "job_id"
        ],
        "title": "JobCreatedOut"
      },
      "JobDetailOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "app_id": {
            "type": "integer",
            "title": "App Id"
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus"
          },
          "attempt": {
            "type": "integer",
            "title": "Attempt"
          },
          "max_attempts": {
            "type": "integer",
            "title": "Max Attempts"
          },
          "src_filename": {
            "type": "string",
            "title": "Src Filename"
          },
          "src_bytes": {
            "type": "integer",
            "title": "Src Bytes"
          },
          "out_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Out Bytes"
          },
          "target_format": {
            "type": "string",
            "title": "Target Format"
          },
          "filter_options": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filter Options"
          },
          "engine": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Engine"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_msg": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Msg"
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          },
          "events": {
            "items": {
              "$ref": "#/components/schemas/JobEventOut"
            },
            "type": "array",
            "title": "Events"
          }
        },
        "type": "object",
        "required": [
          "id",
          "app_id",
          "status",
          "attempt",
          "max_attempts",
          "src_filename",
          "src_bytes",
          "out_bytes",
          "target_format",
          "filter_options",
          "engine",
          "error_code",
          "error_msg",
          "webhook_url",
          "created_at",
          "started_at",
          "finished_at",
          "expires_at",
          "duration_ms",
          "events"
        ],
        "title": "JobDetailOut"
      },
      "JobEventOut": {
        "properties": {
          "at": {
            "type": "string",
            "format": "date-time",
            "title": "At"
          },
          "event": {
            "type": "string",
            "title": "Event"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          }
        },
        "type": "object",
        "required": [
          "at",
          "event",
          "detail"
        ],
        "title": "JobEventOut"
      },
      "JobOut": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "app_id": {
            "type": "integer",
            "title": "App Id"
          },
          "status": {
            "$ref": "#/components/schemas/JobStatus"
          },
          "attempt": {
            "type": "integer",
            "title": "Attempt"
          },
          "max_attempts": {
            "type": "integer",
            "title": "Max Attempts"
          },
          "src_filename": {
            "type": "string",
            "title": "Src Filename"
          },
          "src_bytes": {
            "type": "integer",
            "title": "Src Bytes"
          },
          "out_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Out Bytes"
          },
          "target_format": {
            "type": "string",
            "title": "Target Format"
          },
          "filter_options": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Filter Options"
          },
          "engine": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Engine"
          },
          "error_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Code"
          },
          "error_msg": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error Msg"
          },
          "webhook_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Url"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "finished_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Finished At"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          }
        },
        "type": "object",
        "required": [
          "id",
          "app_id",
          "status",
          "attempt",
          "max_attempts",
          "src_filename",
          "src_bytes",
          "out_bytes",
          "target_format",
          "filter_options",
          "engine",
          "error_code",
          "error_msg",
          "webhook_url",
          "created_at",
          "started_at",
          "finished_at",
          "expires_at",
          "duration_ms"
        ],
        "title": "JobOut"
      },
      "JobStatus": {
        "type": "string",
        "enum": [
          "queued",
          "running",
          "succeeded",
          "failed",
          "canceled",
          "expired"
        ],
        "title": "JobStatus"
      },
      "MeOut": {
        "properties": {
          "id": {
            "type": "integer",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "is_admin": {
            "type": "boolean",
            "title": "Is Admin"
          },
          "is_active": {
            "type": "boolean",
            "title": "Is Active"
          },
          "max_file_mb": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max File Mb"
          },
          "max_jobs_per_day": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Jobs Per Day"
          },
          "max_jobs_per_minute": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Jobs Per Minute"
          },
          "max_concurrent": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Concurrent"
          },
          "allowed_sources": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Sources"
          },
          "allowed_referers": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Allowed Referers"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "created_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By"
          },
          "updated_by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated By"
          },
          "updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          },
          "webhook_secret": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Webhook Secret"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "is_admin",
          "is_active",
          "max_file_mb",
          "max_jobs_per_day",
          "max_jobs_per_minute",
          "max_concurrent",
          "allowed_sources",
          "allowed_referers",
          "created_at",
          "created_by",
          "updated_by",
          "updated_at",
          "webhook_secret"
        ],
        "title": "MeOut"
      },
      "UsageReportOut": {
        "properties": {
          "rows": {
            "items": {
              "$ref": "#/components/schemas/UsageRowOut"
            },
            "type": "array",
            "title": "Rows"
          },
          "totals": {
            "$ref": "#/components/schemas/UsageTotals"
          }
        },
        "type": "object",
        "required": [
          "rows",
          "totals"
        ],
        "title": "UsageReportOut"
      },
      "UsageRowOut": {
        "properties": {
          "app_id": {
            "type": "integer",
            "title": "App Id"
          },
          "day": {
            "type": "string",
            "format": "date",
            "title": "Day"
          },
          "jobs_succeeded": {
            "type": "integer",
            "title": "Jobs Succeeded"
          },
          "jobs_failed": {
            "type": "integer",
            "title": "Jobs Failed"
          },
          "bytes_in": {
            "type": "integer",
            "title": "Bytes In"
          },
          "bytes_out": {
            "type": "integer",
            "title": "Bytes Out"
          },
          "total_duration_ms": {
            "type": "integer",
            "title": "Total Duration Ms"
          }
        },
        "type": "object",
        "required": [
          "app_id",
          "day",
          "jobs_succeeded",
          "jobs_failed",
          "bytes_in",
          "bytes_out",
          "total_duration_ms"
        ],
        "title": "UsageRowOut"
      },
      "UsageTotals": {
        "properties": {
          "jobs_succeeded": {
            "type": "integer",
            "title": "Jobs Succeeded",
            "default": 0
          },
          "jobs_failed": {
            "type": "integer",
            "title": "Jobs Failed",
            "default": 0
          },
          "bytes_in": {
            "type": "integer",
            "title": "Bytes In",
            "default": 0
          },
          "bytes_out": {
            "type": "integer",
            "title": "Bytes Out",
            "default": 0
          },
          "total_duration_ms": {
            "type": "integer",
            "title": "Total Duration Ms",
            "default": 0
          }
        },
        "type": "object",
        "title": "UsageTotals"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "jobs",
      "description": "Submit, track, download, and cancel conversion jobs."
    },
    {
      "name": "meta",
      "description": "Caller identity, own usage, supported formats."
    },
    {
      "name": "admin",
      "description": "User/key management, all-user job view, usage reports, pool control. Admin key required."
    },
    {
      "name": "health",
      "description": "Unauthenticated liveness/readiness probes."
    }
  ]
}
