Email

Everything about sending Emails

Languages
Servers
https://rest.clicksend.com/

Send Email

Request

Send transactional email

Send transactional email

Properties

NameTypeRequiredRestrictionsDescription
toarraytruenoneArray of To Recipient items. (array of names and emails)
ccarrayfalsenoneArray of Cc Recipient items. (array of names and emails)
bccarrayfalsenoneArray of Bcc Recipient items. (array of names and emails)
fromobjecttruenoneFrom Email object. (object containing name and email)
bodystringtruenoneBody of the email.
attachmentsarrayfalsenoneArray of Attachment items.
schedulenumberfalsenoneSchedule.
namestringfalsenoneName of person email belongs to
emailstringtruenoneEmail to be used.
contentstringtruenoneThe base64-encoded contents of the file.
typestringtruenoneThe type of file being attached.
filenamestringtruenoneThe name of the file being attached.
dispositionstringtruenoneInline for content that can be displayed within the email, or attachment for any other files.
content_idstringtruenoneAn ID for the content.

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
toArray of objects
Example: [{"email":"test@test.com","name":"test from"}]
fromobject
Example: {"email_address_id":"{{addressId}}","name":"test"}
subjectstring
Example: "test subject"
bodystring
Example: "test body"
attachmentsArray of objects
Example: [{"content":"{{base64EncodedImageFile}}","type":"image/jpeg","filename":"test.jpg","disposition":"inline","content_id":"test"}]
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "    {
       \"to\":[
          {
             \"email\":\"test@clicksend.com\",
             \"name\":\"John Doe\"
          }
       ],
       \"cc\":[
          {
             \"email\":\"test2@clicksend.com\",
             \"name\":\"Jane Doe\"
          }
       ],
       \"bcc\":[
          {
             \"email\":\"test3@clicksend.com\",
             \"name\":\"Joseph Doe\"
          }
       ],
       \"from\":{
          \"email_address_id\":1,
          \"name\":\"Joanne Doe\"
       },
       \"subject\":\"Test subject\",
       \"body\":\"Lorem ipsum\",
       \"attachments\":[
          {
             \"content\":\"ZmlsZSBjb250ZW50cw==\",
             \"type\":\"text/plain\",
             \"filename\":\"text.txt\",
             \"disposition\":\"attachment\",
             \"content_id\":\"text\"
          }
       ]
    }" \
'https://rest.clicksend.com/v3/email/send'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Transactional email queued for delivery."
dataobject(transactional_email)
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Transactional email queued for delivery.", "data": { "user_id": 1, "subaccount_id": 1, "from_email_address_id": 1, "from_name": "Joanne Doe", "to": [], "cc": [], "bcc": [], "subject": "Test subject", "body": "Lorem ipsum", "body_plain_text": "Lorem ipsum", "schedule": 1507018182, "message_id": "21C632C1-3FCC-4EFF-8191-6079244F0142", "status": "WaitApproval", "status_text": "Accepted for delivery", "soft_bounce_count": 0, "hard_bounce_count": 0, "price": "0.0050", "date_added": 1507018182, "custom_string": null, "_attachments": [], "_currency": {} } }

Calculate Email Price

Request

Get transactional email price

Get transactional email price

Properties

NameTypeRequiredRestrictionsDescription
toarraytruenoneArray of To Recipient items. (array of names and emails)
ccarrayfalsenoneArray of Cc Recipient items. (array of names and emails)
bccarrayfalsenoneArray of Bcc Recipient items. (array of names and emails)
fromobjecttruenoneFrom Email object. (object containing name and email)
bodystringtruenoneBody of the email.
attachmentsarrayfalsenoneArray of Attachment items.
schedulenumberfalsenoneSchedule.
namestringfalsenoneName of person email belongs to
emailstringtruenoneEmail to be used.
contentstringtruenoneThe base64-encoded contents of the file.
typestringtruenoneThe type of file being attached.
filenamestringtruenoneThe name of the file being attached.
dispositionstringtruenoneInline for content that can be displayed within the email, or attachment for any other files.
content_idstringtruenoneAn ID for the content.

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
toArray of objects
Example: [{"email":"test@test.com","name":"test from"}]
fromobject
Example: {"email_address_id":"{{addressId}}","name":"test"}
subjectstring
Example: "test subject"
bodystring
Example: "test body"
curl -i -X POST \
  -u <username>:<password> \
  https://rest.clicksend.com/v3/email/price \
  -H 'Content-Type: application/json' \
  -d '{
    "to": [
      {
        "email": "test@test.com",
        "name": "test from"
      }
    ],
    "from": {
      "email_address_id": "{{addressId}}",
      "name": "test"
    },
    "subject": "test subject",
    "body": "test body"
  }'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here's your price."
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here's your price.", "data": [ {} ] }

