{
  "openapi": "3.1.1",
  "info": {
    "title": "Avenvail API",
    "description": "The HTTP API of a self-hosted Avenvail instance. Requests go to your own instance, for example `https://files.example.com/api/v1/files`. Every endpoint here accepts an API token as `Authorization: Bearer avn_...` with the listed scope. The web app also uses internal endpoints that aren't listed: they need a signed-in browser session and may change in any release.",
    "license": {
      "name": "MIT",
      "identifier": "MIT"
    },
    "version": "v1"
  },
  "servers": [
    {
      "url": "{instance}",
      "description": "Your Avenvail instance",
      "variables": {
        "instance": {
          "default": "https://files.example.com",
          "description": "The base URL of your instance."
        }
      }
    }
  ],
  "paths": {
    "/api/v1/uploads": {
      "post": {
        "tags": [
          "Uploads"
        ],
        "summary": "Upload a file",
        "description": "Streams the first multipart section named `file` straight to storage without buffering the form. Uploads with a token holding shares:create get an unlisted share; others stay private. The optional `folderId` query parameter files the upload into that folder.\n\nAPI token with the `upload:create` scope, or a dashboard session.",
        "operationId": "UploadFile",
        "parameters": [
          {
            "name": "folderId",
            "in": "query",
            "description": "Folder to file the upload into.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "required": [
                  "file"
                ],
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "upload:create"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/bulk": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Act on several files",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "BulkFiles",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileBulkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkResult"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/trash/bulk": {
      "post": {
        "tags": [
          "Trash"
        ],
        "summary": "Act on several trashed items",
        "description": "Restores or deletes trashed files and folders one by one, so one failure leaves the others applied.\n\nAPI token with the `files:write` scope, or a dashboard session.",
        "operationId": "BulkTrash",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrashBulkRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkResult"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/shares": {
      "get": {
        "tags": [
          "Shares"
        ],
        "summary": "List shares",
        "description": "Every share of the owner's active files, newest first, with keyset paging on the share id.\n\nAPI token with the `files:read` scope, or a dashboard session.",
        "operationId": "ListShares",
        "parameters": [
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareListPage"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{id}/shares": {
      "get": {
        "tags": [
          "Shares"
        ],
        "summary": "List a file's shares",
        "description": "API token with the `files:read` scope, or a dashboard session.",
        "operationId": "ListFileShares",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ShareItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Shares"
        ],
        "summary": "Share a file",
        "description": "API token with the `shares:create` scope, or a dashboard session.",
        "operationId": "ShareFile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "null"
                  },
                  {
                    "$ref": "#/components/schemas/CreateShareRequest"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShareItem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "shares:create"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/shares/{id}": {
      "delete": {
        "tags": [
          "Shares"
        ],
        "summary": "Revoke a share",
        "description": "Idempotent. Copies already fetched or held in public caches cannot be recalled.\n\nAPI token with the `shares:create` scope, or a dashboard session.",
        "operationId": "RevokeShare",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "shares:create"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/uploads/{fileId}/state": {
      "get": {
        "tags": [
          "Quarantine"
        ],
        "summary": "Get an upload's intake state",
        "description": "Lets a client follow an upload an intake workflow is still processing.\n\nAPI token with the `upload:create` scope, or a dashboard session.",
        "operationId": "GetUploadState",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadState"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "upload:create"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/auth/me": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "Get the current user",
        "description": "Any API token or a dashboard session.",
        "operationId": "GetMe",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [ ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/upload-sessions": {
      "post": {
        "tags": [
          "Uploads"
        ],
        "summary": "Start a resumable upload",
        "description": "API token with the `upload:create` scope, or a dashboard session.",
        "operationId": "CreateUploadSession",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSessionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadSessionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "upload:create"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Uploads"
        ],
        "summary": "List open upload sessions",
        "description": "API token with the `upload:create` scope, or a dashboard session.",
        "operationId": "ListUploadSessions",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadSessionList"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "upload:create"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/upload-sessions/{id}": {
      "get": {
        "tags": [
          "Uploads"
        ],
        "summary": "Get an upload session",
        "description": "API token with the `upload:create` scope, or a dashboard session.",
        "operationId": "GetUploadSession",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadSessionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "upload:create"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Uploads"
        ],
        "summary": "Upload a chunk",
        "description": "API token with the `upload:create` scope, or a dashboard session.",
        "operationId": "UploadChunk",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Upload-Offset",
            "in": "header",
            "description": "Byte offset of this chunk; must match the session's current offset.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/offset+octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadSessionResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "upload:create"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Uploads"
        ],
        "summary": "Cancel a resumable upload",
        "description": "API token with the `upload:create` scope, or a dashboard session.",
        "operationId": "CancelUploadSession",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "upload:create"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/upload-sessions/{id}/complete": {
      "post": {
        "tags": [
          "Uploads"
        ],
        "summary": "Finish a resumable upload",
        "description": "Commits the staged bytes as a file. Runs to the end even if the client goes away (a proxy may time out on a large file), and the result stays readable from GET and from repeating this call.\n\nAPI token with the `upload:create` scope, or a dashboard session.",
        "operationId": "CompleteUploadSession",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UploadResponse"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "upload:create"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "List files",
        "description": "Owner-scoped listing with filename search, type and tag filters and keyset pagination. `folder` is a folder ID or `root`; without it the whole library is listed. `recursive` widens a folder ID to its descendants. `tag` keeps files with every given tag, or any of them when `match` is `any`. `id` limits the result to the given files, so a client can check whether they still match. `q` matches names containing it, and files where each of its words starts a word somewhere on the file: its name, a tag, a searchable field or a text attachment. A quoted phrase must appear within one of those, and a word or phrase after `-` leaves out files that have it anywhere. `field.{id}` keeps files whose field has that value; an empty value keeps files where the field has any value.\n\nAPI token with the `files:read` scope, or a dashboard session.",
        "operationId": "ListFiles",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "folder",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "recursive",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "tag",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "match",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileListPage"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/search-query": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Parse a search query",
        "description": "How `q` is read: its words, phrases and filters with their labels, and what's wrong with any of them.\n\nAPI token with the `files:read` scope, or a dashboard session.",
        "operationId": "ParseSearchQuery",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchQueryResult"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/automation": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Get files' automation status",
        "description": "What workflows are doing with the given files. Files with nothing to show are left out.\n\nAPI token with the `files:read` scope, or a dashboard session.",
        "operationId": "GetFilesAutomation",
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ItemListOfAutomationItem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{id}": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Get a file",
        "description": "API token with the `files:read` scope, or a dashboard session.",
        "operationId": "GetFile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Files"
        ],
        "summary": "Rename a file",
        "description": "Renames a file. Share URLs and the object key do not change.\n\nAPI token with the `files:write` scope, or a dashboard session.",
        "operationId": "RenameFile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFileRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Files"
        ],
        "summary": "Move a file to the trash",
        "description": "Moves the file to Trash, or deletes it for good when trash retention is zero.\n\nAPI token with the `files:write` scope, or a dashboard session.",
        "operationId": "TrashFile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{id}/move": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Move a file to a folder",
        "description": "Moves the file into a folder, or to the root when folderId is null. Share URLs and the object key do not change.\n\nAPI token with the `files:write` scope, or a dashboard session.",
        "operationId": "MoveFile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{id}/content": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Download a file",
        "description": "API token with the `files:read` scope, or a dashboard session.",
        "operationId": "GetFileContent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/Stream"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "head": {
        "tags": [
          "Files"
        ],
        "summary": "Check a file's content headers",
        "description": "API token with the `files:read` scope, or a dashboard session.",
        "operationId": "CheckFileContent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/Stream"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{id}/thumbnail": {
      "get": {
        "tags": [
          "Files"
        ],
        "summary": "Get a file's thumbnail",
        "description": "API token with the `files:read` scope, or a dashboard session.",
        "operationId": "GetFileThumbnail",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "image/webp": {
                "schema": {
                  "$ref": "#/components/schemas/Stream"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "head": {
        "tags": [
          "Files"
        ],
        "summary": "Check a file's thumbnail headers",
        "description": "API token with the `files:read` scope, or a dashboard session.",
        "operationId": "CheckFileThumbnail",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "image/webp": {
                "schema": {
                  "$ref": "#/components/schemas/Stream"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{id}/reprocess": {
      "post": {
        "tags": [
          "Files"
        ],
        "summary": "Process a file again",
        "description": "Runs every file processor on the file again, such as after a thumbnail failed.\n\nAPI token with the `files:write` scope, or a dashboard session.",
        "operationId": "ReprocessFile",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileDetail"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/trash": {
      "get": {
        "tags": [
          "Trash"
        ],
        "summary": "List the trash",
        "description": "Files and folders trashed on their own; contents trashed with a folder are counted on it.\n\nAPI token with the `files:read` scope, or a dashboard session.",
        "operationId": "ListTrash",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrashPage"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Trash"
        ],
        "summary": "Empty the trash",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "EmptyTrash",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmptyResult"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/trash/{id}/restore": {
      "post": {
        "tags": [
          "Trash"
        ],
        "summary": "Restore from the trash",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "RestoreTrashItem",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RestoreResult"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/trash/{id}": {
      "delete": {
        "tags": [
          "Trash"
        ],
        "summary": "Delete from the trash permanently",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "DeleteTrashItem",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/folders": {
      "get": {
        "tags": [
          "Folders"
        ],
        "summary": "List folders",
        "description": "API token with the `files:read` scope, or a dashboard session.",
        "operationId": "ListFolders",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderList"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Folders"
        ],
        "summary": "Create a folder",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "CreateFolder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFolderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderItem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/folders/{id}": {
      "patch": {
        "tags": [
          "Folders"
        ],
        "summary": "Rename a folder",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "RenameFolder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenameFolderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderItem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Folders"
        ],
        "summary": "Move a folder to the trash",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "TrashFolder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/folders/{id}/move": {
      "post": {
        "tags": [
          "Folders"
        ],
        "summary": "Move a folder",
        "description": "Moves a folder under another one, or to the root when folderId is null. Never into itself or a descendant.\n\nAPI token with the `files:write` scope, or a dashboard session.",
        "operationId": "MoveFolder",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderItem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/tags": {
      "get": {
        "tags": [
          "Tags"
        ],
        "summary": "List tags",
        "description": "API token with the `files:read` scope, or a dashboard session.",
        "operationId": "ListTags",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagList"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Tags"
        ],
        "summary": "Create a tag",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "CreateTag",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TagNameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagItem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/tags/{id}": {
      "patch": {
        "tags": [
          "Tags"
        ],
        "summary": "Rename a tag",
        "description": "Renames a tag. A name another tag already uses is refused; merge the tags instead.\n\nAPI token with the `files:write` scope, or a dashboard session.",
        "operationId": "RenameTag",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TagNameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagItem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Tags"
        ],
        "summary": "Delete a tag",
        "description": "Deletes the tag and takes it off every file. The files themselves are untouched.\n\nAPI token with the `files:write` scope, or a dashboard session.",
        "operationId": "DeleteTag",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/tags/{id}/merge": {
      "post": {
        "tags": [
          "Tags"
        ],
        "summary": "Merge a tag into another",
        "description": "Moves every file of this tag onto another tag, then deletes this one.\n\nAPI token with the `files:write` scope, or a dashboard session.",
        "operationId": "MergeTag",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MergeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagItem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{fileId}/tags": {
      "post": {
        "tags": [
          "Tags"
        ],
        "summary": "Tag a file",
        "description": "Tags the file by name, creating the tag when the owner has none by that name. Tagging twice is a no-op.\n\nAPI token with the `files:write` scope, or a dashboard session.",
        "operationId": "TagFile",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TagNameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileTags"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{fileId}/tags/{tagId}": {
      "delete": {
        "tags": [
          "Tags"
        ],
        "summary": "Untag a file",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "UntagFile",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "tagId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileTags"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/fields": {
      "get": {
        "tags": [
          "Fields"
        ],
        "summary": "List fields",
        "description": "API token with the `files:read` scope, or a dashboard session.",
        "operationId": "ListFields",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FieldItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Fields"
        ],
        "summary": "Create a field",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "CreateField",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFieldRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldItem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/fields/{id}": {
      "patch": {
        "tags": [
          "Fields"
        ],
        "summary": "Update a field",
        "description": "Changes a field. A new type or choice list converts every existing value; values that can't be converted refuse the change with `field_values_incompatible`, unless `dropIncompatible` clears them.\n\nAPI token with the `files:write` scope, or a dashboard session.",
        "operationId": "UpdateField",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFieldRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FieldItem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Fields"
        ],
        "summary": "Delete a field",
        "description": "Deletes the field and its value on every file. Workflows that use it fail to validate until they're changed.\n\nAPI token with the `files:write` scope, or a dashboard session.",
        "operationId": "DeleteField",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{fileId}/fields": {
      "get": {
        "tags": [
          "Fields"
        ],
        "summary": "List a file's field values",
        "description": "API token with the `files:read` scope, or a dashboard session.",
        "operationId": "ListFileFields",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FileFieldItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{fileId}/fields/{fieldId}": {
      "put": {
        "tags": [
          "Fields"
        ],
        "summary": "Set a file's field value",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "SetFileField",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "fieldId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetFieldRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FileFieldItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Fields"
        ],
        "summary": "Clear a file's field value",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "ClearFileField",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "fieldId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/FileFieldItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{fileId}/attachments": {
      "get": {
        "tags": [
          "Attachments"
        ],
        "summary": "List a file's attachments",
        "description": "API token with the `files:read` scope, or a dashboard session.",
        "operationId": "ListAttachments",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AttachmentItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Attachments"
        ],
        "summary": "Add a text attachment",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "CreateAttachment",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAttachmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentItem"
                }
              }
            }
          },
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AttachmentItem"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{fileId}/attachments/{id}/content": {
      "get": {
        "tags": [
          "Attachments"
        ],
        "summary": "Download an attachment",
        "description": "Shown inline as text (never rendered), or downloaded with `?download=1`.\n\nAPI token with the `files:read` scope, or a dashboard session.",
        "operationId": "GetAttachmentContent",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/Stream"
                }
              }
            }
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:read"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    },
    "/api/v1/files/{fileId}/attachments/{id}": {
      "delete": {
        "tags": [
          "Attachments"
        ],
        "summary": "Delete an attachment",
        "description": "API token with the `files:write` scope, or a dashboard session.",
        "operationId": "DeleteAttachment",
        "parameters": [
          {
            "name": "fileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Not signed in, or the token is missing or revoked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "The session or token may not do this.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "default": {
            "description": "Problem Details with a stable `code`.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "token": [
              "files:write"
            ]
          },
          {
            "session": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AttachmentItem": {
        "required": [
          "id",
          "name",
          "kind",
          "size",
          "contentUrl",
          "createdAt",
          "provenance"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "text",
              "markdown",
              "json"
            ],
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          },
          "contentUrl": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "provenance": {
            "$ref": "#/components/schemas/ProvenanceItem"
          }
        }
      },
      "AutomationItem": {
        "required": [
          "fileId",
          "status"
        ],
        "type": "object",
        "properties": {
          "fileId": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/FileAutomationStatus"
          }
        }
      },
      "BulkItem": {
        "required": [
          "id",
          "ok",
          "code"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "ok": {
            "type": "boolean"
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BulkResult": {
        "required": [
          "items",
          "succeeded",
          "failed",
          "trashed",
          "tag"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkItem"
            }
          },
          "succeeded": {
            "type": "integer",
            "format": "int32"
          },
          "failed": {
            "type": "integer",
            "format": "int32"
          },
          "trashed": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "For trash: false when retention is zero and the files were deleted for good."
          },
          "tag": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/TagRef"
              }
            ]
          }
        }
      },
      "CreateAttachmentRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "kind": {
            "type": [
              "null",
              "string"
            ]
          },
          "text": {
            "type": [
              "null",
              "string"
            ]
          },
          "onConflict": {
            "type": [
              "null",
              "string"
            ],
            "description": "`replace` (default), `keep-existing`, `rename` or `fail`."
          }
        }
      },
      "CreateFieldRequest": {
        "type": "object",
        "properties": {
          "key": {
            "type": [
              "null",
              "string"
            ]
          },
          "label": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "options": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "showOnShares": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "searchable": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Whether search matches words in the field's values; on by default except for links."
          }
        }
      },
      "CreateFolderRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "parentId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "CreateSessionRequest": {
        "required": [
          "size"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "size": {
            "type": "integer",
            "format": "int64"
          },
          "folderId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "CreateShareRequest": {
        "type": "object",
        "properties": {
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "EmptyResult": {
        "required": [
          "deleted"
        ],
        "type": "object",
        "properties": {
          "deleted": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "FieldItem": {
        "required": [
          "id",
          "key",
          "label",
          "type",
          "options",
          "showOnShares",
          "searchable",
          "pluginId",
          "fileCount",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "enum": [
              "text",
              "long-text",
              "number",
              "date",
              "boolean",
              "choice",
              "list",
              "link"
            ],
            "type": "string"
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "showOnShares": {
            "type": "boolean"
          },
          "searchable": {
            "type": "boolean"
          },
          "pluginId": {
            "type": [
              "null",
              "string"
            ]
          },
          "fileCount": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "FileAutomationStatus": {
        "required": [
          "state",
          "running",
          "runId"
        ],
        "type": "object",
        "properties": {
          "state": {
            "enum": [
              "running",
              "attention",
              "failed"
            ],
            "type": "string",
            "description": "running, attention or failed."
          },
          "running": {
            "type": "integer",
            "format": "int32"
          },
          "runId": {
            "type": [
              "null",
              "string"
            ],
            "description": "The run to open: the one that needs attention or failed most recently.",
            "format": "uuid"
          }
        }
      },
      "FileBulkRequest": {
        "type": "object",
        "properties": {
          "action": {
            "type": [
              "null",
              "string"
            ],
            "description": "move, tag, untag or trash."
          },
          "ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "folderId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Destination for move; null moves to the root.",
            "format": "uuid"
          },
          "tag": {
            "type": [
              "null",
              "string"
            ],
            "description": "Tag name for tag; created when the owner has none by that name."
          },
          "tagId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Tag to take off for untag.",
            "format": "uuid"
          }
        }
      },
      "FileDetail": {
        "required": [
          "id",
          "name",
          "originalName",
          "mimeType",
          "size",
          "createdAt",
          "revision",
          "folderId",
          "tags",
          "contentUrl",
          "thumbnailUrl",
          "width",
          "height",
          "takenAt",
          "processing",
          "shares",
          "fields",
          "attachments",
          "runs"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "originalName": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "revision": {
            "type": "integer",
            "format": "int32"
          },
          "folderId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TagRef"
            }
          },
          "contentUrl": {
            "type": "string"
          },
          "thumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "width": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "height": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "takenAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "processing": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProcessingItem"
            }
          },
          "shares": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShareItem"
            }
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileFieldItem"
            }
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AttachmentItem"
            }
          },
          "runs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileRunItem"
            }
          }
        }
      },
      "FileFieldItem": {
        "required": [
          "fieldId",
          "key",
          "label",
          "type",
          "value",
          "provenance"
        ],
        "type": "object",
        "properties": {
          "fieldId": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "type": {
            "enum": [
              "text",
              "long-text",
              "number",
              "date",
              "boolean",
              "choice",
              "list",
              "link"
            ],
            "type": "string"
          },
          "value": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonNode"
              }
            ]
          },
          "provenance": {
            "$ref": "#/components/schemas/ProvenanceItem"
          }
        }
      },
      "FileListItem": {
        "required": [
          "id",
          "name",
          "mimeType",
          "size",
          "createdAt",
          "revision",
          "folderId",
          "tags",
          "contentUrl",
          "shareUrl",
          "thumbnailUrl",
          "width",
          "height",
          "takenAt",
          "matches",
          "automation"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "revision": {
            "type": "integer",
            "format": "int32"
          },
          "folderId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TagRef"
            }
          },
          "contentUrl": {
            "type": "string"
          },
          "shareUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "thumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "width": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "height": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "takenAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "matches": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/SearchMatch"
            }
          },
          "automation": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FileAutomationStatus"
              }
            ]
          }
        }
      },
      "FileListPage": {
        "required": [
          "items",
          "nextCursor",
          "total"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FileListItem"
            }
          },
          "nextCursor": {
            "type": [
              "null",
              "string"
            ]
          },
          "total": {
            "type": [
              "null",
              "integer"
            ],
            "description": "How many files match the filters; only on the first page.",
            "format": "int32"
          }
        }
      },
      "FileRunItem": {
        "required": [
          "runId",
          "workflowId",
          "workflowName",
          "state",
          "createdAt",
          "completedAt",
          "errorMessage"
        ],
        "type": "object",
        "properties": {
          "runId": {
            "type": [
              "null",
              "string"
            ],
            "description": "Null while an event waits to start the file's runs.",
            "format": "uuid"
          },
          "workflowId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "workflowName": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "enum": [
              "queued",
              "running",
              "retrying",
              "waiting",
              "needs_attention",
              "canceling",
              "succeeded",
              "completed_with_errors",
              "failed",
              "canceled"
            ],
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "errorMessage": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "FileTags": {
        "required": [
          "tags"
        ],
        "type": "object",
        "properties": {
          "tags": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TagRef"
            }
          }
        }
      },
      "FolderItem": {
        "required": [
          "id",
          "parentId",
          "name",
          "createdAt",
          "revision",
          "fileCount"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "parentId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "revision": {
            "type": "integer",
            "format": "int32"
          },
          "fileCount": {
            "type": "integer",
            "format": "int32",
            "default": 0
          }
        }
      },
      "FolderList": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FolderItem"
            }
          }
        }
      },
      "ItemListOfAutomationItem": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationItem"
            }
          }
        }
      },
      "JsonNode": { },
      "Me": {
        "required": [
          "id",
          "name",
          "role"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "enum": [
              "member",
              "admin"
            ],
            "type": "string"
          }
        }
      },
      "MergeRequest": {
        "type": "object",
        "properties": {
          "into": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "MoveRequest": {
        "type": "object",
        "properties": {
          "folderId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "revision": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          }
        }
      },
      "Problem": {
        "required": [
          "code"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "code": {
            "type": "string"
          },
          "args": {
            "type": "object"
          },
          "traceId": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Problem Details as every error response carries them."
      },
      "ProcessingItem": {
        "required": [
          "processor",
          "state",
          "error",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "processor": {
            "type": "string"
          },
          "state": {
            "enum": [
              "queued",
              "succeeded",
              "failed"
            ],
            "type": "string"
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProvenanceItem": {
        "required": [
          "source",
          "tokenId",
          "workflowId",
          "workflowName",
          "runId",
          "stepId",
          "at"
        ],
        "type": "object",
        "properties": {
          "source": {
            "enum": [
              "user",
              "api",
              "workflow",
              "import"
            ],
            "type": "string"
          },
          "tokenId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "workflowId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "workflowName": {
            "type": [
              "null",
              "string"
            ]
          },
          "runId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "stepId": {
            "type": [
              "null",
              "string"
            ]
          },
          "at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RenameFolderRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "revision": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          }
        }
      },
      "RestoreResult": {
        "required": [
          "kind"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "enum": [
              "file",
              "folder"
            ],
            "type": "string",
            "description": "`file` or `folder`."
          },
          "file": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FileDetail"
              }
            ]
          },
          "folder": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/FolderItem"
              }
            ]
          }
        }
      },
      "SearchMatch": {
        "required": [
          "kind",
          "sourceId",
          "sourceName",
          "parts",
          "from",
          "fromName",
          "fromIcon"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "enum": [
              "name",
              "tag",
              "field",
              "attachment"
            ],
            "type": "string"
          },
          "sourceId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "sourceName": {
            "type": [
              "null",
              "string"
            ]
          },
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SnippetPart"
            }
          },
          "from": {
            "type": [
              "null",
              "string"
            ],
            "description": "For an attachment a workflow stored, the step type whose output it holds, such as `avenvail.ocr.extract-text`."
          },
          "fromName": {
            "type": [
              "null",
              "string"
            ],
            "description": "The step's name, such as Extract text, when string? SearchMatch.From is a known step."
          },
          "fromIcon": {
            "type": [
              "null",
              "string"
            ]
          }
        },
        "description": "Why a file matched: the source (SearchSources), its id and readable name (tag name, field label or\nattachment name; null for the file name), and a short snippet with the matched words marked."
      },
      "SearchPart": {
        "required": [
          "start",
          "length",
          "kind",
          "negated",
          "key",
          "op",
          "values",
          "quoted",
          "property",
          "fieldId",
          "fieldType",
          "label",
          "ids",
          "problem",
          "indexed"
        ],
        "type": "object",
        "properties": {
          "start": {
            "type": "integer",
            "format": "int32"
          },
          "length": {
            "type": "integer",
            "format": "int32"
          },
          "kind": {
            "enum": [
              "word",
              "phrase",
              "filter"
            ],
            "type": "string"
          },
          "negated": {
            "type": "boolean"
          },
          "key": {
            "type": [
              "null",
              "string"
            ]
          },
          "op": {
            "enum": [
              ":",
              ">",
              ">=",
              "<",
              "<=",
              null
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "values": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "quoted": {
            "type": "array",
            "items": {
              "type": "boolean"
            }
          },
          "property": {
            "enum": [
              "tag",
              "type",
              "in",
              "field",
              null
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "fieldId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "fieldType": {
            "enum": [
              "text",
              "long-text",
              "number",
              "date",
              "boolean",
              "choice",
              "list",
              "link",
              null
            ],
            "type": [
              "null",
              "string"
            ]
          },
          "label": {
            "type": [
              "null",
              "string"
            ]
          },
          "ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            }
          },
          "problem": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SearchProblem"
              }
            ]
          },
          "indexed": {
            "type": "boolean",
            "description": "Whether the field is included in search, so its text is matched through the index."
          }
        },
        "description": "A part of a search with what it refers to: for a filter, the property, the field it names and its label, and the\ntags or folders its values resolved to."
      },
      "SearchProblem": {
        "required": [
          "code",
          "message",
          "args"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "args": {
            "type": "object"
          }
        },
        "description": "Why a part of a search can't run. string SearchProblem.Code is translated by the UI; string SearchProblem.Message is the English text."
      },
      "SearchQueryResult": {
        "required": [
          "parts",
          "problems"
        ],
        "type": "object",
        "properties": {
          "parts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchPart"
            }
          },
          "problems": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SearchProblem"
            }
          }
        }
      },
      "SetFieldRequest": {
        "type": "object",
        "properties": {
          "value": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonNode"
              }
            ]
          }
        }
      },
      "SharedFile": {
        "required": [
          "id",
          "name",
          "mimeType",
          "size"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "ShareItem": {
        "required": [
          "id",
          "url",
          "rawUrl",
          "createdAt",
          "expiresAt",
          "revokedAt",
          "active"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "rawUrl": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "revokedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "active": {
            "type": "boolean"
          }
        }
      },
      "ShareListItem": {
        "required": [
          "id",
          "url",
          "rawUrl",
          "createdAt",
          "expiresAt",
          "revokedAt",
          "active",
          "file"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "url": {
            "type": "string"
          },
          "rawUrl": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "revokedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "active": {
            "type": "boolean"
          },
          "file": {
            "$ref": "#/components/schemas/SharedFile"
          }
        }
      },
      "ShareListPage": {
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShareListItem"
            }
          },
          "nextCursor": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SnippetPart": {
        "required": [
          "text",
          "hit"
        ],
        "type": "object",
        "properties": {
          "text": {
            "type": "string"
          },
          "hit": {
            "type": "boolean"
          }
        },
        "description": "A span of a search snippet; Hit marks text that matched."
      },
      "Stream": {
        "type": "string",
        "format": "binary"
      },
      "TagItem": {
        "required": [
          "id",
          "name",
          "fileCount",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "fileCount": {
            "type": "integer",
            "format": "int32"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TagList": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TagItem"
            }
          }
        }
      },
      "TagNameRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TagRef": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "TrashBulkRequest": {
        "type": "object",
        "properties": {
          "action": {
            "type": [
              "null",
              "string"
            ],
            "description": "restore or delete."
          },
          "ids": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      },
      "TrashItem": {
        "required": [
          "id",
          "kind",
          "name",
          "mimeType",
          "size",
          "fileCount",
          "trashedAt",
          "purgeAt",
          "revokedShares"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "enum": [
              "file",
              "folder"
            ],
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "mimeType": {
            "type": [
              "null",
              "string"
            ]
          },
          "size": {
            "type": "integer",
            "format": "int64"
          },
          "fileCount": {
            "type": "integer",
            "format": "int32"
          },
          "trashedAt": {
            "type": "string",
            "format": "date-time"
          },
          "purgeAt": {
            "type": "string",
            "format": "date-time"
          },
          "revokedShares": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "TrashPage": {
        "required": [
          "items",
          "nextCursor",
          "count",
          "totalSize",
          "retentionDays"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrashItem"
            }
          },
          "nextCursor": {
            "type": [
              "null",
              "string"
            ]
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "totalSize": {
            "type": "integer",
            "format": "int64"
          },
          "retentionDays": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "UpdateFieldRequest": {
        "type": "object",
        "properties": {
          "key": {
            "type": [
              "null",
              "string"
            ]
          },
          "label": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "options": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "showOnShares": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "searchable": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "dropIncompatible": {
            "type": [
              "null",
              "boolean"
            ],
            "description": "Clears values that don't fit a new type or choice list instead of refusing the change."
          }
        }
      },
      "UpdateFileRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "revision": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          }
        }
      },
      "UploadResponse": {
        "required": [
          "id",
          "name",
          "mimeType",
          "size",
          "url",
          "shareUrl",
          "thumbnailUrl",
          "deletionUrl",
          "processingStatus",
          "state"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          },
          "url": {
            "type": "string"
          },
          "shareUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "thumbnailUrl": {
            "type": [
              "null",
              "string"
            ]
          },
          "deletionUrl": {
            "type": "string"
          },
          "processingStatus": {
            "type": "string"
          },
          "state": {
            "enum": [
              "active",
              "pending"
            ],
            "type": "string",
            "default": "active"
          }
        }
      },
      "UploadSessionList": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UploadSessionResponse"
            }
          }
        }
      },
      "UploadSessionResponse": {
        "required": [
          "id",
          "name",
          "size",
          "offset",
          "chunkSize",
          "state",
          "folderId",
          "createdAt",
          "expiresAt",
          "file"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "format": "int64"
          },
          "offset": {
            "type": "integer",
            "format": "int64"
          },
          "chunkSize": {
            "type": "integer",
            "format": "int64"
          },
          "state": {
            "enum": [
              "open",
              "completed"
            ],
            "type": "string"
          },
          "folderId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "file": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/UploadResponse"
              }
            ]
          }
        }
      },
      "UploadState": {
        "required": [
          "fileId",
          "state",
          "runId"
        ],
        "type": "object",
        "properties": {
          "fileId": {
            "type": "string",
            "format": "uuid"
          },
          "state": {
            "enum": [
              "pending",
              "quarantined",
              "discarded",
              "active",
              "deleted"
            ],
            "type": "string"
          },
          "runId": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      }
    },
    "securitySchemes": {
      "token": {
        "type": "http",
        "description": "An API token created under Settings > API tokens, sent as `Authorization: Bearer avn_...`. Each token has scopes: `upload:create`, `files:read`, `files:write` and `shares:create`.",
        "scheme": "bearer"
      },
      "session": {
        "type": "apiKey",
        "description": "The dashboard's session cookie. Requests other than GET and HEAD must also come from the instance's own origin and send `X-Avenvail-Request: 1`.",
        "name": "avenvail_session",
        "in": "cookie"
      }
    }
  },
  "tags": [
    {
      "name": "Uploads"
    },
    {
      "name": "Files"
    },
    {
      "name": "Folders"
    },
    {
      "name": "Tags"
    },
    {
      "name": "Fields"
    },
    {
      "name": "Attachments"
    },
    {
      "name": "Shares"
    },
    {
      "name": "Trash"
    },
    {
      "name": "Quarantine"
    },
    {
      "name": "Account"
    }
  ],
  "externalDocs": {
    "description": "Using the API",
    "url": "https://docs.avenvail.dev/reference/api"
  }
}