Method: projects.registrations.topicSubscriptions.patch

Updates a TopicSubscription. Subscribes an app installation instance by registration_id, either FID or FCM Token, to a topicSubscription. Returns an existing TopicSubscription or creates a new one if it does not exist.

HTTP request

PATCH https://fcm.googleapis.com/v1/{topicSubscription.name=projects/*/registrations/*/topicSubscriptions/*}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
topicSubscription.name

string

Identifier. The resource name of the subscription. Format: projects/{project}/registrations/{registration}/topicSubscriptions/{topicSubscription} The {registration} part contains the registration ID (e.g., FID).

Query parameters

Parameters
allowMissing

boolean

Optional. If set to true, and the topic subscription is not found, a new topic subscription will be created.

Request body

The request body contains an instance of TopicSubscription.

Response body

If successful, the response body contains an instance of TopicSubscription.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/firebase.messaging
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the OAuth 2.0 Overview.

IAM Permissions

Requires the following IAM permission on the name resource:

  • cloudmessaging.topicSubscriptions.update

For more information, see the IAM documentation.