View Email History

Request

Get all transactional email history

Get all transactional email history

Parameters

ParameterInTypeRequiredDescription
date_fromqueryinteger(int32)falseStart date (Unix Timestamp e.g. 1436849372)
date_toqueryinteger(int32)falseEnd date (Unix Timestamp e.g. 1436879372)
pagequeryinteger(int32)falsePage number
limitqueryinteger(int32)falseNumber of records per page

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/history'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here is your result."
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here is your result.", "data": [ {} ] }

Export Email History

Request

Export all Transactional Email history

Export all Transactional Email history

Parameters

ParameterInTypeRequiredDescription
filenamequerystringtrueFilename to download history as
date_fromqueryinteger(int32)falseStart date (Unix Timestamp e.g. 1436849372)
date_toqueryinteger(int32)falseEnd date (Unix Timestamp e.g. 1436879372)

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/history/export?filename={filename}'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Download your file here."
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Download your file here.", "data": { "url": "https://rest.clicksend.com/files/22D55AF9-6CF0-476D-A8B3-82A998FD2738?filename=export.csv" } }

View Allowed Email Addresses

Request

Get all email addresses

Get all email addresses

Parameters

ParameterInTypeRequiredDescription
pagequeryinteger(int32)falsePage number
limitqueryinteger(int32)falseNumber of records per page

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/addresses'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here are your email addresses"
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here are your email addresses", "data": { "total": 2, "per_page": 15, "current_page": 1, "last_page": 1, "next_page_url": null, "prev_page_url": null, "from": 1, "to": 2, "data": [] } }

Create Allowed Email Address

Request

Create allowed Email Address

Create allowed Email Address

Parameters

ParameterInTypeRequiredDescription
bodybodystringtrueEmail to be allowed.

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
email_addressstring
Example: "test@test.com"
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
  \"email_address\": \"johndoe1@user.com\",
  \"Body\": \"\"
}" \
'https://rest.clicksend.com/v3/email/addresses'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Email address has been created."
dataobject(email_address)
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Email address has been created.", "data": { "email_address_id": 2, "email_address": "test2@user.com", "verified": 0, "date_added": "1436157486" } }

Send Email Verification Token

Request

Send verification token

Send verification token

Parameters

ParameterInTypeRequiredDescription
email_address_idpathinteger(int32)trueAllowed email address id

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
email_address_idstringrequired
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
toArray of objects
Example: [{"email":"test@test.com","name":"Test From"}]
fromobject
Example: {"email_address_id":2,"name":"Test"}
subjectstring
Example: "Test Subject"
bodystring
Example: "Test Body"
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
'https://rest.clicksend.com/v3/email/address-verify/{email_address_id}/send'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Verification email has been sent."
dataobject or null
Example: null
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Verification email has been sent.", "data": null }

Verify Allowed Email Address

Request

Verify email address using verification token

Verify email address using verification token

Parameters

ParameterInTypeRequiredDescription
email_address_idpathinteger(int32)trueAllowed email address id
activation_tokenpathstringtrueYour activation token.

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
email_address_idstringrequired
activation_tokenstringrequired
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
toArray of objects
Example: [{"email":"test@test.com","name":"test from"}]
fromobject
Example: {"email_address_id":2,"name":"test"}
subjectstring
Example: "test subject"
bodystring
Example: "test body"
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
'https://rest.clicksend.com/v3/email/address-verify/{email_address_id}/verify/{activation_token}'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Email address verified."
dataobject(email_address)
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Email address verified.", "data": { "email_address_id": 2, "email_address": "test2@user.com", "verified": 0, "date_added": "1436157486" } }

