Pakat Email Service API
Last updated
Last updated
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 issues please call support on +982191015383
GET
https://api.pakat.net/v3/account
Name | Type | Description |
---|---|---|
GET
https://api.pakat.net/v3/contacts
POST
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" }
}
PUT
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'}
GET
https://api.pakat.net/v3/contacts/attributes
GET
https://api.pakat.net/v3/contacts/lists
POST
https://api.pakat.net/v3/contacts/lists
GET
https://api.pakat.net/v3/contacts/folders
POST
https://api.pakat.net/v3/contacts/folders
GET
https://api.pakat.net/v3/smtp/blockedContacts
GET
https://api.pakat.net/v3/smtp/statistics/reports
GET
https://api.pakat.net/v3/smtp/statistics/aggregatedReport
GET
https://api.pakat.net/v3/smtp/statistics/events
This endpoint will show the aggregated stats for past 30 days by default if startDate
and endDate
OR days
is not passed. The date range can not exceed 90 days
GET
https://api.pakat.net/v3/smtp/templates
POST
https://api.pakat.net/v3/smtp/templates
GET
https://api.pakat.net/v3/smtp/templates/:templateId
PUT
https://api.pakat.net/v3/smtp/templates/:templateId
DELETE
https://api.pakat.net/v3/smtp/templates/:templateId
POST
https://api.pakat.net/v3/smtp/templates/templateId/sendTest
POST
https://api.pakat.net/v3/smtp/email
In order to insert data in a transactional template you have two options
1: contact attributes
contact attributes defined in Contasts can be used as {{ contacts.FIRSTNAME }}
in your template and you do not have to pass anything in API call. if the to
field exists in a Contacts list, the data will be retrieved from there.
2: api params
you can pass parameters when using this API. use {{ params.FNAME }}
for example in your template in order to accept FNAME
parameter from API request.
GET
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.
GET
https://api.pakat.net/v3/emailCampaigns
POST
https://api.pakat.net/v3/emailCampaigns
POST
https://api.pakat.net/v3/emailCampaigns/{campaignId}/sendNow
POST
https://api.pakat.net/v3/emailCampaigns/{campaignId}/sendTest
GET
https://api.pakat.net/v3/emailCampaigns/{campaignId}
GET
https://api.pakat.net/v3/webhooks
POST
https://api.pakat.net/v3/webhooks
GET
https://api.pakat.net/v3/webhooks/{webhookId}
PUT
https://api.pakat.net/v3/webhooks/{webhookId}
DELETE
https://api.pakat.net/v3/webhooks/{webhookId}
GET
https://api.pakat.net/v3/senders
POST
https://api.pakat.net/v3/senders
PUT
https://api.pakat.net/v3/senders/{senderId}
DELETE
https://api.sendinblue.com/v3/senders/{senderId}
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Content-Type
String
Accept*
String
application/json
api-key*
String
Your API Key
limit
string
Number of documents per page
offset
string
Index of the first document of the page
modifiedSince
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.
Content-Type
string
application/json
Accept*
string
application/json
api-key*
string
Your API Key
api-key*
string
Content-Type*
string
application/json
Accept
string
application/json
smtpBlacklistSender
boolean
transactional email forbidden sender for contact. Use only for email Contact ( only available if updateEnabled = true )
updateEnabled
boolean
Facilitate to update the existing contact in the same request (updateEnabled = true)
string
Email address of the user. Mandatory if "sms" field is not passed in "attributes" parameter
attributes
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
boolean
Set this field to blacklist the contact for emails (emailBlacklisted = true)
smsBlacklisted
boolean
Set this field to blacklist the contact for SMS (smsBlacklisted = true)
listIds
array
Array of integers. Ids of the lists to add the contact to
string
Email (urlencoded) of the contact
api-key*
String
Your API Key
Accept*
String
application/json
listIds
array
Ids of the lists to add the contact to
unlinkListIds
array
Ids of the lists to remove the contact from
smtpBlacklistSender
array
transactional email forbidden sender for contact. Use only for email Contact
smsBlacklisted
boolean
Set/unset this field to blacklist/allow the contact for SMS (smsBlacklisted = true)
emailBlacklisted
boolean
Set/unset this field to blacklist/allow the contact for emails (emailBlacklisted = true)
api-key*
String
Your API Key
Accept*
String
application/json
sort
string
Sort the results in the ascending/descending order of record creation. Default order is descending if sort
is not passed. type values as asc
or desc
offset
integer
Index of the first document of the page
limit
integer
Number of documents per page
api-key*
String
Your API Key
Accept*
String
application/json
api-key*
String
Your API Key
Accept*
String
application/json
name
string
Name of the list
folderId
integer
Id of the parent folder in which this list is to be created
sort
string
Sort the results in the ascending/descending order of record creation. Default order is descending if sort is not passed. type values as asc or desc
offset
integer
Index of the first document of the page
limit
integer
Number of documents per page
api-key*
String
Your API Key
Accept*
String
application/json
api-key*
String
Your API Key
Accept*
String
application/json
name
string
Name of the folder
startDate
String
Mandatory if endDate is used. Starting date (YYYY-MM-DD) from which you want to fetch the blocked or unsubscribed contacts
endDate
String
Mandatory if startDate is used. Ending date (YYYY-MM-DD) till which you want to fetch the blocked or unsubscribed contacts
limit
String
Number of documents returned per page
offset
String
Index of the first document on the page
senders
array of strings
Comma separated list of emails of the senders from which contacts are blocked or unsubscribed
sort
String
Sort the results in the ascending/descending order of record creation. Default order is descending if sort
is not passed
api-key*
String
Your API Key
Accept*
String
application/json
limit
string
Number of documents returned per page
offset
string
Index of the first document on the page
startDate
string
Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD)
endDate
string
Mandatory if endDate is used. Ending date of the report (YYYY-MM-DD)
days
string
Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
tag
string
Tag of the emails
api-key*
String
Your API Key
Accept*
String
application/json
string
startDate
string
Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate
endDate
string
Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate
days
string
Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
tag
string
Tag of the emails
api-key*
String
Your API Key
Accept*
String
application/json
limit
string
Number limitation for the result returned
offset
string
Beginning point in the list to retrieve from
startDate
string
Mandatory if endDate is used. Starting date of the report (YYYY-MM-DD). Must be lower than equal to endDate
endDate
string
Mandatory if startDate is used. Ending date of the report (YYYY-MM-DD). Must be greater than equal to startDate
days
string
Number of days in the past including today (positive integer). Not compatible with 'startDate' and 'endDate'
string
Filter the report for a specific email addresses
event
string
Filter the report for a specific event type
tags
string
Filter the report for tags (serialized and urlencoded array)
messageId
string
Filter on a specific message id
templateId
string
Filter on a specific template id
templateStatus
boolean
Filter on the status of the template. Active = true, inactive = false
limit
string
Number of documents returned per page
offset
string
Index of the first document in the page
string
tag
string
Tag of the template
sender
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
string
Name of the template
htmlContent
string
Body of the message (HTML version). The field must have more than 10 characters. REQUIRED if htmlUrl is empty
htmlUrl
string
Url which contents the body of the email message. REQUIRED if htmlContent is empty
subject
string
Subject of the template
replyTo
string
Email on which campaign recipients will be able to reply to
toField
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
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
boolean
Status of template. isActive = true means template is active and isActive = false means template is inactive
templateId
integer
id of the template
templateId
integer
id of the template
tag
string
Tag of the template
sender
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
string
Name of the template
htmlContent
string
Required if htmlUrl is empty. Body of the message (HTML must have more than 10 characters)
htmlUrl
string
Name of the template
subject
string
subject of the email
replyTo
string
Email on which campaign recipients will be able to reply to
toField
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
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
boolean
Status of the template. isActive = false means template is inactive, isActive = true means template is active
templateId
integer
Id of the template
templateId
integer
Id of the template
emailTo
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.
api-key
String
sThe API key
sender
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
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
array
List of email addresses and names (optional) of the recipients in bcc
cc
array
List of email addresses and names (optional) of the recipients in cc
htmlContent
string
HTML body of the message ( Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed )
textContent
string
Plain Text body of the message ( Ignored if 'templateId' is passed )
subject
string
Subject of the message. Mandatory if 'templateId' is not passed
replyTo
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
string
attachment
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
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
integer
Id of the template
params
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
array
Tag your emails to find them more easily
scheduledAt
date-time
UTC date-time on which the email has to schedule (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for scheduling. There can be an expected delay of +5 minutes in scheduled email delivery. Please note this feature is currently a public beta.
batchId
String
Valid UUIDv4 batch id to identify the scheduled batches transactional email. If not passed we will create a valid UUIDv4 batch id at our end.
string
Mandatory if templateId and messageId are not passed in query filters. Email address to which transactional email has been sent.
templateId
number
Mandatory if email and messageId are not passed in query filters. Id of the template that was used to compose transactional email.
messageId
string
Mandatory if templateId and email are not passed in query filters. Message ID of the transactional email sent.
startDate
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
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.
type
string
Filter on the type of the campaigns
status
string
Filter on the status of the campaign
startDate
string
Mandatory if endDate is used. Starting (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
endDate
string
Mandatory if startDate is used. Ending (urlencoded) UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ) to filter the sent email campaigns. Prefer to pass your timezone in date-time format for accurate result ( only available if either 'status' not passed and if passed is set to 'sent' )
limit
integer
Number of documents per page
offset
integer
Index of the first document in the page
tag
string
Tag of the campaign
sender
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} name string Sender Name email string Sender email id integer Select the sender for the campaign on the basis of sender id. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email).
name
string
Name of the campaign
htmlContent
string
Mandatory if htmlUrl and templateId are empty. Body of the message (HTML).
htmlUrl
string
Mandatory if htmlContent and templateId are empty. Url to the message (HTML). For example: https://html.domain.com
templateId
string
Mandatory if htmlContent and htmlUrl are empty. Id of the transactional email template with status active. Used to copy only its content fetched from htmlContent/htmlUrl to an email campaign for RSS feature.
scheduledAt
string
Sending UTC date-time (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for accurate result. If sendAtBestTime is set to true, your campaign will be sent according to the date passed (ignoring the time part). For example: 2017-06-01T12:30:00+02:00
subject
string
Subject of the campaign. Mandatory if abTesting is false. Ignored if abTesting is true.
replyTo
string
Email on which the campaign recipients will be able to reply to
toField
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 paramsused please use {{contact.FNAME}} {{contact.LNAME}} for personalization
recipients
object
List ids to include/exclude from campaign exclusionListIds array of integers List ids to exclude from the campaign listIds array of integers Mandatory if scheduledAt is not empty. List Ids to send the campaign to
attachmentUrl
string
Absolute url of the attachment (no local file). Extension allowed:
inlineImageActivation
boolean
Use true to embedded the images in your email. Final size of the email should be less than 4MB. Campaigns with embedded images can not be sent to more than 5000 contacts
mirrorActive
boolean
Use true to enable the mirror link
footer
string
Footer of the email campaign
header
string
Header of the email campaign
utmCampaign
string
Customize the utm_campaign value. If this field is empty, the campaign name will be used. Only alphanumeric characters and spaces are allowed
params
object
Pass the set of attributes to customize the type classic campaign. For example: {"FNAME":"Joe", "LNAME":"Doe"}. Only available if type is classic. It's considered only if campaign is in New Template Language format. The New Template Language is dependent on the values of subject, htmlContent/htmlUrl, sender.name & toField
sendAtBestTime
boolean
Set this to true if you want to send your campaign at best time.
abTesting
boolean
Status of A/B Test. abTesting = false means it is disabled & abTesting = true means it is enabled. subjectA, subjectB, splitRule, winnerCriteria & winnerDelay will be considered when abTesting is set to true. subjectA & subjectB are mandatory together & subject if passed is ignored. Can be set to true only if sendAtBestTime is false. You will be able to set up two subject lines for your campaign and send them to a random sample of your total recipients. Half of the test group will receive version A, and the other half will receive version B
subjectA
string
Subject A of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value
subjectB
string
Subject B of the campaign. Mandatory if abTesting = true. subjectA & subjectB should have unique value
splitRule
integer
Add the size of your test groups. Mandatory if abTesting = true & 'recipients' is passed. We'll send version A and B to a random sample of recipients, and then the winning version to everyone else
winnerCriteria
string
Choose the metrics that will determinate the winning version. Mandatory if splitRule >= 1 and < 50. If splitRule = 50, winnerCriteria
is ignored if passed
winnerDelay
integer
Choose the duration of the test in hours. Maximum is 7 days, pass 24*7 = 168 hours. The winning version will be sent at the end of the test. Mandatory if splitRule >= 1 and < 50. If splitRule = 50, winnerDelay
is ignored if passed
ipWarmupEnable
boolean
Available for dedicated ip clients. Set this to true if you wish to warm up your ip. set to false or true.
initialQuota
integer
Mandatory if ipWarmupEnable is set to true. Set an initial quota greater than 1 for warming up your ip. We recommend you set a value of 3000.
increaseRate
integer
Mandatory if ipWarmupEnable is set to true. Set a percentage increase rate for warming up your ip. We recommend you set the increase rate to 30% per day. If you want to send the same number of emails every day, set the daily increase value to 0%.
campaignId*
integer
Id of the campaign
campaignId*
integer
Id of the campaign
emailTo
array of strings
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. You can not send more than 50 test emails per day.
example:
"emailTo": [
"test@pakat.net",
"support@pakat.net"
]
type
String
Filter on webhook type
sort
String
Sort the results in the ascending/descending order of webhook creation
url*
String
URL of the webhook
description
String
Description of the webhook
events*
String
Events triggering the webhook. Possible values for Transactional type webhook:
sent
OR request
, delivered
, hardBounce
, softBounce
, blocked
, spam
, invalid
, deferred
, click
, opened
, uniqueOpened
and unsubscribed
Possible values for Marketing type webhook:
spam
, opened
, click
, hardBounce
, softBounce
, unsubscribed
, listAddition
& delivered
type
Type of the webhook. Possible value is either marketing
or transactional
domain
String
Inbound domain of webhook, required in case of event type inbound
webhookId*
integer
Id of the webhook
webhookId*
integer
Id of the webhook
url
String
URL of the webhook
description
String
Description of the webhook
events
String
Events triggering the webhook. Possible values for Transactional type webhook:
sent
OR request
, delivered
, hardBounce
, softBounce
, blocked
, spam
, invalid
, deferred
, click
, opened
, uniqueOpened
and unsubscribed
Possible values for Marketing type webhook:
spam
, opened
, click
, hardBounce
, softBounce
, unsubscribed
, listAddition
& delivered
domain
String
Inbound domain of webhook, used in case of event type inbound
webhookId
integer
Id of the webhook
ip
String
Filter your senders for a specific IP. Available for dedicated IP usage only
domain
String
Filter your senders for a specific domain
api-key
String
API key v3
api-key
String
Your API key v3
name*
String
From Name to use for the sender
email*
String
From email to use for the sender. A verification email will be sent to this address.
ips
array of json
Mandatory in case of dedicated IP.
every entry in the array contains "ip" and "domain"
senderId
String
Id of the sender
api-key
String
API key v3
name*
String
From Name to update the sender
email*
String
From Email to update the sender
ips
String
Only in case of dedicated IP. IPs to associate to the sender. If passed, will replace all the existing IPs.
senderId
String
Id of the sender
api-key
String
API key v3