V3 REFERENCE Contact Lists

/listrecipient

Manage the relationship between a contact and a contactslists.

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

# list listrecipient resources

curl -s -X GET \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/listrecipient
Properties
Name Description
ContactID
OR
ContactALT
ContactID
ID reference to Contact
ContactALT
Value of the Email field of the related Contact resource
  • Mandatory
  • Read Only
  • [ Type TContact ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
IsActive Is this subscription active.
  • [ Type Boolean ]
IsUnsubscribed Has the contact been unsubscribed from the list ?.
  • [ Type Boolean ]
ListID
OR
ListALT
ListID
ID reference to ContactsList
ListALT
Value of the Address field of the related ContactsList resource
  • Mandatory
  • [ Type TContactsList ]
UnsubscribedAt Timestamp when unsubscription was registered.
  • [ Type TRFC3339DateTime ]
Filters
Name Description
Active Retrieve only list recipients for which the IsActive property matches the specified value.
  • [ Type TBooleanFilter ]
Blocked Retrieve only list recipients for which the contact's IsBlocked property matches the specified value.
  • [ Type TBooleanFilter ]
Contact Only retrieve listrecipient resources for which Contact ID equals the specified value.
  • [ Type Int64 ]
ContactEmail Retrieve only list recipients for which the contact's Email property matches the specified value.
  • [ Type AnsiString ]
ContactsList Retrieve only list recipients for the specified contact list.
  • [ Type Int64 ]
IgnoreDeleted Remove deleted contacts from the resultset
  • [ Type TBooleanFilter ]
LastActivityAt Timestamp of last registered activity for this ListRecipient.
  • [ Type TRFC3339DateTime ]
ListName Retrieve only list recipients for the specified contact list.
  • [ Type AnsiString ]
Opened Retrieve only list recipients for which the contact has at least an opened email.
  • [ Type TBooleanFilter ]
Status Retrieve only list recipients for the given status.
  • [ Type AnsiString ]
Unsub Retrieve only list recipients for which the IsUnsubscribed property matches the specified value.
  • [ Type TBooleanFilter ]

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

# access the listrecipient resource identified by $ID

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

    
    
Properties
Name Description
ContactID
OR
ContactALT
ContactID
ID reference to Contact
ContactALT
Value of the Email field of the related Contact resource
  • Mandatory
  • Read Only
  • [ Type TContact ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
IsActive Is this subscription active.
  • [ Type Boolean ]
IsUnsubscribed Has the contact been unsubscribed from the list ?.
  • [ Type Boolean ]
ListID
OR
ListALT
ListID
ID reference to ContactsList
ListALT
Value of the Address field of the related ContactsList resource
  • Mandatory
  • [ Type TContactsList ]
UnsubscribedAt Timestamp when unsubscription was registered.
  • [ Type TRFC3339DateTime ]

Add a new listrecipient resource with a POST request.

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

curl -s -X POST \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/listrecipient \
-H 'Content-Type: application/json' \
-d '{"IsActive": ...}'
Properties
Name Description
ContactID
OR
ContactALT
ContactID
ID reference to Contact
ContactALT
Value of the Email field of the related Contact resource
  • Mandatory
  • Read Only
  • [ Type TContact ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
IsActive Is this subscription active.
  • [ Type Boolean ]
IsUnsubscribed Has the contact been unsubscribed from the list ?.
  • [ Type Boolean ]
ListID
OR
ListALT
ListID
ID reference to ContactsList
ListALT
Value of the Address field of the related ContactsList resource
  • Mandatory
  • [ Type TContactsList ]
UnsubscribedAt Timestamp when unsubscription was registered.
  • [ Type TRFC3339DateTime ]

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

# update content of resource listrecipient identified by ID $ID

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

    
Properties
Name Description
ContactID
OR
ContactALT
ContactID
ID reference to Contact
ContactALT
Value of the Email field of the related Contact resource
  • Mandatory
  • Read Only
  • [ Type TContact ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
IsActive Is this subscription active.
  • [ Type Boolean ]
IsUnsubscribed Has the contact been unsubscribed from the list ?.
  • [ Type Boolean ]
ListID
OR
ListALT
ListID
ID reference to ContactsList
ListALT
Value of the Address field of the related ContactsList resource
  • Mandatory
  • [ Type TContactsList ]
UnsubscribedAt Timestamp when unsubscription was registered.
  • [ Type TRFC3339DateTime ]

Remove one given listrecipient resource with a DELETE request, providing the listrecipient's ID value.

# delete resource listrecipient with ID $ID

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