Preview campaign contentMenu

Preview campaign content

POST/v1/campaigns/{id}/preview

Requires an API key with the campaigns:read scope. About keys and scopes

Works with integration, agent and partner keys.

Reads only: safe to retry. About idempotency

Renders the campaign's email to HTML and plain text against the contact contactId (required), so merge tags resolve, without sending anything; data fills {{ data.<key> }} as a trigger's recipient would. A draft renders as far as it goes. A campaign that sends no email returns 409 CONFLICT.

Path parameters

idstringrequired

The campaign's id.

uuid

Header parameters

Kirora-Workspacestringoptional

Partner keys only: the child workspace to act in, by the external id the partner gave it. Without it, a partner key acts in its own workspace. Any other key that sends it is refused with 403, and an unknown workspace is 404.

pattern ^[A-Za-z0-9._:-]{1,128}$

Request body

contactIdstringrequired

The contact whose values fill the merge tags.

uuid

versionintegeroptional

The A/B version to preview; 1 is the campaign's own content.

min 1 · max 4 · default 1

datamap<string, any>optional

Values for {{ data.<key> }}, as a trigger would pass them; a triggered campaign previews with what one recipient would get.

keys: pattern ^[A-Za-z0-9_-]{1,64}$

Returns

Returns 200 OK with a CampaignEmailPreview in data. It can also return 409 Conflict, 413 Payload Too Large or 415 Unsupported Media Type; see the statuses below. Otherwise returns an error; Errors lists every code and which to retry.

  • 200 OKThe rendered preview.
  • 409 ConflictThe request conflicts with current state — a duplicate unique value, or a resource whose status does not allow this operation.
  • 413 Payload Too LargeThe body is larger than this operation accepts (PAYLOAD_TOO_LARGE).
  • 415 Unsupported Media TypeThe body is not JSON, or not the upload the operation takes (UNSUPPORTED_MEDIA_TYPE).
subjectstringrequired

The subject with merge tags filled in.

htmlstringrequired

The rendered HTML body.

textstringoptional

The rendered plain-text body.