The /contact/managemanycontacts resource allows you to add, remove or unsubscribe multiple contacts to / from multiple lists. It works the same way as /contactslist/{list_ID}/managemanycontacts, but you can specify multiple lists in the payload.
curl -s \
-X POST \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contact/managemanycontacts \
-H 'Content-Type: application/json' \
-d '{
"Contacts":[
{
"Email":"passenger@mailjet.com",
"IsExcludedFromCampaigns":"false",
"Name":"Passenger 1",
"Properties":"object"
}
],
"ContactsLists":[
{
"Action":"addforce",
"ListID":"987654321"
},
{
"Action":"addnoforce",
"ListID":"987654321"
},
{
"Action":"remove",
"ListID":"987654321"
},
{
"Action":"unsub",
"ListID":"987654321"
}
]
}'{
"Count": 1,
"Data": [
{
"JobID": 123456
}
],
"Total": 1
}