View Allowed Email Address

Request

Get specific email address

Get specific email address

Parameters

ParameterInTypeRequiredDescription
email_address_idpathinteger(int32)trueAllowed email address id

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
email_address_idstringrequired
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/addresses/{email_address_id}'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here is your email address."
dataobject(email_address)
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here is your email address.", "data": { "email_address_id": 2, "email_address": "test2@user.com", "verified": 0, "date_added": "1436157486" } }

Delete Allowed Email Address

Request

Delete specific email address

Delete specific email address

Parameters

ParameterInTypeRequiredDescription
email_address_idpathinteger(int32)trueAllowed email address id

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
email_address_idstringrequired
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \
'https://rest.clicksend.com/v3/email/addresses/{email_address_id}'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Email address deleted."
dataobject or null
Example: null
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Email address deleted.", "data": null }

Send Email Campaign

Request

Send email campaign

Send email campaign

Properties

NameTypeRequiredRestrictionsDescription
namestringtruenoneYour campaign name.
subjectstringtruenoneYour campaign subject.
bodystringtruenoneYour campaign message.
from_email_address_idnumbertruenoneThe allowed email address id.
from_namestringtruenoneYour name or business name.
template_idnumberfalsenoneYour template id.
list_idnumbertruenoneYour contact list id.
scheduleinteger(int32)falsenoneYour schedule timestamp.

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
namestring
Example: "test campaign"
subjectstring
Example: "Test email subject"
from_email_address_idstring
Example: "{{emailId}}"
template_idstring
Example: "{{templateId}}"
list_idstring
Example: "{{listId}}"
from_namestring
Example: "Test Name"
draftinteger
custom_stringstring
Example: "test !@#$%^&*()"
bodystring
Example: "<p>it's a test</p>"
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
  \"name\" : \"John Doe\",
  \"subject\" : \"Lorem Ipsum\",
  \"from_email_address_id\" : 2,
  \"from_name\" : \"From name\",
  \"template_id\" : 31,
  \"body\" : \"<p>This is a test</p>\",
  \"list_id\" : 456
}" \
'https://rest.clicksend.com/v3/email-campaigns/send'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Email campaign has been created."
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Email campaign has been created.", "data": { "totlal_count": 1, "total_price": "0.0066", "queued_count": 1, "data": {}, "_currency": {} } }

Calculate Email Campaign Price

Request

Calculate email campaign price

Calculate email campaign price

Properties

NameTypeRequiredRestrictionsDescription
namestringtruenoneYour campaign name.
subjectstringtruenoneYour campaign subject.
bodystringtruenoneYour campaign message.
from_email_address_idnumbertruenoneThe allowed email address id.
from_namestringtruenoneYour name or business name.
template_idnumberfalsenoneYour template id.
list_idnumbertruenoneYour contact list id.
scheduleinteger(int32)falsenoneYour schedule timestamp.

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
namestring
Example: "test campaign"
subjectstring
Example: "Test email subject"
from_email_address_idstring
Example: "{{emailId}}"
template_idstring
Example: "{{templateId}}"
list_idstring
Example: "{{listId}}"
from_namestring
Example: "Test Name"
draftinteger
schedulestring
Example: "1250165515"
custom_stringstring
Example: "test !@#$%^&*()"
bodystring
Example: "<p>it's a test</p>"
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
  \"name\" : \"John Doe\",
  \"subject\" : \"Lorem Ipsum\",
  \"from_email_address_id\" : 2,
  \"from_name\" : \"From name\",
  \"template_id\" : 31,
  \"body\" : \"<p>This is a test</p>\",
  \"list_id\" : 456
}" \
'https://rest.clicksend.com/v3/email-campaigns/price'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Total price for email campaign."
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Total price for email campaign.", "data": { "total_count": 1, "total_price": "0.0066", "queued_count": 2, "data": {}, "_currency": {} } }

