New-mail push (BRM-API)
The mail server tells BRM-API about new mail so it can send push notifications. Needs X-Mail-Hook-Key.
| Method | Path | Summary |
|---|---|---|
| POST | /v1/maildelivery/new | Tell Bramble about new mail (mail server only) |
#Tell Bramble about new mail (mail server only)
POST
/v1/maildelivery/new- Address
https://<your-org>.brambleit.cloud/api/v1/maildelivery/new- Requires
- None: public, or protected by a token in the address or body.
Request body JSON
| Name | Type | Description |
|---|---|---|
user | any | |
messages | array of any |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean | |
sent | integer |
Example response
JSON
{
"ok": true,
"sent": 1
}Errors
| Status | Message |
|---|---|
| 400 | user is required |
| 401 | Unauthorized |
Example request
Bash
curl -X POST 'https://<your-org>.brambleit.cloud/api/v1/maildelivery/new' \
-H "X-API-Key: $BRAMBLE_KEY" \
-H "Content-Type: application/json" \
-d '{"user":"…","messages":[]}'JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/api/v1/maildelivery/new', {
method: 'POST',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({"user":"…","messages":[]}),
});
const data = await res.json();Python
import os, requests
r = requests.post(
"https://<your-org>.brambleit.cloud/api/v1/maildelivery/new",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
json={"user":"…","messages":[]},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
$body = '{"user":"…","messages":[]}'
Invoke-RestMethod -Method POST -Uri 'https://<your-org>.brambleit.cloud/api/v1/maildelivery/new' -Headers $headers -ContentType 'application/json' -Body $bodyWas this page helpful?
Thanks for your feedback.