Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

YouTube

OAuth 2.0 communication

Connect this agent connector to let your agent:

  • Search search — Search for videos, channels, and playlists on YouTube
  • List reporting, analytics groups — List reports that have been generated for a YouTube reporting job
  • Query analytics — Query YouTube Analytics data to retrieve metrics like views, watch time, subscribers, revenue, etc
  • Update videos, analytics groups, playlist — Update metadata for an existing YouTube video
  • Delete subscriptions, reporting jobs, analytics groups — Unsubscribe the authenticated user from a YouTube channel using the subscription ID
  • Insert playlist, playlist items, analytics group item — Create a new YouTube playlist for the authenticated user

This connector uses OAuth 2.0. Scalekit acts as the OAuth client: it redirects your user to YouTube, obtains an access token, and automatically refreshes it before it expires. Your agent code never handles tokens directly — you only pass a connectionName and a user identifier.

You supply your YouTube Connected App credentials (Client ID + Secret) once per environment in the Scalekit dashboard.

Set up the connector

Register your Google OAuth 2.0 credentials with Scalekit so it can manage the OAuth 2.0 authentication flow and token lifecycle for YouTube on your behalf. You’ll need a Client ID and Client Secret from the Google Cloud Console.

  1. Create an OAuth 2.0 client in Google Cloud

    • Go to the Google Cloud Console and select your project (or create a new one).

      Google Cloud Console welcome page
    • Search for OAuth in the top search bar. Select Credentials under APIs & Services.

      Searching for OAuth in Google Cloud Console
    • On the Credentials page, click + Create credentials and select OAuth client ID.

      Google Cloud Credentials page showing OAuth 2.0 Client IDs Create credentials dropdown with OAuth client ID option
    • Set the Application type to Web application and enter a Name (e.g., Scalekit).

      Create OAuth client ID form with Web application type and Scalekit name
    • Leave the Authorized redirect URIs section empty for now — you’ll add the Scalekit redirect URI in a later step.

  2. Create a connection in Scalekit

    • In Scalekit dashboard, go to Agent AuthCreate Connection.

      Scalekit Agent Auth connections page
    • Search for YouTube and click Create.

      Searching for YouTube in Scalekit Create Connection
    • Copy the Redirect URI from the connection configuration panel. It looks like https://<SCALEKIT_ENVIRONMENT_URL>/sso/v1/oauth/<CONNECTION_ID>/callback.

      Configure YouTube Connection panel showing Redirect URI, Client ID, Client Secret, and Scopes fields
  3. Configure the redirect URI in Google Cloud

    • Back in the Google Cloud Console, open your OAuth 2.0 client (or continue from step 1).

    • Under Authorized redirect URIs, click + Add URI and paste the Scalekit Redirect URI.

      Google Cloud OAuth client with Scalekit redirect URI added
    • Click Create (or Save if editing an existing client). A dialog displays your Client ID and Client secret. Copy both values.

      OAuth client created dialog showing Client ID and Client secret
  4. Add credentials in Scalekit

    • In Scalekit dashboard, go to Agent AuthConnections and open the YouTube connection you created.

    • Enter your credentials:

      • Client ID — the Client ID from your Google OAuth 2.0 client
      • Client Secret — the Client secret from the dialog in step 3
      • Scopes — select the scopes your app needs (e.g., youtube.readonly, youtube, youtube.force-ssl, yt-analytics.readonly)
      Configure YouTube Connection panel filled with Client ID and Client Secret
    • Click Save.

youtube_analytics_group_create Create a YouTube Analytics group to organize videos, playlists, channels, or assets for collective analytics reporting. 3 params

Create a YouTube Analytics group to organize videos, playlists, channels, or assets for collective analytics reporting.

Name Type Required Description
item_type string required Type of items the group will contain
title string required Title of the analytics group
on_behalf_of_content_owner string optional Content owner ID. For content partners only.
youtube_analytics_group_item_insert Add a video, playlist, or channel to a YouTube Analytics group. 4 params

Add a video, playlist, or channel to a YouTube Analytics group.

Name Type Required Description
group_id string required ID of the Analytics group to add the item to
resource_id string required ID of the resource (video ID, channel ID, or playlist ID)
resource_kind string required Type of the resource
on_behalf_of_content_owner string optional Content owner ID. For content partners only.
youtube_analytics_group_items_delete Remove an item (video, channel, or playlist) from a YouTube Analytics group. 2 params

Remove an item (video, channel, or playlist) from a YouTube Analytics group.

