V3 REFERENCE Contact Lists

/contactslist

Manage your contact lists. One Contact might be associated to one or more ContactsList.

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

# list contactslist resources

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

In addition to the resource $ID, you can also use the unique key $Address to identify this resource. Please refer to the field(s) description below for more information.

Properties
Name Description
Address Email address at which this contacts of this list can be reached.
  • Unique
  • Read Only
  • [ Type AnsiString ]
CreatedAt Timestamp when object was created in database.
  • Read Only
  • [ Type TRFC3339DateTime ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
IsDeleted Has this list been deleted or not.
  • [ Type Boolean ]
Name User-specified name for this contact list (must be unique).
  • [ Type AnsiString ]
SubscriberCount Number of subscribers for this list.
  • Read Only
  • [ Type LongInt ]
Filters
Name Description
Address Only retrieve ContactsList resources for which Address equals the specified value.
  • [ Type AnsiString ]
ExcludeID Exclude ContactsList resources with specified ID from result.
  • [ Type Int64 ]
IsDeleted Only retrieve ContactsList resources for which IsDeleted equals the specified value.
  • [ Type TBooleanFilter ]
Name Only retrieve ContactsList resources for which Name equals the specified value.
  • [ Type AnsiString ]

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

# access the contactslist resource identified by $ID

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

    
# access the resource through the Address's value
# note: all keys marked as 'unique' may be used as an alternate ID

curl -s -X GET \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contactslist/$Address
    
    
Unique Key

In addition to the resource $ID, you can also use the unique key $Address to identify this resource. Please refer to the field(s) description below for more information.

Properties
Name Description
Address Email address at which this contacts of this list can be reached.
  • Unique
  • Read Only
  • [ Type AnsiString ]
CreatedAt Timestamp when object was created in database.
  • Read Only
  • [ Type TRFC3339DateTime ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
IsDeleted Has this list been deleted or not.
  • [ Type Boolean ]
Name User-specified name for this contact list (must be unique).
  • [ Type AnsiString ]
SubscriberCount Number of subscribers for this list.
  • Read Only
  • [ Type LongInt ]

Add a new contactslist resource with a POST request.

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

curl -s -X POST \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contactslist \
-H 'Content-Type: application/json' \
-d '{"IsDeleted": ...}'
Unique Key

In addition to the resource $ID, you can also use the unique key $Address to identify this resource. Please refer to the field(s) description below for more information.

Properties
Name Description
Address Email address at which this contacts of this list can be reached.
  • Unique
  • Read Only
  • [ Type AnsiString ]
CreatedAt Timestamp when object was created in database.
  • Read Only
  • [ Type TRFC3339DateTime ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
IsDeleted Has this list been deleted or not.
  • [ Type Boolean ]
Name User-specified name for this contact list (must be unique).
  • [ Type AnsiString ]
SubscriberCount Number of subscribers for this list.
  • Read Only
  • [ Type LongInt ]

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

# update content of resource contactslist identified by ID $ID

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

    
# update the content, using the value of the Address property
# note: all keys marked as 'unique' may be used as an alternate ID

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

In addition to the resource $ID, you can also use the unique key $Address to identify this resource. Please refer to the field(s) description below for more information.

Properties
Name Description
Address Email address at which this contacts of this list can be reached.
  • Unique
  • Read Only
  • [ Type AnsiString ]
CreatedAt Timestamp when object was created in database.
  • Read Only
  • [ Type TRFC3339DateTime ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
IsDeleted Has this list been deleted or not.
  • [ Type Boolean ]
Name User-specified name for this contact list (must be unique).
  • [ Type AnsiString ]
SubscriberCount Number of subscribers for this list.
  • Read Only
  • [ Type LongInt ]

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

# delete resource contactslist with ID $ID

curl -s -X DELETE \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contactslist/$ID
    
# delete the resource using the alternate unique key Address
# note: all keys marked as 'unique' may be used as an alternate ID

curl -s -X DELETE \
--user "$MJ_APIKEY_PUBLIC:$MJ_APIKEY_PRIVATE" \
https://api.mailjet.com/v3/REST/contactslist/:Address
    
Unique Key

In addition to the resource $ID, you can also use the unique key $Address to identify this resource. Please refer to the field(s) description below for more information.