Skip to contentDevelopersPrezly website
Campaigns

Create a draft campaign

Create a campaign draft before selecting recipients or sending.

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

Content accepts plain text or serialized email content. Do not copy an entire story document into an email unchanged.

Read the guide

POST
/campaigns

It is possible to create a campaign providing a contacts selector to be added as recipients. If the selection is too large to be processed synchonously, the endpoint may decide to defer the operation and run it in background. In that case an 202 Accepted response will be returned.

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.

Request Body

application/json
  1. body
subject?string
sender?number

Reference to SenderAddress ID. If not provided, the default sender address will be used.

content?||

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

story?number

Reference to Story ID

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

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

Response Body

Created

application/json
  1. response
campaign*
message*string
warnings*array<>
notifications*array<>
recipients_total?integerDeprecated
recipients_included?integerDeprecated
Example Request
curl -X POST 'https://api.prezly.com/v2/campaigns' \  -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"  },  "message": "string",  "warnings": [    {      "field": "string",      "code": "string",      "message": "string"    }  ],  "notifications": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "type": "string",      "style": "success",      "title": "string",      "description": "string",      "actions": [        {          "target": "http://example.com",          "name": "string"        }      ]    }  ],  "recipients_total": 0,  "recipients_included": 0}