Skip to main content
POST
Generate Messages
CLI:

Overview

This endpoint supports one POST action, selected by the action field in the body:
  • resolve — synchronously resolves %variables% for ordinary sendable nodes and materializes recipient rows in campaign_prospect_messages as draft. For personalized email nodes, it prepares drafts from the saved skeleton and preserves $ai {instruction}$ slots for the outbound copy operations. Manually edited rows are preserved; template changes flow through to unedited rows.
The campaign must be in draft status. Legacy generate_ai generation is not supported by this endpoint.

AI agent notes

resolve is safe to re-run. It upserts on (campaign_id, prospect_id, node_id) and excludes manually-edited rows from the upsert — template changes propagate without clobbering user customizations. If the “find edited messages” query itself fails, the server falls back to ignoreDuplicates: true for the whole batch to avoid silently overwriting edits.AI copy is a separate operation. resolve does not seed recipient drafts from legacy generated_examples and does not ask a copywriter to fill personalization. Use puffleAgent.previewOutboundCopy to fill a reusable preview for up to five recipients, then use puffleAgent.writeOutboundCopy after explicit user approval to fill every remaining $ai {instruction}$ slot. Previewed copy and manual edits are preserved.Check status before launch. Use puffleAgent.getOutboundCopyStatus to determine whether copy is ready, needs_generation, or needs_attention. A needs_attention response can include copywriterError; surface it and retry the copy operation after correcting any manually unresolved slot. For reading the draft outbox or inline-editing one message, use GET or PATCH on this same campaign messages path.

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

Synchronously materializes ordinary draft messages. $ai {prompt}$ personalization slots are preserved for puffleAgent.previewOutboundCopy and puffleAgent.writeOutboundCopy.

action
enum<string>
required
Available options:
resolve
prospect_offset
integer
default:0
required

Offset into the stable campaign lead order when count is provided.

Required range: 0 <= x <= 9007199254740991
count
integer

Optionally resolve only the first N campaign leads.

Required range: 0 < x <= 100

Response

Messages were resolved or AI generation was queued.

messages
object[]
required