bulkmail/v1
Campaigns to many recipients, sent at a pace the app's mail account can take. Campaigns are records in the
provider's collection, created and edited with PocketBase's records API; this contract runs them. The list of
addresses never to mail is mail.suppression/v1; providers' bounce and
complaint reports are mail.feedback/v1.
A wire contract (bulkmail.go).
Use
| Operation |
HTTP (POST) |
Body |
Token scope |
| Count |
/api/_c/bulkmail/v1/count |
{"audience": {...}} |
bulkmail:read |
| Start |
/api/_c/bulkmail/v1/start |
{"campaign": "<id>", "limit": 0} |
bulkmail |
| Pause, Resume, Cancel |
/api/_c/bulkmail/v1/pause (resume, cancel) |
{"campaign": "<id>"} |
bulkmail |
| Preview |
/api/_c/bulkmail/v1/preview |
{"campaign": "<id>", "email": ""} |
bulkmail:read |
| Test |
/api/_c/bulkmail/v1/test |
{"campaign": "<id>", "to": ""} |
bulkmail |
Campaign actions answer {"campaign": <the record>}. The audience's shape is the provider's (see
Bulk Mail). Only superusers may call these. Agents get them as MCP tools
(bulkmail_start, ...); pb_hooks can hook each (onBulkmailStart).
Provide
Implement bulkmailv1.Campaigns and provide it in your extension's Register.
Commands and APIs
Every operation is a REST endpoint, a pocketone command and an MCP tool, all generated from the contract and behind the same token scope check and hooks. See Remote CLI, or the full CLI, Extension APIs and MCP references.
count
Says how many recipients an audience reaches, how many of them are suppressed, and a few sample addresses.
|
|
| REST |
POST /api/_c/bulkmail/v1/count |
| CLI |
pocketone remote bulkmail count --audience <json> |
| MCP |
bulkmail_count |
| Token scope |
bulkmail:read |
| Input field |
Flag |
Type |
audience |
--audience |
json |
start
Queues a campaign's recipients and starts sending (Limit > 0: at most that many new recipients).
|
|
| REST |
POST /api/_c/bulkmail/v1/start |
| CLI |
pocketone remote bulkmail start --campaign <value> --limit <n> |
| MCP |
bulkmail_start |
| Token scope |
bulkmail |
| Input field |
Flag |
Type |
campaign |
--campaign |
string |
limit |
--limit |
int |
pause
Stops sending a campaign; Resume carries on.
|
|
| REST |
POST /api/_c/bulkmail/v1/pause |
| CLI |
pocketone remote bulkmail pause --campaign <value> |
| MCP |
bulkmail_pause |
| Token scope |
bulkmail |
| Input field |
Flag |
Type |
campaign |
--campaign |
string |
resume
Carries on sending a paused campaign.
|
|
| REST |
POST /api/_c/bulkmail/v1/resume |
| CLI |
pocketone remote bulkmail resume --campaign <value> |
| MCP |
bulkmail_resume |
| Token scope |
bulkmail |
| Input field |
Flag |
Type |
campaign |
--campaign |
string |
cancel
Stops a campaign for good; recipients not yet sent to are dropped.
|
|
| REST |
POST /api/_c/bulkmail/v1/cancel |
| CLI |
pocketone remote bulkmail cancel --campaign <value> |
| MCP |
bulkmail_cancel |
| Token scope |
bulkmail |
| Input field |
Flag |
Type |
campaign |
--campaign |
string |
preview
Renders a campaign's message for one recipient (the first in its audience when Email is empty).
|
|
| REST |
POST /api/_c/bulkmail/v1/preview |
| CLI |
pocketone remote bulkmail preview --campaign <value> --email <value> |
| MCP |
bulkmail_preview |
| Token scope |
bulkmail:read |
| Input field |
Flag |
Type |
campaign |
--campaign |
string |
email |
--email |
string |
test
Sends a campaign's message to one address, marked as a test.
|
|
| REST |
POST /api/_c/bulkmail/v1/test |
| CLI |
pocketone remote bulkmail test --campaign <value> --to <value> |
| MCP |
bulkmail_test |
| Token scope |
bulkmail |
| Input field |
Flag |
Type |
campaign |
--campaign |
string |
to |
--to |
string |
Extensions
License
MIT
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.