API

We are excited to announce that our users can now take advantage of the MailScheduler API as part of our API-first strategy. This allows for seamless integration and automated scheduling of emails.

Authenticate and get a session token

post

Authenticate and get a session token. This session token can be used for further authentication of all other requests.

Authorizations
Body
emailstringOptionalExample: [email protected]
passwordstringOptional
Responses
200
Successful operation
application/json
post
POST /api/login HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 46

{
  "email": "[email protected]",
  "password": "text"
}
{
  "user": {
    "id": "1",
    "name": "John Doe",
    "email": "[email protected]",
    "email_verified_at": "null,",
    "is_admin": true,
    "created_at": "2023-10-03T08:16:46.000000Z",
    "updated_at": "2023-11-20T13:58:04.000000Z"
  },
  "token": "8|RSX9LwIKpiXdiMr73KOG0gpoEtD8LrMRLuhQOF8u98cfe793"
}

List all schedules

get

Multiple status values can be provided with comma separated strings

Authorizations
Responses
200
successful operation
application/json
get
GET /api/schedules HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Accept: */*
200

successful operation

[
  {
    "data": [
      {
        "id": 3,
        "label": "Weekly schedule",
        "admin_email": "[email protected]",
        "testmode": true,
        "is_active": true,
        "created_at": "2024-01-01 09:10:00",
        "updated_at": "2024-01-01 09:10:00",
        "site_id": 2,
        "start_on": "2024-01-01",
        "end_on": "2024-12-31",
        "notify_on_failure": false,
        "tasks_count": 12,
        "active_tasks_count": 10,
        "upcoming": "2024-02-26 09:00:00",
        "frequencyString": "Days of the week: MON -> Dailyat: 09:00",
        "frequencies": "NA"
      }
    ],
    "current_page": 1,
    "last_page": 5
  }
]

View a task of a schedule

get
Authorizations
Path parameters
scheduleIdstringRequired

Schedule ID

Example: 1
Responses
200
successfully retrieved task
application/json
get
GET /api/schedules/{scheduleId}/tasks HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Accept: */*
{
  "recipient_count": 1,
  "label": "Sales overview",
  "filename": "Sales",
  "subject": "Weekly update",
  "mailinglists": [
    "5",
    "7"
  ],
  "emails": [
    {
      "email": "[email protected]"
    }
  ],
  "send_type": "bcc",
  "from_email": "text",
  "from_name": "text",
  "reply_to_email": "text",
  "reply_to_name": "text",
  "active": true,
  "save": true,
  "notify_on_failure": true,
  "csv_delimiter": ",",
  "csv_extension": "csv",
  "views": [
    {
      "id": "text",
      "label": "text",
      "workbook_id": "text",
      "view_id": "text",
      "is_landscape": true,
      "order": 1,
      "export_types": 2,
      "filters": [
        {
          "id": "temp-key-234",
          "key": "Region",
          "value": "North"
        }
      ]
    }
  ],
  "templates": [
    {
      "id": 1,
      "label": "company logo",
      "position": "header-right",
      "is_global": true,
      "body": "Hi {name}, Please see the overview below...",
      "img_id": 2,
      "img_url": "https://website.com/images/company-logo.png",
      "img_width": 200,
      "img_height": 200,
      "img_align": "right"
    }
  ]
}

Add a task to a schedule'

post
Authorizations
Path parameters
scheduleIdstringRequired

Schedule ID

Example: 1
Body
labelstringOptional

A recognizable label for your reference

Example: Sales overview
filenamestringOptional

The filename for the merged PDF.

Example: Sales
subjectstringOptional

Subject of the email

Example: Weekly update
mailinglistsarrayOptionalExample: ["5","7"]
emailsarrayOptionalExample: [{"email":"[email protected]"}]
send_typestring · enumOptional

Send the email with the following method

Example: bccPossible values:
from_emailstringOptional

Email address to use in the from email field. Note that you need permission with the authenticated email account to send an email with this email address.

from_namestringOptional

Name from in the email

