API
Embed form endpoint
POST /forms/{form_public_id}/subscribe
Public endpoint used by MailPirate embed snippets and by custom signup UIs. No Marketing API token.
When to use it
- You embedded a form (WordPress shortcode/block or HTML mount)
- You built your own form UI but still want MailPirate to own consent + list membership
For server-side opt-ins with a token, prefer /subscribe.
Public config (used by the embed script):
GET /api/v1/marketing/forms/01H...
Returns headline, layout, fields, style, and success copy. Cacheable (Cache-Control: public, max-age=60, ETag). No token.
Authenticated list (Marketing API token; used by the Woo plugin block picker):
GET /api/v1/marketing/forms?store_slug=your-store
Authorization: Bearer …
Request
POST /api/v1/marketing/forms/01H.../subscribe
Content-Type: application/json
{
"email": "[email protected]",
"first_name": "Ada",
"last_name": "Lovelace",
"phone": "+1 555 0100"
}
| Field | Required |
|---|---|
email |
Yes |
first_name |
No |
last_name |
No |
phone |
No |
Response 200
{
"ok": true,
"status": "pending",
"message": "Thanks - check your inbox to confirm."
}
status- profile status after the submit (pendingwhen DOI is required)message- success copy configured on the form
Errors and limits
| Status | Meaning |
|---|---|
404 |
Unknown or disabled form |
422 |
Validation failed |
429 |
More than 30 requests per minute |
Product guide
See Embed forms for creating forms and publishing via WordPress or HTML.