Skip to contentDevelopersPrezly website
Campaigns

Update draft campaign

Edit a campaign draft before testing and sending.

Personal token scopes: campaigns:write. Your account must also have access to the requested data. Authentication

Supplied content replaces the email body. Review the draft, its audience, and its warnings before testing or sending.

Read the guide

PATCH
/campaigns/{id}
  • It is not allowed to modify an already sent campaign. An error will be thrown (403 Forbidden).

Email content accepts serialized Prezly email JSON, {"json":""}, or {"text":"Plain text"}. Use an email document, not a story document. Supplying content replaces the entire email body.

Personal access tokens: campaigns:write. Every listed scope is required; the token owner's permissions, feature availability and newsroom access still apply.

Authorization

API_key
headerAuthorizationBearer <token>

Bearer authentication using an integration API key, or a personal access token only where the operation explicitly supports it. Every listed personal-token scope is required; owner permissions and newsroom access still apply.

Path Parameters

id*number

Campaign ID

Request Body

  1. body
subject?string
sender?|

Pointer to a SenderAddress to be used with create & update operations.

content?||

Serialized content JSON, or a single-key wrapper containing serialized JSON or plain text. A parsed document object is not accepted.

story?|

Pointer to a story to be used with create & update operations.

story_alignment?string
Value in"left""center""right"
story_appearance?string
Value in"intro""full"
audience_selection_data?|

Structured data describing how the campaign audience was selected. Null when recipients were selected manually from the contacts grid.

Response Body

OK

application/json
  1. response
campaign*
warnings*array<>
Example Request
curl -X PATCH 'https://api.prezly.com/v2/campaigns/0' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "campaign": {    "id": 0,    "subject": "string",    "content": "string",    "lifecycle_status": "draft",    "story_alignment": "left",    "story_appearance": "full",    "sender_domain_verification_status": "valid",    "sender_domain_verification_flow": "v1",    "author": {      "id": 0,      "email": "http://example.com",      "name": "string",      "display_name": "string",      "first_name": "string",      "last_name": "string",      "avatar_url": "http://example.com"    },    "sender": {      "id": 0,      "sender_email": "user@example.com",      "sender_name": "string",      "type": "string",      "is_default": true,      "is_public_webmail": true,      "domain": {        "domain_name": "example.com",        "is_valid": true,        "is_public_webmail": true,        "is_prezlymail": true,        "is_upgrade_recommended": true,        "verification_flow_version": "v1"      },      "is_verified": true,      "is_approved": true,      "domain_info": "string"    },    "story": {      "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",      "id": 0,      "thumbnail_url": "http://example.com",      "title": "string",      "culture": {        "code": "en",        "name": "string",        "direction": "ltr",        "language_code": "en",        "native_name": "string"      },      "language": "string",      "status": "uninitialized",      "lifecycle_status": "uninitialized",      "publication_status": "uninitialized",      "visibility": "public",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z",      "published_at": "2019-08-24T14:15:22Z",      "scheduled_at": "2019-08-24T14:15:22Z",      "author": {        "id": 0,        "email": "http://example.com",        "name": "string",        "display_name": "string",        "first_name": "string",        "last_name": "string",        "avatar_url": "http://example.com"      },      "newsroom": {        "id": 0,        "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",        "name": "string",        "display_name": "string",        "subdomain": "string",        "thumbnail_url": "http://example.com",        "timezone": "europe/london",        "is_active": true,        "is_archived": true,        "is_online": true,        "is_offline": true,        "is_multilingual": true,        "url": "http://example.com",        "links": {          "media_gallery_api": "http://example.com",          "room_contacts_api": "http://example.com",          "analytics_and_visibility_settings": "http://example.com",          "categories_management": "http://example.com",          "company_info_settings": "http://example.com",          "contacts_management": "http://example.com",          "domain_settings": "http://example.com",          "edit": "http://example.com",          "gallery_management": "http://example.com",          "hub_settings": "http://example.com",          "languages": "http://example.com",          "look_and_feel_settings": "http://example.com",          "manual_subscription_management": "http://example.com",          "privacy_settings": "http://example.com",          "widget_settings": "http://example.com"        }      },      "url": "http://example.com",      "oembed": {        "url": "http://example.com",        "type": "video",        "version": "1.0",        "title": "string",        "description": "string",        "author_name": "string",        "author_url": "http://example.com",        "provider_name": "string",        "provider_url": "http://example.com",        "cache_age": 0,        "html": "string",        "thumbnail_url": "http://example.com",        "thumbnail_width": 1,        "thumbnail_height": 1,        "screenshot_url": "http://example.com"      },      "slug": "string"    },    "newsroom": {      "id": 0,      "uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f",      "name": "string",      "display_name": "string",      "subdomain": "string",      "thumbnail_url": "http://example.com",      "timezone": "europe/london",      "is_active": true,      "is_archived": true,      "is_online": true,      "is_offline": true,      "is_multilingual": true,      "url": "http://example.com",      "links": {        "media_gallery_api": "http://example.com",        "room_contacts_api": "http://example.com",        "analytics_and_visibility_settings": "http://example.com",        "categories_management": "http://example.com",        "company_info_settings": "http://example.com",        "contacts_management": "http://example.com",        "domain_settings": "http://example.com",        "edit": "http://example.com",        "gallery_management": "http://example.com",        "hub_settings": "http://example.com",        "languages": "http://example.com",        "look_and_feel_settings": "http://example.com",        "manual_subscription_management": "http://example.com",        "privacy_settings": "http://example.com",        "widget_settings": "http://example.com"      }    },    "thumbnail_url": "http://example.com",    "recipients_number": 0,    "audience_selection_data": {      "tags": {        "included": [          1        ],        "excluded": [          1        ],        "match": "any"      },      "emails": {        "addresses": [          "user@example.com"        ],        "create_missing_contacts": true      },      "previous_campaigns": [        1      ],      "contact_views": [        "e84dd9cf-e694-4488-bfb6-af5b67542a12"      ]    },    "stats": {      "recipients": 0,      "delivered": 0,      "clicks": 0,      "opens": 0,      "replies": 0,      "bounces": 0,      "unsubscribes": "string",      "clicks_rate": 0,      "opens_rate": 0,      "replies_rate": 0,      "unsubscribes_rate": 0,      "undelivered_rate": 0    },    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "scheduled_at": "2019-08-24T14:15:22Z",    "sent_at": "2019-08-24T14:15:22Z",    "delivered_at": "2019-08-24T14:15:22Z"  },  "warnings": [    {      "field": "string",      "code": "string",      "message": "string"    }  ]}