{
 "openapi": "3.0.3",
 "info": {
  "title": "Bramble Sites API",
  "version": "2026-11-13",
  "description": "Bramble Sites: team and communication sites with pages and news, members and roles, navigation and branding, and document libraries (which are Drive libraries managed by the site). Works with an API key.\n"
 },
 "servers": [
  {
   "url": "https://{org}.brambleit.cloud/sites",
   "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": "Home & search",
   "description": "Your sites home page, search, news across sites, and finding people."
  },
  {
   "name": "Sites",
   "description": "Create and change sites, members and roles, following, libraries, pages and news."
  },
  {
   "name": "Pages & news",
   "description": "A page's draft, publishing, versions, pinning and making it the site's home page."
  },
  {
   "name": "Page blocks",
   "description": "Data page blocks use (files, people, embed checks) and uploading images."
  },
  {
   "name": "Library files (Bramble Sync)",
   "description": "Older file routes Bramble Sync uses for site libraries. They pass straight through to Drive.\n"
  },
  {
   "name": "Legacy v1 (BRM-API)",
   "description": "The original Sites endpoints in BRM-API, before Sites v2. Use `/sites/api/v2`."
  }
 ],
 "paths": {
  "/api/upload/{siteId}": {
   "post": {
    "tags": [
     "Library files (Bramble Sync)"
    ],
    "summary": "Upload a file to a site library (Sync)",
    "operationId": "post-api-upload-siteid",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "siteId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/item/{itemId}/content": {
   "patch": {
    "tags": [
     "Library files (Bramble Sync)"
    ],
    "summary": "Replace a file's contents (Sync)",
    "operationId": "patch-api-item-itemid-content",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "itemId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/download/{itemId}": {
   "get": {
    "tags": [
     "Library files (Bramble Sync)"
    ],
    "summary": "Download a file (Sync)",
    "operationId": "get-api-download-itemid",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "itemId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/preview/{itemId}": {
   "get": {
    "tags": [
     "Library files (Bramble Sync)"
    ],
    "summary": "Preview a file (Sync)",
    "operationId": "get-api-preview-itemid",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "itemId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/trash/{itemId}": {
   "delete": {
    "tags": [
     "Library files (Bramble Sync)"
    ],
    "summary": "Move a file to the bin (Sync)",
    "operationId": "delete-api-trash-itemid",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "itemId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/site/{siteId}/trash": {
   "delete": {
    "tags": [
     "Library files (Bramble Sync)"
    ],
    "summary": "Empty a site library's bin (Sync)",
    "operationId": "delete-api-site-siteid-trash",
    "description": "Requires: None: public, or protected by a token in the address or body.",
    "parameters": [
     {
      "name": "siteId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/me": {
   "get": {
    "tags": [
     "Home & search"
    ],
    "summary": "Who you are: the signed-in person and what they can do here",
    "operationId": "get-api-v2-me",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "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"
            }
           }
          },
          "can_create": {
           "type": "boolean"
          },
          "colors": {
           "type": "array",
           "items": {}
          },
          "icons": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/home": {
   "get": {
    "tags": [
     "Home & search"
    ],
    "summary": "Your sites home page",
    "operationId": "get-api-v2-home",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "following": {
           "type": "array",
           "items": {}
          },
          "member_of": {
           "type": "array",
           "items": {}
          },
          "discover": {
           "type": "array",
           "items": {}
          },
          "news": {},
          "news_scope": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/sites": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "List sites you can see",
    "operationId": "get-api-v2-sites",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {},
      "description": "Text to search site names for."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sites": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Sites"
    ],
    "summary": "Create a site",
    "operationId": "post-api-v2-sites",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "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 site's name."
         },
         "description": {
          "type": "string"
         },
         "type": {
          "type": "string",
          "description": "`team` (members work together, the default) or `communication` (a few publish to many)."
         },
         "privacy": {
          "description": "`private` (members only) or `org` (everyone in the organisation can read it). Defaults to `private` for team sites and `org` for communication sites."
         },
         "color": {
          "description": "Hex colour."
         },
         "icon": {
          "description": "Icon name."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/search": {
   "get": {
    "tags": [
     "Home & search"
    ],
    "summary": "Search sites and pages",
    "operationId": "get-api-v2-search",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/news": {
   "get": {
    "tags": [
     "Home & search"
    ],
    "summary": "News from your sites",
    "operationId": "get-api-v2-news",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "scope",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "`following` (sites you follow) or `org` (every site you can read, the default)."
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "offset",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "news": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/people": {
   "get": {
    "tags": [
     "Home & search"
    ],
    "summary": "Find people",
    "operationId": "get-api-v2-people",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "q",
      "in": "query",
      "required": false,
      "schema": {}
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "results": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/sites/{ref}": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "Get a site",
    "operationId": "get-api-v2-sites-ref",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "ref",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/sites/{id}": {
   "patch": {
    "tags": [
     "Sites"
    ],
    "summary": "Update a site",
    "operationId": "patch-api-v2-sites-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "400": {
      "description": "Give the site a name"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "color": {},
         "icon": {},
         "header": {
          "type": "string",
          "enum": [
           "standard",
           "compact",
           "banner"
          ],
          "description": "Header settings."
         },
         "privacy": {
          "type": "string"
         },
         "type": {
          "type": "string"
         },
         "nav": {
          "description": "The site's navigation links."
         },
         "slug": {
          "type": "string",
          "description": "The site's address."
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Sites"
    ],
    "summary": "Delete a site",
    "operationId": "delete-api-v2-sites-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "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/sites/{id}/follow": {
   "post": {
    "tags": [
     "Sites"
    ],
    "summary": "Follow or unfollow a site",
    "operationId": "post-api-v2-sites-id-follow",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "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": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/sites/{id}/members": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "A site's members",
    "operationId": "get-api-v2-sites-id-members",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "put": {
    "tags": [
     "Sites"
    ],
    "summary": "Add or change a member",
    "operationId": "put-api-v2-sites-id-members",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "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": "`owner`, `editor` or `viewer`."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/sites/{id}/members/{type}/{pid}": {
   "delete": {
    "tags": [
     "Sites"
    ],
    "summary": "Remove a member",
    "operationId": "delete-api-v2-sites-id-members-type-pid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "type",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "pid",
      "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/sites/{id}/libraries": {
   "post": {
    "tags": [
     "Sites"
    ],
    "summary": "Add a document library",
    "operationId": "post-api-v2-sites-id-libraries",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/sites/{id}/libraries/{lid}": {
   "patch": {
    "tags": [
     "Sites"
    ],
    "summary": "Rename a document library",
    "operationId": "patch-api-v2-sites-id-libraries-lid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "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": {
         "type": "object",
         "properties": {
          "libraries": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   },
   "delete": {
    "tags": [
     "Sites"
    ],
    "summary": "Delete a document library",
    "operationId": "delete-api-v2-sites-id-libraries-lid",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "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": {
         "type": "object",
         "properties": {
          "libraries": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/sites/{id}/pages": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "A site's pages",
    "operationId": "get-api-v2-sites-id-pages",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "kind",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "description": "`page` or `news`."
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Sites"
    ],
    "summary": "Create a page or news post",
    "operationId": "post-api-v2-sites-id-pages",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "title": {
          "type": "string"
         },
         "kind": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/sites/{ref}/page/{slug}": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "Get a page by its address",
    "operationId": "get-api-v2-sites-ref-page-slug",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "ref",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "slug",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/sites/{id}/news": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "A site's news",
    "operationId": "get-api-v2-sites-id-news",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "offset",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "news": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/pages/{id}": {
   "get": {
    "tags": [
     "Pages & news"
    ],
    "summary": "Get a page",
    "operationId": "get-api-v2-pages-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "delete": {
    "tags": [
     "Pages & news"
    ],
    "summary": "Delete a page",
    "operationId": "delete-api-v2-pages-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "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/pages/{id}/draft": {
   "put": {
    "tags": [
     "Pages & news"
    ],
    "summary": "Save a page's draft",
    "operationId": "put-api-v2-pages-id-draft",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     },
     "400": {
      "description": "Give it a title"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "content": {
          "description": "The page's blocks."
         },
         "banner_asset_id": {
          "type": "number",
          "description": "A banner image (from the image upload)."
         },
         "title": {
          "type": "string",
          "description": "Its title."
         },
         "summary": {
          "description": "Its summary (for news)."
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/pages/{id}/publish": {
   "post": {
    "tags": [
     "Pages & news"
    ],
    "summary": "Publish a page's draft",
    "operationId": "post-api-v2-pages-id-publish",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/pages/{id}/discard": {
   "post": {
    "tags": [
     "Pages & news"
    ],
    "summary": "Throw away a page's draft",
    "operationId": "post-api-v2-pages-id-discard",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/pages/{id}/home": {
   "post": {
    "tags": [
     "Pages & news"
    ],
    "summary": "Make a page the site's home page",
    "operationId": "post-api-v2-pages-id-home",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "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/pages/{id}/pin": {
   "post": {
    "tags": [
     "Pages & news"
    ],
    "summary": "Pin or unpin a news post",
    "operationId": "post-api-v2-pages-id-pin",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "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": {}
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/pages/{id}/versions": {
   "get": {
    "tags": [
     "Pages & news"
    ],
    "summary": "A page's published versions",
    "operationId": "get-api-v2-pages-id-versions",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "versions": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/pages/{id}/versions/{vid}/restore": {
   "post": {
    "tags": [
     "Pages & news"
    ],
    "summary": "Restore a published version",
    "operationId": "post-api-v2-pages-id-versions-vid-restore",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "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/sites/{id}/blocks/files": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "Files for a Files block",
    "operationId": "get-api-v2-sites-id-blocks-files",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "library",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "folder",
      "in": "query",
      "required": false,
      "schema": {
       "type": "number"
      }
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/blocks/people": {
   "get": {
    "tags": [
     "Page blocks"
    ],
    "summary": "People for a People block",
    "operationId": "get-api-v2-blocks-people",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "ids",
      "in": "query",
      "required": false,
      "schema": {
       "type": "array",
       "items": {}
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "people": {}
         }
        }
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/blocks/embed-check": {
   "post": {
    "tags": [
     "Page blocks"
    ],
    "summary": "Can this address be embedded?",
    "operationId": "post-api-v2-blocks-embed-check",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "src": {}
         }
        }
       }
      }
     },
     "400": {
      "description": "That link can't be embedded. Use a YouTube, Vimeo, Loom, Google Maps/Docs or Microsoft Forms link."
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/api/v2/sites/{id}/libraries/{lid}/folders": {
   "get": {
    "tags": [
     "Sites"
    ],
    "summary": "Folders of a site library, for the Files block's folder picker",
    "operationId": "get-api-v2-sites-id-libraries-lid-folders",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "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": {
         "type": "object",
         "properties": {
          "folders": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "parent_id": {
              "type": "integer",
              "nullable": true
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "404": {
      "description": "Library not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/sites/{id}/assets": {
   "post": {
    "tags": [
     "Sites"
    ],
    "summary": "Upload an image",
    "operationId": "post-api-v2-sites-id-assets",
    "description": "The request body is the image's bytes; `X-Filename` names it. Images are re-encoded before they're stored.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {}
       }
      }
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/api/v2/assets/{id}": {
   "get": {
    "tags": [
     "Page blocks"
    ],
    "summary": "Get an image",
    "operationId": "get-api-v2-assets-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "number"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     },
     "404": {
      "description": "Image not found"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/sites": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "List sites the caller is a member of",
    "operationId": "get-v1-app-sites",
    "description": "List sites the caller is a member of. Includes the caller's role on each site, current usage, and member count.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "sites": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "description": {
              "type": "string",
              "nullable": true
             },
             "created_at": {
              "type": "string",
              "format": "date-time",
              "nullable": true
             },
             "role": {
              "type": "string",
              "enum": [
               "owner",
               "editor",
               "viewer"
              ],
              "nullable": true
             },
             "used_bytes": {},
             "member_count": {
              "type": "boolean"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Create a site. Creator is automatically added as a drive_site_members row with role owner",
    "operationId": "post-v1-app-sites",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          },
          "name": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Name required"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "name": {
          "type": "string"
         },
         "description": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  },
  "/v1/app/sites/{id}": {
   "delete": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Soft-delete a site. Requires owner role on the site (drive_site_members)",
    "operationId": "delete-v1-app-sites-id",
    "description": "Requires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Not authorised"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/sites/{id}/quota": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Get a site's storage usage against the tenant's shared site-storage pool",
    "operationId": "get-v1-app-sites-id-quota",
    "description": "Get a site's storage usage against the tenant's shared site-storage pool. Requires any membership (viewer or above) on the site. Sites don't have their own per-site quota — they draw from a tenant-wide shared pool sized from drive_licenses' shared_bytes.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "site_used_bytes": {
           "type": "number"
          },
          "pool_bytes": {
           "type": "integer"
          },
          "pool_used_bytes": {
           "type": "integer"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Not a member"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/sites/{id}/items": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "List items in a site folder",
    "operationId": "get-v1-app-sites-id-items",
    "description": "List items in a site folder. Requires any membership on the site.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "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"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Not a member"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/sites/{id}/item/{itemId}/path": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Get the breadcrumb path to an item within a site",
    "operationId": "get-v1-app-sites-id-item-itemid-path",
    "description": "Get the breadcrumb path to an item within a site. Requires any membership on the site. Walks up parent_id (max 50 levels) to the site root.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "itemId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "path": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Not a member"
     },
     "404": {
      "description": "Not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/sites/{id}/folder": {
   "post": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Create a folder within a site",
    "operationId": "post-v1-app-sites-id-folder",
    "description": "Create a folder within a site. Requires editor or owner role on the site.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "id": {
           "type": "integer"
          },
          "name": {
           "type": "string"
          },
          "type": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Name required"
     },
     "403": {
      "description": "Not authorised"
     },
     "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/sites/{id}/item/{itemId}": {
   "patch": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Rename an item within a site",
    "operationId": "patch-v1-app-sites-id-item-itemid",
    "description": "Rename an item within a site. Requires editor or owner role on the site.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "itemId",
      "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"
     },
     "403": {
      "description": "Not authorised"
     },
     "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": "Soft-delete an item within a site",
    "operationId": "delete-v1-app-sites-id-item-itemid",
    "description": "Soft-delete an item within a site. Requires editor or owner role on the site.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "itemId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Not authorised"
     },
     "404": {
      "description": "Not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/sites/{id}/item/{itemId}/move": {
   "post": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Move an item into a different folder within a site",
    "operationId": "post-v1-app-sites-id-item-itemid-move",
    "description": "Move an item into a different folder within a site. Requires editor or owner role on the site. Target folder (when given) must exist in the same site; the move is also blocked if the target is a descendant of the item being moved (would orphan the branch).\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "itemId",
      "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"
     },
     "403": {
      "description": "Not authorised"
     },
     "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/sites/{id}/trash": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "List trashed items within a site",
    "operationId": "get-v1-app-sites-id-trash",
    "description": "List trashed items within a site. Requires any membership on the site.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "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
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Not a member"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/sites/{id}/trash/restore/{itemId}": {
   "post": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Restore an item out of trash within a site",
    "operationId": "post-v1-app-sites-id-trash-restore-itemid",
    "description": "Restore an item out of trash within a site. Requires editor or owner role on the site.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "itemId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Not authorised"
     },
     "404": {
      "description": "Not found"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/sites/{id}/members": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "List a site's members",
    "operationId": "get-v1-app-sites-id-members",
    "description": "List a site's members. Requires any membership on the site. Ordered owner, then editor, then viewer.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "members": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Not a member"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   },
   "post": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Add or update a site member",
    "operationId": "post-v1-app-sites-id-members",
    "description": "Add or update a site member. Requires owner role on the site. Target user must be a staff user in the caller's tenant. If the user is already a member their role is updated (upsert on site_id+user_id).\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     }
    ],
    "responses": {
     "201": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "user_id required"
     },
     "403": {
      "description": "Not authorised"
     },
     "404": {
      "description": "User not found in tenant"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "user_id": {
          "type": "integer"
         },
         "role": {
          "type": "string",
          "description": "Default \"viewer\"."
         }
        },
        "required": [
         "user_id"
        ]
       }
      }
     }
    }
   }
  },
  "/v1/app/sites/{id}/member/{targetUserId}": {
   "delete": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Remove a member from a site",
    "operationId": "delete-v1-app-sites-id-member-targetuserid",
    "description": "Remove a member from a site. Requires owner role on the site. An owner cannot remove themselves this way.\n\nRequires: Signed-in session, `X-API-Key`, or a Bramble app access token (`Authorization: Bearer`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "name": "targetUserId",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Success",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Cannot remove yourself from site"
     },
     "403": {
      "description": "Not authorised"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  },
  "/v1/app/sites/{id}/search": {
   "get": {
    "tags": [
     "Legacy v1 (BRM-API)"
    ],
    "summary": "Search a site's items by name",
    "operationId": "get-v1-app-sites-id-search",
    "description": "Search a site's items by name. Requires any membership on the site. 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`). Licence: Sites.",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      }
     },
     {
      "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"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "403": {
      "description": "Not a member"
     },
     "500": {
      "description": "Internal Server Error"
     }
    },
    "security": [
     {
      "apiKey": []
     },
     {
      "session": []
     },
     {
      "bearer": []
     }
    ]
   }
  }
 }
}