curl

Choose Language

Whitelists Calls

/whitelists/add.json

Adds an email to your email rejection whitelist. If the address is currently on your blacklist, that blacklist entry will be removed automatically.

Example Request

curl -A 'Mandrill-Curl/1.0' -d '{"key":"example key","email":"email@example.com","comment":"Internal support address"}' 'https://mandrillapp.com/api/1.0/whitelists/add.json'

Example Response

{"email":"example email","added":true}

Example Error Response

{"status":"error","code":-1,"name":"Invalid_Key","message":"Invalid API key"}
Parameters
key* string a valid api key
email* string an email address to add to the whitelist
Validation: email
comment string an optional description of why the email was whitelisted
Validation: maxlength(255)
Return Value
struct a status object containing the address and the result of the operation
email string the email address you provided
added boolean whether the operation succeeded
Errors
Invalid_Key The provided API key is not a valid Mandrill API key
ValidationError The parameters passed to the API call are invalid or not provided when required
GeneralError An unexpected error occurred processing the request. Mandrill developers will be notified.

/whitelists/list.json

Retrieves your email rejection whitelist. You can provide an email address or search prefix to limit the results. Returns up to 1000 results.

Example Request

curl -A 'Mandrill-Curl/1.0' -d '{"key":"example key","email":"example email"}' 'https://mandrillapp.com/api/1.0/whitelists/list.json'

Example Response

[{"email":"example email","detail":"Whitelisted internal address","created_at":"2013-01-01 15:30:32"}]

Example Error Response

{"status":"error","code":-1,"name":"Invalid_Key","message":"Invalid API key"}
Parameters
key* string a valid api key
email string an optional email address or prefix to search by
Return Value
array up to 1000 whitelist entries
return[] struct the information for each whitelist entry
email string the email that is whitelisted
detail string a description of why the email was whitelisted
created_at string when the email was added to the whitelist
Errors
Invalid_Key The provided API key is not a valid Mandrill API key
ValidationError The parameters passed to the API call are invalid or not provided when required
GeneralError An unexpected error occurred processing the request. Mandrill developers will be notified.

/whitelists/delete.json

Removes an email address from the whitelist.

Example Request

curl -A 'Mandrill-Curl/1.0' -d '{"key":"example key","email":"email@example.com"}' 'https://mandrillapp.com/api/1.0/whitelists/delete.json'

Example Response

{"email":"email@example.com","deleted":true}

Example Error Response

{"status":"error","code":-1,"name":"Invalid_Key","message":"Invalid API key"}
Parameters
key* string a valid api key
email* string the email address to remove from the whitelist
Validation: required, email
Return Value
struct a status object containing the address and whether the deletion succeeded
email string the email address that was removed from the blacklist
deleted boolean whether the address was deleted successfully
Errors
Invalid_Key The provided API key is not a valid Mandrill API key
ValidationError The parameters passed to the API call are invalid or not provided when required
GeneralError An unexpected error occurred processing the request. Mandrill developers will be notified.