Name Type Required Description
id string required ID of the group item to remove
on_behalf_of_content_owner string optional Content owner ID on whose behalf the request is being made
youtube_analytics_group_items_list Retrieve a list of items (videos, playlists, channels, or assets) that belong to a YouTube Analytics group. 2 params

Retrieve a list of items (videos, playlists, channels, or assets) that belong to a YouTube Analytics group.

Name Type Required Description
group_id string required ID of the group whose items to retrieve
on_behalf_of_content_owner string optional Content owner ID on whose behalf the request is being made
youtube_analytics_groups_delete Delete a YouTube Analytics group. This removes the group but does not delete the videos, channels, or playlists within it. 2 params

Delete a YouTube Analytics group. This removes the group but does not delete the videos, channels, or playlists within it.

Name Type Required Description
group_id string required ID of the Analytics group to delete
on_behalf_of_content_owner string optional Content owner ID on whose behalf the request is being made
youtube_analytics_groups_list Retrieve a list of YouTube Analytics groups for a channel or content owner. Specify either id or mine to filter results. 4 params

Retrieve a list of YouTube Analytics groups for a channel or content owner. Specify either id or mine to filter results.

Name Type Required Description
id string optional Comma-separated list of group IDs to retrieve
mine boolean optional If true, return only groups owned by the authenticated user. Required if id is not set.
on_behalf_of_content_owner string optional Content owner ID on whose behalf the request is being made
page_token string optional Token for retrieving the next page of results
youtube_analytics_groups_update Update the title of an existing YouTube Analytics group. 3 params

Update the title of an existing YouTube Analytics group.

Name Type Required Description
group_id string required ID of the Analytics group to update
title string required New title for the Analytics group
on_behalf_of_content_owner string optional Content owner ID. For content partners only.
youtube_analytics_query Query YouTube Analytics data to retrieve metrics like views, watch time, subscribers, revenue, etc. for channels or content owners. 11 params

Query YouTube Analytics data to retrieve metrics like views, watch time, subscribers, revenue, etc. for channels or content owners.

Name Type Required Description
end_date string required End date for the analytics report in YYYY-MM-DD format
ids string required Channel or content owner ID. Format: channel==CHANNEL_ID or contentOwner==CONTENT_OWNER_ID
metrics string required Comma-separated list of metrics to retrieve (e.g., views,estimatedMinutesWatched,likes,subscribersGained)
start_date string required Start date for the analytics report in YYYY-MM-DD format
currency string optional Currency for monetary metrics (ISO 4217 code, e.g., USD)
dimensions string optional Comma-separated list of dimensions to group results by (e.g., day,country,video)
filters string optional Filter expression to narrow results (e.g., country==US, video==VIDEO_ID)
include_historical_channel_data boolean optional Include historical channel data recorded before the channel was linked to a content owner
max_results integer optional Maximum number of rows to return in the response (maximum value: 200)
sort string optional Comma-separated list of columns to sort by. Prefix with - for descending order (e.g., -views)
start_index integer optional 1-based index of the first row to return (for pagination)
youtube_captions_list Retrieve a list of caption tracks for a YouTube video. The part parameter is fixed to 'snippet'. Requires youtube.force-ssl scope. 2 params

Retrieve a list of caption tracks for a YouTube video. The part parameter is fixed to 'snippet'. Requires youtube.force-ssl scope.

Name Type Required Description
video_id string required ID of the video to list captions for
id string optional Comma-separated list of caption track IDs to filter results
youtube_channels_list Retrieve information about one or more YouTube channels including subscriber count, video count, and channel metadata. You must provide exactly one filter: id, mine, for_handle, for_username, or managed_by_me. Requires a valid YouTube OAuth2 connection. 8 params

Retrieve information about one or more YouTube channels including subscriber count, video count, and channel metadata. You must provide exactly one filter: id, mine, for_handle, for_username, or managed_by_me. Requires a valid YouTube OAuth2 connection.

Name Type Required Description
part string required Comma-separated list of channel resource parts to include in the response
for_handle string optional YouTube channel handle to look up (e.g., @MrBeast). Use instead of id, mine, or for_username.
for_username string optional YouTube username of the channel to look up (legacy). Use instead of id, mine, or for_handle.
id string optional Comma-separated list of YouTube channel IDs. Use instead of mine, for_handle, or for_username.
managed_by_me boolean optional Return channels managed by the authenticated user (content partners only). Use instead of id, mine, for_handle, or for_username.
max_results integer optional Maximum number of results to return (0-50, default: 5)
mine boolean optional Return the authenticated user's channel. Use instead of id, for_handle, or for_username.
page_token string optional Token for pagination
youtube_comment_threads_insert Post a new top-level comment on a YouTube video. Requires youtube.force-ssl scope. 2 params

