V3 REFERENCE Contact Lists

/contact

Manage the details of a Contact.

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

# list contact resources

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

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

Properties
Name Description
CreatedAt Timestamp when object was created in database.
  • Read Only
  • [ Type TRFC3339DateTime ]
DeliveredCount Number of messages delivered to this contact.
  • Read Only
  • [ Type Int64 ]
Email Email address of this contact.
  • Mandatory
  • Unique
  • [ Type TEmail ]
ExclusionFromCampaignsUpdatedAt Last update of the exclusion from campaigns status.
  • Read Only
  • [ Type TRFC3339DateTime ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
IsExcludedFromCampaigns Represents the exclusion state of the given contact in campaigns. True if excluded from any campaigns. False otherwise.
  • [ Type Boolean ]
IsOptInPending Is an opt-in for a contactslist subscription pending ?.
  • Read Only
  • [ Type Boolean ]
IsSpamComplaining Is this contact complaining of spam ?.
  • Read Only
  • [ Type Boolean ]
LastActivityAt Timestamp of last registered activity for this contact.
  • Read Only
  • [ Type TRFC3339DateTime ]
LastUpdateAt Timestamp of last update of this contact.
  • Read Only
  • [ Type TRFC3339DateTime ]
Name User-provided name for this contact.
  • [ Type AnsiString ]
UnsubscribedAt (deprecated) Timestamp of last unsubscribe from all lists request.
  • Read Only
  • [ Type TRFC3339DateTime ]
UnsubscribedBy (deprecated) Description of who initiated the unsubscribe from all lists request.
  • Read Only
  • [ Type AnsiString ]
Filters
Name Description
Campaign Only retrieve contacts targeted by this campaign.
  • [ Type Int64 ]
ContactsList Only retrieve contacts from this contact list.
  • [ Type Int64 ]
IsExcludedFromCampaigns Retrieve contacts which are in the given exclusion status.
  • [ Type TBooleanFilter ]
IsUnsubscribed Only retrieve contacts which have been unsubscribed (or not).
  • [ Type TBooleanFilter ]
LastActivityAt Only retrieve contact resources for which LastActivityAt equals the specified value.
  • [ Type TRFC3339DateTime ]
Status Only retrieve contacts with the specified status.
  • [ Type AnsiString ]

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

# access the contact resource identified by $ID

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

    
# access the resource through the Email'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/contact/$Email
    
    
Unique Key

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

Properties
Name Description
CreatedAt Timestamp when object was created in database.
  • Read Only
  • [ Type TRFC3339DateTime ]
DeliveredCount Number of messages delivered to this contact.
  • Read Only
  • [ Type Int64 ]
Email Email address of this contact.
  • Mandatory
  • Unique
  • [ Type TEmail ]
ExclusionFromCampaignsUpdatedAt Last update of the exclusion from campaigns status.
  • Read Only
  • [ Type TRFC3339DateTime ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
IsExcludedFromCampaigns Represents the exclusion state of the given contact in campaigns. True if excluded from any campaigns. False otherwise.
  • [ Type Boolean ]
IsOptInPending Is an opt-in for a contactslist subscription pending ?.
  • Read Only
  • [ Type Boolean ]
IsSpamComplaining Is this contact complaining of spam ?.
  • Read Only
  • [ Type Boolean ]
LastActivityAt Timestamp of last registered activity for this contact.
  • Read Only
  • [ Type TRFC3339DateTime ]
LastUpdateAt Timestamp of last update of this contact.
  • Read Only
  • [ Type TRFC3339DateTime ]
Name User-provided name for this contact.
  • [ Type AnsiString ]
UnsubscribedAt (deprecated) Timestamp of last unsubscribe from all lists request.
  • Read Only
  • [ Type TRFC3339DateTime ]
UnsubscribedBy (deprecated) Description of who initiated the unsubscribe from all lists request.
  • Read Only
  • [ Type AnsiString ]

Add a new contact resource with a POST request.

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

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

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

Properties
Name Description
CreatedAt Timestamp when object was created in database.
  • Read Only
  • [ Type TRFC3339DateTime ]
DeliveredCount Number of messages delivered to this contact.
  • Read Only
  • [ Type Int64 ]
Email Email address of this contact.
  • Mandatory
  • Unique
  • [ Type TEmail ]
ExclusionFromCampaignsUpdatedAt Last update of the exclusion from campaigns status.
  • Read Only
  • [ Type TRFC3339DateTime ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
IsExcludedFromCampaigns Represents the exclusion state of the given contact in campaigns. True if excluded from any campaigns. False otherwise.
  • [ Type Boolean ]
IsOptInPending Is an opt-in for a contactslist subscription pending ?.
  • Read Only
  • [ Type Boolean ]
IsSpamComplaining Is this contact complaining of spam ?.
  • Read Only
  • [ Type Boolean ]
LastActivityAt Timestamp of last registered activity for this contact.
  • Read Only
  • [ Type TRFC3339DateTime ]
LastUpdateAt Timestamp of last update of this contact.
  • Read Only
  • [ Type TRFC3339DateTime ]
Name User-provided name for this contact.
  • [ Type AnsiString ]
UnsubscribedAt (deprecated) Timestamp of last unsubscribe from all lists request.
  • Read Only
  • [ Type TRFC3339DateTime ]
UnsubscribedBy (deprecated) Description of who initiated the unsubscribe from all lists request.
  • Read Only
  • [ Type AnsiString ]

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

# update content of resource contact identified by ID $ID

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

    
# update the content, using the value of the Email 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/contact/:Email \
-H 'Content-Type: application/json' \
-d '{"CreatedAt": ...}'
    
Unique Key

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

Properties
Name Description
CreatedAt Timestamp when object was created in database.
  • Read Only
  • [ Type TRFC3339DateTime ]
DeliveredCount Number of messages delivered to this contact.
  • Read Only
  • [ Type Int64 ]
Email Email address of this contact.
  • Mandatory
  • Unique
  • [ Type TEmail ]
ExclusionFromCampaignsUpdatedAt Last update of the exclusion from campaigns status.
  • Read Only
  • [ Type TRFC3339DateTime ]
ID Unique numerical ID for this object.
  • Read Only
  • [ Type Int64 ]
IsExcludedFromCampaigns Represents the exclusion state of the given contact in campaigns. True if excluded from any campaigns. False otherwise.
  • [ Type Boolean ]
IsOptInPending Is an opt-in for a contactslist subscription pending ?.
  • Read Only
  • [ Type Boolean ]
IsSpamComplaining Is this contact complaining of spam ?.
  • Read Only
  • [ Type Boolean ]
LastActivityAt Timestamp of last registered activity for this contact.
  • Read Only
  • [ Type TRFC3339DateTime ]
LastUpdateAt Timestamp of last update of this contact.
  • Read Only
  • [ Type TRFC3339DateTime ]
Name User-provided name for this contact.
  • [ Type AnsiString ]
UnsubscribedAt (deprecated) Timestamp of last unsubscribe from all lists request.
  • Read Only
  • [ Type TRFC3339DateTime ]
UnsubscribedBy (deprecated) Description of who initiated the unsubscribe from all lists request.
  • Read Only
  • [ Type AnsiString ]