Method: subscriptions.insert

Adds a subscription for the authenticated user's channel.

In the Subscription request body, snippet.resourceId.channelId is required to identify the channel to subscribe to (omitting it or passing an invalid channel ID returns 404 publisherNotFound), and part must include snippet. If specified, snippet.channelId must match the authenticated user's channel ID. The authenticated user must have a verified email address. YouTube doesn't persist contentDetails.activityType; new subscriptions always include all public activity.

For method-specific error responses, see subscriptions.insert errors. For code examples, see subscriptions.insert code snippets.

HTTP request

POST https://youtube.googleapis.com/youtube/v3/subscriptions

The URL uses gRPC Transcoding syntax.

Query parameters

Parameters
part[]

string

Required. The part parameter serves two purposes in this operation. It identifies the properties that the write operation sets as well as the properties that the API response includes.

Valid values are contentDetails, id, snippet, and subscriberSnippet. Set part to include snippet, because the request body must contain the snippet object.

Request body

The request body contains an instance of Subscription.

Response body

If successful, the response body contains a newly created instance of Subscription.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/youtube
  • https://www.googleapis.com/auth/youtubepartner
  • https://www.googleapis.com/auth/youtube.force-ssl

For more information, see the OAuth 2.0 Overview.