Pub/Sub Notifications
Nylas offers two ways to get notifications of what's happening on the provider. You can either subscribe to webhook notifications, or you can set up a notification channel.
Nylas offers Pub/Sub and Amazon SNS notification channels. These can be used in place of, or in addition to, normal webhook notifications.
To use Pub/Sub notifications, you first need to set up a Pub/Sub queue on Google Cloud Platform. For detailed set up instructions see the Pub/Sub notifications documentation.
To use Amazon SNS notifications, you need to set up an SNS topic and IAM role in your AWS account. For detailed set up instructions see the Amazon SNS notifications documentation.
Nylas notification channels use the same notification trigger types and schemas as webhook notifications, and require the same provider scopes.
Payload compression
Both Pub/Sub and SNS channels accept a compressed_delivery boolean that gzip-compresses each notification payload before delivery. Nylas adds a content_encoding message attribute (gzip for Pub/Sub, gzip+base64 for SNS) so your subscriber knows which messages to decompress. We strongly recommend enabling it on SNS channels, where the 256 KB message limit makes compression the simplest way to avoid payload truncation. For setup and decode patterns, see Reducing payload size with compression.
Monitor grant status
The most important notifications to subscribe to are those related to grant status: grant.created, grant.updated, grant.deleted, and grant.expired. They allow you to automate important grant lifecycle processes, like onboarding messages, data refreshes, and backend deletions.
The grant.expired trigger notifies you when a user needs to re-authenticate their account. When you receive a grant.expired notification, you can take appropriate action (for example, notifying the user or starting a background re-authentication process).
If the grant has been out of service for more than 72 hours, Nylas does not send backfill notifications. In this case, look for the grant.expired and grant.updated notifications, and query the Nylas API for objects that changed between those timestamps.
GET /v3/channels/pubsubGet the Pub/Sub channels for an application.
POST /v3/channels/pubsubCreate a Pub/Sub channel in the specified application.
GET /v3/channels/pubsub/{id}Get a specific Pub/Sub channel from a specific Nylas application.
PUT /v3/channels/pubsub/{id}Updates the specified Pub/Sub channel. When you make a PUT request, Nylas replaces all data in the nested object with the information included in your request. For more information, see Updating objec...
DELETE /v3/channels/pubsub/{id}Delete a specific Pub/Sub channel from a specific Nylas application.