Google Cloud Pub/Sub Subscriptions API
Operations for managing Pub/Sub subscriptions
Operations for managing Pub/Sub subscriptions
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/google-cloud-pubsub:google-cloud-pubsub-subscriptions-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Google Cloud Pub/Sub Subscriptions API
description: The Cloud Pub/Sub API provides reliable, many-to-many, asynchronous messaging between applications. Publishers send messages to topics, and subscribers receive messages via subscriptions. It supports both push and pull delivery modes.
version: v1
contact:
name: Google Cloud
url: https://cloud.google.com/pubsub
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://pubsub.googleapis.com/v1
description: Google Cloud Pub/Sub API v1
security:
- oauth2: []
tags:
- name: Subscriptions
description: Operations for managing Pub/Sub subscriptions
paths:
/projects/{projectId}/subscriptions:
get:
operationId: listSubscriptions
summary: Google Cloud Pub/Sub List subscriptions
description: Lists matching subscriptions in the given project.
tags:
- Subscriptions
parameters:
- name: projectId
in: path
required: true
schema:
type: string
- name: pageSize
in: query
schema:
type: integer
- name: pageToken
in: query
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/ListSubscriptionsResponse'
/projects/{projectId}/subscriptions/{subscriptionId}:
get:
operationId: getSubscription
summary: Google Cloud Pub/Sub Get a subscription
description: Gets the configuration details of a subscription.
tags:
- Subscriptions
parameters:
- name: projectId
in: path
required: true
schema:
type: string
- name: subscriptionId
in: path
required: true
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Subscription'
put:
operationId: createSubscription
summary: Google Cloud Pub/Sub Create a subscription
description: Creates a subscription to a given topic.
tags:
- Subscriptions
parameters:
- name: projectId
in: path
required: true
schema:
type: string
- name: subscriptionId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Subscription'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/Subscription'
delete:
operationId: deleteSubscription
summary: Google Cloud Pub/Sub Delete a subscription
description: Deletes an existing subscription.
tags:
- Subscriptions
parameters:
- name: projectId
in: path
required: true
schema:
type: string
- name: subscriptionId
in: path
required: true
schema:
type: string
responses:
'200':
description: Successful response
/projects/{projectId}/subscriptions/{subscriptionId}:pull:
post:
operationId: pullMessages
summary: Google Cloud Pub/Sub Pull messages
description: Pulls messages from the server.
tags:
- Subscriptions
parameters:
- name: projectId
in: path
required: true
schema:
type: string
- name: subscriptionId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
maxMessages:
type: integer
description: Required. Maximum number of messages to return.
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
receivedMessages:
type: array
items:
$ref: '#/components/schemas/ReceivedMessage'
/projects/{projectId}/subscriptions/{subscriptionId}:acknowledge:
post:
operationId: acknowledgeMessages
summary: Google Cloud Pub/Sub Acknowledge messages
description: Acknowledges the messages associated with the ack IDs in the request.
tags:
- Subscriptions
parameters:
- name: projectId
in: path
required: true
schema:
type: string
- name: subscriptionId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
ackIds:
type: array
items:
type: string
responses:
'200':
description: Successful response
components:
schemas:
ListSubscriptionsResponse:
type: object
properties:
subscriptions:
type: array
items:
$ref: '#/components/schemas/Subscription'
nextPageToken:
type: string
PubsubMessage:
type: object
properties:
data:
type: string
description: The message data field (base64-encoded).
attributes:
type: object
additionalProperties:
type: string
messageId:
type: string
description: Output only. ID of this message.
publishTime:
type: string
format: date-time
description: Output only. The time at which the message was published.
orderingKey:
type: string
ReceivedMessage:
type: object
properties:
ackId:
type: string
message:
$ref: '#/components/schemas/PubsubMessage'
deliveryAttempt:
type: integer
Subscription:
type: object
properties:
name:
type: string
description: The name of the subscription.
topic:
type: string
description: The name of the topic from which this subscription receives messages.
pushConfig:
type: object
properties:
pushEndpoint:
type: string
attributes:
type: object
additionalProperties:
type: string
oidcToken:
type: object
properties:
serviceAccountEmail:
type: string
audience:
type: string
ackDeadlineSeconds:
type: integer
description: The approximate amount of time Pub/Sub waits for acknowledgment.
retainAckedMessages:
type: boolean
messageRetentionDuration:
type: string
labels:
type: object
additionalProperties:
type: string
enableMessageOrdering:
type: boolean
expirationPolicy:
type: object
properties:
ttl:
type: string
filter:
type: string
description: Expression to filter messages.
deadLetterPolicy:
type: object
properties:
deadLetterTopic:
type: string
maxDeliveryAttempts:
type: integer
retryPolicy:
type: object
properties:
minimumBackoff:
type: string
maximumBackoff:
type: string
detached:
type: boolean
enableExactlyOnceDelivery:
type: boolean
state:
type: string
enum:
- STATE_UNSPECIFIED
- ACTIVE
- RESOURCE_ERROR
securitySchemes:
oauth2:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://accounts.google.com/o/oauth2/auth
tokenUrl: https://oauth2.googleapis.com/token
scopes:
https://www.googleapis.com/auth/pubsub: View and manage Pub/Sub topics and subscriptions
https://www.googleapis.com/auth/cloud-platform: Full access to Google Cloud Platform
externalDocs:
description: Google Cloud Pub/Sub Documentation
url: https://cloud.google.com/pubsub/docs/reference/rest