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

NameTypeDescription

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

NameTypeDescription

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

NameTypeDescription

Content-Type

string

application/json

Accept*

string

application/json

api-key*

string

Your API Key

{
    "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
}

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

NameTypeDescription

api-key*

string

Content-Type*

string

application/json

Accept

string

application/json

Request Body

NameTypeDescription

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)

email

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

NameTypeDescription

email

string

Email (urlencoded) of the contact

Headers

NameTypeDescription

api-key*

String

Your API Key

Accept*

String

application/json

Request Body

NameTypeDescription

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)

Contact updated

List all attributes

GET https://api.pakat.net/v3/contacts/attributes

Headers

NameTypeDescription

api-key*

String

Your API Key

Accept*

String

application/json

Get all the lists

GET https://api.pakat.net/v3/contacts/lists

Query Parameters

NameTypeDescription

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

NameTypeDescription

api-key*

String

Your API Key

Accept*

String

application/json

Create a list

POST https://api.pakat.net/v3/contacts/lists

Headers

NameTypeDescription

api-key*

String

Your API Key

Accept*

String

application/json

Request Body

NameTypeDescription

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

NameTypeDescription

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

NameTypeDescription

api-key*

String

Your API Key

Accept*

String

application/json

Create a folder

POST https://api.pakat.net/v3/contacts/folders

Headers

NameTypeDescription

api-key*

String

Your API Key

Accept*

String

application/json

Request Body

NameTypeDescription

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

NameTypeDescription

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

Headers

NameTypeDescription

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

NameTypeDescription

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

NameTypeDescription

api-key*

String

Your API Key

Accept*

String

application/json

{
"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 your transactional email activity aggregated over a period of time

GET https://api.pakat.net/v3/smtp/statistics/aggregatedReport

Path Parameters

NameTypeDescription

string

Query Parameters

NameTypeDescription

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

NameTypeDescription

api-key*

String

Your API Key

Accept*

String

application/json

{
"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 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

NameTypeDescription

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'

email

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

{
"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 the list of transactional email templates

GET https://api.pakat.net/v3/smtp/templates

Query Parameters

NameTypeDescription

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

{
"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"
}
]
}

Create a transactional email template

POST https://api.pakat.net/v3/smtp/templates

Path Parameters

NameTypeDescription

string

Request Body

NameTypeDescription

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

Returns the template informations

GET https://api.pakat.net/v3/smtp/templates/:templateId

Path Parameters

NameTypeDescription

templateId

integer

id of the template

{
"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"
}

Updates a transactional email templates

PUT https://api.pakat.net/v3/smtp/templates/:templateId

Path Parameters

NameTypeDescription

templateId

integer

id of the template

Request Body

NameTypeDescription

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

transactional email template updated

Delete an inactive transactional email template

DELETE https://api.pakat.net/v3/smtp/templates/:templateId

Path Parameters

NameTypeDescription

templateId

integer

Id of the template

Inactive transactional email template has been deleted

Send a template to your test list

POST https://api.pakat.net/v3/smtp/templates/templateId/sendTest

Path Parameters

NameTypeDescription

templateId

integer

Id of the template

Request Body

NameTypeDescription

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.

Test email has been sent successfully to all recipients

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

NameTypeDescription

api-key

String

sThe API key

Request Body

NameTypeDescription

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.

transactional email sent

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

NameTypeDescription

email

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

NameTypeDescription

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

[Object]	campaigns
Integer	campaigns[].id
ID of the campaign

String	campaigns[].name
Name of the campaign

String	campaigns[].subject
Subject of the campaign. Only available if abTesting flag of the campaign is false

String	campaigns[].type
Type of campaign

String	campaigns[].status
Status of the campaign

String	campaigns[].scheduledAt
UTC date-time on which campaign is scheduled (YYYY-MM-DDTHH:mm:ss.SSSZ)

Boolean	campaigns[].abTesting
Status of A/B Test for the campaign. abTesting = false means it is disabled, & abTesting = true means it is enabled.

String	campaigns[].subjectA
Subject A of the ab-test campaign. Only available if abTesting flag of the campaign is true

String	campaigns[].subjectB
Subject B of the ab-test campaign. Only available if abTesting flag of the campaign is true

Integer	campaigns[].splitRule
The size of your ab-test groups. Only available if abTesting flag of the campaign is true

String	campaigns[].winnerCriteria
Criteria for the winning version. Only available if abTesting flag of the campaign is true

Integer	campaigns[].winnerDelay
The duration of the test in hours at the end of which the winning version will be sent. Only available if abTesting flag of the campaign is true

Boolean	campaigns[].sendAtBestTime
It is true if you have chosen to send your campaign at best time, otherwise it is false

Boolean	campaigns[].testSent
Retrieved the status of test email sending. (true=Test email has been sent false=Test email has not been sent)

String	campaigns[].header
Header of the campaign

String	campaigns[].footer
Footer of the campaign

Object	campaigns[].sender
String	campaigns[].sender.name
Sender name of the campaign

String	campaigns[].sender.email
Sender email of the campaign

String	campaigns[].sender.id
Sender id of the campaign

String	campaigns[].replyTo
Email defined as the "Reply to" of the campaign

String	campaigns[].toField
Customisation of the "to" field of the campaign

String	campaigns[].htmlContent
HTML content of the campaign

String	campaigns[].shareLink
Link to share the campaign on social medias

String	campaigns[].tag
Tag of the campaign

String	campaigns[].createdAt
Creation UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)

