V3 REFERENCE Campaigns

/newsletter

Newsletter data.

List newsletter resources available for this apikey, use a GET request. Alternatively, you may want to add one or more filters.

# list newsletter resources

curl -s -X GET \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/newsletter
Properties
Name Description
AXFraction Fraction of AXTesting in percentage. Zero means remainder
  • [ Type Double ]
AXFractionName Display name for the fraction
  • [ Type AnsiString ]
AXTesting A reference to AXTesting object
  • [ Type TAXTesting ]
Callback Callback URL.
  • [ Type AnsiString ]
CampaignID
OR
CampaignALT
CampaignID
ID reference to Campaign
CampaignALT
Value of the CustomValue field of the related Campaign resource
  • Read Only
  • [ Type TCampaign ]
ContactsListID
OR
ContactsListALT
ContactsListID
ID reference to ContactsList
ContactsListALT
Value of the Address field of the related ContactsList resource
  • [ Type TContactsList ]
CreatedAt Timestamp when object was created in database.
  • [ Type TRFC3339DateTime ]
DeliveredAt When the newsletter was delivered.
  • [ Type TRFC3339DateTime ]
EditMode Edit mode for newsletter.
  • [ Type AnsiString ]

Allowed values:
  • tool
  • html
EditType Edit type.
  • [ Type AnsiString ]

Allowed values:
  • full
  • light
  • ulight
Footer Footer type to generate.
  • [ Type AnsiString ]

Allowed values:
  • default
  • none
FooterAddress Address to use in footer.
  • [ Type AnsiString ]
FooterWYSIWYGType What kind of footer to generate.
  • [ Type SmallInt ]
HeaderFilename Filename to use in header.
  • [ Type AnsiString ]
HeaderLink Link used in header.
  • [ Type AnsiString ]
HeaderText Text of header.
  • [ Type AnsiString ]