reply_to_emailstringOptional

The reply to email address in the email

reply_to_namestringOptional

The reply to name in the email

activebooleanOptional

When the task is active, it will be sent once the schedule is executed.

Example: true
savebooleanOptional

Save a copy of the PDF on your server

Example: true
notify_on_failurebooleanOptional

In case a task would fail, all recipients will get a notification that we were not able to send the email. We are aware of the issue and are working on it. This way we prevent that everyone will notify you about the failed email.

Example: true
csv_delimiterstringOptional

The delimiter to be used in your csv export

Example: ,
csv_extensionstringOptional

The extension for the csv export

Example: csv
Responses
201
successfully created task
application/json
post
POST /api/schedules/{scheduleId}/tasks HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 784

{
  "label": "Sales overview",
  "filename": "Sales",
  "subject": "Weekly update",
  "mailinglists": [
    "5",
    "7"
  ],
  "emails": [
    {
      "email": "[email protected]"
    }
  ],
  "send_type": "bcc",
  "from_email": "text",
  "from_name": "text",
  "reply_to_email": "text",
  "reply_to_name": "text",
  "active": true,
  "save": true,
  "notify_on_failure": true,
  "csv_delimiter": ",",
  "csv_extension": "csv",
  "views": [
    {
      "id": "text",
      "label": "text",
      "workbook_id": "text",
      "view_id": "text",
      "is_landscape": true,
      "order": 1,
      "export_types": 2,
      "filters": [
        {
          "id": "temp-key-234",
          "key": "Region",
          "value": "North"
        }
      ]
    }
  ],
  "templates": [
    {
      "id": 1,
      "label": "company logo",
      "position": "header-right",
      "is_global": true,
      "body": "Hi {name}, Please see the overview below...",
      "img_id": 2,
      "img_url": "https://website.com/images/company-logo.png",
      "img_width": 200,
      "img_height": 200,
      "img_align": "right"
    }
  ]
}
{
  "recipient_count": 1,
  "label": "Sales overview",
  "filename": "Sales",
  "subject": "Weekly update",
  "mailinglists": [
    "5",
    "7"
  ],
  "emails": [
    {
      "email": "[email protected]"
    }
  ],
  "send_type": "bcc",
  "from_email": "text",
  "from_name": "text",
  "reply_to_email": "text",
  "reply_to_name": "text",
  "active": true,
  "save": true,
  "notify_on_failure": true,
  "csv_delimiter": ",",
  "csv_extension": "csv",
  "views": [
    {
      "id": "text",
      "label": "text",
      "workbook_id": "text",
      "view_id": "text",
      "is_landscape": true,
      "order": 1,
      "export_types": 2,
      "filters": [
        {
          "id": "temp-key-234",
          "key": "Region",
          "value": "North"
        }
      ]
    }
  ],
  "templates": [
    {
      "id": 1,
      "label": "company logo",
      "position": "header-right",
      "is_global": true,
      "body": "Hi {name}, Please see the overview below...",
      "img_id": 2,
      "img_url": "https://website.com/images/company-logo.png",
      "img_width": 200,
      "img_height": 200,
      "img_align": "right"
    }
  ]
}

Update a task

put
Authorizations
Path parameters
scheduleIdstringRequired

Schedule ID

Example: 1
taskIdstringRequired

Task ID

Example: 1
Body
labelstringOptional

A recognizable label for your reference

Example: Sales overview
filenamestringOptional

The filename for the merged PDF.

Example: Sales
subjectstringOptional

Subject of the email

Example: Weekly update
mailinglistsarrayOptionalExample: ["5","7"]
emailsarrayOptionalExample: [{"email":"[email protected]"}]
send_typestring · enumOptional

Send the email with the following method

Example: bccPossible values:
from_emailstringOptional

Email address to use in the from email field. Note that you need permission with the authenticated email account to send an email with this email address.

from_namestringOptional

Name from in the email

reply_to_emailstringOptional

The reply to email address in the email

reply_to_namestringOptional

The reply to name in the email