String	campaigns[].modifiedAt
UTC date-time of last modification of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ)

Boolean	campaigns[].inlineImageActivation
Status of inline image. inlineImageActivation = false means image can’t be embedded, & inlineImageActivation = true means image can be embedded, in the email.

Boolean	campaigns[].mirrorActive
Status of mirror links in campaign. mirrorActive = false means mirror links are deactivated, & mirrorActive = true means mirror links are activated, in the campaign

Boolean	campaigns[].recurring
FOR TRIGGER ONLY ! Type of trigger campaign.recurring = false means contact can receive the same Trigger campaign only once, & recurring = true means contact can receive the same Trigger campaign several times

String	campaigns[].sentDate
Sent UTC date-time of the campaign (YYYY-MM-DDTHH:mm:ss.SSSZ). Only available if 'status' of the campaign is 'sent'

Integer	campaigns[].returnBounce
Total number of non-delivered campaigns for a particular campaign id.

Object	campaigns[].recipients
[Integer]	campaigns[].recipients.lists
[Integer]	campaigns[].recipients.exclusionLists
Object	campaigns[].statistics
Object	campaigns[].statistics.globalStats
Overall statistics of the campaign

[Object]	campaigns[].statistics.campaignStats
List-wise statistics of the campaign.

Integer	campaigns[].statistics.mirrorClick
Number of clicks on mirror link

Integer	campaigns[].statistics.remaining
Number of remaning emails to send

Object	campaigns[].statistics.linksStats
Statistics about the number of clicks for the links

Object	campaigns[].statistics.statsByDomain
Object	campaigns[].statistics.statsByDevice
Object	campaigns[].statistics.statsByBrowser
String	campaigns[].shareLink
Link to share the campaign on social medias

Integer	count
Number of Email campaigns retrieved

Create an email campaign

POST https://api.pakat.net/v3/emailCampaigns

Request Body

NameTypeDescription

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%.

Email campaigns informations

Response schema type: object

Send an email campaign immediately, based on campaignId

POST https://api.pakat.net/v3/emailCampaigns/{campaignId}/sendNow

Path Parameters

NameTypeDescription

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

NameTypeDescription

campaignId*

integer

Id of the campaign

Request Body

NameTypeDescription

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

NameTypeDescription

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

NameTypeDescription

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

Get a webhook details

GET https://api.pakat.net/v3/webhooks/{webhookId}

Path Parameters

NameTypeDescription

webhookId*

integer

Id of the webhook

Update a webhook

PUT https://api.pakat.net/v3/webhooks/{webhookId}

Path Parameters

NameTypeDescription

webhookId*

integer

Id of the webhook

Request Body

NameTypeDescription

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

Delete a webhook

DELETE https://api.pakat.net/v3/webhooks/{webhookId}

Path Parameters

NameTypeDescription

webhookId

integer

Id of the webhook

Sender

Get the list of all your senders

GET https://api.pakat.net/v3/senders

Query Parameters

NameTypeDescription

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

NameTypeDescription

api-key

String

API key v3

{
  "senders": [
    {
      "id": 1,
      "name": "Marketing",
      "email": "marketing@mycompany.com",
      "active": true,
      "ips": [
        {
          "ip": "123.98.689.7",
          "domain": "mycompany.com",
          "weight": 100
        }
      ]
    },
    {
      "id": 2,
      "name": "Newsletter",
      "email": "newsletter@mycompany.com",
      "active": false,
      "ips": [
        {
          "ip": "123.98.689.7",
          "domain": "mycompany.com",
          "weight": 50
        },
        {
          "ip": "123.98.643.2",
          "domain": "news.mycompany.com",
          "weight": 50
        }
      ]
    }
  ]
}

Create a new sender

POST https://api.pakat.net/v3/senders

Headers

NameTypeDescription

api-key

String

Your API key v3

Request Body

NameTypeDescription

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"

{
  "id": 5,
  "spfError": true,
  "dkimError": false
}

Example request to create a sender

curl --request POST \
     --url https://api.pakat.net/v3/senders \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'api-key: my-api-key-v3' \
     --data '
{
     "ips": [
          {
               "ip": "1.1.1.1",
               "domain": "example.com"
          }
     ],
     "name": "Ali",
     "email": "example@example.com"
}
'

Update a sender

PUT https://api.pakat.net/v3/senders/{senderId}

Path Parameters

NameTypeDescription

senderId

String

Id of the sender

Headers

NameTypeDescription

api-key

String

API key v3

Request Body

NameTypeDescription

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

NameTypeDescription

senderId

String

Id of the sender

Headers

NameTypeDescription

api-key

String

API key v3

{
    // Response
}

Last updated