Skip to content

Campaign — Email

Campaign email entity. This is the email payload sent when the campaign runs.

Endpoint

Method URL
POST /campaign/<campaign>/email
PUT /campaign/<campaign>/email
DELETE /campaign/<campaign>/email

POST /campaign/<campaign>/email

Note

The payload must be sent as multipart/form-data to accommodate the attachment parameter.

Parameter Type Description
header_from_name string Human-readable sender name
header_from string Sender email. The domain must be enabled as a sending domain.
subject string Message subject
message string Message HTML
block_editor_content string (optional) JSON for block editor content (Froala only)
attachment file (optional) Attachment, submitted as <input type="file">

Returns: The edited campaign and email.

Example:

curl -u "username:api_key" -H "Accept: application/json" \
  -F "header_from_name=My Brand" \
  -F "header_from=noreply@yourdomain.com" \
  -F "subject=Newsletter #1" \
  -F "message=<html><body><p>Hello {{name}}</p></body></html>" \
  https://app.duo.pt/campaign/{campaign_id}/email

Response:

{
  "success": true,
  "data": {
    "email": {
      "envelope_from_domain": null,
      "header_from_name": "Example...",
      "header_from": "sender@yourdomain.com",
      "subject": "Summer Newsletter 2026",
      "message": "<html><body><p>Hello {{name}}</p></body></html>",
      "attachment": null,
      "memoizedAttachment": null,
      "send_scheduled": 1
    }
  }
}

PUT /campaign/<campaign>/email

Same fields as POST. Parameters must be sent as query string (not request body), and must include send_scheduled set to the campaign ID.

Parameter Type Description
send_scheduled int The campaign ID. Required for PUT.
header_from_name string Human-readable sender name
header_from string Sender email address. The domain must have is_sending: true.
subject string Message subject
message string Message HTML
block_editor_content string (optional) JSON for block editor content

Returns: The edited campaign and email.

Example:

curl -u "username:api_key" -H "Accept: application/json" -X PUT \
  "https://app.duo.pt/campaign/{campaign_id}/email?send_scheduled={campaign_id}&header_from_name=My+Brand&header_from=noreply%40yourdomain.com&subject=Updated+Subject&message=%3Chtml%3E%3Cbody%3EUpdated%3C%2Fbody%3E%3C%2Fhtml%3E"

Response:

{
  "success": true,
  "data": {
    "email": {
      "envelope_from_domain": null,
      "header_from_name": "My Brand",
      "header_from": "noreply@yourdomain.com",
      "subject": "Updated Subject",
      "message": "<html><body>Updated</body></html>",
      "attachment": null,
      "send_scheduled": 1,
      "block_editor_type": null,
      "block_editor_content": null
    }
  }
}

DELETE /campaign/<campaign>/email

Payload: No payload.

Returns: The deleted email.

Example:

curl -u "username:api_key" -H "Accept: application/json" -X DELETE \
  https://app.duo.pt/campaign/{campaign_id}/email

Response:

{
  "success": true,
  "data": {
    "email": {
      "envelope_from_domain": null,
      "header_from_name": "Example...",
      "header_from": "sender@yourdomain.com",
      "subject": "Summer Newsletter 2026",
      "message": "<html><body><p>Hello {{name}}</p></body></html>",
      "attachment": null,
      "memoizedAttachment": null,
      "send_scheduled": 1,
      "block_editor_type": null,
      "block_editor_content": null
    }
  }
}