Pakat Email Service API

This documentation is a work in progress.

In order to get your api-key, please click on Login and get your api-key in profile.If you have any issue please call support on +982128423221

Contacts

get
Get all the contacts

https://api.pakat.net/v3/contacts
Request
Response
Request
Headers
Content-Type
required
string
application/json
Accept
required
string
application/json
api-key
required
string
Your API Key
Query Parameters
limit
optional
string
Number of documents per page
offset
optional
string
Index of the first document of the page
modifiedSince
optional
string
Filter (urlencoded) the contacts modified after a given UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result.
Response
200: OK
s
{
"contacts": [
{
"email": "hadi@google.com",
"id": 7,
"emailBlacklisted": false,
"smsBlacklisted": false,
"createdAt": "2019-07-22T07:39:18.409+01:00",
"modifiedAt": "2019-07-22T07:42:34.627+01:00",
"listIds": [],
"attributes": {
"LASTNAME": "Hadi",
"FIRSTNAME": "Farnoud",
"SMS": "09203016490"
}
},
{
"email": "saeedjoshani@gmail.com",
"id": 6,
"emailBlacklisted": false,
"smsBlacklisted": false,
"createdAt": "2019-07-22T06:49:48.549+01:00",
"modifiedAt": "2019-07-22T06:49:48.582+01:00",
"listIds": [
4
],
"attributes": {}
},
{
"email": "hadi@kamva.ir",
"id": 5,
"emailBlacklisted": false,
"smsBlacklisted": false,
"createdAt": "2019-07-10T14:48:25.134+01:00",
"modifiedAt": "2019-07-10T14:48:25.134+01:00",
"listIds": [
2
],
"attributes": {}
},
{
"email": "dev-email@flywheel.local",
"id": 4,
"emailBlacklisted": false,
"smsBlacklisted": false,
"createdAt": "2019-07-10T14:48:25.092+01:00",
"modifiedAt": "2019-07-10T14:48:25.092+01:00",
"listIds": [
2
],
"attributes": {}
},
{
"email": "hadi.farnoud@gmail.com",
"id": 2,
"emailBlacklisted": false,
"smsBlacklisted": false,
"createdAt": "2019-07-07T11:48:19.000+01:00",
"modifiedAt": "2019-07-07T11:48:19.658+01:00",
"listIds": [
2
],
"attributes": {}
},
{
"email": "test@kamva.ir",
"id": 1,
"emailBlacklisted": false,
"smsBlacklisted": false,
"createdAt": "2019-06-15T11:13:41.443+01:00",
"modifiedAt": "2019-07-29T09:31:08.495+01:00",
"listIds": [
2
],
"attributes": {}
}
],
"count": 6
}

post
Create a contact

https://api.pakat.net/v3/contacts
Example request: { "email":"test@pakat.net", "updateEnabled": true, "emailBlacklisted":false, "listIds": [ 14 ], "attributes": { "FIRSTNAME":"تست", "LASTNAME":"پاکت", "FIRST_PURCHASE":"12/10/2018" } }
Request
Response
Request
Headers
api-key
required
string
Content-Type
required
string
application/json
Accept
required
string
application/json
Body Parameters
smtpBlacklistSender
optional
boolean
transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true )
updateEnabled
optional
boolean
Facilitate to update the existing contact in the same request (updateEnabled = true)
email
required
string
Email address of the user. Mandatory if "sms" field is not passed in "attributes" parameter
attributes
optional
array
Pass the set of attributes and their values. These attributes must be present in your Pakat account. For eg. {'FNAME':'Elly', 'LNAME':'Roger'}
emailBlacklisted
optional
boolean
Set this field to blacklist the contact for emails (emailBlacklisted = true)
smsBlacklisted
optional
boolean
Set this field to blacklist the contact for SMS (smsBlacklisted = true)
listIds
required
array
Array of integers. Ids of the lists to add the contact to
Response
200: OK

put
Update a contact

