V3 REFERENCE API Configuration

/apikey

Manage your Mailjet API Keys. API keys are used as credentials to access the API and SMTP server.

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

# list apikey resources

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

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

Properties
Name Description
ACL (AnsiString)
  • [ Type AnsiString ]
APIKey The unique key for this API Key.
  • Mandatory
  • 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 ]
IsActive Is this API Key active ?.
  • [ Type Boolean ]
IsMaster Is this API Key the master key for the user.
  • Read Only
  • [ Type Boolean ]
Name User readable name for this API Key.
  • Mandatory
  • [ Type AnsiString ]
QuarantineValue QuarantineValue
  • Read Only
  • [ Type LongInt ]
Runlevel Runlevel, used to indicate data is migrated and reduced performance is expected.
  • Read Only
  • [ Type TRunLevel ]

Allowed values:
  • Normal
  • Softlock
  • Hardlock
SecretKey Secret key for this API Key (equivalent to password).
  • Read Only
  • [ Type AnsiString ]
TrackHost Host to be used when tracking clicks, opens, unsub requests for this API Key.
  • Read Only
  • [ Type AnsiString ]
UserID User ID for this API key
  • Read Only
  • [ Type LongInt ]
Filters
Name Description
APIKey Only retrieve apikey resources for which APIKey equals the specified value.
  • [ Type AnsiString ]
ConfirmKey Only retrieve apikey resources for which ConfirmKey equals the specified value.
  • [ Type AnsiString ]
CustomStatus Only retrieve apikey resources for which CustomStatus equals the specified value.
  • [ Type TCustomStatus ]
IsActive Only retrieve apikey resources for which IsActive equals the specified value.
  • [ Type TBooleanFilter ]
IsMaster Only retrieve apikey resources for which IsMaster equals the specified value.
  • [ Type TBooleanFilter ]
KeyType Only retrieve apikey resources for which KeyType equals the specified value.
  • [ Type TFilterKeyType ]
Name Only retrieve apikey resources for which Name equals the specified value.
  • [ Type AnsiString ]
User User for which to show API keys.
  • [ Type Int64 ]

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

# access the apikey resource identified by $ID

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

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

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

Properties
Name Description
ACL (AnsiString)
  • [ Type AnsiString ]
APIKey The unique key for this API Key.
  • Mandatory
  • 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 ]
IsActive Is this API Key active ?.
  • [ Type Boolean ]
IsMaster Is this API Key the master key for the user.
  • Read Only
  • [ Type Boolean ]
Name User readable name for this API Key.
  • Mandatory
  • [ Type AnsiString ]
QuarantineValue QuarantineValue
  • Read Only
  • [ Type LongInt ]
Runlevel Runlevel, used to indicate data is migrated and reduced performance is expected.
  • Read Only
  • [ Type TRunLevel ]

Allowed values:
  • Normal
  • Softlock
  • Hardlock
SecretKey Secret key for this API Key (equivalent to password).
  • Read Only
  • [ Type AnsiString ]
TrackHost Host to be used when tracking clicks, opens, unsub requests for this API Key.
  • Read Only
  • [ Type AnsiString ]
UserID User ID for this API key
  • Read Only
  • [ Type LongInt ]

Add a new apikey resource with a POST request.

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

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

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

Properties
Name Description
ACL (AnsiString)
  • [ Type AnsiString ]
APIKey The unique key for this API Key.
  • Mandatory
  • 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 ]
IsActive Is this API Key active ?.
  • [ Type Boolean ]
IsMaster Is this API Key the master key for the user.
  • Read Only
  • [ Type Boolean ]
Name User readable name for this API Key.
  • Mandatory
  • [ Type AnsiString ]
QuarantineValue QuarantineValue
  • Read Only
  • [ Type LongInt ]
Runlevel Runlevel, used to indicate data is migrated and reduced performance is expected.
  • Read Only
  • [ Type TRunLevel ]

Allowed values:
  • Normal
  • Softlock
  • Hardlock
SecretKey Secret key for this API Key (equivalent to password).
  • Read Only
  • [ Type AnsiString ]
TrackHost Host to be used when tracking clicks, opens, unsub requests for this API Key.
  • Read Only
  • [ Type AnsiString ]
UserID User ID for this API key
  • Read Only
  • [ Type LongInt ]

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

# update content of resource apikey identified by ID $ID

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

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

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

Properties
Name Description
ACL (AnsiString)
  • [ Type AnsiString ]
APIKey The unique key for this API Key.
  • Mandatory
  • 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 ]
IsActive Is this API Key active ?.
  • [ Type Boolean ]
IsMaster Is this API Key the master key for the user.
  • Read Only
  • [ Type Boolean ]
Name User readable name for this API Key.
  • Mandatory
  • [ Type AnsiString ]
QuarantineValue QuarantineValue
  • Read Only
  • [ Type LongInt ]
Runlevel Runlevel, used to indicate data is migrated and reduced performance is expected.
  • Read Only
  • [ Type TRunLevel ]

Allowed values:
  • Normal
  • Softlock
  • Hardlock
SecretKey Secret key for this API Key (equivalent to password).
  • Read Only
  • [ Type AnsiString ]
TrackHost Host to be used when tracking clicks, opens, unsub requests for this API Key.
  • Read Only
  • [ Type AnsiString ]
UserID User ID for this API key
  • Read Only
  • [ Type LongInt ]