Skip to content
Skip to main content
PUT
https://api.us.nylas.com/v3/grants/{grant_id}/workflows/{workflow_id}

Update a workflow

Updates the specified grant-level workflow.

Works with an API key, an access token (use /v3/grants/me/ in place of the grant ID), or an IAM API key with the workflows.update permission.

Parameters

Path parameters

grant_id*string

ID of the grant to access. Use /me/ to refer to the grant associated with an access token.

Example: "6c45fe5e-0bb6-41b9-9acc-ccb15bfc51eb"
workflow_id*string

The ID of the workflow to access.

Example: "b79c82b2-a51b-4c54-8469-28006a43551a"

Request body

Update workflow request

delayinteger

The number of minutes between a trigger_event being met and the workflow sending a message.

Example: 1
min: 0
is_enabledboolean

When true, indicates that the workflow is enabled.

Example: false
namestring

The name of the workflow.

Example: "Updated booking confirmation workflow"
template_idstring

The ID of the email template the workflow uses.

Example: "14c00cc8-648c-4381-ad10-52641d9bac8e"
trigger_eventstring

The event which triggers the workflow.

grant.expired and grant.deleted require a from sender address, because the grant that triggered them can no longer send email. Every other trigger accepts a workflow without one.

Workflows have no condition or filter field, so an enabled workflow sends for every matching event in its scope. High-volume triggers such as message.opened fire for every open of every tracked message the workflow covers.

booking.cancelledbooking.createdbooking.pendingbooking.reminderbooking.rescheduledcalendar.createdcalendar.deletedcalendar.updatedcontact.deletedcontact.updatedevent.createdevent.deletedevent.updatedfolder.createdfolder.deletedfolder.updatedgrant.createdgrant.deletedgrant.expiredgrant.imap_sync_completedgrant.updatedmessage.bounce_detectedmessage.link_clickedmessage.openedmessage.send_failedmessage.send_successnotetaker.creatednotetaker.deletednotetaker.medianotetaker.meeting_statenotetaker.speaker.revisionnotetaker.transcript.finalnotetaker.updatedthread.replied
Example: "booking.created"
fromobjectnullable

Details of the sender if the workflow should use transactional send. If not provided, the sender will be the grant associated with the trigger event.

A workflow with from.email must use an application-level template. On a grant-level workflow, if template_id points to a grant-level template, the request returns 400 with the message a Workflow with a from email must use an application-level template.

An application-level workflow accepts only application-level templates. If template_id points to a grant-level template, the request returns 404 with the message template not found.

Responses

request_id*string

The ID of the request.

data*object

A custom workflow that sends messages from a template when certain events are triggered.

PUThttps://api.us.nylas.com/v3/grants/6c45fe5e-0bb6-41b9-9acc-ccb15bfc51eb/workflows/b79c82b2-a51b-4c54-8469-28006a43551a

Find your API key in the Nylas Dashboard under API Keys in your application settings.

grant_idrequiredstring

ID of the grant to access. Use /me/ to refer to the grant associated with an access token.

workflow_idrequiredstring

The ID of the workflow to access.

Loading editor...

Autocomplete and validation come from this endpoint's request schema.