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 issues please call support on +982191015383
Profile
Get your account information, plan and credits details
GET
https://api.pakat.net/v3/account
Headers
Name | Type | Description |
---|---|---|
Content-Type | String | |
Accept* | String | application/json |
api-key* | String | Your API Key |
Contacts
Get all the contacts
GET
https://api.pakat.net/v3/contacts
Query Parameters
Name | Type | Description |
---|---|---|
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. |
Headers
Name | Type | Description |
---|---|---|
Content-Type | string | application/json |
Accept* | string | application/json |
api-key* | string | Your API Key |
Create a contact
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" }
}
Headers
Name | Type | Description |
---|---|---|
api-key* | string | |
Content-Type* | string | application/json |
Accept | string | application/json |
Request Body
Name | Type | Description |
---|---|---|
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 |
Update a contact
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'}
Path Parameters
Name | Type | Description |
---|---|---|
string | Email (urlencoded) of the contact |
Headers
Name | Type | Description |
---|---|---|
api-key* | String | Your API Key |
Accept* | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
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) |
List all attributes
GET
https://api.pakat.net/v3/contacts/attributes
Headers
Name | Type | Description |
---|---|---|
api-key* | String | Your API Key |
Accept* | String | application/json |
Get all the lists
GET
https://api.pakat.net/v3/contacts/lists
Query Parameters
Name | Type | Description |
---|---|---|
sort | string | Sort the results in the ascending/descending order of record creation. Default order is descending if |
offset | integer | Index of the first document of the page |
limit | integer | Number of documents per page |
Headers
Name | Type | Description |
---|---|---|
api-key* | String | Your API Key |
Accept* | String | application/json |
Create a list
POST
https://api.pakat.net/v3/contacts/lists
Headers
Name | Type | Description |
---|---|---|
api-key* | String | Your API Key |
Accept* | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
name | string | Name of the list |
folderId | integer | Id of the parent folder in which this list is to be created |
Get all folders
GET
https://api.pakat.net/v3/contacts/folders
Query Parameters
Name | Type | Description |
---|---|---|
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 |
Headers
Name | Type | Description |
---|---|---|
api-key* | String | Your API Key |
Accept* | String | application/json |
Create a folder
POST
https://api.pakat.net/v3/contacts/folders
Headers
Name | Type | Description |
---|---|---|
api-key* | String | Your API Key |
Accept* | String | application/json |
Request Body
Name | Type | Description |
---|---|---|
name | string | Name of the folder |
Transactional
Get the list of blocked or unsubscribed transactional contacts
GET
https://api.pakat.net/v3/smtp/blockedContacts
Query Parameters
Name | Type | Description |
---|---|---|
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 |
Headers
Name | Type | Description |
---|---|---|
api-key* | String | Your API Key |
Accept* | String | application/json |
Get your transactional email activity aggregated per day
GET
https://api.pakat.net/v3/smtp/statistics/reports
Query Parameters
Name | Type | Description |
---|---|---|
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 |
Headers
Name | Type | Description |
---|---|---|
api-key* | String | Your API Key |
Accept* | String | application/json |
Get your transactional email activity aggregated over a period of time
GET
https://api.pakat.net/v3/smtp/statistics/aggregatedReport
Path Parameters
Name | Type | Description |
---|---|---|
string |
Query Parameters
Name | Type | Description |
---|---|---|
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 |
Headers
Name | Type | Description |
---|---|---|
api-key* | String | Your API Key |
Accept* | String | application/json |
Get all your transactional email activity (unaggregated events)
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
Query Parameters
Name | Type | Description |
---|---|---|
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 |
Get the list of transactional email templates
GET
https://api.pakat.net/v3/smtp/templates
Query Parameters
Name | Type | Description |
---|---|---|
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 |
Create a transactional email template
POST
https://api.pakat.net/v3/smtp/templates
Path Parameters
Name | Type | Description |
---|---|---|
string |
Request Body
Name | Type | Description |
---|---|---|
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 |
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 |
Returns the template informations
GET
https://api.pakat.net/v3/smtp/templates/:templateId
Path Parameters
Name | Type | Description |
---|---|---|
templateId | integer | id of the template |
Updates a transactional email templates
PUT
https://api.pakat.net/v3/smtp/templates/:templateId
Path Parameters
Name | Type | Description |
---|---|---|
templateId | integer | id of the template |
Request Body
Name | Type | Description |
---|---|---|
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 |
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 |
Delete an inactive transactional email template
DELETE
https://api.pakat.net/v3/smtp/templates/:templateId
Path Parameters
Name | Type | Description |
---|---|---|
templateId | integer | Id of the template |
Send a template to your test list
POST
https://api.pakat.net/v3/smtp/templates/templateId/sendTest
Path Parameters
Name | Type | Description |
---|---|---|
templateId | integer | Id of the template |
Request Body
Name | Type | Description |
---|---|---|
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. |
Send a transactional email
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.
Headers
Name | Type | Description |
---|---|---|
api-key | String | sThe API key |
Request Body
Name | Type | Description |
---|---|---|
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 |
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 | ||
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, |
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, |
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. |
Get the list of transactional emails on the basis of allowed filters
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.
Request Body
Name | Type | Description |
---|---|---|
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. |
Email Campaigns
Return all your created email campaigns
GET
https://api.pakat.net/v3/emailCampaigns
Query Parameters
Name | Type | Description |
---|---|---|
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 |
Create an email campaign
POST
https://api.pakat.net/v3/emailCampaigns
Request Body
Name | Type | Description |
---|---|---|
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, |
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, |
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%. |
Send an email campaign immediately, based on campaignId
POST
https://api.pakat.net/v3/emailCampaigns/{campaignId}/sendNow
Path Parameters
Name | Type | Description |
---|---|---|
campaignId* | integer | Id of the campaign |
Send an email campaign to your test list
POST
https://api.pakat.net/v3/emailCampaigns/{campaignId}/sendTest
Path Parameters
Name | Type | Description |
---|---|---|
campaignId* | integer | Id of the campaign |
Request Body
Name | Type | Description |
---|---|---|
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" ]
|
Get an email campaign report
GET
https://api.pakat.net/v3/emailCampaigns/{campaignId}
Webhooks
Get all webhooks
GET
https://api.pakat.net/v3/webhooks
Query Parameters
Name | Type | Description |
---|---|---|
type | String | Filter on webhook type |
sort | String | Sort the results in the ascending/descending order of webhook creation |
Create a webhook
POST
https://api.pakat.net/v3/webhooks
Request Body
Name | Type | Description |
---|---|---|
url* | String | URL of the webhook |
description | String | Description of the webhook |
events* | String | Events triggering the webhook. Possible values for Transactional type webhook:
Possible values for Marketing type webhook:
|
type | Type of the webhook. Possible value is either | |
domain | String | Inbound domain of webhook, required in case of event type |
Get a webhook details
GET
https://api.pakat.net/v3/webhooks/{webhookId}
Path Parameters
Name | Type | Description |
---|---|---|
webhookId* | integer | Id of the webhook |
Update a webhook
PUT
https://api.pakat.net/v3/webhooks/{webhookId}
Path Parameters
Name | Type | Description |
---|---|---|
webhookId* | integer | Id of the webhook |
Request Body
Name | Type | Description |
---|---|---|
url | String | URL of the webhook |
description | String | Description of the webhook |
events | String | Events triggering the webhook. Possible values for Transactional type webhook:
Possible values for Marketing type webhook:
|
domain | String | Inbound domain of webhook, used in case of event type |
Delete a webhook
DELETE
https://api.pakat.net/v3/webhooks/{webhookId}
Path Parameters
Name | Type | Description |
---|---|---|
webhookId | integer | Id of the webhook |
Sender
Get the list of all your senders
GET
https://api.pakat.net/v3/senders
Query Parameters
Name | Type | Description |
---|---|---|
ip | String | Filter your senders for a specific IP. Available for dedicated IP usage only |
domain | String | Filter your senders for a specific domain |
Headers
Name | Type | Description |
---|---|---|
api-key | String | API key v3 |
Create a new sender
POST
https://api.pakat.net/v3/senders
Headers
Name | Type | Description |
---|---|---|
api-key | String | Your API key v3 |
Request Body
Name | Type | Description |
---|---|---|
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" |
Example request to create a sender
Update a sender
PUT
https://api.pakat.net/v3/senders/{senderId}
Path Parameters
Name | Type | Description |
---|---|---|
senderId | String | Id of the sender |
Headers
Name | Type | Description |
---|---|---|
api-key | String | API key v3 |
Request Body
Name | Type | Description |
---|---|---|
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. |
Delete a sender
DELETE
https://api.sendinblue.com/v3/senders/{senderId}
Path Parameters
Name | Type | Description |
---|---|---|
senderId | String | Id of the sender |
Headers
Name | Type | Description |
---|---|---|
api-key | String | API key v3 |
Last updated