> For the complete documentation index, see [llms.txt](https://docs.fastn.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fastn.ai/connectors/catalog/cloud-devops/google-cloud-pub-sub.md). Agents can also search and read this documentation through its [MCP server](https://docs.fastn.ai/~gitbook/mcp).

# Google Cloud Pub/Sub

Google Cloud Pub/Sub is a messaging service. Manage topics, subscriptions, schemas and snapshots, publish messages and acknowledge received ones.

![Google Cloud Pub/Sub logo](https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-4581f2f8693b34024ca2dd45dfd9c394a2809669%2Fgoogle-cloud-pub-sub.png?alt=media)

|                    |                                                                                           |
| ------------------ | ----------------------------------------------------------------------------------------- |
| **Category**       | [Cloud and DevOps](https://docs.fastn.ai/connectors/catalog/cloud-devops.md)              |
| **Website**        | [cloud.google.com](https://cloud.google.com)                                              |
| **Authentication** | OAuth 2.0                                                                                 |
| **Slug**           | `googleCloudPubSub`                                                                       |
| **On fastn.ai**    | [Embed Google Cloud Pub/Sub in your product](https://fastn.ai/integrations/google-pubsub) |

## Setup

Your customers sign in to Google Cloud Pub/Sub through Fastn's own OAuth app, so nothing needs setting up first. To show your own app on the consent screen instead, add your OAuth app on the connector's **Auth** tab under **Manage providers**.

## Connect in Fastn

Your customers connect Google Cloud Pub/Sub from your widget. To connect an account yourself:

1. Go to **Build → Integrations → Connectors** and search for **Google Cloud Pub/Sub**.
2. Select **Connect** on the Google Cloud Pub/Sub card.

   <figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-586dd03cdc0c6904263f58928d7a531eae2f85df%2Fconnect-search.png?alt=media" alt="The Connectors page in Fastn with ServiceNow typed in the search box and the ServiceNow card showing a Connect button"><figcaption><p>Search for the connector, then select Connect on its card. ServiceNow is shown here.</p></figcaption></figure>
3. Keep the **Default** auth provider, or choose your own OAuth app if you added one. Pick the **Scopes** you need, select **Authorize**, then sign in to Google Cloud Pub/Sub and approve access in the window that opens.

   <figure><img src="https://1255842839-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3iSr2Tx8FvvuoLPncziH%2Fuploads%2Fgit-blob-0e2bbdd7109cec207402cf6883484b8525b7fbf5%2Fconnect-oauth.png?alt=media" alt="The Connect Salesforce dialog for OAuth 2.0 with the Default auth provider, an optional account name, the Scopes selector and an Authorize button"><figcaption><p>A connect form for OAuth 2.0. Salesforce is shown here.</p></figcaption></figure>
4. Check that the connection appears under **Operate → Connections** with the status `Active`. Your workflows can now use Google Cloud Pub/Sub's actions.

For more detail, see [Connect an app](https://docs.fastn.ai/build/integrations/connectors/connect-an-app.md).

## Actions

<table><thead><tr><th width="240">Action</th><th width="260">Slug</th><th>What it does</th></tr></thead><tbody><tr><td>Acknowledge Messages</td><td><code>acknowledgeMessages</code></td><td>Acknowledge one or more messages previously pulled from a subscription, using the ackIds returned by Pull Messages, so they are not redelivered.</td></tr><tr><td>Commit Schema</td><td><code>commitSchema</code></td><td>Commit a new revision of an existing schema. The supplied schema object (with its full resource name, type, and definition) becomes the latest revision.</td></tr><tr><td>Create Schema</td><td><code>createSchema</code></td><td>Create a schema in a project. The schema ID is supplied as a query parameter and the body carries the schema type (Protocol Buffer or Avro) and its definition.</td></tr><tr><td>Create Snapshot</td><td><code>createSnapshot</code></td><td>Create a snapshot from a subscription, capturing the message acknowledgement state of that subscription's topic so a subscription can later be sought back to this point. The snapshot name is taken from the URL path.</td></tr><tr><td>Create Subscription</td><td><code>createSubscription</code></td><td>Create a Pub/Sub subscription on a topic. The subscription name is taken from the URL path; the request body must include the topic and may configure push/BigQuery/Cloud Storage delivery, ack deadline, retention, ordering, filtering, dead-letter and retry policies, and exactly-once delivery.</td></tr><tr><td>Create Topic</td><td><code>createTopic</code></td><td>Create a Pub/Sub topic in the given project. The topic name is taken from the URL path; the request body carries optional configuration such as labels, message storage policy, message retention duration, CMEK key, schema settings, and ingestion data source settings.</td></tr><tr><td>Delete Schema</td><td><code>deleteSchema</code></td><td>Delete a schema and all of its revisions.</td></tr><tr><td>Delete Schema Revision</td><td><code>deleteSchemaRevision</code></td><td>Delete a specific revision of a schema. The most recent revision cannot be deleted while other revisions remain, and a schema's only revision cannot be deleted with this method.</td></tr><tr><td>Delete Snapshot</td><td><code>deleteSnapshot</code></td><td>Delete a Pub/Sub snapshot. Subscriptions can no longer be sought to a deleted snapshot.</td></tr><tr><td>Delete Subscription</td><td><code>deleteSubscription</code></td><td>Delete a Pub/Sub subscription. All messages retained in the subscription are immediately dropped and cannot be delivered.</td></tr></tbody></table>

<details>

<summary>View 36 more actions</summary>

<table><thead><tr><th width="240">Action</th><th width="260">Slug</th><th>What it does</th></tr></thead><tbody><tr><td>Delete Topic</td><td><code>deleteTopic</code></td><td>Delete a Pub/Sub topic. Existing subscriptions are not deleted but their topic field is set to _deleted-topic_.</td></tr><tr><td>Detach Subscription</td><td><code>detachSubscription</code></td><td>Detach a subscription from its topic. All messages retained in the subscription are dropped and the subscription stops receiving new messages; publishers can continue publishing to the topic.</td></tr><tr><td>Get Schema</td><td><code>getSchema</code></td><td>Retrieve a schema by its project and schema ID. Use the view parameter to control whether the definition is included.</td></tr><tr><td>Get Schema IAM Policy</td><td><code>getSchemaIamPolicy</code></td><td>Get the IAM access control policy for a Pub/Sub schema.</td></tr><tr><td>Get Snapshot</td><td><code>getSnapshot</code></td><td>Retrieve the configuration of a single Pub/Sub snapshot by its project and snapshot ID.</td></tr><tr><td>Get Snapshot IAM Policy</td><td><code>getSnapshotIamPolicy</code></td><td>Get the IAM access control policy for a Pub/Sub snapshot.</td></tr><tr><td>Get Subscription</td><td><code>getSubscription</code></td><td>Retrieve the configuration of a single Pub/Sub subscription by its project and subscription ID.</td></tr><tr><td>Get Subscription IAM Policy</td><td><code>getSubscriptionIamPolicy</code></td><td>Get the IAM access control policy for a Pub/Sub subscription.</td></tr><tr><td>Get Topic</td><td><code>getTopic</code></td><td>Retrieve the configuration of a single Pub/Sub topic by its project and topic ID.</td></tr><tr><td>Get Topic IAM Policy</td><td><code>getTopicIamPolicy</code></td><td>Get the IAM access control policy for a Pub/Sub topic.</td></tr><tr><td>List Schema Revisions</td><td><code>listSchemaRevisions</code></td><td>List all revisions of a schema, with optional detail view and pagination.</td></tr><tr><td>List Schemas</td><td><code>listSchemas</code></td><td>List all schemas in a project, with optional detail view and pagination.</td></tr><tr><td>List Snapshots</td><td><code>listSnapshots</code></td><td>List all Pub/Sub snapshots in a project, with optional pagination.</td></tr><tr><td>List Subscriptions</td><td><code>listSubscriptions</code></td><td>List all Pub/Sub subscriptions in a project, with optional pagination.</td></tr><tr><td>List Topic Snapshots</td><td><code>listTopicSnapshots</code></td><td>List the names of snapshots taken from subscriptions attached to a Pub/Sub topic, with optional pagination.</td></tr><tr><td>List Topic Subscriptions</td><td><code>listTopicSubscriptions</code></td><td>List the names of subscriptions attached to a Pub/Sub topic, with optional pagination.</td></tr><tr><td>List Topics</td><td><code>listTopics</code></td><td>List all Pub/Sub topics in a project, with optional pagination.</td></tr><tr><td>Modify Ack Deadline</td><td><code>modifyAckDeadline</code></td><td>Modify the acknowledgement deadline for specific pulled messages. Use to extend processing time or, with a deadline of 0, to immediately make messages available for redelivery (nack).</td></tr><tr><td>Modify Push Config</td><td><code>modifyPushConfig</code></td><td>Modify the push delivery configuration of a subscription. Supply an empty pushConfig to switch the subscription from push to pull delivery.</td></tr><tr><td>Publish Messages</td><td><code>publishToTopic</code></td><td>Publish one or more messages to a Pub/Sub topic. Each message's data must be base64-encoded; attributes and an ordering key are optional. Returns the server-assigned message IDs in publish order.</td></tr><tr><td>Pull Messages</td><td><code>pullSubscription</code></td><td>Pull messages from a Pub/Sub subscription. Returns received messages each with an ackId that must be passed to Acknowledge Messages to confirm processing.</td></tr><tr><td>Rollback Schema</td><td><code>rollbackSchema</code></td><td>Create a new schema revision that is a copy of the given revision ID, effectively rolling the schema back to an earlier definition.</td></tr><tr><td>Seek Subscription</td><td><code>seekSubscription</code></td><td>Seek a subscription to a past point in time or to a snapshot, resetting the acknowledgement state of messages. Provide exactly one of time or snapshot.</td></tr><tr><td>Set Schema IAM Policy</td><td><code>setSchemaIamPolicy</code></td><td>Set (replace) the IAM access control policy for a Pub/Sub schema. The supplied policy overwrites the existing one.</td></tr><tr><td>Set Snapshot IAM Policy</td><td><code>setSnapshotIamPolicy</code></td><td>Set (replace) the IAM access control policy for a Pub/Sub snapshot. The supplied policy overwrites the existing one.</td></tr><tr><td>Set Subscription IAM Policy</td><td><code>setSubscriptionIamPolicy</code></td><td>Set (replace) the IAM access control policy for a Pub/Sub subscription. The supplied policy overwrites the existing one.</td></tr><tr><td>Set Topic IAM Policy</td><td><code>setTopicIamPolicy</code></td><td>Set (replace) the IAM access control policy for a Pub/Sub topic. The supplied policy overwrites the existing one.</td></tr><tr><td>Test Schema IAM Permissions</td><td><code>testSchemaIamPermissions</code></td><td>Return which of the specified IAM permissions the caller holds on a Pub/Sub schema.</td></tr><tr><td>Test Snapshot IAM Permissions</td><td><code>testSnapshotIamPermissions</code></td><td>Return which of the specified IAM permissions the caller holds on a Pub/Sub snapshot.</td></tr><tr><td>Test Subscription IAM Permissions</td><td><code>testSubscriptionIamPermissions</code></td><td>Return which of the specified IAM permissions the caller holds on a Pub/Sub subscription.</td></tr><tr><td>Test Topic IAM Permissions</td><td><code>testTopicIamPermissions</code></td><td>Return which of the specified IAM permissions the caller holds on a Pub/Sub topic.</td></tr><tr><td>Update Snapshot</td><td><code>updateSnapshot</code></td><td>Update an existing Pub/Sub snapshot. Supply the fields to change inside the snapshot object and list their paths in updateMask; only the masked fields (typically labels or expireTime) are modified.</td></tr><tr><td>Update Subscription</td><td><code>updateSubscription</code></td><td>Update an existing Pub/Sub subscription. Supply the fields to change inside the subscription object and list their paths in updateMask; only the masked fields are modified.</td></tr><tr><td>Update Topic</td><td><code>updateTopic</code></td><td>Update an existing Pub/Sub topic. Supply the fields to change inside the topic object and list their paths in updateMask; only the masked fields are modified.</td></tr><tr><td>Validate Message</td><td><code>validateMessage</code></td><td>Validate a message against a schema, either an existing named schema or an inline schema definition, using the given encoding. Returns an empty success response if the message conforms.</td></tr><tr><td>Validate Schema</td><td><code>validateSchema</code></td><td>Validate a schema definition without creating it. Returns an empty success response if the schema type and definition are well-formed, or an error describing the problem.</td></tr></tbody></table>

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fastn.ai/connectors/catalog/cloud-devops/google-cloud-pub-sub.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
