Skip to main content
POST
/
agent
/
{agent_id}
/
triggers
/
add_youtube_channels
Add YouTube Channels
curl --request POST \
  --url https://api.example.com/agent/{agent_id}/triggers/add_youtube_channels
Additively merges channel IDs/URLs into the existing YouTube trigger set. You do not need to resend previously added channels. Behavior:
  • Creates a new trigger if none exists
  • Merges new channels into the existing trigger if one exists
  • Updates the webhook URL if trigger_callback_url is provided

Request

curl -X POST "https://api.mosaic.so/agent/[agent_id]/triggers/add_youtube_channels" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "youtube_channels": [
      "UCxxxxxxxxxxxxxx",
      "https://www.youtube.com/@mkbhd"
    ],
    "trigger_callback_url": "https://your-app.com/webhooks/youtube-trigger"
  }'

Parameters

FieldTypeRequiredDescription
youtube_channelsstring[]YesList of new YouTube channel IDs or URLs to add
trigger_callback_urlstring | nullNoOptional webhook URL. If provided, it replaces the existing webhook URL. Set to null to remove.

Response

{
  "message": "YouTube channels added successfully",
  "channel_ids": [
    "UCxxxxxxxxxxxxxx",
    "UCyyyyyyyyyyyyyy"
  ],
  "channels": [
    {
      "input": "UCxxxxxxxxxxxxxx",
      "channel_id": "UCxxxxxxxxxxxxxx"
    },
    {
      "input": "https://www.youtube.com/@mkbhd",
      "channel_id": "UCyyyyyyyyyyyyyy"
    }
  ],
  "youtube_channel_details": [
    {
      "channel_id": "UCxxxxxxxxxxxxxx",
      "channel_name": "Channel Name",
      "channel_handle": null,
      "thumbnail_url": null,
      "subscriber_count": null
    },
    {
      "channel_id": "UCyyyyyyyyyyyyyy",
      "channel_name": "Marques Brownlee",
      "channel_handle": "@mkbhd",
      "thumbnail_url": "https://yt3.googleusercontent.com/...",
      "subscriber_count": 19200000
    }
  ]
}
Duplicate Handling: If you add a channel that is already being monitored, it will be ignored (no duplicates are created).