activebooleanOptional

When the task is active, it will be sent once the schedule is executed.

Example: true
savebooleanOptional

Save a copy of the PDF on your server

Example: true
notify_on_failurebooleanOptional

In case a task would fail, all recipients will get a notification that we were not able to send the email. We are aware of the issue and are working on it. This way we prevent that everyone will notify you about the failed email.

Example: true
csv_delimiterstringOptional

The delimiter to be used in your csv export

Example: ,
csv_extensionstringOptional

The extension for the csv export

Example: csv
Responses
200
successfully updated
put
PUT /api/schedules/{scheduleId}/tasks/{taskId} HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 784

{
  "label": "Sales overview",
  "filename": "Sales",
  "subject": "Weekly update",
  "mailinglists": [
    "5",
    "7"
  ],
  "emails": [
    {
      "email": "[email protected]"
    }
  ],
  "send_type": "bcc",
  "from_email": "text",
  "from_name": "text",
  "reply_to_email": "text",
  "reply_to_name": "text",
  "active": true,
  "save": true,
  "notify_on_failure": true,
  "csv_delimiter": ",",
  "csv_extension": "csv",
  "views": [
    {
      "id": "text",
      "label": "text",
      "workbook_id": "text",
      "view_id": "text",
      "is_landscape": true,
      "order": 1,
      "export_types": 2,
      "filters": [
        {
          "id": "temp-key-234",
          "key": "Region",
          "value": "North"
        }
      ]
    }
  ],
  "templates": [
    {
      "id": 1,
      "label": "company logo",
      "position": "header-right",
      "is_global": true,
      "body": "Hi {name}, Please see the overview below...",
      "img_id": 2,
      "img_url": "https://website.com/images/company-logo.png",
      "img_width": 200,
      "img_height": 200,
      "img_align": "right"
    }
  ]
}

No content

Delete a task

delete
Authorizations
Path parameters
scheduleIdstringRequired

Schedule ID

Example: 1
taskIdstringRequired

Task ID

Example: 1
Responses
200
successfully deleted task
delete
DELETE /api/schedules/{scheduleId}/tasks/{taskId} HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Accept: */*

No content

Get all mailinglists

get
Authorizations
Responses
200
Get all mailinglists
application/json
Responseobject
get
GET /api/mailing-lists HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Accept: */*
200

Get all mailinglists

{
  "data": null
}

Create a new mailinglist

post
Authorizations
Body
namestringOptional

The label of the mailinglist

Example: Managers
descriptionstringOptional

A description for the mailinglist

Example: Managers from region West
Responses
201
Create a new mailinglist
application/json
Responseany

Mailinglist Response.

post
POST /api/mailing-lists HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 72

{
  "name": "Managers",
  "description": "Managers from region West",
  "sites": []
}

No content

Update a mailinglist

put
Authorizations
Path parameters
mailinglistIdstringRequired

Mailinglist ID

Example: 1
Body
namestringOptional

The label of the mailinglist

Example: Managers
descriptionstringOptional

A description for the mailinglist

Example: Managers from region West
Responses
200
Update a mailinglist
application/json
Responseany

Mailinglist Response.

put
PUT /api/mailing-lists/{mailinglistId} HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 72

{
  "name": "Managers",
  "description": "Managers from region West",
  "sites": []
}

No content

Delete a mailinglist

delete
Authorizations
Path parameters
mailinglistIdstringRequired

Mailinglist ID

Example: 1
Responses
200
successfully deleted mailinglist
delete
DELETE /api/mailing-lists/{mailinglistId} HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Accept: */*

No content

Get all recipients

get
Authorizations
Responses
200
Get all recipients
application/json
get
GET /api/recipients HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Accept: */*
200

Get all recipients