View All Email Campaigns

Request

Get all email campaigns

Get all email campaigns

Parameters

ParameterInTypeRequiredDescription
pagequeryinteger(int32)falsePage number
limitqueryinteger(int32)falseNumber of records per page

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email-campaigns'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here are your email campaigns"
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here are your email campaigns", "data": { "total": 2, "per_page": 15, "current_page": 1, "last_page": 1, "next_page_url": null, "prev_page_url": null, "from": 1, "to": 2, "data": [] } }

View Email Campaign

Request

Get specific email campaign

Get specific email campaign

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
email_campaign_idstringrequired
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here is your email campaign."
dataobject(email_campaign)
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here is your email campaign.", "data": { "email_campaign_id": 64, "name": "test email", "user_id": 1201, "subaccount_id": 1038, "subject": "My test subject", "list_id": 443, "from_email_address_id": 2, "from_name": "Test name", "template_id": 24, "schedule": "", "status": "Sent", "date_added": "1455586793", "custom_string": "", "send_count": 0, "open_count": 5, "click_count": 0, "hard_bounce_count": 0, "soft_bounce_count": 0, "abuse_count": 0, "unsubscribe_count": 0, "body": "test body", "body_plain_text": "test body" } }

Update Email Campaign

Request

Edit email campaign

Edit email campaign

Parameters

ParameterInTypeRequiredDescription
email_campaign_idpathinteger(int32)trueAllowed email campaign id

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
email_campaign_idstringrequired
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
scheduleinteger
list_idinteger
Example: 123
subjectstring
Example: "subject"
from_email_address_idinteger
Example: 4062
namestring
Example: "name"
template_idinteger
Example: 4077
bodystring
Example: "body"
from_namestring
Example: "from_name"
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
     --header "Content-Type: application/json" \
     --data-binary "{
  \"name\" : \"John Doe\",
  \"subject\" : \"Lorem Ipsum\",
  \"from_email_address_id\" : 2,
  \"from_name\" : \"From name\",
  \"template_id\" : 31,
  \"body\" : \"<p>This is a test</p>\",
  \"list_id\" : 456
}" \
'https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Email campaign has been updated."
dataobject(email_campaign)
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Email campaign has been updated.", "data": { "email_campaign_id": 64, "name": "test email", "user_id": 1201, "subaccount_id": 1038, "subject": "My test subject", "list_id": 443, "from_email_address_id": 2, "from_name": "Test name", "template_id": 24, "schedule": "", "status": "Sent", "date_added": "1455586793", "custom_string": "", "send_count": 0, "open_count": 5, "click_count": 0, "hard_bounce_count": 0, "soft_bounce_count": 0, "abuse_count": 0, "unsubscribe_count": 0, "body": "test body", "body_plain_text": "test body" } }

Cancel Email Campaign

Request

Cancel email campaign

Cancel email campaign

Parameters

ParameterInTypeRequiredDescription
email_campaign_idpathinteger(int32)trueAllowed email campaign id
date_fromqueryinteger(int32)falseStart date (Unix Timestamp e.g. 1436849372)
date_toqueryinteger(int32)falseEnd date (Unix Timestamp e.g. 1436879372)
pagequeryinteger(int32)falsePage number
limitqueryinteger(int32)falseNumber of records per page

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
email_campaign_idstringrequired
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
namestring
Example: "test campaign"
subjectstring
Example: "Test email subject"
from_email_address_idinteger
Example: 1
template_idinteger
Example: 67
list_idinteger
Example: 285
from_namestring
Example: "Test Name"
draftinteger
schedulestring
Example: "1250165515"
custom_stringstring
Example: "test !@#$%^&*()"
bodystring
Example: "<p>it's a test</p>"
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \
'https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}/cancel'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Email campaign has been cancelled."
dataobject(email_campaign)
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Email campaign has been cancelled.", "data": { "email_campaign_id": 64, "name": "test email", "user_id": 1201, "subaccount_id": 1038, "subject": "My test subject", "list_id": 443, "from_email_address_id": 2, "from_name": "Test name", "template_id": 24, "schedule": "", "status": "Sent", "date_added": "1455586793", "custom_string": "", "send_count": 0, "open_count": 5, "click_count": 0, "hard_bounce_count": 0, "soft_bounce_count": 0, "abuse_count": 0, "unsubscribe_count": 0, "body": "test body", "body_plain_text": "test body" } }