https://api.pakat.net/v3/contacts/{email}
Pass the set of attributes to be updated. These attributes must be present in your account. To update existing email address of a contact with the new one please pass EMAIL in attribtes. For eg. { 'EMAIL':'newemail@domain.com', 'FNAME':'Hadi', 'LNAME':'Mofidi'}
Request
Response
Request
Path Parameters
email
required
string
Email (urlencoded) of the contact
Body Parameters
listIds
optional
array
Ids of the lists to add the contact to
unlinkListIds
optional
array
Ids of the lists to remove the contact from
smtpBlacklistSender
optional
array
transactional email forbidden sender for contact. Use only for email Contact
smsBlacklisted
optional
boolean
Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true)
emailBlacklisted
optional
boolean
Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true)
Response
200: OK
Contact updated

Transactional

get
Get the list of blocked or unsubscribed transactional contacts

https://api.pakat.net/v3/smtp/blockedContacts
Request
Response
Request
Path Parameters
optional
string
Query Parameters
limit
optional
string
Number of documents returned per page
offset
optional
string
Index of the first document on the page
senders
optional
string
Comma separated list of emails of the senders from which contacts are blocked or unsubscribed
endDate
optional
string
Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts
startDate
optional
string
Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts
Response
200: OK
List of blocked or unsubscribed transactional contacts Response schema type: object count integer Count of blocked or unsubscribed contact contacts object contacts[].email string Email address of the blocked or unsubscribed contact contacts[].senderEmail string Sender email address of the blocked or unsubscribed contact contacts[].reason object Reason for blocking / unsubscribing contacts[].reason.code string Reason code for blocking / unsubscribing (This code is safe for comparison) contacts[].reason.message string Reason for blocking / unsubscribing (This string is not safe for comparison)
{
"contacts":[
0:{
"email":"abc@xyz.com"
"senderEmail":"ez312@gmal.com"
"reason":{
"message":"Admin blocked"
"code":"adminBlocked"
}
"blockedAt":"2017-05-01T12:30:00Z"
}
]
"count":1
}

get

https://api.pakat.net/v3/smtp/blockedContacts
Request
Response
Request
Path Parameters
optional
string
Response
200: OK
[Object]

get
Get your transactional email activity aggregated per day

https://api.pakat.net/v3/smtp/statistics/reports
Request
Response
Request
Path Parameters
optional
string
Query Parameters
limit
optional
string
Number of documents returned per page
offset
optional
string
Index of the first document on the page
startDate
optional
string
Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD)
endDate
optional
string
Mandatory if endDate is used. Ending date of the report (YYYY-MM-DD)
days
optional
string
Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
tag
optional
string
Tag of the emails
Response
200: OK
{
"reports":[
0:{
"date":"2017-04-30"
"requests":10756
"delivered":10103
"hardBounces":21
"softBounces":137
"clicks":1026
"uniqueClicks":720
"opens":5091
"uniqueOpens":2318
"spamReports":0
"blocked":519
"invalid":1
"unsubscribed":0
}
1:{
"date":"2017-05-01"
"requests":18812
"delivered":17499
"hardBounces":34
"softBounces":254
"clicks":1514
"uniqueClicks":1090
"opens":10089
"uniqueOpens":4393
"spamReports":0
"blocked":920
"invalid":2
"unsubscribed":3
}
]
}

get
Get your transactional email activity aggregated over a period of time

https://api.pakat.net/v3/smtp/statistics/aggregatedReport
Request
Response
Request
Path Parameters
optional
string
Query Parameters
startDate
optional
string
Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate
endDate
optional
string
Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate
days
optional
string
Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
tag
optional
string
Tag of the emails
Response
200: OK
{
"range":"2016-09-08|2017-04-28"
"requests":19887
"delivered":18996
"hardBounces":234
"softBounces":1533
"clicks":9987
"uniqueClicks":8766
"opens":17654
"uniqueOpens":13688
"spamReports":1
"blocked":2
"invalid":0
"unsubscribed":2
}

get
Get all your transactional email activity (unaggregated events)

