Skip to main content
POST
Set the audience of an email campaign

Authorizations

Authorization
string
header
required

API key created in the organization settings.

Headers

Idempotency-Key
string

Unique key for the operation, 1 to 255 characters (a UUID, for example). Repeating the same key with the same body within 24 hours returns the original response instead of running it again.

Path Parameters

email_campaign_id
string
required

Public email campaign ID.

Pattern: ^emc_[A-Za-z0-9_-]+$

Body

application/json
audience
enum<string>
required

everyone: every customer the campaign reaches. segments: the customers of the segments in segment_ids.

Available options:
everyone,
segments
segment_ids
string[]

Segments that get the campaign, up to 20. Customers in more than one get it once.

Required array length: 1 - 20 elements
Pattern: ^seg_[A-Za-z0-9_-]+$
segment_id
string
deprecated

Compatibility alias: one segment, the same as segment_ids with that id. Send segment_ids or segment_id, not both.

Pattern: ^seg_[A-Za-z0-9_-]+$
excluded_segment_ids
string[]

Segments left out, up to 20: customers in any of them don't get the campaign, even when every customer or an included segment has them. A segment both included and excluded is excluded. Omit it or send [] to exclude nobody.

Maximum array length: 20
Pattern: ^seg_[A-Za-z0-9_-]+$
operation_id
string

Optional unique id for this call, such as a UUID. Reuse the same value only to retry the same call: the retry returns the first result instead of creating again. The same value with a different body is rejected with 409.

Required string length: 8 - 128

Response

Draft updated.

object
string
required
Allowed value: "email_campaign_write"
campaign
object
required
next_step
string
required

What the campaign still needs before it can be sent.