Mail intake
Mailboxes Paper checks, and the rules that file their attachments into cabinets.
| Method | Path | Summary |
|---|---|---|
| GET | /api/mail | Mail accounts and rules |
| POST | /api/mail/accounts | Add a mailbox to check |
| PATCH | /api/mail/accounts/:id | Update a mailbox |
| DELETE | /api/mail/accounts/:id | Remove a mailbox |
| POST | /api/mail/accounts/:id/test | Signs in and returns the folders |
| POST | /api/mail/accounts/:id/check | Check a mailbox now |
| POST | /api/mail/rules | Create a mail rule |
| PATCH | /api/mail/rules/:id | Update a mail rule |
| DELETE | /api/mail/rules/:id | Delete a mail rule |
#Mail accounts and rules
GET
/api/mail- Address
https://<your-org>.brambleit.cloud/paper/api/mail- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Response 200
| Field | Type | Description |
|---|---|---|
accounts | array of any | |
rules | array of object | |
rules[].tag_ids | array of any | |
rules[].enabled | boolean | |
log | array of any |
Example response
JSON
{
"accounts": [],
"rules": [
{
"…r": "…",
"tag_ids": [],
"enabled": true
}
],
"log": []
}Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/mail', {
method: 'GET',
credentials: 'include',
});
const data = await res.json();#Add a mailbox to check
POST
/api/mail/accountsPublic mail servers only; private network addresses are refused.
- Address
https://<your-org>.brambleit.cloud/paper/api/mail/accounts- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Request body JSON
| Name | Type | Description |
|---|---|---|
port | number | |
secure | any | |
allow_self_signed | any | |
enabled | boolean | |
password | string |
Response 201
Errors
| Status | Message |
|---|---|
| 400 | Enter the … |
| 400 | Enter a port between 1 and 65535 |
| 400 | Enter the password |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/mail/accounts', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"port":12.5,"secure":"…","allow_self_signed":"…","enabled":true,"password":"…"}),
});
const data = await res.json();#Update a mailbox
PATCH
/api/mail/accounts/:id- Address
https://<your-org>.brambleit.cloud/paper/api/mail/accounts/: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 |
|---|---|---|
port | number | |
secure | any | |
allow_self_signed | any | |
enabled | boolean | |
password | string |
Response 200
Errors
| Status | Message |
|---|---|
| 400 | Enter the … |
| 400 | Enter a port between 1 and 65535 |
| 400 | Enter the password |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/mail/accounts/42', {
method: 'PATCH',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"port":12.5,"secure":"…","allow_self_signed":"…","enabled":true,"password":"…"}),
});
const data = await res.json();#Remove a mailbox
DELETE
/api/mail/accounts/:id- Address
https://<your-org>.brambleit.cloud/paper/api/mail/accounts/: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/mail/accounts/42', {
method: 'DELETE',
credentials: 'include',
});
const data = await res.json();#Signs in and returns the folders
POST
/api/mail/accounts/:id/test- Address
https://<your-org>.brambleit.cloud/paper/api/mail/accounts/:id/test- 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 | |
folders | boolean |
Example response
JSON
{
"ok": true,
"folders": false
}Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/mail/accounts/42/test', {
method: 'POST',
credentials: 'include',
});
const data = await res.json();#Check a mailbox now
POST
/api/mail/accounts/:id/check- Address
https://<your-org>.brambleit.cloud/paper/api/mail/accounts/:id/check- 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/mail/accounts/42/check', {
method: 'POST',
credentials: 'include',
});
const data = await res.json();#Create a mail rule
POST
/api/mail/rules- Address
https://<your-org>.brambleit.cloud/paper/api/mail/rules- Requires
- Signed-in browser session (the
sso_session/session_idcookies from Bramble sign-in).
Licence: Paper.
Request body JSON
| Name | Type | Description |
|---|---|---|
account_id | integer |
Response 201
| Field | Type | Description |
|---|---|---|
id | integer |
Example response
JSON
{
"id": 42
}Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/mail/rules', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"account_id":7}),
});
const data = await res.json();#Update a mail rule
PATCH
/api/mail/rules/:id- Address
https://<your-org>.brambleit.cloud/paper/api/mail/rules/: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 |
|---|---|---|
name | string | |
cabinet_id | integer | |
enabled | boolean | |
sort | number | |
max_age_days | number | |
title_from | string | |
correspondent_mode | string: "match" | "sender" | "set" | |
action | string: "read" | "flag" | "move" | "delete" | "none" | |
tag_ids | array of any | |
correspondent_id | integer | |
doctype_id | integer | |
action_folder | any |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean |
Example response
JSON
{
"ok": true
}Errors
| Status | Message |
|---|---|
| 400 | Give the rule a name |
| 400 | Choose the folder to move emails to |
Example request
JavaScript
// From a page served by Bramble (uses the signed-in session)
const res = await fetch('/paper/api/mail/rules/42', {
method: 'PATCH',
credentials: 'include',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({"name":"Example name","cabinet_id":7,"enabled":true,"sort":12.5,"max_age_days":12.5,"title_from":"Example title from","correspondent_mode":"match","action":"read","tag_ids":[],"correspondent_id":7,"doctype_id":7,"action_folder":"…"}),
});
const data = await res.json();#Delete a mail rule
DELETE
/api/mail/rules/:id- Address
https://<your-org>.brambleit.cloud/paper/api/mail/rules/: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/mail/rules/42', {
method: 'DELETE',
credentials: 'include',
});
const data = await res.json();Was this page helpful?
Thanks for your feedback.