Post a new top-level comment on a YouTube video. Requires youtube.force-ssl scope.

Name Type Required Description
text string required Text of the comment
video_id string required ID of the video to comment on
youtube_comment_threads_list Retrieve top-level comment threads for a YouTube video or channel. You must provide exactly one filter: video_id, all_threads_related_to_channel_id, or id. Each thread includes the top-level comment and optionally its replies. Requires a valid YouTube OAuth2 connection. 8 params

Retrieve top-level comment threads for a YouTube video or channel. You must provide exactly one filter: video_id, all_threads_related_to_channel_id, or id. Each thread includes the top-level comment and optionally its replies. Requires a valid YouTube OAuth2 connection.

Name Type Required Description
part string required Comma-separated list of comment thread resource parts to include
all_threads_related_to_channel_id string optional Return all comment threads associated with a specific channel. Use instead of video_id or id.
id string optional Comma-separated list of comment thread IDs to retrieve. Use instead of video_id or all_threads_related_to_channel_id.
max_results integer optional Maximum number of comment threads to return (1-100, default: 20)
order string optional Sort order for comment threads
page_token string optional Token for pagination
search_terms string optional Limit results to comments containing these search terms
video_id string optional YouTube video ID to fetch comment threads for. Use instead of all_threads_related_to_channel_id or id.
youtube_comments_list Retrieve a list of replies to a specific YouTube comment thread. You must provide exactly one filter: parent_id or id. The part parameter is fixed to 'snippet'. Requires youtube.readonly scope. 5 params

Retrieve a list of replies to a specific YouTube comment thread. You must provide exactly one filter: parent_id or id. The part parameter is fixed to 'snippet'. Requires youtube.readonly scope.

Name Type Required Description
id string optional Comma-separated list of comment IDs to retrieve. Use instead of parent_id.
max_results integer optional Maximum number of replies to return (1-100, default: 20). Cannot be used with id filter.
page_token string optional Token for pagination to retrieve the next page of replies. Cannot be used with id filter.
parent_id string optional ID of the comment thread (top-level comment) to list replies for. Use instead of id.
text_format string optional Format of the comment text in the response
youtube_playlist_delete Permanently delete a YouTube playlist. This action cannot be undone. Requires youtube scope. 1 param

Permanently delete a YouTube playlist. This action cannot be undone. Requires youtube scope.

Name Type Required Description
playlist_id string required ID of the playlist to delete
youtube_playlist_insert Create a new YouTube playlist for the authenticated user. Requires youtube scope. 5 params

Create a new YouTube playlist for the authenticated user. Requires youtube scope.

Name Type Required Description
title string required Playlist title
default_language string optional Default language of the playlist
description string optional Playlist description
privacy_status string optional Privacy setting
tags array optional Tags for the playlist
youtube_playlist_items_delete Remove a video from a YouTube playlist by its playlist item ID. Requires youtube scope. 1 param

Remove a video from a YouTube playlist by its playlist item ID. Requires youtube scope.

Name Type Required Description
playlist_item_id string required ID of the playlist item to remove (not the video ID)
youtube_playlist_items_insert Add a video to a YouTube playlist at an optional position. Requires youtube scope. 4 params

Add a video to a YouTube playlist at an optional position. Requires youtube scope.

Name Type Required Description
playlist_id string required Playlist to add the video to
video_id string required YouTube video ID to add
note string optional Optional note for this playlist item
position integer optional Zero-based position in the playlist. Omit to add at end.
youtube_playlist_items_list Retrieve a list of videos in a YouTube playlist. Returns playlist items with video details, positions, and metadata. Requires a valid YouTube OAuth2 connection. 5 params

Retrieve a list of videos in a YouTube playlist. Returns playlist items with video details, positions, and metadata. Requires a valid YouTube OAuth2 connection.

Name Type Required Description
part string required Comma-separated list of playlist item resource parts to include
playlist_id string required YouTube playlist ID to retrieve items from
max_results integer optional Maximum number of playlist items to return (0-50, default: 5)
page_token string optional Token for pagination to retrieve the next page
video_id string optional Filter results to items containing a specific video
youtube_playlist_update Update an existing YouTube playlist's title, description, privacy status, or default language. Requires youtube scope. 5 params

Update an existing YouTube playlist's title, description, privacy status, or default language. Requires youtube scope.