View Email Campaign History

Request

Get specific email campaign history

Get specific email campaign history

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
email_campaign_idstringrequired
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email-campaigns/{campaign_id}/history'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here is your result."
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here is your result.", "data": { "total": 2, "per_page": 15, "current_page": 1, "last_page": 1, "next_page_url": null, "prev_page_url": null, "from": 1, "to": 2, "data": [] } }

Export Email Campaign History

Request

Export specific email campaign history

Export specific email campaign history

Parameters

ParameterInTypeRequiredDescription
email_campaign_idpathinteger(int32)trueAllowed email campaign id
date_fromqueryinteger(int32)falseStart date (Unix Timestamp e.g. 1436849372)
date_toqueryinteger(int32)falseEnd date (Unix Timestamp e.g. 1436879372)

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
email_campaign_idstringrequired
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email-campaigns/{campaign_id}/history/export'

Responses

Successful response

Bodyapplication/json
Response
application/json
null

View Master Email Templates

Request

Get all master email templates.

Get all master email templates.

Parameters

ParameterInTypeRequiredDescription
pagequeryinteger(int32)falsePage number
limitqueryinteger(int32)falseNumber of records per page

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/master-templates'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "List of Email Master Templates"
dataArray of objects(master_email_template)
Example: [{"template_id_master":57,"template_name":"Welcome Email","date_added":"1436157486","thumbnail":{"small":"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-small.jpg","large":"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-large.jpg"}},{"template_id_master":1,"template_name":"Minty","date_added":"1445848821","thumbnail":{"small":"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/minty/thumb-small.jpg","large":"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/minty/thumb-large.jpg"}}]
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "List of Email Master Templates", "data": [ {}, {} ] }

View Master Email Template

Request

Get specific master email template

Get specific master email template

Parameters

ParameterInTypeRequiredDescription
template_idpathinteger(int32)trueEmail template id

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
template_idstringrequired
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/master-templates/{template_id}'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here is your email template"
dataobject(master_email_template)
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here is your email template", "data": { "template_id_master": 57, "template_name": "Welcome Email", "date_added": "1436157486", "body": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" ...\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n</body>\n</html>", "thumbnail": {} } }

View Template Categories

Request

Get all master email template categories

Get all master email template categories

Parameters

ParameterInTypeRequiredDescription
pagequeryinteger(int32)falsePage number
limitqueryinteger(int32)falseNumber of records per page

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/master-templates-categories'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "List of Email Categories"
dataArray of objects
Example: [{"category_id":2,"category_name":"Alerts/Notificartions"},{"category_id":3,"category_name":"Art"},{"category_id":4,"category_name":"Birthday"},{"category_id":23,"category_name":"Blank Template"}]
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "List of Email Categories", "data": [ {}, {}, {}, {} ] }

View Template Category

Request

Get specific master email template category

Get specific master email template category

Parameters

ParameterInTypeRequiredDescription
category_idpathinteger(int32)trueEmail category id

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
category_idstringrequired
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/master-templates-categories/{category_id}'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here are your data."
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here are your data.", "data": { "category_id": 4, "name": "Birthday" } }

View Templates in Category

Request

Get all master email templates in a category

Get all master email templates in a category

Parameters

