---
title: "Create a Pub/Sub channel"
method: POST
path: "/v3/channels/pubsub"
tags: ["Pub/Sub Notifications"]
---

# Create a Pub/Sub channel

`POST /v3/channels/pubsub`

Create a Pub/Sub channel in the specified application.

## Request body

- PubsubInputPayload
  - `description` string — A human-readable description of the Pub/Sub channel.
  - `trigger_types` string[], required — The event that triggers the notification. See the [notification schemas](/docs/reference/notifications/) for details about each trigger type. See the [Grants](/docs/reference/api/manage-grants/), [Calendar](/docs/reference/api/calendar/), [Events](/docs/reference/api/events/), and [Messages](/docs/reference/api/messages/) references for information on how to trigger each event type.
  - `topic` string — The Google Pub/Sub topic that Nylas sends notifications to.
  - `notification_email_addresses` string[] — The email addresses that Nylas notifies if delivery to the Pub/Sub channel fails.
  - `compressed_delivery` boolean — 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`.

## Response `200`

Pub/Sub channel created

- object
  - `data` object
    - `id` string — A unique identifier for the Pub/Sub notification channel.
    - `description` string — A human-readable description of the Pub/Sub notification channel.
    - `trigger_types` string[] — The event that triggers the notification. See the [notification schemas](/docs/reference/notifications/) for details about each trigger type. See the [Grants](/docs/reference/api/manage-grants/), [Calendar](/docs/reference/api/calendar/), [Events](/docs/reference/api/events/), and [Messages](/docs/reference/api/messages/) references for information on how to trigger each event type.
    - `topic` string — The Google Pub/Sub topic that Nylas sends notifications to.
    - `status` 'active' — The status of the Pub/Sub channel. When you first create a new channel, Nylas sets it to "active".
    - `notification_email_addresses` string[] — The email addresses that Nylas notifies if delivery to the Pub/Sub channel fails.
    - `compressed_delivery` boolean — If `true`, Nylas compresses notification payloads using gzip before delivering them.
  - `request_id` string — The unique ID of the request that generated this response.

## Other responses

- `400` — Unable to create Pub/Sub channel

---

[API](https://skmtc.dev/nylas/apis/nylas-api.md) · [All operations](https://skmtc.dev/nylas/apis/nylas-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nylas/nylas-api/revisions/51c2c1b4ecff/schema)