Name Type Required Description
playlist_id string required ID of the playlist to update
default_language string optional Language of the playlist
description string optional New playlist description
privacy_status string optional New privacy setting
title string optional New playlist title
youtube_playlists_list Retrieve a list of YouTube playlists for a channel or the authenticated user. You must provide exactly one filter: channel_id, id, or mine. Requires a valid YouTube OAuth2 connection. 6 params

Retrieve a list of YouTube playlists for a channel or the authenticated user. You must provide exactly one filter: channel_id, id, or mine. Requires a valid YouTube OAuth2 connection.

Name Type Required Description
part string required Comma-separated list of playlist resource parts to include
channel_id string optional Return playlists for a specific channel. Use instead of id or mine.
id string optional Comma-separated list of playlist IDs to retrieve. Use instead of channel_id or mine.
max_results integer optional Maximum number of playlists to return (0-50, default: 5)
mine boolean optional Return playlists owned by the authenticated user. Use instead of channel_id or id.
page_token string optional Token for pagination
youtube_reporting_create_job Create a YouTube reporting job to schedule daily generation of a specific report type. Once created, YouTube will generate the report daily. 3 params

Create a YouTube reporting job to schedule daily generation of a specific report type. Once created, YouTube will generate the report daily.

Name Type Required Description
name string required Human-readable name for the reporting job
report_type_id string required ID of the report type to generate (e.g., channel_basic_a2, channel_demographics_a1)
on_behalf_of_content_owner string optional Content owner ID on whose behalf the job is being created
youtube_reporting_jobs_delete Delete a scheduled YouTube Reporting API job. Stopping a job means new reports will no longer be generated. 2 params

Delete a scheduled YouTube Reporting API job. Stopping a job means new reports will no longer be generated.

Name Type Required Description
job_id string required ID of the reporting job to delete
on_behalf_of_content_owner string optional Content owner ID on whose behalf the request is being made
youtube_reporting_list_jobs List all YouTube Reporting API jobs scheduled for a channel or content owner. 4 params

List all YouTube Reporting API jobs scheduled for a channel or content owner.

Name Type Required Description
include_system_managed boolean optional If true, include system-managed reporting jobs in the response
on_behalf_of_content_owner string optional Content owner ID on whose behalf the request is being made
page_size integer optional Maximum number of jobs to return per page
page_token string optional Token for retrieving the next page of results
youtube_reporting_list_report_types List all YouTube Reporting API report types available for a channel or content owner (e.g., channel_basic_a2, channel_demographics_a1). 4 params

List all YouTube Reporting API report types available for a channel or content owner (e.g., channel_basic_a2, channel_demographics_a1).

Name Type Required Description
include_system_managed boolean optional If true, include system-managed report types in the response
on_behalf_of_content_owner string optional Content owner ID on whose behalf the request is being made
page_size integer optional Maximum number of report types to return per page
page_token string optional Token for retrieving the next page of results
youtube_reporting_list_reports List reports that have been generated for a YouTube reporting job. Each report is a downloadable CSV file. 7 params

List reports that have been generated for a YouTube reporting job. Each report is a downloadable CSV file.

Name Type Required Description
job_id string required ID of the reporting job whose reports to list
created_after string optional Only return reports created after this timestamp (RFC3339 format, e.g., 2024-01-01T00:00:00Z)
on_behalf_of_content_owner string optional Content owner ID on whose behalf the request is being made
page_size integer optional Maximum number of reports to return per page
page_token string optional Token for retrieving the next page of results
start_time_at_or_after string optional Only return reports whose data start time is at or after this timestamp (RFC3339 format)
start_time_before string optional Only return reports whose data start time is before this timestamp (RFC3339 format)
youtube_subscriptions_delete Unsubscribe the authenticated user from a YouTube channel using the subscription ID. Requires youtube scope. 1 param

Unsubscribe the authenticated user from a YouTube channel using the subscription ID. Requires youtube scope.

Name Type Required Description
subscription_id string required ID of the subscription to delete
youtube_subscriptions_insert Subscribe the authenticated user to a YouTube channel. Requires youtube scope. 1 param

Subscribe the authenticated user to a YouTube channel. Requires youtube scope.

Name Type Required Description
channel_id string required ID of the YouTube channel to subscribe to
youtube_subscriptions_list Retrieve a list of YouTube channel subscriptions for the authenticated user or a specific channel. You must provide exactly one filter: channel_id, id, mine, my_recent_subscribers, or my_subscribers. Requires a valid YouTube OAuth2 connection with youtube.readonly scope. 10 params

Retrieve a list of YouTube channel subscriptions for the authenticated user or a specific channel. You must provide exactly one filter: channel_id, id, mine, my_recent_subscribers, or my_subscribers. Requires a valid YouTube OAuth2 connection with youtube.readonly scope.