HeaderUrl URL used in header.
  • [ Type AnsiString ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
Ip IP address used to create newsletter.
  • [ Type AnsiString ]
IsHandled Has the newsletter been handled by Mailjet ?.
  • [ Type Boolean ]
IsStarred Is this a starred newsletter ?.
  • [ Type Boolean ]
IsTextPartIncluded Does the newsletter include a text version ?.
  • [ Type Boolean ]
Locale Locale in which the information in this record is recorded.
  • Mandatory
  • [ Type AnsiString ]
ModifiedAt Timestamp when newsletter content was last modified.
  • [ Type TRFC3339DateTime ]
Permalink Type of permalink that should be added to the newsletter.
  • [ Type AnsiString ]

Allowed values:
  • default
  • none
PermalinkHost Host for the permalink.
  • [ Type AnsiString ]
PermalinkWYSIWYGType ?.
  • [ Type SmallInt ]
PolitenessMode ?.
  • [ Type SmallInt ]
ReplyEmail Reply-To address for the mail.
  • [ Type TEmail ]
SegmentationID
OR
SegmentationALT
SegmentationID
ID reference to ContactFilter
SegmentationALT
Value of the Name field of the related ContactFilter resource
  • [ Type TContactFilter ]
Sender Sender.
  • Mandatory
  • [ Type AnsiString ]
SenderEmail Sender email address in headers.
  • Mandatory
  • [ Type TEmail ]
SenderName Name of the sender in Sender headers.
  • [ Type AnsiString ]
Status Status of the newsletter.
  • [ Type SmallInt ]

Allowed values:
  • AXCanceled (-3)
  • Deleted (-2)
  • Archived (-1)
  • Draft (0)
  • Programmed (1)
  • Sent (2)
  • AXTested (3)
  • AXSelected (4)
Subject Newsletter subject.
  • Mandatory
  • [ Type AnsiString ]
TemplateID ID reference to NewsletterTemplate Template from which this newsletter was generated, or as which it was last saved.
  • [ Type TNewsLetterTemplate ]
TestAddress Address used for testing.
  • [ Type AnsiString ]
Title Newsletter title.
  • [ Type AnsiString ]
Url URL where an online version of the newsletter can be found [?].
  • [ Type AnsiString ]
Filters
Name Description
AXTesting Only retrieve newsletter objects with the specified AXTesting ID
  • [ Type Int64 ]
Campaign Only retrieve Newsletter resources for which Campaign ID equals the specified value.
  • [ Type Int64 ]
ContactsList Only retrieve newsletter resources for which ContactsList ID equals the specified value.
  • [ Type Int64 ]
DeliveredAt Only retrieve newsletters delivered after this value.
  • [ Type TRFC3339DateTime ]
EditMode Only retrieve newsletters with edit mode equal to the specified value.
  • [ Type AnsiString ]
IsArchived Only retrieve newsletter resources for which IsArchived equals the specified value.
  • [ Type TBooleanFilter ]
IsCampaign Only retrieve newsletter objects which already have a corresponding campaign
  • [ Type TBooleanFilter ]
IsDeleted Only retrieve campaigns where isDeleted matches the specified value.
  • [ Type TBooleanFilter ]
IsHandled Only retrieve newsletters with IsHandled equal to the specified value.
  • [ Type TBooleanFilter ]
IsStarred Only retrieve newsletters with IsStarred equal to the specified value.
  • [ Type TBooleanFilter ]
Modified Only retrieve modified newsletters.
  • [ Type Boolean ]
NewsLetterTemplate Only retrieve newsletters based on this template.
  • [ Type Int64 ]
Segmentation Only retrieve newsletter objects with the specified contact list filter ID
  • [ Type Int64 ]
Status Comma-separated list of statuses: only newsletters with these statuses are retrieved.
  • [ Type AnsiString ]
Subject Only retrieve newsletters with this subject.
  • [ Type AnsiString ]

Access a given newsletter resource, use a GET request, providing the newsletter's ID value.

# access the newsletter resource identified by $ID

curl -s -X GET \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/newsletter/$ID

    
    
Properties
Name Description
AXFraction Fraction of AXTesting in percentage. Zero means remainder
  • [ Type Double ]
AXFractionName Display name for the fraction
  • [ Type AnsiString ]
AXTesting A reference to AXTesting object
  • [ Type TAXTesting ]
Callback Callback URL.
  • [ Type AnsiString ]
CampaignID
OR
CampaignALT
CampaignID
ID reference to Campaign
CampaignALT
Value of the CustomValue field of the related Campaign resource
  • Read Only
  • [ Type TCampaign ]
ContactsListID
OR
ContactsListALT
ContactsListID
ID reference to ContactsList
ContactsListALT
Value of the Address field of the related ContactsList resource
  • [ Type TContactsList ]
CreatedAt Timestamp when object was created in database.
  • [ Type TRFC3339DateTime ]
DeliveredAt When the newsletter was delivered.
  • [ Type TRFC3339DateTime ]
EditMode Edit mode for newsletter.
  • [ Type AnsiString ]

Allowed values:
  • tool
  • html
EditType Edit type.
  • [ Type AnsiString ]

Allowed values:
  • full
  • light
  • ulight
Footer Footer type to generate.
  • [ Type AnsiString ]

Allowed values:
  • default
  • none
FooterAddress Address to use in footer.
  • [ Type AnsiString ]
FooterWYSIWYGType What kind of footer to generate.
  • [ Type SmallInt ]
HeaderFilename Filename to use in header.
  • [ Type AnsiString ]
HeaderLink Link used in header.
  • [ Type AnsiString ]
HeaderText Text of header.
  • [ Type AnsiString ]
HeaderUrl URL used in header.
  • [ Type AnsiString ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
Ip IP address used to create newsletter.
  • [ Type AnsiString ]
IsHandled Has the newsletter been handled by Mailjet ?.
  • [ Type Boolean ]
IsStarred Is this a starred newsletter ?.
  • [ Type Boolean ]
IsTextPartIncluded Does the newsletter include a text version ?.
  • [ Type Boolean ]
Locale Locale in which the information in this record is recorded.
  • Mandatory
  • [ Type AnsiString ]
ModifiedAt Timestamp when newsletter content was last modified.
  • [ Type TRFC3339DateTime ]
Permalink Type of permalink that should be added to the newsletter.
  • [ Type AnsiString ]

Allowed values:
  • default
  • none
PermalinkHost Host for the permalink.
  • [ Type AnsiString ]
PermalinkWYSIWYGType ?.
  • [ Type SmallInt ]
PolitenessMode ?.
  • [ Type SmallInt ]
ReplyEmail Reply-To address for the mail.
  • [ Type TEmail ]
SegmentationID
OR
SegmentationALT
SegmentationID
ID reference to ContactFilter
SegmentationALT
Value of the Name field of the related ContactFilter resource
  • [ Type TContactFilter ]
Sender Sender.
  • Mandatory
  • [ Type AnsiString ]
SenderEmail Sender email address in headers.
  • Mandatory
  • [ Type TEmail ]
SenderName Name of the sender in Sender headers.
  • [ Type AnsiString ]
Status Status of the newsletter.
  • [ Type SmallInt ]

Allowed values:
  • AXCanceled (-3)
  • Deleted (-2)
  • Archived (-1)
  • Draft (0)
  • Programmed (1)
  • Sent (2)
  • AXTested (3)
  • AXSelected (4)
Subject Newsletter subject.
  • Mandatory
  • [ Type AnsiString ]
TemplateID ID reference to NewsletterTemplate Template from which this newsletter was generated, or as which it was last saved.
  • [ Type TNewsLetterTemplate ]
TestAddress Address used for testing.
  • [ Type AnsiString ]
Title Newsletter title.
  • [ Type AnsiString ]
Url URL where an online version of the newsletter can be found [?].
  • [ Type AnsiString ]

Add a new newsletter resource with a POST request.

# add a new newsletter resource, beware of the Read Only fields!

curl -s -X POST \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/newsletter \
-H 'Content-Type: application/json' \
-d '{"AXFraction": ...}'
Properties
Name Description
AXFraction Fraction of AXTesting in percentage. Zero means remainder
  • [ Type Double ]
AXFractionName Display name for the fraction
  • [ Type AnsiString ]
AXTesting A reference to AXTesting object
  • [ Type TAXTesting ]
Callback Callback URL.
  • [ Type AnsiString ]
CampaignID
OR
CampaignALT
CampaignID
ID reference to Campaign
CampaignALT
Value of the CustomValue field of the related Campaign resource
  • Read Only
  • [ Type TCampaign ]
ContactsListID
OR
ContactsListALT
ContactsListID
ID reference to ContactsList
ContactsListALT
Value of the Address field of the related ContactsList resource
  • [ Type TContactsList ]
CreatedAt Timestamp when object was created in database.
  • [ Type TRFC3339DateTime ]
DeliveredAt When the newsletter was delivered.
  • [ Type TRFC3339DateTime ]
EditMode Edit mode for newsletter.
  • [ Type AnsiString ]

Allowed values:
  • tool
  • html
EditType Edit type.
  • [ Type AnsiString ]

Allowed values:
  • full
  • light
  • ulight
Footer Footer type to generate.
  • [ Type AnsiString ]

Allowed values:
  • default
  • none
FooterAddress Address to use in footer.
  • [ Type AnsiString ]
FooterWYSIWYGType What kind of footer to generate.
  • [ Type SmallInt ]
HeaderFilename Filename to use in header.
  • [ Type AnsiString ]
HeaderLink Link used in header.
  • [ Type AnsiString ]
HeaderText Text of header.
  • [ Type AnsiString ]
HeaderUrl URL used in header.
  • [ Type AnsiString ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
Ip IP address used to create newsletter.
  • [ Type AnsiString ]
IsHandled Has the newsletter been handled by Mailjet ?.
  • [ Type Boolean ]
IsStarred Is this a starred newsletter ?.
  • [ Type Boolean ]
IsTextPartIncluded Does the newsletter include a text version ?.
  • [ Type Boolean ]
Locale Locale in which the information in this record is recorded.
  • Mandatory
  • [ Type AnsiString ]
ModifiedAt Timestamp when newsletter content was last modified.
  • [ Type TRFC3339DateTime ]
Permalink Type of permalink that should be added to the newsletter.
  • [ Type AnsiString ]

Allowed values:
  • default
  • none
PermalinkHost Host for the permalink.
  • [ Type AnsiString ]
PermalinkWYSIWYGType ?.
  • [ Type SmallInt ]
PolitenessMode ?.
  • [ Type SmallInt ]
ReplyEmail Reply-To address for the mail.
  • [ Type TEmail ]
SegmentationID
OR
SegmentationALT
SegmentationID
ID reference to ContactFilter
SegmentationALT
Value of the Name field of the related ContactFilter resource
  • [ Type TContactFilter ]
Sender Sender.
  • Mandatory
  • [ Type AnsiString ]
SenderEmail Sender email address in headers.
  • Mandatory
  • [ Type TEmail ]
SenderName Name of the sender in Sender headers.
  • [ Type AnsiString ]
Status Status of the newsletter.
  • [ Type SmallInt ]

Allowed values:
  • AXCanceled (-3)
  • Deleted (-2)
  • Archived (-1)
  • Draft (0)
  • Programmed (1)
  • Sent (2)
  • AXTested (3)
  • AXSelected (4)
Subject Newsletter subject.
  • Mandatory
  • [ Type AnsiString ]
TemplateID ID reference to NewsletterTemplate Template from which this newsletter was generated, or as which it was last saved.
  • [ Type TNewsLetterTemplate ]
TestAddress Address used for testing.
  • [ Type AnsiString ]
Title Newsletter title.
  • [ Type AnsiString ]
Url URL where an online version of the newsletter can be found [?].
  • [ Type AnsiString ]

Update one specific newsletter resource with a PUT request, providing the newsletter's ID value. Be sure to include all the mandatory properties.

# update content of resource newsletter identified by ID $ID

curl -s -X PUT \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/newsletter/$ID \
-H 'Content-Type: application/json' \
-d '{"AXFraction": ...}'

    
Properties
Name Description
AXFraction Fraction of AXTesting in percentage. Zero means remainder
  • [ Type Double ]
AXFractionName Display name for the fraction
  • [ Type AnsiString ]
AXTesting A reference to AXTesting object
  • [ Type TAXTesting ]
Callback Callback URL.
  • [ Type AnsiString ]
CampaignID
OR
CampaignALT
CampaignID
ID reference to Campaign
CampaignALT
Value of the CustomValue field of the related Campaign resource
  • Read Only
  • [ Type TCampaign ]
ContactsListID
OR
ContactsListALT
ContactsListID
ID reference to ContactsList
ContactsListALT
Value of the Address field of the related ContactsList resource
  • [ Type TContactsList ]
CreatedAt Timestamp when object was created in database.
  • [ Type TRFC3339DateTime ]
DeliveredAt When the newsletter was delivered.
  • [ Type TRFC3339DateTime ]
EditMode Edit mode for newsletter.
  • [ Type AnsiString ]

Allowed values:
  • tool
  • html
EditType Edit type.
  • [ Type AnsiString ]

Allowed values:
  • full
  • light
  • ulight
Footer Footer type to generate.
  • [ Type AnsiString ]

Allowed values:
  • default
  • none
FooterAddress Address to use in footer.
  • [ Type AnsiString ]
FooterWYSIWYGType What kind of footer to generate.
  • [ Type SmallInt ]
HeaderFilename Filename to use in header.
  • [ Type AnsiString ]
HeaderLink Link used in header.
  • [ Type AnsiString ]
HeaderText Text of header.
  • [ Type AnsiString ]
HeaderUrl URL used in header.
  • [ Type AnsiString ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
Ip IP address used to create newsletter.
  • [ Type AnsiString ]
IsHandled Has the newsletter been handled by Mailjet ?.
  • [ Type Boolean ]
IsStarred Is this a starred newsletter ?.
  • [ Type Boolean ]
IsTextPartIncluded Does the newsletter include a text version ?.
  • [ Type Boolean ]
Locale Locale in which the information in this record is recorded.
  • Mandatory
  • [ Type AnsiString ]
ModifiedAt Timestamp when newsletter content was last modified.
  • [ Type TRFC3339DateTime ]
Permalink Type of permalink that should be added to the newsletter.
  • [ Type AnsiString ]

Allowed values:
  • default
  • none
PermalinkHost Host for the permalink.
  • [ Type AnsiString ]
PermalinkWYSIWYGType ?.
  • [ Type SmallInt ]
PolitenessMode ?.
  • [ Type SmallInt ]
ReplyEmail Reply-To address for the mail.
  • [ Type TEmail ]
SegmentationID
OR
SegmentationALT
SegmentationID
ID reference to ContactFilter
SegmentationALT
Value of the Name field of the related ContactFilter resource
  • [ Type TContactFilter ]
Sender Sender.
  • Mandatory
  • [ Type AnsiString ]
SenderEmail Sender email address in headers.
  • Mandatory
  • [ Type TEmail ]
SenderName Name of the sender in Sender headers.
  • [ Type AnsiString ]
Status Status of the newsletter.
  • [ Type SmallInt ]

Allowed values:
  • AXCanceled (-3)
  • Deleted (-2)
  • Archived (-1)
  • Draft (0)
  • Programmed (1)
  • Sent (2)
  • AXTested (3)
  • AXSelected (4)
Subject Newsletter subject.
  • Mandatory
  • [ Type AnsiString ]
TemplateID ID reference to NewsletterTemplate Template from which this newsletter was generated, or as which it was last saved.
  • [ Type TNewsLetterTemplate ]
TestAddress Address used for testing.
  • [ Type AnsiString ]
Title Newsletter title.
  • [ Type AnsiString ]
Url URL where an online version of the newsletter can be found [?].
  • [ Type AnsiString ]