Skip to main content
PATCH
/
api
/
campaigns
/
{id}
/
generate-messages
Edit Generated Email
curl --request PATCH \
  --url https://app.puffle.ai/api/campaigns/{id}/generate-messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "message_id": "<string>",
  "subject": "<string>",
  "body_text": "<string>"
}
'
{
  "message": {
    "id": "<string>",
    "campaign_id": "<string>",
    "prospect_id": "<string>",
    "node_id": "<string>",
    "subject": "<string>",
    "body_text": "<string>",
    "manually_edited": true,
    "created_at": "2023-11-07T05:31:56Z",
    "body_html": "<string>"
  }
}
CLI:
puffle campaign generate-message update --id <id> --message-id <message-id>
puffle campaign generate-message update --id <id> --message-id <message-id> --subject <subject> --body-text <body-text>

Overview

Edits one generated email draft inside a campaign. The path identifies the campaign, and the body identifies the generated message with message_id. Send subject, body_text, or both. When the plaintext body changes, Puffle preserves any previously saved custom HTML suffix instead of rebuilding the entire message from scratch.

AI agent notes

Use this only after the human approves a concrete edit to a draft generated email. Do not use it to regenerate all messages or to send a message. If the target message is already pending or sent, surface the validation error instead of retrying with the same payload.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Campaign UUID

Body

application/json
message_id
string
required
Minimum string length: 1
subject
string
body_text
string

Response

Draft generated message updated successfully.

message
object
required