ParameterInTypeRequiredDescription
category_idpathinteger(int32)trueEmail category id
pagequeryinteger(int32)falsePage number
limitqueryinteger(int32)falseNumber of records per page

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
category_idstringrequired
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/master-templates-categories/{category_id}/master-templates'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "List of Email Templates By Category"
dataArray of objects(master_email_template)
Example: [{"template_id_master":1,"category_id":1,"template_name":"Minty","body":"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" ...\n </tr>\n </tbody>\n </table>\n </td>\n </tr>\n </tbody>\n </table>\n</body>\n</html>","date_added":"1445848821","thumbnail":{"small":"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-small.jpg","large":"https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-large.jpg"}}]
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "List of Email Templates By Category", "data": [ {} ] }

View Email Templates

Request

Get all user email templates

Get all user email templates

Parameters

ParameterInTypeRequiredDescription
pagequeryinteger(int32)falsePage number
limitqueryinteger(int32)falseNumber of records per page

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/templates'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here are your email templates."
dataobject
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here are your email templates.", "data": { "total": 2, "per_page": 15, "current_page": 1, "last_page": 1, "next_page_url": null, "prev_page_url": null, "from": 1, "to": 15, "data": [] } }

Create Email Template

Request

Create email template

Create email template

Properties

NameTypeRequiredRestrictionsDescription
template_namestringtruenoneThe intended name for the new template.
template_id_masternumbertruenoneThe ID of the master template you want to base on.

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
template_id_masterinteger
Example: 1
template_namestring
Example: "bitpolypmus"
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request POST \
     --header "Content-Type: application/json" \
     --data-binary "{
  \"template_name\": \"Minions\",
  \"template_id_master\": 57
}" \
'https://rest.clicksend.com/v3/email/templates'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "New email template has been saved."
dataobject(user_email_template)
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "New email template has been saved.", "data": { "template_id": 292, "template_id_master": 57, "template_name": "new minion template!", "body": "<div id=\"nb_wrapper\"><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"..." } }

View Email Template

Request

Get specific user email template

Get specific user email templates

Parameters

ParameterInTypeRequiredDescription
template_idpathinteger(int32)trueEmail template id

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
template_idstringrequired
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
'https://rest.clicksend.com/v3/email/templates/{template_id}'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Here is your email template."
dataobject(user_email_template)
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Here is your email template.", "data": { "template_id": 292, "template_id_master": 57, "template_name": "new minion template!", "body": "<div id=\"nb_wrapper\"><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"..." } }

Update Email Template

Request

Update email template

Update email template

Parameters

ParameterInTypeRequiredDescription
template_idpathinteger(int32)trueEmail template id

Properties

NameTypeRequiredRestrictionsDescription
template_namestringfalsenoneThe intended name for the template.
bodystringtruenoneYour template body.

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
template_idstringrequired
Headers
Content-Typestring
Example: application/json
Bodyapplication/json
bodystring
Example: "Test"
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request PUT \

     --data-binary "    {
        \"template_name\":\"Minions\",
        \"body\":\"This is a sample content: Sc0KNWgSMG for this template.\"
    }" \
'https://rest.clicksend.com/v3/email/templates/{template_id}'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Your email template has been updated."
dataobject(user_email_template)
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Your email template has been updated.", "data": { "template_id": 292, "template_id_master": 57, "template_name": "new minion template!", "body": "<div id=\"nb_wrapper\"><!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"..." } }

Delete Email Template

Request

Delete user email template

Delete user email template

Parameters

ParameterInTypeRequiredDescription
template_idpathinteger(int32)trueEmail template id

Refer to Status Codes for definitions of HTTP status code responses.

This endpoint requires authentication,more info...
Path
template_idstringrequired
Headers
Content-Typestring
Example: application/json
curl --include \
     --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
     --request DELETE \
'https://rest.clicksend.com/v3/email/templates/{template_id}'

Responses

Successful response

Bodyapplication/json
http_codeinteger

The HTTP status code of the response.

Example: 200
response_codestring

The response code indicating the status of the operation.

Example: "SUCCESS"
response_msgstring

A message describing the outcome of the operation.

Example: "Your email template has been deleted."
dataArray of items
Example: []
Response
application/json
{ "http_code": 200, "response_code": "SUCCESS", "response_msg": "Your email template has been deleted.", "data": [] }