Pub/Sub Notifications

Create a Pub/Sub channel

Changed on

Create a Pub/Sub channel in the specified application.

post/v3/channels/pubsub

Request

  • Base URL
    https://api.us.nylas.com
  • Auth
    HTTP bearer

Request body

descriptionstring

A human-readable description of the Pub/Sub channel.

trigger_typesstring[]

The event that triggers the notification. See the notification schemas for details about each trigger type.

See the Grants, Calendar, Events, and Messages references for information on how to trigger each event type.

topicstring required

The Google Pub/Sub topic that Nylas sends notifications to.

notification_email_addressesstring[]

The email addresses that Nylas notifies if delivery to the Pub/Sub channel fails.

compressed_deliveryboolean

If true, Nylas compresses notification payloads using gzip before delivering them. Nylas adds a content_encoding: gzip message attribute to the Pub/Sub message. Default is false.

Example request

{
  "description": "Production Pub/Sub for Events notifications",
  "topic": "projects/your-project-id/topics/your-topic-id",
  "notification_email_addresses": [
    "jane@example.com",
    "joe@example.com"
  ],
  "compressed_delivery": true
}

Response

Pub/Sub channel created

request_idstring

The unique ID of the request that generated this response.

Example response

{
  "data": {
    "id": "UMWjAjMeWQ4D8gYF2moonK4486",
    "description": "Production Pub/Sub channel for Grant notifications",
    "topic": "projects/your-project-id/topics/your-topic-id",
    "notification_email_addresses": [
      "jane@example.com",
      "joe@example.com"
    ]
  }
}

Changes

    • warning

      added the new alert.triggered enum value to the // response property for the response status

    • info

      added the new alert.triggered enum value to the request property /

    • breaking

      the request property became required

    • info

      the request property became optional