Nylas Docs

The Nylas Developer Hub

Welcome to the Nylas developer hub. You'll find comprehensive guides and documentation to help you start working with Nylas as quickly as possible, as well as support if you get stuck. Let's jump right in!

Developer Guide

Create a Workflow

Nylas Workflows help you quickly build integrations by making it easier to work with common scenarios. You'll create your first workflow and become an expert on Nylas Workflows.

You’ll walk through the workflow in sections, and at the end, see a completed workflow. In this example, you’ll use the template calendar-event-reminder.

The Calendar Event Reminder Workflow lets you create an event, then send out multiple reminders using email, text, or webhooks. Use webhooks to send reminders to any webhook URL including Teams and Slack.

Create Your First Workflow

Creating a workflow with Nylas requires 1 API call. You’ll walk through the workflow in sections, and at the end, see a completed workflow. In this example, you’ll use the template calendar-event-reminder.

Prerequisites

  • Create a Nylas account.

Ready to Start Building?

Try it Free

Step One Create An Event

To use the calendar-event-reminder template, you need to create a calendar event. The template calls the Calendar Event endpoint to create events. You can list multiple participants; only an email address is required.

📘

SMS Alerts

You must include a North American phone number if you want to use SMS reminders.

  "template": "calendar-event-reminder",
  "data": {
    "create_calendar_event": {
      "calendar_id": "string",
      "when": {
        "start_time": 1607812301,
        "end_time": 1607814101
      },
      "title": "Let'\''s meet",
      "description": "Don'\''t forget to wear masks folks.",
      "location": "Coffee Shop at Mandalore",
      "busy": true,
      "participants": [
        {
          "name": "John Doe",
          "email": "[email protected]",
          "status": "yes",
          "phone_number": 15149998877,
          "comment": "string"
        }
      ]
    },
...

Step Two Create a Reminder

You can create three types of reminders:

  • Email
  • SMS
  • Webhook

The following example shows an email reminder. You can send email reminders with file attachments and message tracking. The time_before_event parameter is used to set the time a reminder is sent in minutes. You can send multiple reminders and multiple types of reminders.

...
    "reminders": [
      {
        "type": "email",
        "time_before_event": "600",
        "subject": "Don'\''t forget",
        "body": "Reminding you about our meeting.",
        "file_ids": [
          "string"
        ],
        "tracking": {
          "links": true,
          "opens": true,
          "thread_replies": true,
          "payload": "string"
        }
      }
    ]
  }
}'

Step Three Complete Workflow Request

Instead of needing to make multiple API requests, you only need to make one request to create events and send reminders.

curl --location --request POST 'https://api.nylas.com/workflows' \
--header 'Authorization: Bearer ACCESS_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw '{
  "template": "calendar-event-reminder",
  "data": {
    "create_calendar_event": {
      "calendar_id": "string",
      "when": {
        "start_time": 1607812301,
        "end_time": 1607814101
      },
      "title": "Let'\''s meet",
      "description": "Don'\''t forget to wear masks folks.",
      "location": "Coffee Shop at mandalore",
      "busy": true,
      "participants": [
        {
          "name": "John Doe",
          "email": "[email protected]",
          "status": "yes",
          "phone_number": 15149998877,
          "comment": "string"
        }
      ]
    },
    "reminders": [
      {
        "type": "email",
        "time_before_event": "600",
        "subject": "Don'\''t forget",
        "body": "Reminding you about our meeting.",
        "file_ids": [
          "string"
        ],
        "tracking": {
          "links": true,
          "opens": true,
          "thread_replies": true,
          "payload": "string"
        }
      }
    ]
  }
}'

👍

Congrats!

That’s it! You’ve created your first event with an email reminder and only needed to make one API request!

Updated 24 days ago


What's Next

Review the Workflows endpoint for more request examples.

Workflow Endpoints

Create a Workflow


Nylas Workflows help you quickly build integrations by making it easier to work with common scenarios. You'll create your first workflow and become an expert on Nylas Workflows.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.