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

Contacts

Get all the contacts

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

Query Parameters

Headers

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

Request Body

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

Headers

Request Body

Contact updated

List all attributes

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

Headers

Get all the lists

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

Query Parameters

Headers

Create a list

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

Headers

Request Body

Get all folders

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

Query Parameters

Headers

Create a folder

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

Headers

Request Body

Transactional

Get the list of blocked or unsubscribed transactional contacts

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

Query Parameters

Headers

Get your transactional email activity aggregated per day

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

Query Parameters

Headers

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

Query Parameters

Headers

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

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

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

Request Body

Returns the template informations

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

Path Parameters

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

Request Body

transactional email template updated

Delete an inactive transactional email template

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

Path Parameters

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

Request Body

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

Request Body

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

Email Campaigns

Return all your created email campaigns

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

Query Parameters

[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

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

Send an email campaign to your test list

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

Path Parameters

Request Body

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

Create a webhook

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

Request Body

Get a webhook details

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

Path Parameters

Update a webhook

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

Path Parameters

Request Body

Delete a webhook

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

Path Parameters

Sender

Get the list of all your senders

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

Query Parameters

Headers

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

Request Body

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

Headers

Request Body

Delete a sender

DELETE https://api.sendinblue.com/v3/senders/{senderId}

Path Parameters

Headers

{
    // Response
}

Last updated