# Create Campaign Draft

Create a new campaign draft. Newsletter and CampaignDraft objects are differentiated by the EditMode values - we recommend using CampaignDraft, as Newsletter objects are ones created using the legacy Mailjet template builder.

Endpoint: POST /v3/REST/campaigndraft
Version: 1.0.0
Security: basicAuth

## Request fields (application/json):

  - `ContactsListID` (integer)
    Unique numeric ID for the contact list linked to this draft. Required for successful sending of the campaign. Interchangeable with ContactsListAlt.

  - `ContactsListAlt` (string)
    A unique contact list email address generated by Mailjet, which is linked to this campaign draft. Required for successful sending of the campaign. Interchangeable with ContactsListID.

  - `Locale` (string, required)
    Locale, in which the information is saved.

  - `SegmentationID` (integer)
    ID of the segment configuration (contactfilter) used for this campaign draft. Interchangeable with SegmentationAlt.

  - `SegmentationAlt` (string)
    The user-selected name of the segment configuration (contactfilter) used for this campaign draft. Interchangeable with SegmentationID.

  - `Sender` (string)
    ID of the sender email address. Required for successful sending of the campaign.

  - `SenderEmail` (string)
    The email address of the sender. Required for successful sending of the campaign.

  - `Subject` (string, required)
    Subject line for the campaign emails.

  - `AXFraction` (number)
    Fraction of an AB Testing campaign as a percentage of the total emails. Zero indicates the remainder.

  - `AXFractionName` (string)
    Name of the AB Testing fraction.

  - `AXTesting` (object)
    An ID reference to the respective AXTesting object.

  - `Current` (integer)
    Data ID of the current content.

  - `EditMode` (string)
    Edit mode for the campaign draft.

Possible values:

- tool2 - Passport drag-and-drop template editor
- html2 - HTML editor in Passport
- mjml - MJML editor in Passport

  - `IsStarred` (boolean)
    Indicates whether the campaign draft is marked as Starred or not.

  - `IsTextPartIncluded` (boolean)
    Indicates whether the draft email contains a text version or not.

  - `ReplyEmail` (string)
    Reply-to email address for the campaign. Returned only if a reply-to email was specified.

  - `SenderName` (string)
    Name of the sender, which will be visible to recipients.

  - `TemplateID` (integer)
    Unique numeric ID of the template the CampaignDraft was generated from, or as which it was last saved. Changing the template ID will not update the content of the CampaignDraft.

  - `Title` (string)
    Internal title for this campaign draft.

## Response 201 fields (application/json):

  - `Count` (integer)
    Indicates the number of objects in the Data array.

  - `Data` (array)
    A JSON array containing a list of objects returned by this endpoint.

  - `Data.CampaignID` (integer)
    Unique numeric ID of the campaign linked to this campaign draft. Will only be returned if the draft is already sent.

  - `Data.ContactsListID` (integer)
    Unique numeric ID for the contact list linked to this draft. Required for successful sending of the campaign.

  - `Data.CreatedAt` (string)
    Timestamp indicating when the campaigndraft was created.

  - `Data.DeliveredAt` (string)
    Timestamp indicating when the campaigndraft was delivered.

  - `Data.ID` (integer)
    Unique numeric ID for this campaign draft.

  - `Data.Locale` (string)
    Locale, in which the information is saved.

  - `Data.ModifiedAt` (string)
    Timestamp indicating when the campaign draft was last modified.

  - `Data.Preset` (string)
    String, representing a JSON array of styles for this campaign draft. The API does not interpret the styles.

  - `Data.SegmentationID` (integer)
    ID of the segment configuration (contactfilter) used for this campaign draft.

  - `Data.Sender` (string)
    Unique numeric ID of the sender email address.

  - `Data.SenderEmail` (string)
    Email address of the sender.

  - `Data.Status` (integer)
    Status of the campaign draft. Only campaign drafts in status Draft or Programmed can be scheduled and sent out via /campaigndraft/{draft_id}/schedule or /campaigndraft/{draft_id}/send.

Possible values:

- -3 - AXCanceled
- -2 - Deleted
- -1 - Archived
- 0 - Draft
- 1 - Programmed (scheduled)
- 2 - Sent
- 3 - AXTested (AB Testing versions sent, but winning version not selected yet)
- 4 - AXSelected (AB Testing winning version selected and sent)

  - `Data.Subject` (string)
    Subject line for the campaign emails.

  - `Data.Url` (string)
    The URL, where an online version of the template can be found. A URL is automatically generated by Mailjet for marketing templates, after the campaign draft is sent.

  - `Data.Used` (boolean)
    Indicates whether the campaign draft (or a test email of it) has been sent or not.

  - `Data.AXFraction` (number)
    Fraction of an AB Testing campaign as a percentage of the total emails. Zero indicates the remainder.

  - `Data.AXFractionName` (string)
    Name of the AB Testing fraction.

  - `Data.AXTesting` (object)
    An ID reference to the respective AXTesting object.

  - `Data.Current` (integer)
    Data ID of the current content.

  - `Data.EditMode` (string)
    Edit mode for the campaign draft.

Possible values:

- tool2 - Passport drag-and-drop template editor
- html2 - HTML editor in Passport
- mjml - MJML editor in Passport

  - `Data.IsStarred` (boolean)
    Indicates whether the campaign draft is marked as Starred or not.

  - `Data.IsTextPartIncluded` (boolean)
    Indicates whether the draft email contains a text version or not.

  - `Data.ReplyEmail` (string)
    Reply-to email address for the campaign. Returned only if a reply-to email was specified.

  - `Data.SenderName` (string)
    Name of the sender, which will be visible to recipients.

  - `Data.TemplateID` (integer)
    Unique numeric ID of the template the CampaignDraft was generated from, or as which it was last saved. Changing the template ID will not update the content of the CampaignDraft.

  - `Data.Title` (string)
    Internal title for this campaign draft.

  - `Total` (integer)
    Indicates the number of objects in the Data array.


## Response 400 fields

## Response 401 fields

## Response 403 fields

## Response 404 fields

## Response 429 fields

## Response 500 fields
