Documents
Searching and listing documents, one document, its file and thumbnail, editing, bulk changes, reprocessing, locked PDFs, sharing links, and saved views.
| Method | Path | Summary |
|---|---|---|
| GET | /api/me | Who you are: the signed-in person and what they can do here |
| GET | /api/documents | Search and list documents |
| GET | /api/documents/:id | Get a document |
| PATCH | /api/documents/:id | Update a document |
| DELETE | /api/documents/:id | Delete a document |
| POST | /api/documents/bulk | Change many documents at once |
| POST | /api/documents/:id/reprocess | Read a document's text again |
| GET | /api/documents/:id/file | The file itself, streamed from Drive (Range passed on, for PDF.js) |
| POST | /api/documents/:id/unlock | Unlock a password-protected PDF |
| GET | /api/documents/:id/thumb | A document's thumbnail |
| GET | /api/documents/:id/sharing | Sharing is Drive's: links (with expiry, password, download switch) and people/groups |
| POST | /api/documents/:id/links | Create a share link |
| DELETE | /api/documents/:id/links/:lid | Delete a share link |
| POST | /api/upload | Add a document |
| POST | /api/views | Save a view (filters) |
| DELETE | /api/views/:id | Delete a saved view |
#Who you are: the signed-in person and what they can do here
GET
/api/me- Address
https://<your-org>.brambleit.cloud/paper/api/me- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Response 200
| Field | Type | Description |
|---|---|---|
user | object | |
user.id | integer | |
user.name | string | |
user.first_name | string | |
user.email | string | |
cabinets | array of any | |
tags | array of any | |
correspondents | array of any | |
doctypes | array of any | |
inbox | any | |
locked | any | |
views | array of object | |
views[].id | integer, or null | |
views[].name | string | |
views[].filters | array of any |
Example response
JSON
{
"user": {
"id": 42,
"name": "Example name",
"first_name": "Alex",
"email": "alex@example.com"
},
"cabinets": [],
"tags": [],
"correspondents": [],
"doctypes": [],
"inbox": null,
"locked": null,
"views": [
{
"id": 42,
"name": "Example name",
"filters": []
}
]
}Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/me', {
method: 'GET',
credentials: 'include',
});
const data = await res.json();#Search and list documents
GET
/api/documents- Address
https://<your-org>.brambleit.cloud/paper/api/documents- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Query parameters
| Name | Type | Description |
|---|---|---|
sort | string | Sort order (e.g. date, added, title). |
limit | number | How many. |
offset | number | Where to start. |
Response 200
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/documents', {
method: 'GET',
credentials: 'include',
});
const data = await res.json();#Get a document
GET
/api/documents/:id- Address
https://<your-org>.brambleit.cloud/paper/api/documents/:id- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | integer |
Response 200
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/documents/42', {
method: 'GET',
credentials: 'include',
});
const data = await res.json();#Update a document
PATCH
/api/documents/:id- Address
https://<your-org>.brambleit.cloud/paper/api/documents/:id- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | integer |
Request body JSON
| Name | Type | Description |
|---|---|---|
title | string | Its title. |
date | string (date) | Its date. |
correspondent_id | integer | Who it's from. |
doctype_id | integer | What kind of document it is. |
notes | string | Notes (stored encrypted). |
asn | string | Archive serial number. |
tag_ids | array of any | Its tags. |
Response 200
Errors
| Status | Message |
|---|---|
| 400 | Give the document a title |
| 400 | That isn’t a date |
| 400 | The archive number must be a whole number |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/documents/42', {
method: 'PATCH',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"title":"Example title","date":"2026-11-12","correspondent_id":7,"doctype_id":7,"notes":"string","asn":"string","tag_ids":[]}),
});
const data = await res.json();#Delete a document
DELETE
/api/documents/:id- Address
https://<your-org>.brambleit.cloud/paper/api/documents/:id- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | integer |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean |
Example response
JSON
{
"ok": true
}Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/documents/42', {
method: 'DELETE',
credentials: 'include',
});
const data = await res.json();#Change many documents at once
POST
/api/documents/bulk- Address
https://<your-org>.brambleit.cloud/paper/api/documents/bulk- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Request body JSON
| Name | Type | Description |
|---|---|---|
all | any | |
filters | array of any | |
ids | array of any | The documents (or all with filters). |
op | string | add_tags, remove_tags, set_correspondent, set_doctype, checked, reprocess or delete. |
value | any | The tags, correspondent or type to set. |
Response 200
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/documents/bulk', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"all":"…","filters":[],"ids":[],"op":"string","value":"…"}),
});
const data = await res.json();#Read a document's text again
POST
/api/documents/:id/reprocess- Address
https://<your-org>.brambleit.cloud/paper/api/documents/:id/reprocess- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | number |
Response 200
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/documents/12.5/reprocess', {
method: 'POST',
credentials: 'include',
});
const data = await res.json();#The file itself, streamed from Drive (Range passed on, for PDF.js)
GET
/api/documents/:id/fileThe file itself, streamed from Drive (Range passed on, for PDF.js). The document as a PDF: Paper's PDF copy when there is one (photos, scans, text, unlocked PDFs), otherwise the file itself. ?original=1 always gives the file as it was added. ?download=1 saves rather than opens.
- Address
https://<your-org>.brambleit.cloud/paper/api/documents/:id/file- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | integer |
Query parameters
| Name | Type | Description |
|---|---|---|
original | any | |
download | any |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/documents/42/file', {
method: 'GET',
credentials: 'include',
});
const data = await res.json();#Unlock a password-protected PDF
POST
/api/documents/:id/unlockA locked PDF: try a password now. { password, remember } — remember keeps it for the cabinet, and every other locked PDF there gets another go.
- Address
https://<your-org>.brambleit.cloud/paper/api/documents/:id/unlock- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | integer |
Request body JSON
| Name | Type | Description |
|---|---|---|
password | any | The PDF's password. |
remember | any | Save the password for this cabinet. |
label | string | A name for the saved password. |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean | |
retried | any |
Example response
JSON
{
"ok": true,
"retried": null
}Errors
| Status | Message |
|---|---|
| 400 | Enter the password |
| 400 | That password didn’t open it |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/documents/42/unlock', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"password":"…","remember":"…","label":"Example label"}),
});
const data = await res.json();#A document's thumbnail
GET
/api/documents/:id/thumb- Address
https://<your-org>.brambleit.cloud/paper/api/documents/:id/thumb- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | integer |
Response
An empty body, a body.
Errors
| Status | Message |
|---|---|
| 404 | No preview |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/documents/42/thumb', {
method: 'GET',
credentials: 'include',
});
const data = await res.json();#Sharing is Drive's: links (with expiry, password, download switch) and people/groups
GET
/api/documents/:id/sharing- Address
https://<your-org>.brambleit.cloud/paper/api/documents/:id/sharing- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | integer |
Response 200
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/documents/42/sharing', {
method: 'GET',
credentials: 'include',
});
const data = await res.json();#Create a share link
POST
/api/documents/:id/links- Address
https://<your-org>.brambleit.cloud/paper/api/documents/:id/links- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | integer |
Request body JSON
| Name | Type | Description |
|---|---|---|
expires_days | integer | |
password | any | |
allow_download | boolean |
Response 200
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/documents/42/links', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"expires_days":1,"password":"…","allow_download":false}),
});
const data = await res.json();#Delete a share link
DELETE
/api/documents/:id/links/:lid- Address
https://<your-org>.brambleit.cloud/paper/api/documents/:id/links/:lid- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | integer | |
lidrequired | number |
Response 200
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/documents/42/links/12.5', {
method: 'DELETE',
credentials: 'include',
});
const data = await res.json();#Add a document
POST
/api/uploadThe request body is the file's bytes.
- Address
https://<your-org>.brambleit.cloud/paper/api/upload- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Query parameters
| Name | Type | Description |
|---|---|---|
cabinet | any | The cabinet. |
name | string | The file name. |
Response duplicate ? 200 : 201
| Field | Type | Description |
|---|---|---|
duplicate | any |
Example response
JSON
{
"…await documents.get(req.": "…",
"duplicate": null
}Errors
| Status | Message |
|---|---|
| 411 | Content-Length is required |
| 413 | Files can be up to 500 MB |
| 400 | The file needs a name |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/upload', {
method: 'POST',
credentials: 'include',
});
const data = await res.json();#Save a view (filters)
POST
/api/views- Address
https://<your-org>.brambleit.cloud/paper/api/views- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Request body JSON
| Name | Type | Description |
|---|---|---|
name | string | |
filters | array of any |
Response 201
| Field | Type | Description |
|---|---|---|
id | integer |
Example response
JSON
{
"id": 42
}Errors
| Status | Message |
|---|---|
| 400 | Give the view a name |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/views', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"name":"Example name","filters":[]}),
});
const data = await res.json();#Delete a saved view
DELETE
/api/views/:id- Address
https://<your-org>.brambleit.cloud/paper/api/views/:id- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | number |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean |
Example response
JSON
{
"ok": true
}Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/views/12.5', {
method: 'DELETE',
credentials: 'include',
});
const data = await res.json();Was this page helpful?
Thanks for your feedback.