{
  "data": [
    {
      "name": "John Doe",
      "email": "[email protected]",
      "filters": [
        {
          "id": "temp-key-234",
          "key": "Region",
          "value": "North"
        }
      ],
      "placeholders": [
        {
          "id": 1,
          "key": "name",
          "value": "John Doe"
        }
      ],
      "sites": [],
      "mailinglists": [
        5
      ],
      "created_at": "2024-01-17T09:45:14.000000Z",
      "updated_at": "2024-01-17T09:45:14.000000Z"
    }
  ],
  "current_page": 1,
  "last_page": 5
}

Create a recipient

post
Authorizations
Body
namestringOptional

Name of the recipient. Primarely used for your reference, but acts as a fallback when you use the "name" placeholder

Example: John Doe
emailstringOptional

Emailaddress of the recipient

Example: [email protected]
mailinglistsstring[]OptionalExample: 5
Responses
201
Store a new recipient
application/json
post
POST /api/recipients HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 199

{
  "name": "John Doe",
  "email": "[email protected]",
  "filters": [
    {
      "id": "temp-key-234",
      "key": "Region",
      "value": "North"
    }
  ],
  "placeholders": [
    {
      "id": 1,
      "key": "name",
      "value": "John Doe"
    }
  ],
  "sites": [],
  "mailinglists": [
    5
  ]
}
{
  "name": "John Doe",
  "email": "[email protected]",
  "filters": [
    {
      "id": "temp-key-234",
      "key": "Region",
      "value": "North"
    }
  ],
  "placeholders": [
    {
      "id": 1,
      "key": "name",
      "value": "John Doe"
    }
  ],
  "sites": [],
  "mailinglists": [
    5
  ],
  "created_at": "2024-01-17T09:45:14.000000Z",
  "updated_at": "2024-01-17T09:45:14.000000Z"
}

Update a recipient

put
Authorizations
Path parameters
recipientIdstringRequired

Recipient ID

Example: 1
Body
namestringOptional

Name of the recipient. Primarely used for your reference, but acts as a fallback when you use the "name" placeholder

Example: John Doe
emailstringOptional

Emailaddress of the recipient

Example: [email protected]
mailinglistsstring[]OptionalExample: 5
Responses
200
successfully updated recipient
put
PUT /api/recipients/{recipientId} HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 199

{
  "name": "John Doe",
  "email": "[email protected]",
  "filters": [
    {
      "id": "temp-key-234",
      "key": "Region",
      "value": "North"
    }
  ],
  "placeholders": [
    {
      "id": 1,
      "key": "name",
      "value": "John Doe"
    }
  ],
  "sites": [],
  "mailinglists": [
    5
  ]
}

No content

Delete a recipient

delete
Authorizations
Path parameters
recipientIdstringRequired

Recipient ID

Example: 1
Responses
200
successfully deleted recipient
delete
DELETE /api/recipients/{recipientId} HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Accept: */*

No content

get
Authorizations
Responses
200
Get all sites
application/json
get
GET /api/sites HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Accept: */*
200

Get all sites

[
  {
    "id": "text",
    "label": "text",
    "site_name": "companyname",
    "token_id": "1",
    "server_id": 1
  }
]
post
Authorizations
Path parameters
siteIdstringRequired

Site ID, required to access Tableau

Example: 1
Body
namestringOptional

The name of the workbook

Example: MyWorkbook
Responses
200
Get back the workbook ID from Tableau
application/json
post
POST /api/tableau/get-workbook-id/{siteId} HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 21

{
  "name": "MyWorkbook"
}
200

Get back the workbook ID from Tableau

{
  "workbookd_id": "3a051b9c-e21a-4a77-b809-6d2d0a9f2305"
}
post
Authorizations
Path parameters
siteIdstringRequired

Site ID, required to access Tableau

Example: 1
Body
namestringOptional

The name of the Dashboard or view

Example: MyDashboardName
Responses
200
Get back the view ID from Tableau
application/json
post
POST /api/tableau/get-view-id/{siteId} HTTP/1.1
Host: localhost:8000
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 26

{
  "name": "MyDashboardName"
}
200

Get back the view ID from Tableau

{
  "view_id": "3a051b9c-e21a-4a77-b809-6d2d0a9f2305"
}

Last updated

Was this helpful?