Generated from Postwind commit a19b2e4 OpenAPI 0.1.0 synced

Campaigns HTTP API

PATCH/api/v1/projects/{project_id}/campaigns/{campaign_id}

update_campaign

Changes a campaign’s fields: name, lists, template, sender, reply-to, subject, transport, tracking, throttle.

Call it
to fix a draft before it is launched.
Needs
an admin key with project_id, or a project key with scope write (its own project; the argument is ignored), and a campaign in draft or scheduled (otherwise conflict); new lists and template are checked as create_campaign checks them. Arguments left out keep their values; null clears what may be empty; list_ids and tracking_override are replaced as a whole.
Returns
the campaign after the change, the same as PATCH /api/v1/projects/{project_id}/campaigns/{campaign_id}.

Arguments

  • object
  • campaign_idstring · uuidrequired

    The campaign’s id.

  • from_emailstring · email | null

    The sender address; null: the project’s settings.from_email.

  • from_namestring | null

    The sender name, 1 to 128 characters; null: the project’s settings.from_name.

    example Acme News

  • list_idsarray of string

    The new lists, replaced as a whole: 1 to 16 distinct ids of live lists of the project; leave it out to keep them.

    1–16 items

  • namestring

    The new name; leave it out to keep the name.

  • project_idstring · uuid | null

    The campaign’s project. An admin key must pass it; a project key’s own project is used and this is ignored.

  • reply_tostring · email | null

    Reply-To; null: the project’s settings.reply_to.

  • subject_overridestring | null

    The subject source in place of the template’s; null: the template’s.

  • template_idstring · uuid

    Another message template of the project; leave it out to keep it.

  • throttle_per_hourinteger · int64 | null

    Most messages an hour, 1 to 4294967295; null: the project’s default_throttle_per_hour, or no limit.

    1–4294967295

  • tracking_overrideTrackingOverrideArguments | null

    What to track, both flags, in place of the project’s settings.tracking; null: the project’s.

    2 fields
  • transport_overridestring | null

    direct or relay:<name> (a relay of the node); null: the project’s transport.

No other arguments are accepted.

Result

The result comes back as structuredContent, with the same JSON as a text block.

  • object · all fields required
  • completed_atstring · date-time | null
  • created_atstring · date-time
  • from_emailstring | null

    null: the project’s settings.from_email.

  • from_namestring | null

    null: the project’s settings.from_name.

  • idstring · uuid
  • last_errorstring | null

    Why the launch failed; null unless failed.

  • launched_atstring · date-time | null
  • list_idsarray of string

    The lists it goes to, in the order given.

  • namestring
  • partial_versionsmap of string → integer · uint32

    The versions of the partials fixed at launch, by name; {} before.

  • project_idstring · uuid
  • reply_tostring | null

    null: the project’s settings.reply_to.

  • scheduled_atstring · date-time | null

    When a scheduled campaign launches; null unless scheduled.

  • shard_countinteger · uint32 | null

    Fixed at launch; null before.

    ≥ 0

  • statusstring

    draft, scheduled, launching, sending, paused, completed, cancelled or failed.

  • subject_overridestring | null

    null: the template’s subject.

  • template_idstring · uuid
  • template_versioninteger · uint32 | null

    The template’s version fixed at launch; null before.

    ≥ 0

  • throttle_per_hourinteger · uint32 | null

    null: the project’s default_throttle_per_hour, or no limit.

    ≥ 0

  • total_recipientsinteger · uint64 | null

    Recipients of the launch’s snapshot; null before.

    ≥ 0

  • tracking_overrideTrackingOverride | null

    null: the project’s settings.tracking.

    2 fields
  • transport_overridestring | null

    null: the project’s transport, then the node’s default.

  • updated_atstring · date-time

    The latest change: creation, fields, status.

Definitions

TrackingOverride

What a campaign tracks in place of the project’s.

  • object · all fields required
  • clicksboolean
  • opensboolean

TrackingOverrideArguments

What a campaign tracks.

  • object · all fields required
  • clicksboolean

    Click redirects.

  • opensboolean

    The open pixel.

Errors

A failed call answers isError: true with a code from the same table as the HTTP API, and detail. How tools report errors

HTTP API

The same operation over HTTP: PATCH /api/v1/projects/{project_id}/campaigns/{campaign_id}