https://api.pakat.net/v3/smtp/statistics/events
Request
Response
Request
Path Parameters
optional
string
Query Parameters
limit
optional
string
Number limitation for the result returned
offset
optional
string
Beginning point in the list to retrieve from
startDate
optional
string
Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate
endDate
optional
string
Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate
days
optional
string
Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
email
optional
string
Filter the report for a specific email addresses
event
optional
string
Filter the report for a specific event type
tags
optional
string
Filter the report for tags (serialized and urlencoded array)
messageId
optional
string
Filter on a specific message id
templateId
optional
string
Filter on a specific template id
Response
200: OK
{
"events":[
0:{
"email":"john.smith@example.com"
"date":"2017-03-12T12:30:00Z"
"messageId":"<201798300811.5787683@example.domain.com>"
"event":"deferred"
"reason":"Error connection timeout"
"tag":"OrderConfirmation"
"from":"john@example.com"
}
1:{
"email":"john.smith@example.com"
"date":"2017-03-13T16:30:00Z"
"messageId":"<201798300811.5787683@example.domain.com>"
"event":"delivered"
"tag":"OrderConfirmation"
"from":"john@example.com"
}
]
}

get
Get the list of transactional email templates

https://api.pakat.net/v3/smtp/templates
Request
Response
Request
Query Parameters
templateStatus
optional
boolean
Filter on the status of the template. Active = true, inactive = false
limit
optional
string
Number of documents returned per page
offset
optional
string
Index of the first document in the page
Response
200: OK
{
"count":2
"templates":[
0:{
"id":5
"name":"ChristomasTimeTemplate"
"subject":"Merry Christmas"
"isActive":false
"testSent":false
"sender":{...}
"replyTo":"replyto@domain.com"
"toField":""
"tag":"Festival"
"htmlContent":"HTML CONTENT 1"
"createdAt":"2016-02-24T14:44:24Z"
"modifiedAt":"2016-02-24T15:37:11Z"
}
1:{
"id":12
"name":"SummerSales2017Template"
"subject":"Enjoy our summer Sales !"
"isActive":true
"testSent":false
"sender":{...}
"replyTo":"replyto@domain.com"
"toField":""
"tag":"Summer"
"htmlContent":"HTML CONTENT 2"
"createdAt":"2016-02-25T11:53:26Z"
"modifiedAt":"2016-02-25T11:53:26Z"
}
]
}

post
Create a transactional email template

https://api.pakat.net/v3/smtp/templates
Request
Response
Request
Path Parameters
optional
string
Body Parameters
tag
optional
string
Tag of the template
sender
required
object
Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example {"name":"xyz", "email":"example@abc.com"} , {"name":"xyz", "id":123}
templateName
required
string
Name of the template
htmlContent
optional
string
Body of the message (HTML version). The field must have more than 10 characters. REQUIRED if htmlUrl is empty
htmlUrl
optional
string
Url which contents the body of the email message. REQUIRED if htmlContent is empty
subject
required
string
Subject of the template
replyTo
optional
string
Email on which campaign recipients will be able to reply to
toField
optional
string
To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use for personalization
attachmentUrl
optional
string
Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps
isActive
optional
boolean
Status of template. isActive = true means template is active and isActive = false means template is inactive
Response
200: OK

get
Returns the template informations

https://api.pakat.net/v3/smtp/templates/:templateId
Request
Response
Request
Path Parameters
templateId
required
integer
id of the template
Response
200: OK
{
"id":33
"name":"OrderConfirmation"
"subject":"Order Confirmation : Thanks for your Purchase !"
"isActive":true
"testSent":false
"sender":{
"name":"John"
"email":"john.smith@example.com"
"id":26
}
"replyTo":"replyto@domain.com"
"toField":""
"tag":""
"htmlContent":"HTML CONTENT 4"
"createdAt":"2016-02-25T11:53:26Z"
"modifiedAt":"2016-02-25T11:53:26Z"
}

put
Updates a transactional email templates

https://api.pakat.net/v3/smtp/templates/:templateId
Request
Response
Request
Path Parameters
templateId
required
integer
id of the template
Body Parameters
tag
optional
string
Tag of the template
sender
optional
object
Sender details including id or email and name (optional). Only one of either Sender's email or Sender's ID shall be passed in one request at a time. For example {"name":"xyz", "email":"example@abc.com", id="3" }
templateName
optional
string
Name of the template
htmlContent
optional
string
Required if htmlUrl is empty. Body of the message (HTML must have more than 10 characters)
htmlUrl
optional
string
Name of the template
subject
optional
string
subject of the email
replyTo
optional
string
Email on which campaign recipients will be able to reply to
toField
optional
string
To personalize the «To» Field. If you want to include the first name and last name of your recipient, add {FNAME} {LNAME}. These contact attributes must already exist in your SendinBlue account. If input parameter 'params' used please use for personalization
attachmentUrl
optional
string
Absolute url of the attachment (no local file). Extension allowed: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub and eps
isActive
optional
boolean
Status of the template. isActive = false means template is inactive, isActive = true means template is active
Response
204: No Content
transactional email template updated
400: Bad Request
bad request
404: Not Found
Template ID not found

