{
  "openapi": "3.1.0",
  "info": {
    "title": "RSX Files",
    "version": "v1",
    "description": "File and media CDN control plane — uploads, share links, and object metadata for rsxcdn.com."
  },
  "servers": [
    {
      "url": "https://api.rsx.group"
    }
  ],
  "components": {
    "schemas": {
      "UploadMode": {
        "type": "string",
        "enum": [
          "single",
          "multipart"
        ]
      },
      "UploadGrant": {
        "type": "object",
        "properties": {
          "partNumber": {
            "type": "integer",
            "minimum": 1,
            "example": 1
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "enum": [
              "PUT"
            ]
          },
          "headers": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "required": [
          "partNumber",
          "url",
          "method",
          "headers"
        ]
      },
      "UploadSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "hash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{64}$",
            "example": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
          },
          "mode": {
            "$ref": "#/components/schemas/UploadMode"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "done",
              "aborted"
            ]
          },
          "deduped": {
            "type": "boolean"
          },
          "partSize": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 5242880
          },
          "partCount": {
            "type": "integer",
            "minimum": 1
          },
          "completedParts": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "grants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UploadGrant"
            }
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "hash",
          "mode",
          "status",
          "deduped",
          "partSize",
          "partCount",
          "completedParts",
          "grants",
          "expiresAt"
        ]
      },
      "CreateUpload": {
        "type": "object",
        "properties": {
          "hash": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "example": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 34359738368,
            "example": 284913
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "example": "render-final.png"
          }
        },
        "required": [
          "size",
          "filename"
        ]
      },
      "UploadedPart": {
        "type": "object",
        "properties": {
          "partNumber": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          },
          "etag": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "partNumber",
          "etag"
        ]
      },
      "ReportParts": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UploadedPart"
            },
            "minItems": 1,
            "maxItems": 10000
          }
        },
        "required": [
          "id",
          "parts"
        ]
      },
      "RemoveUpload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "id"
        ]
      },
      "Quota": {
        "type": "object",
        "properties": {
          "usedBytes": {
            "type": "integer",
            "minimum": 0,
            "example": 1073741824
          },
          "limitBytes": {
            "type": "integer",
            "minimum": 0,
            "example": 10737418240
          },
          "maxObjectBytes": {
            "type": "integer",
            "minimum": 0
          },
          "objectCount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "usedBytes",
          "limitBytes",
          "maxObjectBytes",
          "objectCount"
        ]
      },
      "ObjectKind": {
        "type": "string",
        "enum": [
          "image",
          "video",
          "audio",
          "archive",
          "model",
          "text",
          "document",
          "other"
        ]
      },
      "Visibility": {
        "type": "string",
        "enum": [
          "public",
          "unlisted",
          "private"
        ]
      },
      "PreviewStatus": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          "pending",
          "ready",
          "partial",
          "unsupported",
          "failed"
        ]
      },
      "ModelFormat": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          "glb",
          "gltf",
          "obj",
          "stl",
          "fbx",
          "rbxm"
        ]
      },
      "FileObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9A-Za-z]{10}$",
            "example": "K3nZ9qLm2P"
          },
          "hash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{64}$",
            "example": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "example": "render-final.png"
          },
          "size": {
            "type": "integer",
            "minimum": 0,
            "example": 284913
          },
          "mime": {
            "type": "string",
            "example": "image/png"
          },
          "kind": {
            "$ref": "#/components/schemas/ObjectKind"
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "example": "https://rsxcdn.com/K3nZ9qLm2P.png"
          },
          "pageUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "example": "https://cdn.rsx.group/f/K3nZ9qLm2P"
          },
          "thumbUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "posterUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "previewStatus": {
            "$ref": "#/components/schemas/PreviewStatus"
          },
          "previewDetail": {
            "type": [
              "string",
              "null"
            ]
          },
          "hasManifest": {
            "type": "boolean"
          },
          "hasText": {
            "type": "boolean"
          },
          "modelFormat": {
            "$ref": "#/components/schemas/ModelFormat"
          },
          "treeUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "width": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "height": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "hash",
          "filename",
          "size",
          "mime",
          "kind",
          "visibility",
          "url",
          "pageUrl",
          "thumbUrl",
          "posterUrl",
          "previewStatus",
          "previewDetail",
          "hasManifest",
          "hasText",
          "modelFormat",
          "treeUrl",
          "width",
          "height",
          "createdAt",
          "expiresAt"
        ]
      },
      "CreateObject": {
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string",
            "format": "uuid"
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "example": "render-final.png"
          },
          "visibility": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Visibility"
              },
              {
                "default": "public"
              }
            ]
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "uploadId"
        ]
      },
      "UpdateObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9A-Za-z]{10}$",
            "example": "K3nZ9qLm2P"
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "example": "render-final.png"
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id"
        ]
      },
      "RemoveObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9A-Za-z]{10}$",
            "example": "K3nZ9qLm2P"
          }
        },
        "required": [
          "id"
        ]
      },
      "ArchiveEntry": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0
          },
          "path": {
            "type": "string"
          },
          "isDirectory": {
            "type": "boolean"
          },
          "size": {
            "type": "integer",
            "minimum": 0
          },
          "compressedSize": {
            "type": "integer",
            "minimum": 0
          },
          "extractable": {
            "type": "boolean"
          },
          "modified": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "index",
          "path",
          "isDirectory",
          "size",
          "compressedSize",
          "extractable",
          "modified"
        ]
      },
      "TextPreview": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "lines": {
            "type": "integer",
            "minimum": 0
          },
          "truncated": {
            "type": "boolean"
          },
          "truncatedBy": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "bytes",
              "lines",
              "lineLength"
            ]
          },
          "previewBytes": {
            "type": "integer",
            "minimum": 0
          },
          "totalBytes": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "text",
          "lines",
          "truncated",
          "truncatedBy",
          "previewBytes",
          "totalBytes"
        ]
      },
      "ResolvedObject": {
        "type": "object",
        "properties": {
          "storageKey": {
            "type": "string",
            "minLength": 1,
            "example": "blob/e3b0c442…"
          },
          "hash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{64}$",
            "example": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
          },
          "mime": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "minimum": 0
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "example": "render-final.png"
          },
          "disposition": {
            "type": "string",
            "enum": [
              "inline",
              "attachment"
            ]
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "kind": {
            "$ref": "#/components/schemas/ObjectKind"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "thumbKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "posterKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "manifestKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "modelFormat": {
            "$ref": "#/components/schemas/ModelFormat"
          },
          "treeKey": {
            "type": [
              "string",
              "null"
            ]
          },
          "width": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "height": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          }
        },
        "required": [
          "storageKey",
          "hash",
          "mime",
          "size",
          "filename",
          "disposition",
          "visibility",
          "expiresAt",
          "kind",
          "createdAt",
          "thumbKey",
          "posterKey",
          "manifestKey",
          "modelFormat",
          "treeKey",
          "width",
          "height"
        ]
      },
      "ResolveObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9A-Za-z]{10}$",
            "example": "K3nZ9qLm2P"
          }
        },
        "required": [
          "id"
        ]
      },
      "AdminObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[0-9A-Za-z]{10}$",
            "example": "K3nZ9qLm2P"
          },
          "ownerId": {
            "type": "string"
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "example": "render-final.png"
          },
          "size": {
            "type": "integer",
            "minimum": 0
          },
          "mime": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/ObjectKind"
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "storageKey": {
            "type": "string"
          },
          "hash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{64}$",
            "example": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
          },
          "refcount": {
            "type": "integer",
            "minimum": 0
          },
          "verified": {
            "type": "boolean"
          },
          "previewStatus": {
            "$ref": "#/components/schemas/PreviewStatus"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "deletedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "ownerId",
          "filename",
          "size",
          "mime",
          "kind",
          "visibility",
          "storageKey",
          "hash",
          "refcount",
          "verified",
          "previewStatus",
          "createdAt",
          "expiresAt",
          "deletedAt",
          "url"
        ]
      },
      "AdminObjectState": {
        "type": "string",
        "enum": [
          "live",
          "revoked",
          "all"
        ],
        "default": "live"
      },
      "AdminBlob": {
        "type": "object",
        "properties": {
          "storageKey": {
            "type": "string"
          },
          "hash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{64}$",
            "example": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
          },
          "size": {
            "type": "integer",
            "minimum": 0
          },
          "mime": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/ObjectKind"
          },
          "verified": {
            "type": "boolean"
          },
          "refcount": {
            "type": "integer",
            "minimum": 0
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "objects": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[0-9A-Za-z]{10}$",
                  "example": "K3nZ9qLm2P"
                },
                "ownerId": {
                  "type": "string"
                },
                "filename": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 255,
                  "example": "render-final.png"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "id",
                "ownerId",
                "filename",
                "createdAt"
              ]
            }
          }
        },
        "required": [
          "storageKey",
          "hash",
          "size",
          "mime",
          "kind",
          "verified",
          "refcount",
          "createdAt",
          "objects"
        ]
      },
      "AdminAccount": {
        "type": "object",
        "properties": {
          "ownerId": {
            "type": "string"
          },
          "usedBytes": {
            "type": "integer",
            "minimum": 0
          },
          "objectCount": {
            "type": "integer",
            "minimum": 0
          },
          "quotaBytes": {
            "type": "integer",
            "minimum": 0
          },
          "quotaOverridden": {
            "type": "boolean"
          },
          "uploadsBlocked": {
            "type": "boolean"
          },
          "accessBlocked": {
            "type": "boolean"
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updatedBy": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastUploadAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "ownerId",
          "usedBytes",
          "objectCount",
          "quotaBytes",
          "quotaOverridden",
          "uploadsBlocked",
          "accessBlocked",
          "note",
          "updatedAt",
          "updatedBy",
          "lastUploadAt"
        ]
      },
      "AdminWipe": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "queued",
              "running",
              "done",
              "failed"
            ]
          },
          "objectsTotal": {
            "type": "integer",
            "minimum": 0
          },
          "objectsDone": {
            "type": "integer",
            "minimum": 0
          },
          "bytesFreed": {
            "type": "integer",
            "minimum": 0
          },
          "actor": {
            "type": "string"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "finishedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "ownerId",
          "status",
          "objectsTotal",
          "objectsDone",
          "bytesFreed",
          "actor",
          "reason",
          "startedAt",
          "finishedAt",
          "detail"
        ]
      },
      "AdminUpload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "ownerId": {
            "type": "string"
          },
          "filename": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255,
            "example": "render-final.png"
          },
          "size": {
            "type": "integer",
            "minimum": 0
          },
          "hash": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9a-f]{64}$",
            "example": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
          },
          "mode": {
            "$ref": "#/components/schemas/UploadMode"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "done",
              "aborted"
            ]
          },
          "partsDone": {
            "type": "integer",
            "minimum": 0
          },
          "partCount": {
            "type": "integer",
            "minimum": 0
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "objectId": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[0-9A-Za-z]{10}$",
            "example": "K3nZ9qLm2P"
          }
        },
        "required": [
          "id",
          "ownerId",
          "filename",
          "size",
          "hash",
          "mode",
          "status",
          "partsDone",
          "partCount",
          "createdAt",
          "expiresAt",
          "objectId"
        ]
      },
      "CdnSettings": {
        "type": "object",
        "properties": {
          "uploadsBlocked": {
            "type": "boolean"
          },
          "accessBlocked": {
            "type": "boolean"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updatedBy": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "uploadsBlocked",
          "accessBlocked",
          "updatedAt",
          "updatedBy"
        ]
      },
      "AdminStats": {
        "type": "object",
        "properties": {
          "objects": {
            "type": "integer",
            "minimum": 0
          },
          "revokedObjects": {
            "type": "integer",
            "minimum": 0
          },
          "blobs": {
            "type": "integer",
            "minimum": 0
          },
          "storedBytes": {
            "type": "integer",
            "minimum": 0
          },
          "orphanBlobs": {
            "type": "integer",
            "minimum": 0
          },
          "orphanBytes": {
            "type": "integer",
            "minimum": 0
          },
          "owners": {
            "type": "integer",
            "minimum": 0
          },
          "uploadsLast24h": {
            "type": "integer",
            "minimum": 0
          },
          "failedPreviews": {
            "type": "integer",
            "minimum": 0
          },
          "blockedAccounts": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "objects",
          "revokedObjects",
          "blobs",
          "storedBytes",
          "orphanBlobs",
          "orphanBytes",
          "owners",
          "uploadsLast24h",
          "failedPreviews",
          "blockedAccounts"
        ]
      },
      "AdminAuditEntry": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "actor": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "targetType": {
            "type": "string",
            "enum": [
              "object",
              "blob",
              "account",
              "cdn"
            ]
          },
          "targetId": {
            "type": "string"
          },
          "targetLabel": {
            "type": [
              "string",
              "null"
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "actor",
          "action",
          "targetType",
          "targetId",
          "targetLabel",
          "at",
          "detail"
        ]
      }
    },
    "parameters": {}
  },
  "paths": {
    "/files/v1/uploads/add": {
      "post": {
        "operationId": "addUpload",
        "summary": "Open an upload session",
        "tags": [
          "uploads"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUpload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upload session opened, or the blob already existed",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/UploadSession"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/uploads/get": {
      "get": {
        "operationId": "getUpload",
        "summary": "Fetch an upload session (and the next batch of grants)",
        "tags": [
          "uploads"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "required": true,
            "name": "id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Upload session",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/UploadSession"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/uploads/update": {
      "post": {
        "operationId": "updateUpload",
        "summary": "Report completed parts and collect the next grants",
        "tags": [
          "uploads"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportParts"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Parts recorded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/UploadSession"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/uploads/remove": {
      "post": {
        "operationId": "removeUpload",
        "summary": "Abort an upload session",
        "tags": [
          "uploads"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveUpload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Upload session aborted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/quota/get": {
      "get": {
        "operationId": "getQuota",
        "summary": "Storage usage for the calling account",
        "tags": [
          "quota"
        ],
        "responses": {
          "200": {
            "description": "Quota and usage",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Quota"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/objects/add": {
      "post": {
        "operationId": "addObject",
        "summary": "Finalise an upload into a share link",
        "tags": [
          "objects"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateObject"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Share link created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileObject"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/objects/list": {
      "get": {
        "operationId": "listObjects",
        "summary": "List your objects",
        "tags": [
          "objects"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "example": 20
            },
            "required": false,
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Objects",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FileObject"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "cursor"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/objects/get": {
      "get": {
        "operationId": "getObject",
        "summary": "Fetch one object",
        "tags": [
          "objects"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[0-9A-Za-z]{10}$",
              "example": "K3nZ9qLm2P"
            },
            "required": true,
            "name": "id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Object",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileObject"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/objects/update": {
      "post": {
        "operationId": "updateObject",
        "summary": "Rename an object or change its visibility",
        "tags": [
          "objects"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateObject"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Object updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FileObject"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/objects/remove": {
      "post": {
        "operationId": "removeObject",
        "summary": "Revoke a share link",
        "tags": [
          "objects"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveObject"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Share link revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/archives/list": {
      "get": {
        "operationId": "listArchiveEntries",
        "summary": "Browse the contents of an archive",
        "tags": [
          "archives"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[0-9A-Za-z]{10}$",
              "example": "K3nZ9qLm2P"
            },
            "required": true,
            "name": "id",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "default": 0
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 200
            },
            "required": false,
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Archive entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ArchiveEntry"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "format": {
                          "type": "string",
                          "enum": [
                            "zip",
                            "tar",
                            "targz",
                            "rar"
                          ]
                        },
                        "totalEntries": {
                          "type": "integer"
                        },
                        "truncated": {
                          "type": "boolean"
                        },
                        "cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "format",
                        "totalEntries",
                        "truncated",
                        "cursor"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/archives/get": {
      "get": {
        "operationId": "getArchiveEntry",
        "summary": "Extract a single entry from an archive",
        "tags": [
          "archives"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[0-9A-Za-z]{10}$",
              "example": "K3nZ9qLm2P"
            },
            "required": true,
            "name": "id",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0
            },
            "required": false,
            "name": "index",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "The entry's decompressed bytes",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/archives/resolve": {
      "post": {
        "operationId": "resolveArchiveEntries",
        "summary": "Archive contents for a public share page (internal)",
        "tags": [
          "archives"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[0-9A-Za-z]{10}$",
                    "example": "K3nZ9qLm2P"
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 500
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Archive entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ArchiveEntry"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "totalEntries": {
                          "type": "integer"
                        },
                        "truncated": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "totalEntries",
                        "truncated"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/text/get": {
      "get": {
        "operationId": "getTextPreview",
        "summary": "Read a text file's contents preview",
        "tags": [
          "text"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[0-9A-Za-z]{10}$",
              "example": "K3nZ9qLm2P"
            },
            "required": true,
            "name": "id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "The stored contents preview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TextPreview"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/text/resolve": {
      "post": {
        "operationId": "resolveTextPreview",
        "summary": "Contents preview for a public share page (internal)",
        "tags": [
          "text"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[0-9A-Za-z]{10}$",
                    "example": "K3nZ9qLm2P"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stored contents preview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TextPreview"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/objects/resolve": {
      "post": {
        "operationId": "resolveObject",
        "summary": "Resolve an object for the delivery path (internal)",
        "tags": [
          "objects"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResolveObject"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resolved delivery metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ResolvedObject"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/objects/list": {
      "get": {
        "operationId": "adminListObjects",
        "summary": "Browse every file on the platform",
        "tags": [
          "admin"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "required": false,
            "name": "q",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 128
            },
            "required": false,
            "name": "ownerId",
            "in": "query"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ObjectKind"
            },
            "required": false,
            "name": "kind",
            "in": "query"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/Visibility"
            },
            "required": false,
            "name": "visibility",
            "in": "query"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/AdminObjectState"
            },
            "required": false,
            "name": "state",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "required": false,
            "name": "storageKey",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "default": 0
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Files",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdminObject"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "total",
                        "cursor"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/objects/get": {
      "get": {
        "operationId": "adminGetObject",
        "summary": "One file, with its blob and owner",
        "tags": [
          "admin"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[0-9A-Za-z]{10}$",
              "example": "K3nZ9qLm2P"
            },
            "required": true,
            "name": "id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "File",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminObject"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/objects/link": {
      "get": {
        "operationId": "adminObjectLink",
        "summary": "Mint a short-lived link to inspect one file",
        "tags": [
          "admin"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "pattern": "^[0-9A-Za-z]{10}$",
              "example": "K3nZ9qLm2P"
            },
            "required": true,
            "name": "id",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A working delivery URL",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        },
                        "expiresIn": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "url",
                        "expiresIn"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/objects/update": {
      "post": {
        "operationId": "adminUpdateObject",
        "summary": "Rename a file or change its visibility",
        "tags": [
          "admin"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[0-9A-Za-z]{10}$",
                    "example": "K3nZ9qLm2P"
                  },
                  "filename": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255,
                    "example": "render-final.png"
                  },
                  "visibility": {
                    "$ref": "#/components/schemas/Visibility"
                  },
                  "expiresAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated file",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminObject"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/objects/revoke": {
      "post": {
        "operationId": "adminRevokeObject",
        "summary": "Revoke a share link, keeping the file",
        "tags": [
          "admin"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[0-9A-Za-z]{10}$",
                    "example": "K3nZ9qLm2P"
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Revoked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminObject"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/objects/restore": {
      "post": {
        "operationId": "adminRestoreObject",
        "summary": "Undo a revoke",
        "tags": [
          "admin"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[0-9A-Za-z]{10}$",
                    "example": "K3nZ9qLm2P"
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Restored",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminObject"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/objects/delete": {
      "post": {
        "operationId": "adminDeleteObject",
        "summary": "Delete a share link permanently",
        "tags": [
          "admin"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[0-9A-Za-z]{10}$",
                    "example": "K3nZ9qLm2P"
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "blobDeleted": {
                          "type": "boolean"
                        },
                        "bytesFreed": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "refcount": {
                          "type": "integer",
                          "minimum": 0
                        }
                      },
                      "required": [
                        "id",
                        "blobDeleted",
                        "bytesFreed",
                        "refcount"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/objects/reassign": {
      "post": {
        "operationId": "adminReassignObject",
        "summary": "Move a file to a different account",
        "tags": [
          "admin"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^[0-9A-Za-z]{10}$",
                    "example": "K3nZ9qLm2P"
                  },
                  "ownerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "id",
                  "ownerId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reassigned",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminObject"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/blobs/get": {
      "get": {
        "operationId": "adminGetBlob",
        "summary": "A blob and every link pointing at it",
        "tags": [
          "admin"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255
            },
            "required": true,
            "name": "storageKey",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Blob",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminBlob"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/blobs/purge": {
      "post": {
        "operationId": "adminPurgeBlob",
        "summary": "Erase content and every link to it",
        "tags": [
          "admin"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "storageKey": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 255
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "storageKey",
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Purged",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "storageKey": {
                          "type": "string"
                        },
                        "bytesFreed": {
                          "type": "integer",
                          "minimum": 0
                        },
                        "removed": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "ownerId": {
                                "type": "string"
                              },
                              "filename": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "ownerId",
                              "filename"
                            ]
                          }
                        }
                      },
                      "required": [
                        "storageKey",
                        "bytesFreed",
                        "removed"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/accounts/list": {
      "get": {
        "operationId": "adminListCdnAccounts",
        "summary": "Accounts ranked by storage used",
        "tags": [
          "admin"
        ],
        "parameters": [
          {
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "default": 0
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "boolean",
                "null"
              ],
              "default": false
            },
            "required": false,
            "name": "flaggedOnly",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdminAccount"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "cursor"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/accounts/get": {
      "get": {
        "operationId": "adminGetCdnAccount",
        "summary": "One account's CDN usage and policy",
        "tags": [
          "admin"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 128
            },
            "required": true,
            "name": "ownerId",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Account",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminAccount"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/accounts/limits": {
      "post": {
        "operationId": "adminSetCdnAccountLimits",
        "summary": "Set an account's quota and blocks",
        "tags": [
          "admin"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ownerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "quotaBytes": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 0
                  },
                  "uploadsBlocked": {
                    "type": "boolean"
                  },
                  "accessBlocked": {
                    "type": "boolean"
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 500
                  }
                },
                "required": [
                  "ownerId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated policy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminAccount"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/accounts/wipe": {
      "post": {
        "operationId": "adminWipeCdnAccount",
        "summary": "Erase everything an account has stored",
        "tags": [
          "admin"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "ownerId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 128
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  }
                },
                "required": [
                  "ownerId",
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Wipe queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminWipe"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/wipes/list": {
      "get": {
        "operationId": "adminListWipes",
        "summary": "Wipe jobs and their progress",
        "tags": [
          "admin"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 128
            },
            "required": false,
            "name": "ownerId",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "required": false,
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Wipes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdminWipe"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/uploads/list": {
      "get": {
        "operationId": "adminListUploads",
        "summary": "The upload log, finished and abandoned",
        "tags": [
          "admin"
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 128
            },
            "required": false,
            "name": "ownerId",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "done",
                "aborted"
              ]
            },
            "required": false,
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "default": 0
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Upload sessions",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdminUpload"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "cursor": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "total",
                        "cursor"
                      ]
                    }
                  },
                  "required": [
                    "data",
                    "meta"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/settings": {
      "get": {
        "operationId": "adminGetCdnSettings",
        "summary": "Platform-wide CDN switches",
        "tags": [
          "admin"
        ],
        "responses": {
          "200": {
            "description": "Settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CdnSettings"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "adminUpdateCdnSettings",
        "summary": "Throw a platform-wide switch",
        "tags": [
          "admin"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "uploadsBlocked": {
                    "type": "boolean"
                  },
                  "accessBlocked": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 500
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated settings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CdnSettings"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/stats": {
      "get": {
        "operationId": "adminCdnStats",
        "summary": "Platform storage totals",
        "tags": [
          "admin"
        ],
        "responses": {
          "200": {
            "description": "Totals",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AdminStats"
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/files/v1/admin/audit/list": {
      "get": {
        "operationId": "adminListFileAudit",
        "summary": "What operators have done to files and accounts",
        "tags": [
          "admin"
        ],
        "parameters": [
          {
            "schema": {
              "type": [
                "integer",
                "null"
              ],
              "minimum": 0,
              "default": 0
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "object",
                "blob",
                "account",
                "cdn"
              ]
            },
            "required": false,
            "name": "targetType",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "maxLength": 255
            },
            "required": false,
            "name": "targetId",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Audit entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AdminAuditEntry"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {}
}
