Custom routes under prc-email-builder/v1 for the editor sidebar, library, and sends.
Base path: /wp-json/prc-email-builder/v1/
Additional preview and form-related routes live in other classes (class-preview.php, class-public-email-preview.php, form send under prc-api/v3). This page covers the primary REST_API surface.
Auth summary
| Access | Routes |
|---|---|
edit_posts | Audiences, connection, segments, count, library, audiences-system, transactional/create-from-audience, domain-query audience jobs |
edit_post on quiz | POST /transactional/create-from-audience when quiz_id is sent; source-entity jobs for that quiz |
edit_post on dataset | Source-entity audience jobs for that dataset |
edit_post on target campaign/txn (send permission checks) | /send, campaign draft update/unlink/create, reports |
edit_post on transactional post | /send-system-email |
Read endpoints
| Method | Path | Notes |
|---|---|---|
| GET | /audiences | Mailchimp audiences |
| GET | /connection | Connection status and sender info |
| GET | /audiences-system | System-email audiences from options (builder, verification, source_id, source_title) |
| GET | /audience-jobs/{job_id} | Poll a registry-backed audience job (ad_, ds_, qz_, or cs_ id). Job views omit emails. |
| GET | /auth-domain-audiences/{job_id} | Alias of the generic job poller for ad_ jobs |
| GET | /audiences/{audience_id}/segments | Saved segments |
| GET | /audiences/{audience_id}/count | Optional segment_id |
| GET | /library | DataViews backing store |
| GET | /campaigns/{post_id}/report | Stored Mailchimp report, or Mandrill/system envelope from the event ledger |
Library query params
Reference
4 fields
Library filters
Typed options, defaults, and constraints in one scannable reference.
-
post_typeenum -
all, campaign, or txn.
-
newsletter_liststring -
Comma-separated prc_newsletter_list slugs.
-
mailchimp_statusstring -
e.g. campaign:save, campaign:sent.
-
mandrill_statusstring -
txn send status filter.
No fields match this filter.
Pagination uses standard search, orderby, order, page, per_page with X-WP-Total headers.
Write endpoints
| Method | Path | Body |
|---|---|---|
| POST | /send | { post_id, reset? } — Mandrill bulk send |
| POST | /send-system-email | { post_id, to_email, context?, dry_run? } |
| POST | /campaigns/update-draft | { post_id } — push HTML to existing Mailchimp draft |
| POST | /campaigns/unlink | { post_id } — clear linkage meta |
| POST | /campaigns/create-draft | { post_id } — create and send (recovery / retry send) |
| POST | /campaigns/{post_id}/report/refresh | Mailchimp pull, or Mandrill/system ledger recompute |
| POST | /mandrill-webhook | Mandrill events (?key= matches Email Builder or CRM webhook key) |
| POST | /audience-jobs | { builder, ...input } — enqueue a registry-backed job, or persist a CSV audience. Returns 202 with the job view. CSV bodies use { builder: "csv-upload", label, csv }. |
| POST | /audience-jobs/{job_id}/draft | Create a prc_email_txn draft from a ready job |
| POST | /auth-domain-audiences | Alias of POST /audience-jobs for the email-domain builder |
| POST | /auth-domain-audiences/{job_id}/draft | Alias of the generic draft route |
| POST | /transactional/create-from-audience | { audience_key, title?, subject?, quiz_id? } — draft prc_email_txn for a stored Mandrill list |
Request
POST
/wp-json/prc-email-builder/v1/transactional/create-from-audience
HeadersKey: value
Content-Type application/jsonAccept application/jsonRequest bodyJSON
{
"audience_key": "prc_email_audience_quiz_group_owners_123_verified",
"quiz_id": 123
}
Response
200 OK
Response headers
Key: value
BodyJSON
{
"id": 456,
"edit_url": "https://example.test/wp-admin/post.php?post=456&action=edit",
"title": "Update for Climate quiz group creators (verified)"
}
Request
POST
/wp-json/prc-email-builder/v1/campaigns/update-draft
HeadersKey: value
Content-Type application/jsonAccept application/jsonRequest bodyJSON
{
"post_id": 123
}
Response
200 OK
Response headers
Key: value
BodyJSON
{
"success": true
}Anonymous public system-email sends use the form action at /prc-api/v3/form/send-system-email (nonce + captcha), not /send-system-email.