delete
Delete an inactive transactional email template

https://api.pakat.net/v3/smtp/templates/:templateId
Request
Response
Request
Path Parameters
templateId
required
integer
Id of the template
Response
204: No Content
Inactive transactional email template has been deleted

post
Send a template to your test list

https://api.pakat.net/v3/smtp/templates/templateId/sendTest
Request
Response
Request
Path Parameters
templateId
optional
integer
Id of the template
Body Parameters
emailTo
optional
array
List of the email addresses of the recipients whom you wish to send the test mail. If left empty, the test mail will be sent to your entire test list.
Response
204: No Content
Test email has been sent successfully to all recipients

post
Send a template

https://api.pakat.net/v3/smtp/templates/:templateId/send
Request
Response
Request
Body Parameters
headers
optional
object
Pass the set of headers that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, {'Content-Type':'text/html', 'charset':'iso-8859-1', 'sender.ip':'1.2.3.4'}
attributes
optional
object
Pass the set of attributes to customize the template. For example, {'FNAME':'Joe', 'LNAME':'Doe'}
tags
optional
array
Tag your emails to find them more easily
Response
201: Created
Email has been sent successfully to all recipients

post
Send a transactional email

https://api.pakat.net/v3/smtp/email
Request
Response
Request
Body Parameters
sender
required
object
Mandatory if 'templateId' is not passed. Pass name (optional) and email of sender from which emails will be sent. For example, {'name':'Mary from MyShop', 'email':'no-reply@myshop.com'} name string Name of the sender from which the emails will be sent. Maximum allowed characters are 70. email* string Email of the sender from which the emails will be sent (required)
to
required
array
List of email addresses and names (optional) of the recipients. For example, [{'name':'Jimmy', 'email':'jimmy98@example.com'}, {'name':'Joe', 'email':'joe@example.com'}]
bcc
optional
array
List of email addresses and names (optional) of the recipients in bcc
cc
optional
array
List of email addresses and names (optional) of the recipients in cc
htmlContent
optional
string
HTML body of the message ( Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed )
textContent
optional
string
Plain Text body of the message ( Ignored if 'templateId' is passed )
subject
optional
string
Subject of the message. Mandatory if 'templateId' is not passed
replyTo
required
array
Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, {'email':'ann6533@example.com', 'name':'Ann'}. email* string Email address in reply to (required) name string Name in reply to. Maximum allowed characters are 70
optional
string
attachment
optional
array
Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, [{"url":"https://attachment.domain.com/myAttachmentFromUrl.jpg", "name":"My attachment 1"}, {"content":"base64 exmaple content", "name":"My attachment 2"}]. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg and wmv ( If 'templateId' is passed and is in New Template Language format then only attachment url is accepted. If template is in Old template Language format, then 'attachment' is ignored )
headers
optional
object
Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. For example, {"sender.ip":"1.2.3.4", "X-Mailin-custom":"some_custom_header"}.
templateId
optional
integer
Id of the template
params
optional
object
Pass the set of attributes to customize the template. For example, {'FNAME':'Joe', 'LNAME':'Doe'}. It's considered only if template is in New Template Language format.
tags
optional
array
Tag your emails to find them more easily
Response
201: Created
Response schema type: object messageId string: Message ID of the transactional email sent
transactional email sent

get
Get the list of transactional emails on the basis of allowed filters

https://api.pakat.net/v3/smtp/emails
This endpoint will show the list of emails for past 30 days by default. To retrieve emails before that time, please pass startDate and endDate in query filters.
Request
Response
Request
Body Parameters
email
optional
string
Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent.
templateId
optional
number
Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email.
messageId
optional
string
Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent.
startDate
optional
string
Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the list. Maximum time period that can be selected is one month.
endDate
optional
string
Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the list. Maximum time period that can be selected is one month.
Response
200: OK