API

Campaigns & posts

What a campaign is, what a post is, and how they relate.

A campaign is what you create and send. A post is its public web version. This page explains the two words and where each lives in the API.

Campaigns

A campaign is the content you send to your recipients. Recipients are notified by email. Set smsTeaser to also send an SMS that links to the campaign; this requires SMS to be enabled for the workspace. Each contact's notification preferences still apply.

Campaigns are created and read with an API key. The API creates drafts: use Create draft to add one, change it with Update campaign while it is a draft, and publish or schedule it from the app. The list shows every campaign with its status: draft, scheduled, published or failed.

Editing drafts

Create, get and update return the campaign with a hash that changes with each save, also sent as the ETag header; the list leaves it out. Send it as If-Match when updating: if someone changed the campaign in the meantime you get a 412 with the current hash instead of overwriting their change. Omit the header to overwrite regardless.

Omitted fields keep their values, while blocks and recipients.segmentIds replace the whole list. Blocks made in the app that the API cannot express come back as type unsupported and are lost if you send blocks. Only drafts can be updated; anything else answers 409. editorUrl opens the draft in the app.

Posts

A post is the public web version of a campaign. Every campaign gets one, so campaigns can live on the web and be embedded on websites.

Posts need no API key. Use the posts endpoint to read the published web versions, for example from an embed.

The two surfaces

GroupWhat it isAuth
CampaignsCreate and edit drafts, read status and contentAPI key
PostsThe public web versions, powering embedsNone

On this page