{
 "openapi": "3.0.3",
 "info": {
  "title": "Bramble Drive & Office API",
  "version": "2026-11-13",
  "description": "Bramble Drive: personal files and shared libraries, folders, uploads (small and resumable), sharing with people, groups and links, versions, the bin, search, the change feed Bramble Sync uses, public share links, and opening files in Bramble Office. Works with an API key.\n"
 },
 "servers": [
  {
   "url": "https://{org}.brambleit.cloud/drive",
   "variables": {
    "org": {
     "default": "your-org"
    }
   }
  },
  {
   "url": "https://{org}.brambleit.cloud/api",
   "variables": {
    "org": {
     "default": "your-org"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "apiKey",
    "in": "header",
    "name": "X-API-Key"
   },
   "session": {
    "type": "apiKey",
    "in": "cookie",
    "name": "sso_session"
   },
   "bearer": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "JWT"
   }
  }
 },
 "tags": [
  {
   "name": "Browse & search",
   "description": "Folder listings, recent and starred files, what's shared with you and by you, search, your storage use, and finding people to share with."
  },
  {
   "name": "Files & folders",
   "description": "One item: details, contents and thumbnails, rename, star, versions, activity, and sharing (people, groups and links). Plus creating folders, moving, copying and downloading several items as a zip.\n"
  },
  {
   "name": "Uploading",
   "description": "Small uploads in one request, resumable uploads in parts, and checking which names already exist."
  },
  {
   "name": "Quick share",
   "description": "Upload files and get a share link in one step (they land in a \"Quick share\" folder)."
  },
  {
   "name": "Bin",
   "description": "Deleted items stay in the bin for the organisation's retention period and can be restored."
  },
  {
   "name": "Libraries",
   "description": "Shared libraries and their members."
  },
  {
   "name": "Sync change feed",
   "description": "What Bramble Sync and the mobile apps use to stay in step: the spaces you can sync (personal files and libraries) and a change feed per space. Keep the `cursor` from each answer and pass it next time; `wait` long-polls until something changes.\n"
  },
  {
   "name": "Office editing",
   "description": "Opening Word, Excel and PowerPoint files in Bramble Office (needs the Docs, Sheets or Slides licence), creating new blank ones, and the start pages' recent files. The `/wopi/...` endpoints are how the editor reads and saves the file, each call carrying an access token Drive issued for that file; they're refused through the gateway.\n"
  },
  {
   "name": "Public share links",
   "description": "What someone with a share link sees, without signing in: the item (or folder listing), unlocking a password-protected link, downloading, and thumbnails.\n"
  },
  {
   "name": "Legacy v1 (BRM-API)",
   "description": "The original Drive endpoints in BRM-API, kept for older clients. Use `/drive/api/v2`."
  }
 ],
 "paths": {
  "/wopi/files/{id}": {
   "get": {
    "tags": [
     "Office editing"
    ],
    "summary": "File details for the editor (WOPI CheckFileInfo)",
    "operationId": "get-wopi-files-id",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "BaseFileName": {
           "type": "string"
          },
          "BreadcrumbDocName": {
           "type": "string"
          },
          "Size": {
           "type": "number"
          },
          "Version": {
           "type": "array",
           "items": {}
          },
          "LastModifiedTime": {},
          "OwnerId": {
           "type": "string"
          },
          "UserId": {
           "type": "string"
          },
          "UserFriendlyName": {
           "type": "string"
          },
          "UserCanWrite": {},
          "ReadOnly": {
           "type": "boolean"
          },
          "UserCanNotWriteRelative": {
           "type": "boolean"
          },
          "UserCanRename": {
           "type": "boolean"
          },
          "SupportsRename": {
           "type": "boolean"
          },
          "SupportsUpdate": {
           "type": "boolean"
          },
          "SupportsLocks": {
           "type": "boolean"
          },
          "PostMessageOrigin": {},
          "ClosePostMessage": {
           "type": "boolean"
          },
          "EnableInsertRemoteImage": {
           "type": "boolean"
          },
          "EnableShare": {
           "type": "boolean"
          },
          "IsAdminUser": {
           "type": "boolean"
          },
          "IsAnonymousUser": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Office editing"
    ],
    "summary": "Other editor requests (WOPI)",
    "operationId": "post-wopi-files-id",
    "description": "Locks, \"Save as\", rename: not offered (see CheckFileInfo).\n\nRequires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "File, page or redirect"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/wopi/files/{id}/contents": {
   "get": {
    "tags": [
     "Office editing"
    ],
    "summary": "File contents for the editor (WOPI GetFile)",
    "operationId": "get-wopi-files-id-contents",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "File, page or redirect"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Office editing"
    ],
    "summary": "Save from the editor (WOPI PutFile)",
    "operationId": "post-wopi-files-id-contents",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "LastModifiedTime": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/public/{token}": {
   "get": {
    "tags": [
     "Public share links"
    ],
    "summary": "Open a share link",
    "operationId": "get-api-public-token",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "token",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "item",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      },
      "description": "Inside a shared folder, the item to show."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "needs_password": {
           "type": "boolean"
          },
          "item": {},
          "path": {
           "type": "string"
          },
          "children": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/public/{token}/unlock": {
   "post": {
    "tags": [
     "Public share links"
    ],
    "summary": "Unlock a password-protected share link",
    "operationId": "post-api-public-token-unlock",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "token",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "That password isn't right"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "password": {
          "description": "The link's password."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/public/{token}/content": {
   "get": {
    "tags": [
     "Public share links"
    ],
    "summary": "Download from a share link",
    "operationId": "get-api-public-token-content",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "token",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "item",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "download",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     },
     "400": {
      "description": "Not a file"
     },
     "403": {
      "description": "Downloading is turned off for this link"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/public/{token}/thumb": {
   "get": {
    "tags": [
     "Public share links"
    ],
    "summary": "Thumbnail from a share link",
    "operationId": "get-api-public-token-thumb",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "token",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "item",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "s",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "File, page or redirect"
     },
     "404": {
      "description": "No thumbnail"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/sync/spaces": {
   "get": {
    "tags": [
     "Sync change feed"
    ],
    "summary": "Spaces you can sync",
    "operationId": "get-api-v2-sync-spaces",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/sync/changes": {
   "get": {
    "tags": [
     "Sync change feed"
    ],
    "summary": "Changes in a space since a cursor",
    "operationId": "get-api-v2-sync-changes",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "space",
      "in": "query",
      "required": false,
      "schema": {},
      "description": "The space (from `GET /api/v2/sync/spaces`)."
     },
     {
      "name": "cursor",
      "in": "query",
      "required": false,
      "schema": {},
      "description": "The cursor from the last answer (leave out the first time)."
     },
     {
      "name": "after",
      "in": "query",
      "required": false,
      "schema": {}
     },
     {
      "name": "wait",
      "in": "query",
      "required": false,
      "schema": {},
      "description": "Seconds to wait for a change before answering (long poll)."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/me": {
   "get": {
    "tags": [
     "Browse & search"
    ],
    "summary": "Who you are and your Drive settings",
    "operationId": "get-api-v2-me",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "user": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "name": {
             "type": "string"
            },
            "first_name": {
             "type": "string"
            },
            "email": {
             "type": "string"
            }
           }
          },
          "libraries": {
           "type": "array",
           "items": {}
          },
          "usage": {},
          "settings": {
           "type": "object",
           "properties": {
            "links_enabled": {
             "type": "boolean"
            },
            "link_max_days": {
             "type": "integer"
            },
            "trash_days": {
             "type": "integer"
            },
            "quick_share": {},
            "quick_share_max_days": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/usage": {
   "get": {
    "tags": [
     "Browse & search"
    ],
    "summary": "Your storage use",
    "operationId": "get-api-v2-usage",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/list": {
   "get": {
    "tags": [
     "Browse & search"
    ],
    "summary": "List a folder",
    "operationId": "get-api-v2-list",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "parent",
      "in": "query",
      "required": false,
      "schema": {},
      "description": "The folder's id. Leave out for the top of the space."
     },
     {
      "name": "parent_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "site",
      "in": "query",
      "required": false,
      "schema": {},
      "description": "A library's id. Leave out for your personal files."
     },
     {
      "name": "site_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/recent": {
   "get": {
    "tags": [
     "Browse & search"
    ],
    "summary": "Recent files",
    "operationId": "get-api-v2-recent",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {}
          },
          "locations": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/starred": {
   "get": {
    "tags": [
     "Browse & search"
    ],
    "summary": "Starred items",
    "operationId": "get-api-v2-starred",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {}
          },
          "locations": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/shared": {
   "get": {
    "tags": [
     "Browse & search"
    ],
    "summary": "Shared with you",
    "operationId": "get-api-v2-shared",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/shared-by-me": {
   "get": {
    "tags": [
     "Browse & search"
    ],
    "summary": "Shared by you",
    "operationId": "get-api-v2-shared-by-me",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {}
          },
          "locations": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/search": {
   "get": {
    "tags": [
     "Browse & search"
    ],
    "summary": "Search files and folders",
    "operationId": "get-api-v2-search",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": true,
      "schema": {},
      "description": "Text to search for in names."
     },
     {
      "name": "type",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "`file` or `folder`."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {}
          },
          "locations": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/items/{id}": {
   "get": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Get an item",
    "operationId": "get-api-v2-items-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "patch": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Rename an item",
    "operationId": "patch-api-v2-items-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "The new name."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/items/{id}/content": {
   "get": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Download a file",
    "operationId": "get-api-v2-items-id-content",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "v",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      },
      "description": "A version number (default the latest)."
     },
     {
      "name": "download",
      "in": "query",
      "required": false,
      "schema": {
       "type": "boolean"
      },
      "description": "`1` to download rather than open in the browser."
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     },
     "400": {
      "description": "Folders have no content — download them as a zip"
     },
     "404": {
      "description": "Version not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/items/{id}/thumb": {
   "get": {
    "tags": [
     "Files & folders"
    ],
    "summary": "A file's thumbnail",
    "operationId": "get-api-v2-items-id-thumb",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "s",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      },
      "description": "Size in pixels."
     }
    ],
    "responses": {
     "200": {
      "description": "File, page or redirect"
     },
     "404": {
      "description": "No thumbnail"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/items/{id}/star": {
   "post": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Star or unstar an item",
    "operationId": "post-api-v2-items-id-star",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "on": {
          "description": "`true` to star, `false` to unstar."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/items/{id}/versions": {
   "get": {
    "tags": [
     "Files & folders"
    ],
    "summary": "A file's versions",
    "operationId": "get-api-v2-items-id-versions",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/items/{id}/versions/{vid}/restore": {
   "post": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Restore an older version",
    "operationId": "post-api-v2-items-id-versions-vid-restore",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "vid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/items/{id}/versions/{vid}": {
   "delete": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Delete an older version",
    "operationId": "delete-api-v2-items-id-versions-vid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "vid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/items/{id}/activity": {
   "get": {
    "tags": [
     "Files & folders"
    ],
    "summary": "An item's activity",
    "operationId": "get-api-v2-items-id-activity",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "activity": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/items/{id}/sharing": {
   "get": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Who an item is shared with",
    "operationId": "get-api-v2-items-id-sharing",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/items/{id}/sharing/grants": {
   "post": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Share an item with a person or group",
    "operationId": "post-api-v2-items-id-sharing-grants",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "type": {
          "type": "string",
          "description": "`user` or `group`."
         },
         "id": {
          "type": "integer",
          "description": "The person's or group's id."
         },
         "role": {
          "description": "`viewer` or `editor`."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/items/{id}/sharing/grants/{gid}": {
   "patch": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Change someone's access to an item",
    "operationId": "patch-api-v2-items-id-sharing-grants-gid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "gid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "role": {
          "description": "`viewer` or `editor`."
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Stop sharing an item with someone",
    "operationId": "delete-api-v2-items-id-sharing-grants-gid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "gid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "removed_self": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/items/{id}/sharing/links": {
   "post": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Create a share link",
    "operationId": "post-api-v2-items-id-sharing-links",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "expires_days": {
          "type": "integer",
          "description": "Days until the link stops working (empty for never)."
         },
         "password": {
          "description": "A password people must enter (optional)."
         },
         "allow_download": {
          "type": "boolean",
          "description": "Let people download, not just view."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/items/{id}/sharing/links/{lid}": {
   "delete": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Delete a share link",
    "operationId": "delete-api-v2-items-id-sharing-links-lid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "lid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/quick-share": {
   "post": {
    "tags": [
     "Quick share"
    ],
    "summary": "Quick share: start (where to upload), then finish (expiry + link)",
    "operationId": "post-api-v2-quick-share",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "batch": {},
         "name": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/quick-share/{id}": {
   "post": {
    "tags": [
     "Quick share"
    ],
    "summary": "Change a quick share's link",
    "operationId": "post-api-v2-quick-share-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "days": {
          "type": "array",
          "items": {},
          "description": "Days until it expires."
         },
         "password": {
          "description": "A password (optional)."
         },
         "allow_download": {
          "type": "boolean",
          "description": "Let people download."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/items/{id}/keep": {
   "post": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Keep a file out of the bin's automatic clean-up",
    "operationId": "post-api-v2-items-id-keep",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/people": {
   "get": {
    "tags": [
     "Browse & search"
    ],
    "summary": "Find people and groups to share with",
    "operationId": "get-api-v2-people",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {},
      "description": "Name or email to search for."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "results": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/folders": {
   "post": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Create a folder",
    "operationId": "post-api-v2-folders",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "parent": {
          "description": "The folder to create it in."
         },
         "parent_id": {
          "type": "integer"
         },
         "site": {
          "description": "The library to create it in."
         },
         "site_id": {
          "type": "integer"
         },
         "name": {
          "type": "string",
          "description": "The folder's name."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/folders/ensure": {
   "post": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Make sure a folder path exists",
    "operationId": "post-api-v2-folders-ensure",
    "description": "Creates any missing folders along `path` (like `mkdir -p`) and returns the last one.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "parent": {},
         "parent_id": {
          "type": "integer"
         },
         "site": {},
         "site_id": {
          "type": "integer"
         },
         "path": {
          "type": "string",
          "description": "A path such as `Invoices/2026/November`."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/move": {
   "post": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Move items",
    "operationId": "post-api-v2-move",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "parent": {
          "description": "The folder to move them into."
         },
         "parent_id": {
          "type": "integer"
         },
         "site": {
          "description": "The library to move them into."
         },
         "site_id": {
          "type": "integer"
         },
         "ids": {
          "type": "array",
          "items": {},
          "description": "The items to move."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/copy": {
   "post": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Copy items",
    "operationId": "post-api-v2-copy",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "parent": {
          "description": "The folder to copy them into."
         },
         "parent_id": {
          "type": "integer"
         },
         "site": {
          "description": "The library to copy them into."
         },
         "site_id": {
          "type": "integer"
         },
         "ids": {
          "type": "array",
          "items": {},
          "description": "The items to copy."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/trash": {
   "post": {
    "tags": [
     "Bin"
    ],
    "summary": "Move items to the bin",
    "operationId": "post-api-v2-trash",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "ids": {
          "type": "array",
          "items": {},
          "description": "The items."
         }
        }
       }
      }
     }
    }
   },
   "get": {
    "tags": [
     "Bin"
    ],
    "summary": "List the bin",
    "operationId": "get-api-v2-trash",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "site",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "delete": {
    "tags": [
     "Bin"
    ],
    "summary": "Empty the bin",
    "operationId": "delete-api-v2-trash",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "site",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "deleted": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/trash/{id}/restore": {
   "post": {
    "tags": [
     "Bin"
    ],
    "summary": "Restore an item from the bin",
    "operationId": "post-api-v2-trash-id-restore",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/trash/{id}": {
   "delete": {
    "tags": [
     "Bin"
    ],
    "summary": "Delete an item for good",
    "operationId": "delete-api-v2-trash-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/zip": {
   "get": {
    "tags": [
     "Files & folders"
    ],
    "summary": "Download items as a zip",
    "operationId": "get-api-v2-zip",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "ids",
      "in": "query",
      "required": false,
      "schema": {
       "type": "array",
       "items": {}
      },
      "description": "Comma-separated item ids."
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     },
     "400": {
      "description": "Nothing to download"
     },
     "413": {
      "description": "That is more than 20 GB — download it in smaller parts"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/uploads/check": {
   "post": {
    "tags": [
     "Uploading"
    ],
    "summary": "Which of these names already exist in a folder (so the client can ask \"replace or keep both\" before uploading)",
    "operationId": "post-api-v2-uploads-check",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "existing": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "parent": {},
         "parent_id": {
          "type": "integer"
         },
         "site": {},
         "site_id": {
          "type": "integer"
         },
         "names": {
          "type": "array",
          "items": {}
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/upload": {
   "post": {
    "tags": [
     "Uploading"
    ],
    "summary": "Upload a small file",
    "operationId": "post-api-v2-upload",
    "description": "The request body is the file's bytes; everything else is in the query string.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "parent",
      "in": "query",
      "required": false,
      "schema": {},
      "description": "The folder to upload into."
     },
     {
      "name": "parent_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "site",
      "in": "query",
      "required": false,
      "schema": {},
      "description": "The library to upload into."
     },
     {
      "name": "site_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "name",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "The file name."
     },
     {
      "name": "conflict",
      "in": "query",
      "required": false,
      "schema": {},
      "description": "If the name is taken: `rename` (keep both) or `replace` (a new version)."
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/uploads": {
   "post": {
    "tags": [
     "Uploading"
    ],
    "summary": "Start a resumable upload",
    "operationId": "post-api-v2-uploads",
    "description": "Resumable: start, send parts (retry any), complete.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          },
          "part_size": {},
          "parts": {
           "type": "array",
           "items": {}
          },
          "received": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "size is required"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "size": {
          "type": "number",
          "description": "The file's size in bytes."
         },
         "name": {
          "type": "string",
          "description": "The file name."
         },
         "conflict": {
          "type": "string",
          "description": "`rename` or `replace`."
         },
         "type": {
          "type": "string",
          "description": "Its MIME type."
         },
         "part_size": {
          "type": "number",
          "description": "The size of each part you'll send."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/uploads/{uid}": {
   "get": {
    "tags": [
     "Uploading"
    ],
    "summary": "Which parts of an upload have arrived",
    "operationId": "get-api-v2-uploads-uid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "uid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          },
          "part_size": {},
          "parts": {
           "type": "array",
           "items": {}
          },
          "received": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "delete": {
    "tags": [
     "Uploading"
    ],
    "summary": "Abandon an upload",
    "operationId": "delete-api-v2-uploads-uid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "uid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/uploads/{uid}/parts/{n}": {
   "put": {
    "tags": [
     "Uploading"
    ],
    "summary": "Send one part of an upload",
    "operationId": "put-api-v2-uploads-uid-parts-n",
    "description": "The request body is the raw bytes of part `n` (numbered from 1).\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "uid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "n",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/uploads/{uid}/complete": {
   "post": {
    "tags": [
     "Uploading"
    ],
    "summary": "Finish a resumable upload",
    "operationId": "post-api-v2-uploads-uid-complete",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "uid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/libraries": {
   "get": {
    "tags": [
     "Libraries"
    ],
    "summary": "List libraries",
    "operationId": "get-api-v2-libraries",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "libraries": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Libraries"
    ],
    "summary": "Create a library",
    "operationId": "post-api-v2-libraries",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string",
          "description": "The library's name."
         },
         "description": {
          "type": "string",
          "description": "What it's for."
         },
         "color": {
          "description": "Hex colour, e.g. `#2563eb`."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/libraries/{id}": {
   "get": {
    "tags": [
     "Libraries"
    ],
    "summary": "Get a library",
    "operationId": "get-api-v2-libraries-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "patch": {
    "tags": [
     "Libraries"
    ],
    "summary": "Update a library",
    "operationId": "patch-api-v2-libraries-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "color": {}
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Libraries"
    ],
    "summary": "Delete a library",
    "operationId": "delete-api-v2-libraries-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/libraries/{id}/members": {
   "get": {
    "tags": [
     "Libraries"
    ],
    "summary": "A library's members",
    "operationId": "get-api-v2-libraries-id-members",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "put": {
    "tags": [
     "Libraries"
    ],
    "summary": "Add or change a library member",
    "operationId": "put-api-v2-libraries-id-members",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "type": {
          "type": "string",
          "description": "`user` or `group`."
         },
         "id": {
          "type": "number",
          "description": "The person's or group's id."
         },
         "role": {
          "description": "`viewer`, `editor` or `owner`."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/libraries/{id}/members/{type}/{mid}": {
   "delete": {
    "tags": [
     "Libraries"
    ],
    "summary": "Remove a library member",
    "operationId": "delete-api-v2-libraries-id-members-type-mid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "type",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "mid",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "left": {
           "type": "boolean"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/office/config": {
   "get": {
    "tags": [
     "Office editing"
    ],
    "summary": "Which Office apps you can use",
    "operationId": "get-api-v2-office-config",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/office/recent": {
   "get": {
    "tags": [
     "Office editing"
    ],
    "summary": "The Docs / Sheets / Slides start pages: that kind's files the person can reach (their drive, their libraries, shared with them), newest first",
    "operationId": "get-api-v2-office-recent",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "app",
      "in": "query",
      "required": false,
      "schema": {}
     },
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {}
          },
          "locations": {
           "type": "array",
           "items": {}
          },
          "licensed": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Unknown kind"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/office/{id}/session": {
   "post": {
    "tags": [
     "Office editing"
    ],
    "summary": "Opens a file in the editor: the URL to post to and the token to post",
    "operationId": "post-api-v2-office-id-session",
    "description": "Opens a file in the editor: the URL to post to and the token to post. Editors and owners edit; viewers (or ?mode=view) get it read-only.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "url": {
           "type": "string"
          },
          "access_token": {
           "type": "string"
          },
          "access_token_ttl": {},
          "write": {},
          "item": {},
          "path": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Only files can be opened"
     },
     "409": {
      "description": "This file is still being moved to new storage — try again later"
     },
     "503": {
      "description": "Office editing is not switched on"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "mode": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/office/new": {
   "post": {
    "tags": [
     "Office editing"
    ],
    "summary": "A new blank Word document, spreadsheet or presentation in a folder",
    "operationId": "post-api-v2-office-new",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Drive.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "400": {
      "description": "Choose a document, spreadsheet or presentation"
     },
     "503": {
      "description": "Office editing is not switched on"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "kind": {
          "type": "string"
         },
         "name": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/app/drive/items": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "List items in a folder",
    "operationId": "get-v1-app-drive-items",
    "description": "List items in a folder. Returns the caller's own files/folders (created_by = caller) directly under the given parent, or at the root when parent_id is omitted.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "parent_id",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "parent_id": {
              "type": "integer",
              "nullable": true
             },
             "type": {
              "type": "string",
              "enum": [
               "file",
               "folder"
              ]
             },
             "name": {
              "type": "string"
             },
             "mime_type": {
              "type": "string",
              "nullable": true
             },
             "size_bytes": {
              "type": "integer"
             },
             "created_by": {
              "type": "integer"
             },
             "created_at": {
              "type": "string",
              "format": "date-time"
             },
             "updated_at": {
              "type": "string",
              "format": "date-time"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/drive/recent": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "List the caller's 20 most recently updated files",
    "operationId": "get-v1-app-drive-recent",
    "description": "List the caller's 20 most recently updated files. Files only (not folders), most recently updated first.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "parent_id": {
              "type": "integer",
              "nullable": true
             },
             "type": {
              "type": "string",
              "enum": [
               "file",
               "folder"
              ]
             },
             "name": {
              "type": "string"
             },
             "mime_type": {
              "type": "string",
              "nullable": true
             },
             "size_bytes": {
              "type": "integer"
             },
             "updated_at": {
              "type": "string",
              "format": "date-time"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/drive/search": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Search the caller's items by name",
    "operationId": "get-v1-app-drive-search",
    "description": "Search the caller's items by name. Case-insensitive substring match on name, up to 50 results.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "parent_id": {
              "type": "integer",
              "nullable": true
             },
             "type": {
              "type": "string",
              "enum": [
               "file",
               "folder"
              ]
             },
             "name": {
              "type": "string"
             },
             "mime_type": {
              "type": "string",
              "nullable": true
             },
             "size_bytes": {
              "type": "integer"
             },
             "updated_at": {
              "type": "string",
              "format": "date-time"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/drive/quota": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Get the caller's personal storage quota and usage",
    "operationId": "get-v1-app-drive-quota",
    "description": "Get the caller's personal storage quota and usage. Quota is license-aware — the highest active \"base\" drive_products.personal_bytes plus any stackable \"addon\" products, falling back to a 10 GB default when the tenant has no drive licenses assigned.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "quota_bytes": {
           "type": "number"
          },
          "used_bytes": {
           "type": "number"
          },
          "license_name": {
           "type": "string"
          },
          "addons": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/drive/item/{id}/path": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Get the breadcrumb path to an item",
    "operationId": "get-v1-app-drive-item-id-path",
    "description": "Get the breadcrumb path to an item. Walks up parent_id (max 50 levels) from the item to the root, restricted to the caller's own items.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "path": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/drive/folder": {
   "post": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Create a folder. If parent_id is given it must be an existing, non-deleted item belonging to the caller's tenant",
    "operationId": "post-v1-app-drive-folder",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          },
          "name": {
           "type": "string"
          },
          "type": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Name required"
     },
     "404": {
      "description": "Parent folder not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "parent_id": {
          "type": "integer"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/app/drive/item/{id}": {
   "patch": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Rename an item. Only affects items owned (created_by) by the caller",
    "operationId": "patch-v1-app-drive-item-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Name required"
     },
     "404": {
      "description": "Not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Move an item to trash",
    "operationId": "delete-v1-app-drive-item-id",
    "description": "Move an item to trash. Soft delete (sets deleted_at). Only affects items owned by the caller.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/drive/item/{id}/move": {
   "post": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Move an item into a different folder",
    "operationId": "post-v1-app-drive-item-id-move",
    "description": "Move an item into a different folder. New parent (when given) must be an existing folder owned by the caller; a folder cannot be moved into itself.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Cannot move a folder into itself"
     },
     "404": {
      "description": "Target folder not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "parent_id": {
          "type": "integer"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/app/drive/trash": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "List the caller's trashed items",
    "operationId": "get-v1-app-drive-trash",
    "description": "List the caller's trashed items. Items with deleted_at set, most recently deleted first.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "items": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "type": {
              "type": "string",
              "enum": [
               "file",
               "folder"
              ]
             },
             "name": {
              "type": "string"
             },
             "mime_type": {
              "type": "string",
              "nullable": true
             },
             "size_bytes": {
              "type": "integer"
             },
             "deleted_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/drive/trash/restore/{id}": {
   "post": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Restore an item out of trash",
    "operationId": "post-v1-app-drive-trash-restore-id",
    "description": "Restore an item out of trash. Clears deleted_at. Only affects items owned by the caller that are currently trashed.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/drive/item/{id}/share": {
   "post": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Create a public share link for a file",
    "operationId": "post-v1-app-drive-item-id-share",
    "description": "Create a public share link for a file. Only files (not folders) owned by the caller can be shared. Generates a random 64-char share token.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "share_token": {
           "type": "string"
          },
          "share_url": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Only files can be shared"
     },
     "404": {
      "description": "Not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "expires_at": {
          "type": "string",
          "format": "date-time"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/app/drive/item/{id}/shares": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "List active share links for an item",
    "operationId": "get-v1-app-drive-item-id-shares",
    "description": "List active share links for an item. Only returns shares on items owned by the caller.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "shares": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/drive/share/{token}": {
   "delete": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Revoke a share link. Only affects shares on items owned by the caller",
    "operationId": "delete-v1-app-drive-share-token",
    "description": "Revoke a share link. Only affects shares on items owned by the caller. Silently succeeds even if the token doesn't match anything of the caller's.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`).",
    "parameters": [
     {
      "name": "token",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  }
 }
}