Subscriptions

Contacts need to be subscribed to a contact list, in order to receive marketing emails directed to the respective list. The resources below help you manage the subscription status of your contacts.

post

Add, remove or unsubscribe a contact to/from a selection of contact lists

post

Manage a single contact subscription to a specific contact list

post

Create a new list recipient

post

/contact/{contact_ID or contact_email}/managecontactslists

Manage the presence and subscription status of a contact for multiple contact lists. Select the contact lists, as well as the desired action to be performed on each one - add, remove or unsub. The contact should already be present in the global contact list.

Full API path

https://api.mailjet.com/v3/REST/contact/{contact_ID}/managecontactslists

Path parameters

contact_ID

integer, required

Unique numeric ID of the contact you want to manage the subscription status of.

contact_email

Body parameters

ContactsLists

array

A JSON array, containing information about the contact lists and the actions performed for each list.

ListID

integer

Unique numeric ID of the contact list.

Action

string

Action to be performed on the contacts for this list:

  • addforce - Add the contacts to this list and subscribe all of them. Any contacts already present in the list and unsubscribed from it will be forcibly subscribed once again.

  • addnoforce - Add the contacts to this list and subscribe them to it. Any contacts already present will retain their subscription status, i.e. if a contact is part of the list, but unsubscribed, it will not be forcibly subscribed again.

  • remove - Remove the contacts from this list.

  • unsub - Unsubscribe the contacts from this list.

Responses

Note: You can find all the errors related to API in the error page

Count

integer

Data

array

ContactsLists

array

A JSON array, containing information about the contact lists and the actions performed for each list.

Total

integer

post

/contactslist/{list_ID or list_address}/managecontact

Manage the presence and subscription status of a contact to a specific contact list. The API will internally create the new contact if it does not exist, as well as add or update the name and properties.

Full API path

https://api.mailjet.com/v3/REST/contactslist/{list_ID}/managecontact

Path parameters

list_ID

integer, required

Unique numeric ID assigned to this contact list.

list_address

Unique email address generated by Mailjet for this list. This address which can be used only via Mailjet's SMTP server to reach all contacts in it. It is displayed in the Address property of the list. The full email address will be {list_address}@lists.mailjet.com.

Body parameters

Name

string

User-defined name for the contact.

Properties

object

A JSON object containing contact properties and their values. Each property is listed with its name as the parameter name, and the property value as the parameter value. The properties must have been created beforehand.

Action

string, required

Action to be performed on the contact for this list:

  • addforce - Add the contact to this list and subscribe all of them. If the contact is already present in the list and unsubscribed from, it will be forcibly subscribed once again.
  • addnoforce - Add the contact to this list and subscribe them to it. If the contact is already present, it will retain its subscription status, i.e. if a contact is part of the list, but unsubscribed, it will not be forcibly subscribed again.
  • remove - Remove the contact from this list
  • unsub - Unsubscribe the contact from this list

Email

string, required

The email address of this contact.

Responses

Note: You can find all the errors related to API in the error page

Count

integer

Data

array

Name

string

User-defined name for the contact.

Properties

object

A JSON object containing contact properties and their values. Each property is listed with its name as the parameter name, and the property value as the parameter value. The properties must have been created beforehand.

Action

string

Action performed on the contact for this list:

  • addforce - Add the contact to this list and subscribe all of them. If the contact is already present in the list and unsubscribed from, it will be forcibly subscribed once again.
  • addnoforce - Add the contact to this list and subscribe them to it. If the contact is already present, it will retain its subscription status, i.e. if a contact is part of the list, but unsubscribed, it will not be forcibly subscribed again.
  • remove - Remove the contact from this list
  • unsub - Unsubscribe the contact from this list

Email

string

The email address of this contact.

Total

integer

post

/listrecipient

Create a new list recipient. A list recipient object manages the relationship between a `contact` and a `contactslist` - every instance of a contact being added to a list creates a new list recipient. Both the contact and the list need to be created beforehand.

Full API path

https://api.mailjet.com/v3/REST/listrecipient

Body parameters

IsUnsubscribed

boolean

Indicates whether the list recipient is unsubscribed from this List ID or not.

Default value: false

ContactID

integer, required

Unique numeric ID for the contact the list recipient is linked to. Interchangeable with ContactAlt.

ContactAlt

string

The email address of the contact the list recipient is linked to. Interchangeable with ContactID.

ListID

integer, required

Unique numeric ID of the contact list, for which to create the new recipient. Interchangeable with ListAlt.

ListAlt

string

A unique contact list email address generated by Mailjet, for which to create the new recipient. Interchangeable with ListID.

Responses

Note: You can find all the errors related to API in the error page

Count

integer

Data

array

IsUnsubscribed

boolean

Indicates whether the list recipient is unsubscribed from this List ID or not.

Default value: false

ContactID

integer

Unique numeric ID for the contact the list recipient is linked to.

ID

integer

Unique numeric ID assigned to this list recipient.

IsActive

boolean

Legacy Property - indicates whether the subscription for this contact is active or not. Please use IsUnsubscribed instead.

Default value: true

ListID

integer

Unique numeric ID of the contact list, to which the list recipient was subscribed.

UnsubscribedAt

string

Timestamp indicating when the list recipient was unsubscribed from the list.

Total

integer