Name Type Required Description
part string required Comma-separated list of subscription resource parts to include
channel_id string optional Return subscriptions for a specific channel. Use instead of id, mine, my_recent_subscribers, or my_subscribers.
for_channel_id string optional Filter subscriptions to specific channels (comma-separated channel IDs)
id string optional Comma-separated list of subscription IDs to retrieve. Use instead of channel_id, mine, my_recent_subscribers, or my_subscribers.
max_results integer optional Maximum number of subscriptions to return (0-50, default: 5)
mine boolean optional Return subscriptions for the authenticated user. Use instead of channel_id, id, my_recent_subscribers, or my_subscribers.
my_recent_subscribers boolean optional Return the authenticated user's recent subscribers. Use instead of channel_id, id, mine, or my_subscribers.
my_subscribers boolean optional Return the authenticated user's subscribers. Use instead of channel_id, id, mine, or my_recent_subscribers.
order string optional Sort order for subscriptions
page_token string optional Token for pagination
youtube_video_categories_list Retrieve a list of YouTube video categories available in a given region or by ID. You must provide exactly one filter: id or region_code. The part parameter is fixed to 'snippet'. Useful for setting the category when updating a video. Requires youtube.readonly scope. 3 params

Retrieve a list of YouTube video categories available in a given region or by ID. You must provide exactly one filter: id or region_code. The part parameter is fixed to 'snippet'. Useful for setting the category when updating a video. Requires youtube.readonly scope.

Name Type Required Description
hl string optional Language for the category names in the response (BCP-47)
id string optional Comma-separated list of category IDs to retrieve. Use instead of region_code.
region_code string optional ISO 3166-1 alpha-2 country code to retrieve categories available in that region. Use instead of id.
youtube_videos_delete Permanently delete a YouTube video. This action cannot be undone. Requires youtube scope. 1 param

Permanently delete a YouTube video. This action cannot be undone. Requires youtube scope.

Name Type Required Description
video_id string required ID of the video to delete
youtube_videos_get_rating Retrieve the authenticated user's rating (like, dislike, or none) for one or more YouTube videos. The part parameter is fixed to 'id'. Requires youtube.readonly scope. 1 param

Retrieve the authenticated user's rating (like, dislike, or none) for one or more YouTube videos. The part parameter is fixed to 'id'. Requires youtube.readonly scope.

Name Type Required Description
id string required Comma-separated list of YouTube video IDs to get ratings for
youtube_videos_list Retrieve detailed information about one or more YouTube videos including statistics, snippet, content details, and status. You must provide exactly one filter: id, chart, or my_rating. Requires a valid YouTube OAuth2 connection. 8 params

Retrieve detailed information about one or more YouTube videos including statistics, snippet, content details, and status. You must provide exactly one filter: id, chart, or my_rating. Requires a valid YouTube OAuth2 connection.

Name Type Required Description
part string required Comma-separated list of video resource parts to include in the response
chart string optional Retrieve a chart of the most popular videos. Use instead of id or my_rating.
id string optional Comma-separated list of YouTube video IDs. Use instead of chart or my_rating.
max_results integer optional Maximum number of results to return when using chart filter (1-50, default: 5)
my_rating string optional Filter videos by the authenticated user's rating. Use instead of id or chart.
page_token string optional Token for pagination
region_code string optional ISO 3166-1 alpha-2 country code to filter trending videos by region
video_category_id string optional Filter most popular videos by category ID
youtube_videos_rate Like, dislike, or remove a rating from a YouTube video on behalf of the authenticated user. Requires youtube scope with youtube.force-ssl. 2 params

Like, dislike, or remove a rating from a YouTube video on behalf of the authenticated user. Requires youtube scope with youtube.force-ssl.

Name Type Required Description
rating string required Rating to apply to the video
video_id string required YouTube video ID to rate
youtube_videos_update Update metadata for an existing YouTube video. When updating snippet, both title and category_id are required together. Requires youtube scope. 10 params

Update metadata for an existing YouTube video. When updating snippet, both title and category_id are required together. Requires youtube scope.

Name Type Required Description
video_id string required ID of the video to update
category_id string optional YouTube video category ID. Required together with title when updating snippet.
default_language string optional Language of the video
description string optional New video description
embeddable boolean optional Whether the video can be embedded
license string optional Video license
privacy_status string optional New privacy setting
public_stats_viewable boolean optional Whether stats are publicly visible
tags array optional Video tags
title string optional New video title. Required together with category_id when updating snippet.