{
  "components": {
    "responses": {
      "Error": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorBody"
            }
          }
        },
        "description": "Something went wrong. `error` is a stable code (`unauthorized`, `not_found`, `conflict`, `name_taken`, `quota_exceeded`, `rate_limited`, `transfer_limit`...), `message` is for people."
      }
    },
    "schemas": {
      "ActivityEvent": {
        "description": "Something someone did in a folder. Names aren't here: the client finds\nand decrypts the node's, if it can still reach it.",
        "properties": {
          "actor": {
            "description": "Username of whoever did it.",
            "type": "string"
          },
          "at": {
            "description": "Unix seconds, to the hour.",
            "format": "int64",
            "type": "integer"
          },
          "folder": {
            "type": "boolean"
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "kind": {
            "description": "added, changed (a new version), renamed, moved, trashed or restored.",
            "type": "string"
          },
          "node_id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "node_id",
          "actor",
          "kind",
          "folder",
          "at"
        ],
        "type": "object"
      },
      "AdminAlerts": {
        "description": "`GET /api/admin/alerts`: what an admin should look at. Plain counts,\nlike the stats.",
        "properties": {
          "near_quota": {
            "description": "Accounts (not disabled) using at least 90% of their quota, fullest first.",
            "items": {
              "$ref": "#/components/schemas/QuotaAlert"
            },
            "type": "array"
          },
          "spaces": {
            "description": "The data directory's disk, the blob directory's if it's another one,\nand the bucket when the server was told its capacity.",
            "items": {
              "$ref": "#/components/schemas/StorageSpace"
            },
            "type": "array"
          }
        },
        "required": [
          "spaces",
          "near_quota"
        ],
        "type": "object"
      },
      "AdminSettings": {
        "properties": {
          "default_quota": {
            "description": "Quota for new accounts (from the server's configuration).",
            "format": "int64",
            "type": "integer"
          },
          "downloader": {
            "$ref": "#/components/schemas/DownloaderAccess"
          },
          "downloader_can_merge": {
            "description": "Whether ffmpeg is installed, so video and audio can be merged\n(needed for most YouTube videos).",
            "type": "boolean"
          },
          "downloader_max_bytes": {
            "description": "Largest download passed through, in bytes.",
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "google_drive": {
            "description": "Whether people may link a new Google Drive: None when the server has\nno Google app set up. Drives already linked keep working either way.",
            "type": [
              "boolean",
              "null"
            ]
          },
          "registration": {
            "$ref": "#/components/schemas/Registration"
          },
          "yt_dlp_version": {
            "description": "yt-dlp's version, or None if it isn't installed on the server.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "registration",
          "default_quota",
          "downloader",
          "downloader_can_merge",
          "downloader_max_bytes"
        ],
        "type": "object"
      },
      "AdminUser": {
        "properties": {
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "daily_download_limit": {
            "description": "Daily transfer limits in bytes (None: no limit), and what was moved\ntoday (UTC).",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "daily_upload_limit": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "disabled": {
            "type": "boolean"
          },
          "downloaded_today": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "is_admin": {
            "type": "boolean"
          },
          "last_seen": {
            "description": "Most recent activity of any of their sessions.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "quota_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "uploaded_today": {
            "format": "int64",
            "type": "integer"
          },
          "used_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "username",
          "is_admin",
          "disabled",
          "quota_bytes",
          "used_bytes",
          "created_at"
        ],
        "type": "object"
      },
      "AdoptDropRequest": {
        "properties": {
          "enc_content_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "The file's content key re-wrapped under the new node key, so the\nkey the visitor chose stops mattering. Requires `enc_metadata`."
              }
            ]
          },
          "enc_key": {
            "$ref": "#/components/schemas/B64",
            "description": "The node key wrapped under the folder's key."
          },
          "enc_metadata": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "The metadata under the new key (with a new name, if the dropped one\nis taken), and the name tag."
              }
            ]
          },
          "name_tag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          }
        },
        "required": [
          "enc_key"
        ],
        "type": "object"
      },
      "AppLoginRequest": {
        "properties": {
          "auth_key": {
            "$ref": "#/components/schemas/B64"
          },
          "device_name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "auth_key"
        ],
        "type": "object"
      },
      "AppLoginResponse": {
        "properties": {
          "app_password_id": {
            "type": "string"
          },
          "enc_master_key": {
            "$ref": "#/components/schemas/B64"
          },
          "me": {
            "$ref": "#/components/schemas/Me"
          },
          "scope": {
            "$ref": "#/components/schemas/AppScope"
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "token",
          "me",
          "app_password_id",
          "scope",
          "enc_master_key"
        ],
        "type": "object"
      },
      "AppPassword": {
        "properties": {
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "last_used_at": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "scope": {
            "$ref": "#/components/schemas/AppScope"
          }
        },
        "required": [
          "id",
          "name",
          "scope",
          "created_at"
        ],
        "type": "object"
      },
      "AppScope": {
        "enum": [
          "full",
          "read"
        ],
        "type": "string"
      },
      "AuditEntry": {
        "description": "One admin action (see the server's audit.rs). `target` is the account\nit was about, `detail` the new value where there is one (bytes, a mode,\ndays), both as they were at the time.",
        "properties": {
          "action": {
            "type": "string"
          },
          "actor": {
            "type": "string"
          },
          "at": {
            "format": "int64",
            "type": "integer"
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "format": "int64",
            "type": "integer"
          },
          "target": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "at",
          "actor",
          "action"
        ],
        "type": "object"
      },
      "AuditPage": {
        "description": "Newest first; `more` when there are older ones (ask with `?before=<last id>`).",
        "properties": {
          "entries": {
            "items": {
              "$ref": "#/components/schemas/AuditEntry"
            },
            "type": "array"
          },
          "more": {
            "type": "boolean"
          }
        },
        "required": [
          "entries",
          "more"
        ],
        "type": "object"
      },
      "AuthOptions": {
        "description": "What the sign-in screen needs to know before anyone is signed in.",
        "properties": {
          "admin_username": {
            "description": "...and must have this username, when set.",
            "type": [
              "string",
              "null"
            ]
          },
          "registration": {
            "$ref": "#/components/schemas/Registration"
          },
          "setup": {
            "description": "The first account on this new server needs the setup code.",
            "type": "boolean"
          },
          "turnstile": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TurnstileOptions",
                "description": "Set when this server asks for a Cloudflare Turnstile check."
              }
            ]
          }
        },
        "required": [
          "registration"
        ],
        "type": "object"
      },
      "AvatarGrant": {
        "properties": {
          "sealed_key": {
            "$ref": "#/components/schemas/B64",
            "description": "The avatar key sealed to the grantee (see `seal_avatar_key`)."
          }
        },
        "required": [
          "sealed_key"
        ],
        "type": "object"
      },
      "B64": {
        "contentEncoding": "base64url",
        "description": "Bytes as unpadded base64url.",
        "type": "string"
      },
      "ChangeFeed": {
        "description": "One page of the change feed (`GET /api/changes?since=<cursor>`).",
        "properties": {
          "changes": {
            "description": "Nodes that changed after the cursor, oldest first. A node may appear\nmore than once. Only ids: fetch the node to see what it is now (a 404\nmeans it's gone, or no longer yours to see).",
            "items": {
              "$ref": "#/components/schemas/ChangedNode"
            },
            "type": "array"
          },
          "cursor": {
            "description": "Where to continue from next time.",
            "format": "int64",
            "type": "integer"
          },
          "more": {
            "description": "More changes wait: ask again with `cursor` straight away.",
            "type": "boolean"
          },
          "resync": {
            "description": "The cursor is older than the history kept: walk the whole tree again,\nthen carry on from `cursor`.",
            "type": "boolean"
          }
        },
        "required": [
          "changes",
          "cursor",
          "more",
          "resync"
        ],
        "type": "object"
      },
      "ChangePasswordRequest": {
        "properties": {
          "current_auth_key": {
            "$ref": "#/components/schemas/B64"
          },
          "new_auth_key": {
            "$ref": "#/components/schemas/B64"
          },
          "new_enc_master_key": {
            "$ref": "#/components/schemas/B64"
          },
          "new_kdf_params": {
            "$ref": "#/components/schemas/KdfParams"
          },
          "new_kdf_salt": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "current_auth_key",
          "new_auth_key",
          "new_kdf_salt",
          "new_kdf_params",
          "new_enc_master_key"
        ],
        "type": "object"
      },
      "ChangedNode": {
        "properties": {
          "node_id": {
            "type": "string"
          },
          "seq": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "seq",
          "node_id"
        ],
        "type": "object"
      },
      "Comment": {
        "properties": {
          "author": {
            "description": "The author's username. Comments go when their author's account does.",
            "type": "string"
          },
          "author_id": {
            "type": "string"
          },
          "created_at": {
            "description": "To the hour; the exact time is inside the encrypted body.",
            "format": "int64",
            "type": "integer"
          },
          "enc_body": {
            "$ref": "#/components/schemas/B64"
          },
          "id": {
            "type": "string"
          },
          "node_id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "node_id",
          "author_id",
          "author",
          "created_at",
          "enc_body"
        ],
        "type": "object"
      },
      "CreateAppPasswordRequest": {
        "properties": {
          "auth_key": {
            "$ref": "#/components/schemas/B64",
            "description": "The auth half of the app password (see `derive_app_password_keys`)."
          },
          "current_auth_key": {
            "$ref": "#/components/schemas/B64",
            "description": "Proves the account password."
          },
          "enc_master_key": {
            "$ref": "#/components/schemas/B64",
            "description": "The master key wrapped under the app password's KEK."
          },
          "id": {
            "description": "Client-chosen id, bound into `enc_master_key`.",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "scope": {
            "$ref": "#/components/schemas/AppScope"
          }
        },
        "required": [
          "id",
          "name",
          "scope",
          "current_auth_key",
          "auth_key",
          "enc_master_key"
        ],
        "type": "object"
      },
      "CreateCommentRequest": {
        "properties": {
          "enc_body": {
            "$ref": "#/components/schemas/B64"
          },
          "id": {
            "description": "Chosen by the client: it's bound into `enc_body`.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "enc_body"
        ],
        "type": "object"
      },
      "CreateFolderRequest": {
        "properties": {
          "enc_key": {
            "$ref": "#/components/schemas/B64"
          },
          "enc_metadata": {
            "$ref": "#/components/schemas/B64"
          },
          "id": {
            "type": "string"
          },
          "name_tag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "`name_tag(parent key, name)`: lets the server refuse a duplicate name."
              }
            ]
          },
          "parent_id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "parent_id",
          "enc_key",
          "enc_metadata"
        ],
        "type": "object"
      },
      "CreateInviteRequest": {
        "properties": {
          "days": {
            "description": "How long the invite stays valid, in days (1 to 90).",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "days"
        ],
        "type": "object"
      },
      "CreateLinkRequest": {
        "properties": {
          "enc_link_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "With a password (except upload-only links): the node key wrapped\nunder the link's KEK (`wrap_link_key`), handed to visitors who give\nthe password, and the link's secret under the node key\n(`encrypt_link_secret`) so the owner can show the link again."
              }
            ]
          },
          "enc_link_secret": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "expires_at": {
            "description": "Unix seconds.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "max_opens": {
            "description": "Stop working after this many opens (1: after the first). An open is\na visit to the link page; the visit itself can then fetch everything.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "node_id": {
            "type": "string"
          },
          "password_auth": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "For a link with a password: the auth key from\n`derive_link_password_keys`. The password itself never reaches the\nserver."
              }
            ]
          },
          "upload_only": {
            "description": "A file drop: visitors can add files to the folder but see nothing\nin it. The link carries the owner's public key after `#` instead of\nthe folder key.",
            "type": "boolean"
          }
        },
        "required": [
          "node_id"
        ],
        "type": "object"
      },
      "CreateShareRequest": {
        "properties": {
          "expires_at": {
            "description": "Unix seconds; the share ends then.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "node_id": {
            "type": "string"
          },
          "permission": {
            "$ref": "#/components/schemas/Permission"
          },
          "recipient": {
            "type": "string"
          },
          "wrapped_key": {
            "$ref": "#/components/schemas/B64",
            "description": "Node key sealed to the recipient's public key."
          }
        },
        "required": [
          "node_id",
          "recipient",
          "wrapped_key",
          "permission"
        ],
        "type": "object"
      },
      "CreateUploadRequest": {
        "properties": {
          "chunk_count": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "enc_content_key": {
            "$ref": "#/components/schemas/B64"
          },
          "enc_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "Required for a new file."
              }
            ]
          },
          "enc_metadata": {
            "$ref": "#/components/schemas/B64"
          },
          "if_revision": {
            "description": "For new versions: fail with 409 if the node changed meanwhile.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "name_tag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "For a new file: its name tag (see `name_tag`)."
              }
            ]
          },
          "node_id": {
            "description": "Client-chosen id of the new node, or the id of an existing file\nnode when uploading a new version.",
            "type": "string"
          },
          "parent_id": {
            "description": "Set for a new file: the folder to create it in.",
            "type": [
              "string",
              "null"
            ]
          },
          "version_id": {
            "type": "string"
          }
        },
        "required": [
          "node_id",
          "enc_metadata",
          "version_id",
          "enc_content_key",
          "chunk_count"
        ],
        "type": "object"
      },
      "CreatedInvite": {
        "description": "A new invite. `token` is shown once; the server keeps only its hash.",
        "properties": {
          "invite": {
            "$ref": "#/components/schemas/Invite"
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "invite",
          "token"
        ],
        "type": "object"
      },
      "CurrentPassword": {
        "properties": {
          "current_auth_key": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "current_auth_key"
        ],
        "type": "object"
      },
      "DeleteAccountRequest": {
        "description": "Delete your own account, proving the password again.",
        "properties": {
          "current_auth_key": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "current_auth_key"
        ],
        "type": "object"
      },
      "DeviceSession": {
        "description": "A signed-in device, as listed in Settings. No IP addresses are kept.",
        "properties": {
          "app_password": {
            "description": "Name of the app password it signed in with, if any.",
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "current": {
            "description": "The session making this request.",
            "type": "boolean"
          },
          "device_name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "last_seen": {
            "format": "int64",
            "type": "integer"
          },
          "method": {
            "description": "How it signed in: `password`, `password+code`, `password+passkey`,\n`passkey`, `recovery`, `register` or `app_password`. None for\nsessions from before the server recorded it.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "device_name",
          "created_at",
          "last_seen",
          "current"
        ],
        "type": "object"
      },
      "DownloaderAccess": {
        "description": "Who may use the video downloader, the one tool where the server sees\nwhat it handles (see MILESTONES.md). Off by default.",
        "enum": [
          "off",
          "admins",
          "everyone"
        ],
        "type": "string"
      },
      "Draft": {
        "description": "Unsaved edits to a text file, encrypted under the editor's master key\n(see `encrypt_private_data`, labelled with the node id).",
        "properties": {
          "base_revision": {
            "description": "The file's revision the draft started from.",
            "format": "int64",
            "type": "integer"
          },
          "data": {
            "$ref": "#/components/schemas/B64"
          },
          "updated_at": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "base_revision"
        ],
        "type": "object"
      },
      "DroppedFile": {
        "description": "A file added through an upload-only link, waiting for the folder owner\nto open its sealed key and wrap it under the folder key.",
        "properties": {
          "node": {
            "$ref": "#/components/schemas/Node"
          },
          "sealed_key": {
            "$ref": "#/components/schemas/B64",
            "description": "The node key sealed to the owner's public key (see `seal_drop_key`)."
          }
        },
        "required": [
          "node",
          "sealed_key"
        ],
        "type": "object"
      },
      "EnableTotpRequest": {
        "properties": {
          "code": {
            "type": "string"
          },
          "setup_id": {
            "type": "string"
          }
        },
        "required": [
          "setup_id",
          "code"
        ],
        "type": "object"
      },
      "ErrorBody": {
        "properties": {
          "error": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        },
        "required": [
          "error",
          "message"
        ],
        "type": "object"
      },
      "FileVersion": {
        "properties": {
          "chunk_count": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "created_by": {
            "type": "string"
          },
          "current": {
            "type": "boolean"
          },
          "enc_content_key": {
            "$ref": "#/components/schemas/B64"
          },
          "enc_metadata": {
            "$ref": "#/components/schemas/B64",
            "description": "Metadata the version was uploaded with (plaintext size, mtime)."
          },
          "id": {
            "type": "string"
          },
          "pinned": {
            "description": "Kept out of the per-file limit, thinning and pruning for space.\nMissing from older servers, so it defaults to false.",
            "type": "boolean"
          },
          "size": {
            "description": "Stored (ciphertext) size in bytes.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "enc_content_key",
          "enc_metadata",
          "chunk_count",
          "size",
          "created_at",
          "created_by",
          "current"
        ],
        "type": "object"
      },
      "FinishUploadRequest": {
        "description": "Optional body for finishing an upload of a new file: a new name (and\nits tag) if the one it started with was taken meanwhile.",
        "properties": {
          "enc_metadata": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "name_tag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          }
        },
        "type": "object"
      },
      "IncomingShare": {
        "properties": {
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "expires_at": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "node": {
            "$ref": "#/components/schemas/Node"
          },
          "owner": {
            "type": "string"
          },
          "owner_pq_public_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "owner_public_key": {
            "$ref": "#/components/schemas/B64"
          },
          "permission": {
            "$ref": "#/components/schemas/Permission"
          },
          "wrapped_key": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "id",
          "owner",
          "owner_public_key",
          "permission",
          "wrapped_key",
          "node",
          "created_at"
        ],
        "type": "object"
      },
      "Invite": {
        "properties": {
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "created_by": {
            "type": "string"
          },
          "expires_at": {
            "format": "int64",
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "used_at": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "used_by": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "id",
          "created_by",
          "created_at",
          "expires_at"
        ],
        "type": "object"
      },
      "KdfParams": {
        "description": "Argon2id cost parameters. Stored (in the clear) by the server so the\nclient can re-derive keys on login.",
        "properties": {
          "m_cost": {
            "description": "Memory in KiB.",
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "p_cost": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "t_cost": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          }
        },
        "required": [
          "m_cost",
          "t_cost",
          "p_cost"
        ],
        "type": "object"
      },
      "KeyBundle": {
        "description": "Encrypted key material the client needs after login.",
        "properties": {
          "enc_master_key": {
            "$ref": "#/components/schemas/B64"
          },
          "enc_pq_private_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "enc_private_key": {
            "$ref": "#/components/schemas/B64"
          },
          "kdf_params": {
            "$ref": "#/components/schemas/KdfParams"
          },
          "kdf_salt": {
            "$ref": "#/components/schemas/B64"
          },
          "pq_public_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "Absent for accounts made before post-quantum keys."
              }
            ]
          },
          "public_key": {
            "$ref": "#/components/schemas/B64"
          },
          "root_node_id": {
            "type": "string"
          }
        },
        "required": [
          "kdf_salt",
          "kdf_params",
          "enc_master_key",
          "public_key",
          "enc_private_key",
          "root_node_id"
        ],
        "type": "object"
      },
      "Link": {
        "properties": {
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "enc_link_secret": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "For a link with a password: its secret, sealed under the node key."
              }
            ]
          },
          "expires_at": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "has_password": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "max_opens": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "node_id": {
            "type": "string"
          },
          "opens": {
            "format": "int64",
            "type": "integer"
          },
          "token": {
            "type": "string"
          },
          "upload_only": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "token",
          "node_id",
          "has_password",
          "created_at"
        ],
        "type": "object"
      },
      "LinkStorageRequest": {
        "description": "`POST /api/storage/google`: start linking.",
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/StorageMode"
          }
        },
        "required": [
          "mode"
        ],
        "type": "object"
      },
      "LinkStorageResponse": {
        "description": "Where to send the browser to approve access.",
        "properties": {
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "LoginRequest": {
        "properties": {
          "auth_key": {
            "$ref": "#/components/schemas/B64"
          },
          "device_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "turnstile": {
            "description": "A Turnstile token, when the server asks for one.",
            "type": [
              "string",
              "null"
            ]
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "username",
          "auth_key"
        ],
        "type": "object"
      },
      "LoginResponse": {
        "description": "What signing in with a password returns: a session, or, when the account\nhas two-factor sign-in, a ticket to finish it with a second factor.",
        "oneOf": [
          {
            "$ref": "#/components/schemas/SessionResponse"
          },
          {
            "properties": {
              "second_factor": {
                "$ref": "#/components/schemas/SecondFactorChallenge"
              }
            },
            "required": [
              "second_factor"
            ],
            "type": "object"
          }
        ]
      },
      "Me": {
        "properties": {
          "is_admin": {
            "type": "boolean"
          },
          "keys": {
            "$ref": "#/components/schemas/KeyBundle"
          },
          "max_versions": {
            "description": "Versions kept per file, including the current one.",
            "format": "int64",
            "type": "integer"
          },
          "quota_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "recovery_created_at": {
            "description": "When a recovery key was set up, if there is one.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "totp_created_at": {
            "description": "When an authenticator app (TOTP) was set up, if there is one.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "trash_days": {
            "description": "Days before trashed items are purged.",
            "format": "int64",
            "type": "integer"
          },
          "used_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "user_id": {
            "type": "string"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "user_id",
          "username",
          "is_admin",
          "quota_bytes",
          "used_bytes",
          "keys",
          "max_versions",
          "trash_days"
        ],
        "type": "object"
      },
      "MoveNodeStorageRequest": {
        "description": "`POST /api/nodes/{id}/storage` (owner only): move a batch of the file's\n(or folder's) versions to this server (`to: null`) or into an\nextra-space account. Answered with a `MoveStorageResponse`; call again\nwhile `left` is above zero.",
        "properties": {
          "to": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "MoveStorageRequest": {
        "description": "`POST /api/storage/accounts/{id}/move`: move a batch of file versions\nbetween this server and a linked account (`Linked` only for extra space).\nCall again while `left` is above zero.",
        "properties": {
          "to": {
            "$ref": "#/components/schemas/StoragePrefer"
          }
        },
        "required": [
          "to"
        ],
        "type": "object"
      },
      "MoveStorageResponse": {
        "properties": {
          "full": {
            "description": "Some versions didn't fit at the destination, so they stay where\nthey are.",
            "type": "boolean"
          },
          "left": {
            "description": "Versions still to move, and their bytes.",
            "format": "int64",
            "type": "integer"
          },
          "left_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "moved": {
            "description": "Versions moved by this call, and their bytes.",
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "moved_bytes": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "moved",
          "moved_bytes",
          "left",
          "left_bytes",
          "full"
        ],
        "type": "object"
      },
      "MyAvatar": {
        "properties": {
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "details": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "enc_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "grantees": {
            "description": "Who has been given the avatar key.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          }
        },
        "required": [
          "grantees"
        ],
        "type": "object"
      },
      "NameTagEntry": {
        "properties": {
          "id": {
            "type": "string"
          },
          "name_tag": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "id",
          "name_tag"
        ],
        "type": "object"
      },
      "NameTags": {
        "description": "Name tags for existing children that don't have one yet.",
        "properties": {
          "tags": {
            "items": {
              "$ref": "#/components/schemas/NameTagEntry"
            },
            "type": "array"
          }
        },
        "required": [
          "tags"
        ],
        "type": "object"
      },
      "NewRootFolder": {
        "properties": {
          "enc_key": {
            "$ref": "#/components/schemas/B64",
            "description": "Root folder key wrapped under the master key."
          },
          "enc_metadata": {
            "$ref": "#/components/schemas/B64"
          },
          "id": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "enc_key",
          "enc_metadata"
        ],
        "type": "object"
      },
      "Node": {
        "properties": {
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "enc_key": {
            "$ref": "#/components/schemas/B64",
            "description": "This node's key, wrapped under the parent's key (or the master key\nfor a root folder)."
          },
          "enc_metadata": {
            "$ref": "#/components/schemas/B64"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/NodeKind"
          },
          "name_tagged": {
            "description": "Whether the node has a name tag (older ones may not).",
            "type": "boolean"
          },
          "owner": {
            "type": "string"
          },
          "parent_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "revision": {
            "format": "int64",
            "type": "integer"
          },
          "trash_at": {
            "description": "When it goes to the trash on its own, if its owner set a date.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "updated_at": {
            "format": "int64",
            "type": "integer"
          },
          "version": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/VersionInfo"
              }
            ]
          }
        },
        "required": [
          "id",
          "kind",
          "owner",
          "enc_key",
          "enc_metadata",
          "revision",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "NodeKind": {
        "enum": [
          "file",
          "folder"
        ],
        "type": "string"
      },
      "NodePage": {
        "description": "A page of a folder's children (`GET .../children?limit=<n>&after=<cursor>`);\nwithout `limit` the listing is the whole array instead.",
        "properties": {
          "next": {
            "description": "Pass as `after` for the next page; `None` on the last one.",
            "type": [
              "string",
              "null"
            ]
          },
          "nodes": {
            "items": {
              "$ref": "#/components/schemas/Node"
            },
            "type": "array"
          }
        },
        "required": [
          "nodes"
        ],
        "type": "object"
      },
      "NodePath": {
        "description": "The chain of nodes from the top-most node the caller can access down to\nthe requested node. For the owner this starts at their root folder. For\na share recipient it starts at the shared node, and `share` carries the\nkey wrapped for them.",
        "properties": {
          "nodes": {
            "items": {
              "$ref": "#/components/schemas/Node"
            },
            "type": "array"
          },
          "share": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ShareKey"
              }
            ]
          }
        },
        "required": [
          "nodes"
        ],
        "type": "object"
      },
      "NodePlace": {
        "properties": {
          "account_id": {
            "description": "The linked account, or None for this server.",
            "type": [
              "string",
              "null"
            ]
          },
          "bytes": {
            "format": "int64",
            "type": "integer"
          },
          "versions": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "versions",
          "bytes"
        ],
        "type": "object"
      },
      "NodeStorage": {
        "description": "`GET /api/nodes/{id}/storage` (owner only): where a file's versions, or\nthose of every file in a folder, are kept.",
        "properties": {
          "places": {
            "items": {
              "$ref": "#/components/schemas/NodePlace"
            },
            "type": "array"
          }
        },
        "required": [
          "places"
        ],
        "type": "object"
      },
      "OutgoingShare": {
        "properties": {
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "expires_at": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "node_id": {
            "type": "string"
          },
          "permission": {
            "$ref": "#/components/schemas/Permission"
          },
          "recipient": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "recipient",
          "permission",
          "node_id",
          "created_at"
        ],
        "type": "object"
      },
      "Passkey": {
        "properties": {
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "credential_id": {
            "$ref": "#/components/schemas/B64"
          },
          "id": {
            "type": "string"
          },
          "last_used_at": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "unlock": {
            "description": "It can unlock the account on its own (PRF), not just confirm a sign-in.",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "credential_id",
          "unlock",
          "created_at"
        ],
        "type": "object"
      },
      "PasskeyAssertion": {
        "description": "A WebAuthn assertion, as the browser returns it.",
        "properties": {
          "authenticator_data": {
            "$ref": "#/components/schemas/B64"
          },
          "client_data_json": {
            "$ref": "#/components/schemas/B64"
          },
          "credential_id": {
            "$ref": "#/components/schemas/B64"
          },
          "signature": {
            "$ref": "#/components/schemas/B64"
          },
          "user_handle": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          }
        },
        "required": [
          "credential_id",
          "client_data_json",
          "authenticator_data",
          "signature"
        ],
        "type": "object"
      },
      "PasskeyCreationOptions": {
        "description": "What `navigator.credentials.create` needs to make a passkey.",
        "properties": {
          "challenge": {
            "$ref": "#/components/schemas/B64"
          },
          "exclude_credentials": {
            "items": {
              "$ref": "#/components/schemas/B64"
            },
            "type": "array"
          },
          "registration_id": {
            "type": "string"
          },
          "user_handle": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "registration_id",
          "challenge",
          "user_handle",
          "exclude_credentials"
        ],
        "type": "object"
      },
      "PasskeyLoginRequest": {
        "description": "Sign in with a passkey alone. The challenge comes from\n`/api/auth/passkey/options`.",
        "properties": {
          "assertion": {
            "$ref": "#/components/schemas/PasskeyAssertion"
          },
          "challenge": {
            "$ref": "#/components/schemas/B64"
          },
          "device_name": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "challenge",
          "assertion"
        ],
        "type": "object"
      },
      "PasskeyLoginResponse": {
        "properties": {
          "credential_id": {
            "$ref": "#/components/schemas/B64"
          },
          "enc_master_key": {
            "$ref": "#/components/schemas/B64",
            "description": "Unwrapped with the key from the passkey's PRF output."
          },
          "me": {
            "$ref": "#/components/schemas/Me"
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "token",
          "me",
          "credential_id",
          "enc_master_key"
        ],
        "type": "object"
      },
      "PasskeyRequest": {
        "description": "What `navigator.credentials.get` needs.",
        "properties": {
          "allow_credentials": {
            "description": "The account's credentials (empty for a sign-in with a passkey alone).",
            "items": {
              "$ref": "#/components/schemas/B64"
            },
            "type": "array"
          },
          "challenge": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "challenge"
        ],
        "type": "object"
      },
      "Permission": {
        "enum": [
          "read",
          "write"
        ],
        "type": "string"
      },
      "PinVersionRequest": {
        "description": "`PUT /api/nodes/{id}/versions/{vid}/pinned`.",
        "properties": {
          "pinned": {
            "type": "boolean"
          }
        },
        "required": [
          "pinned"
        ],
        "type": "object"
      },
      "PlaylistEntry": {
        "description": "One video in a playlist.",
        "properties": {
          "duration": {
            "format": "double",
            "type": [
              "number",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url",
          "title"
        ],
        "type": "object"
      },
      "PreloginRequest": {
        "properties": {
          "username": {
            "type": "string"
          }
        },
        "required": [
          "username"
        ],
        "type": "object"
      },
      "PreloginResponse": {
        "properties": {
          "kdf_params": {
            "$ref": "#/components/schemas/KdfParams"
          },
          "kdf_salt": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "kdf_salt",
          "kdf_params"
        ],
        "type": "object"
      },
      "PrivateData": {
        "properties": {
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "None until the client first saves something."
              }
            ]
          },
          "revision": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "revision"
        ],
        "type": "object"
      },
      "PublicLinkInfo": {
        "properties": {
          "enc_link_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "For a link with a password, once it's given: the node key wrapped\nunder the link's KEK, which needs the password and the secret after\n`#` to open."
              }
            ]
          },
          "expires_at": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "folder_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "link_token": {
            "description": "For a link with a limited number of opens: this visit's token, to\npass back in the `X-Link-Token` header.",
            "type": [
              "string",
              "null"
            ]
          },
          "node": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Node",
                "description": "Absent for upload-only links."
              }
            ]
          },
          "owner": {
            "description": "Who files dropped through an upload-only link go to, and the folder\nid to bind into their sealed keys.",
            "type": [
              "string",
              "null"
            ]
          },
          "owner_pq_public_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "The owner's ML-KEM key, for upload-only links whose `#` part names\nits hash. Checked against it, so the server can't swap it."
              }
            ]
          },
          "upload_only": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "PutPrivateData": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/B64"
          },
          "if_revision": {
            "description": "The revision this change is based on; 409 if it moved on.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "data",
          "if_revision"
        ],
        "type": "object"
      },
      "QuotaAlert": {
        "properties": {
          "quota_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "used_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "username",
          "used_bytes",
          "quota_bytes"
        ],
        "type": "object"
      },
      "RecoveryResetRequest": {
        "description": "Step two: a new password, with the master key re-wrapped under it.",
        "properties": {
          "device_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "new_auth_key": {
            "$ref": "#/components/schemas/B64"
          },
          "new_enc_master_key": {
            "$ref": "#/components/schemas/B64"
          },
          "new_kdf_params": {
            "$ref": "#/components/schemas/KdfParams"
          },
          "new_kdf_salt": {
            "$ref": "#/components/schemas/B64"
          },
          "recovery_auth_key": {
            "$ref": "#/components/schemas/B64"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "username",
          "recovery_auth_key",
          "new_auth_key",
          "new_kdf_salt",
          "new_kdf_params",
          "new_enc_master_key"
        ],
        "type": "object"
      },
      "RecoveryUnlockRequest": {
        "description": "Step one of a password reset: prove the recovery key, get the master key\nwrapped under it.",
        "properties": {
          "recovery_auth_key": {
            "$ref": "#/components/schemas/B64"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "username",
          "recovery_auth_key"
        ],
        "type": "object"
      },
      "RecoveryUnlockResponse": {
        "properties": {
          "enc_master_key_recovery": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "enc_master_key_recovery"
        ],
        "type": "object"
      },
      "RegisterPasskeyRequest": {
        "properties": {
          "attestation_object": {
            "$ref": "#/components/schemas/B64"
          },
          "client_data_json": {
            "$ref": "#/components/schemas/B64"
          },
          "current_auth_key": {
            "$ref": "#/components/schemas/B64"
          },
          "enc_master_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "The master key wrapped under a key from the passkey's PRF output (see\n`wrap_master_key_passkey`), when the authenticator supports PRF."
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "registration_id": {
            "type": "string"
          }
        },
        "required": [
          "registration_id",
          "name",
          "current_auth_key",
          "client_data_json",
          "attestation_object"
        ],
        "type": "object"
      },
      "RegisterRequest": {
        "properties": {
          "auth_key": {
            "$ref": "#/components/schemas/B64"
          },
          "device_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "enc_master_key": {
            "$ref": "#/components/schemas/B64"
          },
          "enc_pq_private_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "enc_private_key": {
            "$ref": "#/components/schemas/B64"
          },
          "invite": {
            "description": "Invite token, needed when registration is invite-only.",
            "type": [
              "string",
              "null"
            ]
          },
          "kdf_params": {
            "$ref": "#/components/schemas/KdfParams"
          },
          "kdf_salt": {
            "$ref": "#/components/schemas/B64"
          },
          "pq_public_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "The ML-KEM-768 public key and its seed wrapped under the master key."
              }
            ]
          },
          "public_key": {
            "$ref": "#/components/schemas/B64"
          },
          "root": {
            "$ref": "#/components/schemas/NewRootFolder"
          },
          "setup_code": {
            "description": "The setup code, for the first account on a new server.",
            "type": [
              "string",
              "null"
            ]
          },
          "turnstile": {
            "description": "A Turnstile token, when the server asks for one.",
            "type": [
              "string",
              "null"
            ]
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "username",
          "auth_key",
          "kdf_salt",
          "kdf_params",
          "enc_master_key",
          "public_key",
          "enc_private_key",
          "root"
        ],
        "type": "object"
      },
      "Registration": {
        "description": "Who may create an account.",
        "enum": [
          "open",
          "invite",
          "closed"
        ],
        "type": "string"
      },
      "RemoveRecoveryRequest": {
        "properties": {
          "current_auth_key": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "current_auth_key"
        ],
        "type": "object"
      },
      "ResealShareRequest": {
        "description": "A share's node key sealed again by its recipient, to their own\nX25519 + ML-KEM-768 key (for shares made before they had one).",
        "properties": {
          "wrapped_key": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "wrapped_key"
        ],
        "type": "object"
      },
      "RestoreTrashRequest": {
        "properties": {
          "enc_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "enc_metadata": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "A new name (when the old one is taken) and its tag."
              }
            ]
          },
          "name_tag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "parent_id": {
            "description": "Restore into a different folder (e.g. when the original one is gone).\nRequires `enc_key` re-wrapped under that folder's key.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "RestoreVersionRequest": {
        "properties": {
          "enc_metadata": {
            "$ref": "#/components/schemas/B64",
            "description": "The node's metadata re-encrypted for the restored version (current\nname, the version's size and mtime)."
          },
          "if_revision": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "enc_metadata"
        ],
        "type": "object"
      },
      "SecondFactorChallenge": {
        "properties": {
          "passkey": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PasskeyRequest",
                "description": "Set when the account has passkeys."
              }
            ]
          },
          "ticket": {
            "description": "Pass back with the second factor. Valid for a few minutes.",
            "type": "string"
          },
          "totp": {
            "description": "An authenticator app code is accepted.",
            "type": "boolean"
          }
        },
        "required": [
          "ticket",
          "totp"
        ],
        "type": "object"
      },
      "SecondFactorRequest": {
        "description": "Finish a password sign-in with a TOTP code or a passkey.",
        "properties": {
          "passkey": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PasskeyAssertion"
              }
            ]
          },
          "ticket": {
            "type": "string"
          },
          "totp_code": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "ticket"
        ],
        "type": "object"
      },
      "ServerStats": {
        "description": "Counts only; nothing about what is stored.",
        "properties": {
          "active_sessions": {
            "format": "int64",
            "type": "integer"
          },
          "disabled_users": {
            "format": "int64",
            "type": "integer"
          },
          "files": {
            "format": "int64",
            "type": "integer"
          },
          "folders": {
            "format": "int64",
            "type": "integer"
          },
          "public_links": {
            "format": "int64",
            "type": "integer"
          },
          "quota_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "shares": {
            "format": "int64",
            "type": "integer"
          },
          "used_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "users": {
            "format": "int64",
            "type": "integer"
          },
          "versions": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "users",
          "disabled_users",
          "active_sessions",
          "used_bytes",
          "quota_bytes",
          "files",
          "folders",
          "versions",
          "shares",
          "public_links"
        ],
        "type": "object"
      },
      "SessionResponse": {
        "properties": {
          "me": {
            "$ref": "#/components/schemas/Me"
          },
          "token": {
            "type": "string"
          }
        },
        "required": [
          "token",
          "me"
        ],
        "type": "object"
      },
      "SetAvatar": {
        "properties": {
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "The picture, encrypted under the avatar key."
              }
            ]
          },
          "details": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "Pronouns and grammatical gender, under the same key (`encrypt_person_details`)."
              }
            ]
          },
          "enc_key": {
            "$ref": "#/components/schemas/B64",
            "description": "The avatar key, encrypted under the master key."
          },
          "name": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "The display name, encrypted under the same key (`encrypt_display_name`)."
              }
            ]
          }
        },
        "required": [
          "enc_key"
        ],
        "type": "object"
      },
      "SetPqKeyRequest": {
        "description": "Give an older account its post-quantum key. Only once.",
        "properties": {
          "enc_pq_private_key": {
            "$ref": "#/components/schemas/B64"
          },
          "pq_public_key": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "pq_public_key",
          "enc_pq_private_key"
        ],
        "type": "object"
      },
      "SetRecoveryRequest": {
        "description": "Set up (or replace) a recovery key. Needs the current password.",
        "properties": {
          "current_auth_key": {
            "$ref": "#/components/schemas/B64"
          },
          "enc_master_key_recovery": {
            "$ref": "#/components/schemas/B64"
          },
          "recovery_auth_key": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "current_auth_key",
          "recovery_auth_key",
          "enc_master_key_recovery"
        ],
        "type": "object"
      },
      "SetTrashAtRequest": {
        "description": "`PUT /api/nodes/{id}/trash-at`: a date (Unix seconds) for the node to go\nto the trash on its own, or none. The server learns the date, not the name.",
        "properties": {
          "trash_at": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "ShareKey": {
        "properties": {
          "permission": {
            "$ref": "#/components/schemas/Permission"
          },
          "share_id": {
            "type": "string"
          },
          "wrapped_key": {
            "$ref": "#/components/schemas/B64"
          }
        },
        "required": [
          "share_id",
          "wrapped_key",
          "permission"
        ],
        "type": "object"
      },
      "StorageAccount": {
        "properties": {
          "broken": {
            "description": "The provider stopped accepting the token: link it again.",
            "type": "boolean"
          },
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "free_bytes": {
            "description": "Free space there when last asked; None for no limit or not known yet.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "id": {
            "type": "string"
          },
          "label": {
            "description": "The account's address, to tell accounts apart.",
            "type": [
              "string",
              "null"
            ]
          },
          "mirror_done": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "mirror_total": {
            "description": "For a mirror: bytes this server keeps that it should have, and how\nmany of those it has.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "mode": {
            "$ref": "#/components/schemas/StorageMode"
          },
          "only_there": {
            "description": "Bytes of file versions kept only there (none in a mirror until it\nwas switched from extra space). These come back here before the\naccount can be unlinked.",
            "format": "int64",
            "type": "integer"
          },
          "provider": {
            "description": "`google`.",
            "type": "string"
          },
          "used_bytes": {
            "description": "Bytes thencloud keeps there.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "provider",
          "mode",
          "used_bytes",
          "broken",
          "created_at"
        ],
        "type": "object"
      },
      "StorageInfo": {
        "description": "`GET /api/storage`.",
        "properties": {
          "accounts": {
            "items": {
              "$ref": "#/components/schemas/StorageAccount"
            },
            "type": "array"
          },
          "google": {
            "description": "Whether this server can link Google Drive.",
            "type": "boolean"
          },
          "prefer": {
            "$ref": "#/components/schemas/StoragePrefer"
          },
          "server_quota": {
            "format": "int64",
            "type": "integer"
          },
          "server_used": {
            "description": "Bytes kept on this server, and its quota (as in `Me`).",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "google",
          "prefer",
          "server_used",
          "server_quota",
          "accounts"
        ],
        "type": "object"
      },
      "StorageMode": {
        "description": "What a linked storage account is for.",
        "enum": [
          "mirror",
          "extra"
        ],
        "type": "string"
      },
      "StoragePrefer": {
        "description": "Where new files go first.",
        "enum": [
          "server",
          "linked"
        ],
        "type": "string"
      },
      "StoragePreferRequest": {
        "description": "`PUT /api/storage/prefer`.",
        "properties": {
          "prefer": {
            "$ref": "#/components/schemas/StoragePrefer"
          }
        },
        "required": [
          "prefer"
        ],
        "type": "object"
      },
      "StorageSpace": {
        "properties": {
          "free_bytes": {
            "format": "int64",
            "type": "integer"
          },
          "low": {
            "description": "Nearly full: under a tenth free (or, for a disk, under 2 GiB).",
            "type": "boolean"
          },
          "place": {
            "description": "`data`, `blobs` or `bucket`.",
            "type": "string"
          },
          "total_bytes": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "place",
          "total_bytes",
          "free_bytes",
          "low"
        ],
        "type": "object"
      },
      "ToolsInfo": {
        "description": "Which tools this user can use.",
        "properties": {
          "downloader_can_merge": {
            "description": "Whether separate video and audio can be merged (up to 1080p), or only\nformats offered as one file work.",
            "type": "boolean"
          },
          "downloader_max_bytes": {
            "format": "int64",
            "minimum": 0,
            "type": "integer"
          },
          "video_downloader": {
            "type": "boolean"
          }
        },
        "required": [
          "video_downloader",
          "downloader_max_bytes",
          "downloader_can_merge"
        ],
        "type": "object"
      },
      "TotpSetup": {
        "description": "A new TOTP secret, waiting to be confirmed with a code from the app.",
        "properties": {
          "secret": {
            "description": "Base32, as authenticator apps take it.",
            "type": "string"
          },
          "setup_id": {
            "type": "string"
          }
        },
        "required": [
          "setup_id",
          "secret"
        ],
        "type": "object"
      },
      "TransferInfo": {
        "description": "The caller's own daily transfer limits and use (`GET /api/me/transfer`).",
        "properties": {
          "daily_download_limit": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "daily_upload_limit": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "downloaded_today": {
            "format": "int64",
            "type": "integer"
          },
          "resets_at": {
            "description": "When today's counts start again (Unix seconds, midnight UTC).",
            "format": "int64",
            "type": "integer"
          },
          "uploaded_today": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "downloaded_today",
          "uploaded_today",
          "resets_at"
        ],
        "type": "object"
      },
      "TrashItem": {
        "properties": {
          "node": {
            "$ref": "#/components/schemas/Node"
          },
          "path": {
            "description": "Chain from the owner's root folder down to (and including) the\ntrashed node, so the client can unwrap its key and show where it was.",
            "items": {
              "$ref": "#/components/schemas/Node"
            },
            "type": "array"
          },
          "trashed_at": {
            "format": "int64",
            "type": "integer"
          },
          "trashed_by": {
            "type": "string"
          }
        },
        "required": [
          "node",
          "path",
          "trashed_at",
          "trashed_by"
        ],
        "type": "object"
      },
      "TurnstileOptions": {
        "description": "Where a Turnstile token is needed. The check runs on `/auth`, a page of\nits own; the token then goes with the request as `turnstile`.",
        "properties": {
          "login": {
            "description": "Signing in with a password.",
            "type": "boolean"
          },
          "register": {
            "description": "Creating an account (only while registration is open to everyone).",
            "type": "boolean"
          },
          "site_key": {
            "type": "string"
          }
        },
        "required": [
          "site_key",
          "login",
          "register"
        ],
        "type": "object"
      },
      "UnlockLinkRequest": {
        "properties": {
          "auth": {
            "$ref": "#/components/schemas/B64",
            "description": "The auth key from `derive_link_password_keys`, not the password."
          }
        },
        "required": [
          "auth"
        ],
        "type": "object"
      },
      "UnlockLinkResponse": {
        "properties": {
          "expires_at": {
            "format": "int64",
            "type": "integer"
          },
          "link_token": {
            "description": "Pass back in the `X-Link-Token` header.",
            "type": "string"
          }
        },
        "required": [
          "link_token",
          "expires_at"
        ],
        "type": "object"
      },
      "UpdateNodeRequest": {
        "properties": {
          "enc_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "enc_metadata": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "Re-encrypted metadata (rename)."
              }
            ]
          },
          "if_revision": {
            "description": "Optimistic concurrency: fail with 409 if the node changed.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "name_tag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "The name tag for the new name or parent. Renaming or moving without\none leaves the node untagged."
              }
            ]
          },
          "parent_id": {
            "description": "New parent (move). Requires `enc_key` re-wrapped under the new\nparent's key.",
            "type": [
              "string",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "UpdateSettingsRequest": {
        "properties": {
          "downloader": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DownloaderAccess"
              }
            ]
          },
          "google_drive": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "registration": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Registration"
              }
            ]
          }
        },
        "type": "object"
      },
      "UpdateShareRequest": {
        "properties": {
          "permission": {
            "$ref": "#/components/schemas/Permission"
          }
        },
        "required": [
          "permission"
        ],
        "type": "object"
      },
      "UpdateStorageAccountRequest": {
        "description": "`PATCH /api/storage/accounts/{id}`.",
        "properties": {
          "mode": {
            "$ref": "#/components/schemas/StorageMode"
          }
        },
        "required": [
          "mode"
        ],
        "type": "object"
      },
      "UpdateUserRequest": {
        "properties": {
          "daily_download_limit": {
            "description": "Bytes per day; 0 removes the limit.",
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "daily_upload_limit": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          },
          "disabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "is_admin": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "quota_bytes": {
            "format": "int64",
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "type": "object"
      },
      "UploadResponse": {
        "properties": {
          "expires_at": {
            "format": "int64",
            "type": "integer"
          },
          "max_chunk_bytes": {
            "minimum": 0,
            "type": "integer"
          },
          "upload_id": {
            "type": "string"
          }
        },
        "required": [
          "upload_id",
          "max_chunk_bytes",
          "expires_at"
        ],
        "type": "object"
      },
      "UserAvatar": {
        "description": "Someone else's picture and display name (either may be missing), for a\nuser they gave their avatar key to.",
        "properties": {
          "data": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "details": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "name": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64"
              }
            ]
          },
          "sealed_key": {
            "$ref": "#/components/schemas/B64"
          },
          "updated_at": {
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "sealed_key",
          "updated_at"
        ],
        "type": "object"
      },
      "UserPublicKey": {
        "properties": {
          "pq_public_key": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/B64",
                "description": "Their ML-KEM-768 key, if they have one: seal to both."
              }
            ]
          },
          "public_key": {
            "$ref": "#/components/schemas/B64"
          },
          "username": {
            "type": "string"
          }
        },
        "required": [
          "username",
          "public_key"
        ],
        "type": "object"
      },
      "VersionInfo": {
        "properties": {
          "chunk_count": {
            "format": "int32",
            "minimum": 0,
            "type": "integer"
          },
          "created_at": {
            "format": "int64",
            "type": "integer"
          },
          "enc_content_key": {
            "$ref": "#/components/schemas/B64"
          },
          "has_thumbnail": {
            "description": "Whether this version has an encrypted thumbnail (`encrypt_thumbnail`).",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "size": {
            "description": "Stored (ciphertext) size in bytes.",
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "enc_content_key",
          "chunk_count",
          "size",
          "created_at"
        ],
        "type": "object"
      },
      "VideoInfo": {
        "description": "What a link points at, and what the downloader would fetch for it.",
        "properties": {
          "audio": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/VideoOption"
              }
            ]
          },
          "duration": {
            "description": "Seconds.",
            "format": "double",
            "type": [
              "number",
              "null"
            ]
          },
          "entries": {
            "description": "For a playlist link: its videos (and no `video` or `audio`).",
            "items": {
              "$ref": "#/components/schemas/PlaylistEntry"
            },
            "type": "array"
          },
          "qualities": {
            "description": "The video at each quality that gives a different result, lowest\nfirst.",
            "items": {
              "$ref": "#/components/schemas/VideoOption"
            },
            "type": "array"
          },
          "site": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "uploader": {
            "type": [
              "string",
              "null"
            ]
          },
          "video": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/VideoOption",
                "description": "File extension and approximate size of the video (with sound) and\naudio-only downloads, when the site offers them as one file."
              }
            ]
          }
        },
        "required": [
          "title",
          "site"
        ],
        "type": "object"
      },
      "VideoKind": {
        "enum": [
          "video",
          "audio"
        ],
        "type": "string"
      },
      "VideoLinkRequest": {
        "properties": {
          "kind": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/VideoKind"
              }
            ]
          },
          "quality": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/VideoQuality",
                "description": "Defaults to 1080p."
              }
            ]
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "VideoOption": {
        "properties": {
          "ext": {
            "type": "string"
          },
          "height": {
            "description": "Video height in pixels, for video.",
            "format": "int32",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          },
          "quality": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/VideoQuality",
                "description": "The quality to ask for to get this, for video."
              }
            ]
          },
          "size": {
            "format": "int64",
            "minimum": 0,
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "ext"
        ],
        "type": "object"
      },
      "VideoQuality": {
        "description": "Highest resolution to fetch. Up to 1080p, H.264 is preferred (it plays\neverywhere); `Best` takes the tallest there is, whatever the codec.",
        "enum": [
          "480",
          "720",
          "1080",
          "best"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "linkToken": {
        "description": "Sent on a public link's requests after `GET /public/{token}` (a link with limited opens) or `/unlock` (a password) handed one out. The link's key and secret never leave the browser; this is a signed pass for this visit.",
        "in": "header",
        "name": "X-Link-Token",
        "type": "apiKey"
      },
      "metricsToken": {
        "description": "The server's `--metrics-token`.",
        "scheme": "bearer",
        "type": "http"
      },
      "session": {
        "description": "The token from signing in (`SessionResponse.token`), or from `/auth/app-login` with an app password. A read-only app password may only GET.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "The HTTP API of a thencloud server, under `/api`. Everything here carries ciphertext, wrapped keys and public keys: names, contents and keys are encrypted and decrypted by the client (`thencloud-crypto`, natively or as WASM), and the formats are in `docs/format/README.md`. Binary fields are unpadded base64url strings. Fields may be added to any object over time; clients should ignore what they don't know.",
    "license": {
      "identifier": "AGPL-3.0-or-later",
      "name": "AGPL-3.0-or-later"
    },
    "title": "thencloud",
    "version": "1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/admin/alerts": {
      "get": {
        "operationId": "getAdminAlerts",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminAlerts"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Disks or a bucket nearly full, and accounts near their quota.",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/audit": {
      "get": {
        "operationId": "getAdminAudit",
        "parameters": [
          {
            "description": "Entries older than this id (the next page).",
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditPage"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The audit log of admin actions, newest first, a page at a time.",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/invites": {
      "get": {
        "operationId": "getAdminInvites",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Invite"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Open invites.",
        "tags": [
          "Admin"
        ]
      },
      "post": {
        "operationId": "postAdminInvites",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedInvite"
                }
              }
            },
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Make an invite.",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/invites/{id}": {
      "delete": {
        "operationId": "deleteAdminInvitesId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete an invite.",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/settings": {
      "get": {
        "operationId": "getAdminSettings",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminSettings"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Runtime settings.",
        "tags": [
          "Admin"
        ]
      },
      "patch": {
        "operationId": "patchAdminSettings",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminSettings"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change runtime settings (registration, the downloader, linked storage).",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/stats": {
      "get": {
        "operationId": "getAdminStats",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServerStats"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Counts: accounts, files, bytes.",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/users": {
      "get": {
        "operationId": "getAdminUsers",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AdminUser"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Every account, with usage and limits. Never content.",
        "tags": [
          "Admin"
        ]
      }
    },
    "/admin/users/{id}": {
      "delete": {
        "operationId": "deleteAdminUsersId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete an account and everything in its tree.",
        "tags": [
          "Admin"
        ]
      },
      "patch": {
        "operationId": "patchAdminUsersId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminUser"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change an account's quota, limits, admin flag, or disable it.",
        "tags": [
          "Admin"
        ]
      }
    },
    "/app-passwords": {
      "get": {
        "operationId": "getAppPasswords",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AppPassword"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Your app passwords.",
        "tags": [
          "Account"
        ]
      },
      "post": {
        "operationId": "postAppPasswords",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAppPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppPassword"
                }
              }
            },
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Make an app password (needs the account password).",
        "tags": [
          "Account"
        ]
      }
    },
    "/app-passwords/{id}": {
      "delete": {
        "operationId": "deleteAppPasswordsId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Revoke an app password and sign out its sessions.",
        "tags": [
          "Account"
        ]
      }
    },
    "/auth/app-login": {
      "post": {
        "operationId": "postAuthAppLogin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppLoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppLoginResponse"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "Sign in with an app password alone.",
        "tags": [
          "Signing in"
        ]
      }
    },
    "/auth/login": {
      "post": {
        "operationId": "postAuthLogin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LoginResponse"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "Sign in with the auth key derived from the password: a session, or a ticket for the second step.",
        "tags": [
          "Signing in"
        ]
      }
    },
    "/auth/login/second-factor": {
      "post": {
        "operationId": "postAuthLoginSecondFactor",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecondFactorRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "Finish a password sign-in with a TOTP code or a passkey.",
        "tags": [
          "Signing in"
        ]
      }
    },
    "/auth/logout": {
      "post": {
        "operationId": "postAuthLogout",
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "End this session.",
        "tags": [
          "Signing in"
        ]
      }
    },
    "/auth/options": {
      "get": {
        "operationId": "getAuthOptions",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthOptions"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "What the sign-in screen can offer (registration, setup, passkeys, bot check).",
        "tags": [
          "Signing in"
        ]
      }
    },
    "/auth/passkey/login": {
      "post": {
        "operationId": "postAuthPasskeyLogin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyLoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyLoginResponse"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "Sign in with a passkey that has PRF: a session and the master key wrapped under the PRF output.",
        "tags": [
          "Signing in"
        ]
      }
    },
    "/auth/passkey/options": {
      "post": {
        "operationId": "postAuthPasskeyOptions",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyRequest"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "A challenge for signing in with a passkey alone.",
        "tags": [
          "Signing in"
        ]
      }
    },
    "/auth/password": {
      "post": {
        "operationId": "postAuthPassword",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangePasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Re-wrap the master key under a new password. Other sessions are signed out.",
        "tags": [
          "Account"
        ]
      }
    },
    "/auth/prelogin": {
      "post": {
        "operationId": "postAuthPrelogin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PreloginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreloginResponse"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "The KDF salt and parameters to derive a user's keys with. Unknown users get a stable fake salt.",
        "tags": [
          "Signing in"
        ]
      }
    },
    "/auth/recovery": {
      "delete": {
        "operationId": "deleteAuthRecovery",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveRecoveryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Remove the recovery key.",
        "tags": [
          "Account"
        ]
      },
      "post": {
        "operationId": "postAuthRecovery",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetRecoveryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Set the recovery key (the master key wrapped under it).",
        "tags": [
          "Account"
        ]
      }
    },
    "/auth/recovery/reset": {
      "post": {
        "operationId": "postAuthRecoveryReset",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecoveryResetRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "Set a new password with the recovery key. Every other session is signed out.",
        "tags": [
          "Signing in"
        ]
      }
    },
    "/auth/recovery/unlock": {
      "post": {
        "operationId": "postAuthRecoveryUnlock",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecoveryUnlockRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecoveryUnlockResponse"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "Fetch the master key wrapped under the recovery key.",
        "tags": [
          "Signing in"
        ]
      }
    },
    "/auth/register": {
      "post": {
        "operationId": "postAuthRegister",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponse"
                }
              }
            },
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "Make an account. The first one on a new server needs the setup code.",
        "tags": [
          "Signing in"
        ]
      }
    },
    "/auth/totp": {
      "delete": {
        "operationId": "deleteAuthTotp",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CurrentPassword"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Turn the authenticator app off.",
        "tags": [
          "Account"
        ]
      },
      "post": {
        "operationId": "postAuthTotp",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnableTotpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Turn the authenticator app on with a code from it.",
        "tags": [
          "Account"
        ]
      }
    },
    "/auth/totp/setup": {
      "post": {
        "operationId": "postAuthTotpSetup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CurrentPassword"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TotpSetup"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Start setting up an authenticator app: a new secret, kept aside until a code confirms it.",
        "tags": [
          "Account"
        ]
      }
    },
    "/avatar-grants/{username}": {
      "put": {
        "operationId": "putAvatarGrantsUsername",
        "parameters": [
          {
            "in": "path",
            "name": "username",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AvatarGrant"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Give someone your avatar key. Only between people who share something.",
        "tags": [
          "Account"
        ]
      }
    },
    "/changes": {
      "get": {
        "operationId": "getChanges",
        "parameters": [
          {
            "description": "The cursor from the last page; without it, just the current cursor.",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChangeFeed"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Every change in your tree and under what's shared with you, in order, after a cursor. An expired cursor gets `resync`.",
        "tags": [
          "Files"
        ]
      }
    },
    "/comments/{id}": {
      "delete": {
        "operationId": "deleteCommentsId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a comment (its author or the node's owner).",
        "tags": [
          "Files"
        ]
      }
    },
    "/drops": {
      "get": {
        "operationId": "getDrops",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/DroppedFile"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Files dropped through your upload-only links, waiting to be taken in.",
        "tags": [
          "Sharing"
        ]
      }
    },
    "/drops/{id}": {
      "delete": {
        "operationId": "deleteDropsId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Throw a dropped file away.",
        "tags": [
          "Sharing"
        ]
      }
    },
    "/drops/{id}/adopt": {
      "post": {
        "operationId": "postDropsIdAdopt",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdoptDropRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Node"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Take a dropped file in: its key wrapped under its folder's, instead of sealed to you.",
        "tags": [
          "Sharing"
        ]
      }
    },
    "/health": {
      "get": {
        "operationId": "getHealth",
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "`ok`."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "200 when the database answers and the data directory is there, 503 otherwise.",
        "tags": [
          "Server"
        ]
      }
    },
    "/links": {
      "get": {
        "operationId": "getLinks",
        "parameters": [
          {
            "description": "Only the links of this node.",
            "in": "query",
            "name": "node_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Link"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Your public links.",
        "tags": [
          "Sharing"
        ]
      },
      "post": {
        "operationId": "postLinks",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Link"
                }
              }
            },
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Make a public link. The link's key stays after the `#` and never reaches the server.",
        "tags": [
          "Sharing"
        ]
      }
    },
    "/links/{id}": {
      "delete": {
        "operationId": "deleteLinksId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete a public link.",
        "tags": [
          "Sharing"
        ]
      }
    },
    "/me": {
      "get": {
        "operationId": "getMe",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The signed-in account: keys (wrapped), quota and settings.",
        "tags": [
          "Account"
        ]
      }
    },
    "/me/avatar": {
      "delete": {
        "operationId": "deleteMeAvatar",
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Remove the picture and display name, and every copy of their key handed out.",
        "tags": [
          "Account"
        ]
      },
      "get": {
        "operationId": "getMeAvatar",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MyAvatar"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Your encrypted picture and display name.",
        "tags": [
          "Account"
        ]
      },
      "put": {
        "operationId": "putMeAvatar",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetAvatar"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Set your picture and display name, under a new avatar key.",
        "tags": [
          "Account"
        ]
      }
    },
    "/me/contacts": {
      "get": {
        "operationId": "getMeContacts",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivateData"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Verified contacts, encrypted under the master key.",
        "tags": [
          "Account"
        ]
      },
      "put": {
        "operationId": "putMeContacts",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutPrivateData"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivateData"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Save the contacts. With `if_revision`, a concurrent change is a 409 `conflict`.",
        "tags": [
          "Account"
        ]
      }
    },
    "/me/data/{name}": {
      "get": {
        "operationId": "getMeDataName",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivateData"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One app's data (`music`, `videos`, `files`, `notes`, `books`, `search`, `health` or `prefs`), encrypted under the master key.",
        "tags": [
          "Account"
        ]
      },
      "put": {
        "operationId": "putMeDataName",
        "parameters": [
          {
            "in": "path",
            "name": "name",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutPrivateData"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivateData"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Save one app's data. With `if_revision`, a concurrent change is a 409 `conflict`.",
        "tags": [
          "Account"
        ]
      }
    },
    "/me/delete": {
      "post": {
        "operationId": "postMeDelete",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete your own account and everything in it. Needs the password again.",
        "tags": [
          "Account"
        ]
      }
    },
    "/me/pq-key": {
      "put": {
        "operationId": "putMePqKey",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetPqKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Add the ML-KEM key to an account made before them. Once only.",
        "tags": [
          "Account"
        ]
      }
    },
    "/me/transfer": {
      "get": {
        "operationId": "getMeTransfer",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransferInfo"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Your daily transfer limits and what you've used today.",
        "tags": [
          "Account"
        ]
      }
    },
    "/metrics": {
      "get": {
        "operationId": "getMetrics",
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Prometheus text format."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "metricsToken": []
          }
        ],
        "summary": "Prometheus metrics: the admin view's counts and the data disk's space. Off unless the server has a `--metrics-token`.",
        "tags": [
          "Server"
        ]
      }
    },
    "/nodes/folder": {
      "post": {
        "operationId": "postNodesFolder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFolderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Node"
                }
              }
            },
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Make a folder. Its name and key arrive encrypted; a duplicate name tag is a 409 `name_taken`.",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}": {
      "delete": {
        "operationId": "deleteNodesId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Move to the trash.",
        "tags": [
          "Files"
        ]
      },
      "get": {
        "operationId": "getNodesId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Node"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A file or folder.",
        "tags": [
          "Files"
        ]
      },
      "patch": {
        "operationId": "patchNodesId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateNodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Node"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Rename or move: new encrypted metadata, a re-wrapped key, a new name tag.",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}/activity": {
      "get": {
        "operationId": "getNodesIdActivity",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Events older than this id (the next page).",
            "in": "query",
            "name": "before",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/ActivityEvent"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Who added, changed, renamed, moved, trashed or restored what under a folder, by node id, to the hour. Newest first.",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}/cache-manifest": {
      "get": {
        "operationId": "getNodesIdCacheManifest",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "chunk_hashes": {
                      "description": "Hex SHA-256 of each chunk, in order.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "node": {
                      "$ref": "#/components/schemas/Node"
                    }
                  },
                  "required": [
                    "node",
                    "chunk_hashes"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "SHA-256 of each ciphertext chunk of the current version, for clients that cache chunks.",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}/changes": {
      "get": {
        "operationId": "getNodesIdChanges",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "A stream of change events."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Live changes under a folder as Server-Sent Events (`event: change`, `data: {\"node_id\": ...}`). Ids only.",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}/children": {
      "get": {
        "operationId": "getNodesIdChildren",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size; without it the whole array comes back.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "The `after` cursor of the previous page.",
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "items": {
                        "$ref": "#/components/schemas/Node"
                      },
                      "type": "array"
                    },
                    {
                      "$ref": "#/components/schemas/NodePage"
                    }
                  ]
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A folder's children: all of them, or with `limit` a page continued by `after`.",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}/chunks/{idx}": {
      "get": {
        "operationId": "getNodesIdChunksIdx",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "idx",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "contentMediaType": "application/octet-stream",
                  "type": "string"
                }
              }
            },
            "description": "The chunk.",
            "headers": {
              "X-Version-Id": {
                "description": "The version these bytes belong to.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One encrypted chunk of the current version.",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}/comments": {
      "get": {
        "operationId": "getNodesIdComments",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Comment"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Comments, encrypted under the node key.",
        "tags": [
          "Files"
        ]
      },
      "post": {
        "operationId": "postNodesIdComments",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCommentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Comment"
                }
              }
            },
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Add a comment.",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}/draft": {
      "delete": {
        "operationId": "deleteNodesIdDraft",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Drop the draft.",
        "tags": [
          "Files"
        ]
      },
      "get": {
        "operationId": "getNodesIdDraft",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/Draft"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Your unsaved draft of a file, encrypted under the master key.",
        "tags": [
          "Files"
        ]
      },
      "put": {
        "operationId": "putNodesIdDraft",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Draft"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Keep a draft.",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}/name-tags": {
      "post": {
        "operationId": "postNodesIdNameTags",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NameTags"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Tag children made before name tags existed. A tag that clashes is skipped.",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}/path": {
      "get": {
        "operationId": "getNodesIdPath",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodePath"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The chain of nodes needed to derive this node's key: from your root, or from the top-most node shared with you.",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}/storage": {
      "get": {
        "operationId": "getNodesIdStorage",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NodeStorage"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Where a file's (or a folder's files') versions are kept.",
        "tags": [
          "Linked storage"
        ]
      },
      "post": {
        "operationId": "postNodesIdStorage",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveNodeStorageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MoveStorageResponse"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Move a batch of one file's (or folder's) versions. Owner only.",
        "tags": [
          "Linked storage"
        ]
      }
    },
    "/nodes/{id}/thumbnail": {
      "get": {
        "operationId": "getNodesIdThumbnail",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "contentMediaType": "application/octet-stream",
                  "type": "string"
                }
              }
            },
            "description": "The encrypted thumbnail.",
            "headers": {
              "X-Version-Id": {
                "description": "The version these bytes belong to.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The current version's encrypted thumbnail.",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}/trash-at": {
      "put": {
        "operationId": "putNodesIdTrashAt",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetTrashAtRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Set or clear the date a node goes to the trash on its own (owner only, rounded up to the hour).",
        "tags": [
          "Files"
        ]
      }
    },
    "/nodes/{id}/versions": {
      "get": {
        "operationId": "getNodesIdVersions",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/FileVersion"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "A file's versions.",
        "tags": [
          "Versions"
        ]
      }
    },
    "/nodes/{id}/versions/{vid}": {
      "delete": {
        "operationId": "deleteNodesIdVersionsVid",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "vid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete an old version.",
        "tags": [
          "Versions"
        ]
      }
    },
    "/nodes/{id}/versions/{vid}/chunks/{idx}": {
      "get": {
        "operationId": "getNodesIdVersionsVidChunksIdx",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "vid",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "idx",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "contentMediaType": "application/octet-stream",
                  "type": "string"
                }
              }
            },
            "description": "The chunk.",
            "headers": {
              "X-Version-Id": {
                "description": "The version these bytes belong to.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "One encrypted chunk of a version.",
        "tags": [
          "Versions"
        ]
      }
    },
    "/nodes/{id}/versions/{vid}/pinned": {
      "put": {
        "operationId": "putNodesIdVersionsVidPinned",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "vid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PinVersionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Pin or unpin a version, so automatic thinning passes it over.",
        "tags": [
          "Versions"
        ]
      }
    },
    "/nodes/{id}/versions/{vid}/restore": {
      "post": {
        "operationId": "postNodesIdVersionsVidRestore",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "vid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RestoreVersionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Node"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Make an older version current again. The current one stays in the history.",
        "tags": [
          "Versions"
        ]
      }
    },
    "/nodes/{id}/versions/{vid}/thumbnail": {
      "put": {
        "operationId": "putNodesIdVersionsVidThumbnail",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "vid",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "contentMediaType": "application/octet-stream",
                "type": "string"
              }
            }
          },
          "description": "The encrypted thumbnail.",
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Store a version's encrypted thumbnail (64 KiB at most).",
        "tags": [
          "Files"
        ]
      }
    },
    "/passkeys": {
      "get": {
        "operationId": "getPasskeys",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/Passkey"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Your passkeys.",
        "tags": [
          "Account"
        ]
      },
      "post": {
        "operationId": "postPasskeys",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterPasskeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Passkey"
                }
              }
            },
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Step two: the authenticator's response. Needs the account password.",
        "tags": [
          "Account"
        ]
      }
    },
    "/passkeys/options": {
      "post": {
        "operationId": "postPasskeysOptions",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyCreationOptions"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Step one of adding a passkey: a challenge and the credentials to exclude.",
        "tags": [
          "Account"
        ]
      }
    },
    "/passkeys/{id}": {
      "delete": {
        "operationId": "deletePasskeysId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CurrentPassword"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Remove a passkey.",
        "tags": [
          "Account"
        ]
      }
    },
    "/public/{token}": {
      "get": {
        "operationId": "getPublicToken",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicLinkInfo"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {},
          {
            "linkToken": []
          }
        ],
        "summary": "Open a public link: its node, wrapped key, and for a link with limited opens a visit token (each call counts as an open).",
        "tags": [
          "Public links"
        ]
      }
    },
    "/public/{token}/nodes/{id}/children": {
      "get": {
        "operationId": "getPublicTokenNodesIdChildren",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page size; without it the whole array comes back.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "The `after` cursor of the previous page.",
            "in": "query",
            "name": "after",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "items": {
                        "$ref": "#/components/schemas/Node"
                      },
                      "type": "array"
                    },
                    {
                      "$ref": "#/components/schemas/NodePage"
                    }
                  ]
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {},
          {
            "linkToken": []
          }
        ],
        "summary": "A shared folder's children.",
        "tags": [
          "Public links"
        ]
      }
    },
    "/public/{token}/nodes/{id}/chunks/{idx}": {
      "get": {
        "operationId": "getPublicTokenNodesIdChunksIdx",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "idx",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "contentMediaType": "application/octet-stream",
                  "type": "string"
                }
              }
            },
            "description": "The chunk.",
            "headers": {
              "X-Version-Id": {
                "description": "The version these bytes belong to.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {},
          {
            "linkToken": []
          }
        ],
        "summary": "One encrypted chunk of a shared file.",
        "tags": [
          "Public links"
        ]
      }
    },
    "/public/{token}/nodes/{id}/thumbnail": {
      "get": {
        "operationId": "getPublicTokenNodesIdThumbnail",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "contentMediaType": "application/octet-stream",
                  "type": "string"
                }
              }
            },
            "description": "The encrypted thumbnail.",
            "headers": {
              "X-Version-Id": {
                "description": "The version these bytes belong to.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {},
          {
            "linkToken": []
          }
        ],
        "summary": "A shared file's encrypted thumbnail.",
        "tags": [
          "Public links"
        ]
      }
    },
    "/public/{token}/unlock": {
      "post": {
        "operationId": "postPublicTokenUnlock",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnlockLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnlockLinkResponse"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {},
          {
            "linkToken": []
          }
        ],
        "summary": "Unlock a password-protected link with an auth key derived from the password.",
        "tags": [
          "Public links"
        ]
      }
    },
    "/public/{token}/uploads": {
      "post": {
        "operationId": "postPublicTokenUploads",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUploadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadResponse"
                }
              }
            },
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {},
          {
            "linkToken": []
          }
        ],
        "summary": "Start an upload into a file drop. Its key is sealed to the owner.",
        "tags": [
          "Public links"
        ]
      }
    },
    "/public/{token}/uploads/{id}": {
      "delete": {
        "operationId": "deletePublicTokenUploadsId",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {},
          {
            "linkToken": []
          }
        ],
        "summary": "Give up on a dropped upload.",
        "tags": [
          "Public links"
        ]
      }
    },
    "/public/{token}/uploads/{id}/chunks/{idx}": {
      "put": {
        "operationId": "putPublicTokenUploadsIdChunksIdx",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "idx",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "contentMediaType": "application/octet-stream",
                "type": "string"
              }
            }
          },
          "description": "The encrypted chunk.",
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {},
          {
            "linkToken": []
          }
        ],
        "summary": "Send one encrypted chunk of a dropped upload.",
        "tags": [
          "Public links"
        ]
      }
    },
    "/public/{token}/uploads/{id}/finish": {
      "post": {
        "operationId": "postPublicTokenUploadsIdFinish",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {},
          {
            "linkToken": []
          }
        ],
        "summary": "Finish a dropped upload.",
        "tags": [
          "Public links"
        ]
      }
    },
    "/sessions": {
      "delete": {
        "operationId": "deleteSessions",
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Sign out every session except this one.",
        "tags": [
          "Account"
        ]
      },
      "get": {
        "operationId": "getSessions",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/DeviceSession"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Signed-in sessions: device name, last seen and how each signed in. No addresses are kept.",
        "tags": [
          "Account"
        ]
      }
    },
    "/sessions/{id}": {
      "delete": {
        "operationId": "deleteSessionsId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Sign out one session (this one too, like logging out).",
        "tags": [
          "Account"
        ]
      }
    },
    "/shares": {
      "post": {
        "operationId": "postShares",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateShareRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OutgoingShare"
                }
              }
            },
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Share a node: its key sealed to the recipient. Updates an existing share's key or permission.",
        "tags": [
          "Sharing"
        ]
      }
    },
    "/shares/incoming": {
      "get": {
        "operationId": "getSharesIncoming",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/IncomingShare"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "What's shared with you.",
        "tags": [
          "Sharing"
        ]
      }
    },
    "/shares/outgoing": {
      "get": {
        "operationId": "getSharesOutgoing",
        "parameters": [
          {
            "description": "Only the shares of this node.",
            "in": "query",
            "name": "node_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/OutgoingShare"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "What you've shared.",
        "tags": [
          "Sharing"
        ]
      }
    },
    "/shares/{id}": {
      "delete": {
        "operationId": "deleteSharesId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Revoke a share (owner) or leave it (recipient).",
        "tags": [
          "Sharing"
        ]
      },
      "patch": {
        "operationId": "patchSharesId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateShareRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change a share's permission or expiry.",
        "tags": [
          "Sharing"
        ]
      }
    },
    "/shares/{id}/key": {
      "put": {
        "operationId": "putSharesIdKey",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResealShareRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The recipient seals a share's key again to their hybrid X25519 + ML-KEM-768 key.",
        "tags": [
          "Sharing"
        ]
      }
    },
    "/storage": {
      "get": {
        "operationId": "getStorage",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StorageInfo"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Your linked storage accounts, what each holds, and what's allowed.",
        "tags": [
          "Linked storage"
        ]
      }
    },
    "/storage/accounts/{id}": {
      "delete": {
        "operationId": "deleteStorageAccountsId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Unlink an account. What's kept only there must be moved home first.",
        "tags": [
          "Linked storage"
        ]
      },
      "patch": {
        "operationId": "patchStorageAccountsId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateStorageAccountRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Change a linked account's role (mirror or extra space).",
        "tags": [
          "Linked storage"
        ]
      }
    },
    "/storage/accounts/{id}/move": {
      "post": {
        "operationId": "postStorageAccountsIdMove",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveStorageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MoveStorageResponse"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Move a batch of files between this server and the account. Call again until it says it's done.",
        "tags": [
          "Linked storage"
        ]
      }
    },
    "/storage/google": {
      "post": {
        "operationId": "postStorageGoogle",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LinkStorageRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkStorageResponse"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Start linking Google Drive: the consent page to open.",
        "tags": [
          "Linked storage"
        ]
      }
    },
    "/storage/google/callback": {
      "get": {
        "operationId": "getStorageGoogleCallback",
        "parameters": [
          {
            "description": "From Google.",
            "in": "query",
            "name": "code",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "From Google.",
            "in": "query",
            "name": "state",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "From Google.",
            "in": "query",
            "name": "error",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Never 200: always a 303 redirect."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [],
        "summary": "Google's redirect back; answers 303 to `/storage-linked.html` with the outcome after the `#`.",
        "tags": [
          "Linked storage"
        ]
      }
    },
    "/storage/prefer": {
      "put": {
        "operationId": "putStoragePrefer",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoragePreferRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Where new files go first: this server or a linked account.",
        "tags": [
          "Linked storage"
        ]
      }
    },
    "/tools": {
      "get": {
        "operationId": "getTools",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolsInfo"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Which server-side tools are on.",
        "tags": [
          "Tools"
        ]
      }
    },
    "/tools/video/download": {
      "post": {
        "operationId": "postToolsVideoDownload",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "The media, streamed."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Stream the video (or its audio) as it downloads, for the client to encrypt and upload.",
        "tags": [
          "Tools"
        ]
      }
    },
    "/tools/video/info": {
      "post": {
        "operationId": "postToolsVideoInfo",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VideoLinkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VideoInfo"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "The video downloader (off by default; the server sees the link and the video): look a link up.",
        "tags": [
          "Tools"
        ]
      }
    },
    "/trash": {
      "delete": {
        "operationId": "deleteTrash",
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Empty the trash for good.",
        "tags": [
          "Trash"
        ]
      },
      "get": {
        "operationId": "getTrash",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/TrashItem"
                  },
                  "type": "array"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "What's in your trash.",
        "tags": [
          "Trash"
        ]
      }
    },
    "/trash/{id}": {
      "delete": {
        "operationId": "deleteTrashId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Delete one item for good.",
        "tags": [
          "Trash"
        ]
      }
    },
    "/trash/{id}/restore": {
      "post": {
        "operationId": "postTrashIdRestore",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RestoreTrashRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Node"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Restore into the original folder or, if it's gone (409 `parent_unavailable`), into `parent_id` with a re-wrapped key.",
        "tags": [
          "Trash"
        ]
      }
    },
    "/uploads": {
      "post": {
        "operationId": "postUploads",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateUploadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadResponse"
                }
              }
            },
            "description": "Created."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Start an upload: a new file, or a new version of one (with `if_revision`).",
        "tags": [
          "Uploads"
        ]
      }
    },
    "/uploads/{id}": {
      "delete": {
        "operationId": "deleteUploadsId",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Give up on an upload and free its space.",
        "tags": [
          "Uploads"
        ]
      }
    },
    "/uploads/{id}/chunks/{idx}": {
      "put": {
        "operationId": "putUploadsIdChunksIdx",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "idx",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/octet-stream": {
              "schema": {
                "contentMediaType": "application/octet-stream",
                "type": "string"
              }
            }
          },
          "description": "The encrypted chunk.",
          "required": true
        },
        "responses": {
          "204": {
            "description": "Done."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Send one encrypted chunk.",
        "tags": [
          "Uploads"
        ]
      }
    },
    "/uploads/{id}/finish": {
      "post": {
        "operationId": "postUploadsIdFinish",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FinishUploadRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Node"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Finish an upload once every chunk is in.",
        "tags": [
          "Uploads"
        ]
      }
    },
    "/users/{username}/avatar": {
      "get": {
        "operationId": "getUsersUsernameAvatar",
        "parameters": [
          {
            "in": "path",
            "name": "username",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/UserAvatar"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Someone's picture and display name, if they gave you their avatar key.",
        "tags": [
          "Account"
        ]
      }
    },
    "/users/{username}/public-key": {
      "get": {
        "operationId": "getUsersUsernamePublicKey",
        "parameters": [
          {
            "in": "path",
            "name": "username",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserPublicKey"
                }
              }
            },
            "description": "OK."
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "security": [
          {
            "session": []
          }
        ],
        "summary": "Someone's public keys, to check their fingerprint and seal a share to.",
        "tags": [
          "Sharing"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "/api"
    }
  ]
}
