Add YouTube

Add a YouTube video transcript to an agent's knowledge base.

POST/knowledge/add-youtube

Extract a YouTube video's transcript and index it for retrieval.

No parameters for this endpoint.


Request Body

FieldTypeRequiredDescription
agent_idstringYesThe agent's public ID (ag_*)
urlstringYesYouTube video URL

Supported URL formats:

  • https://www.youtube.com/watch?v=VIDEO_ID
  • https://youtu.be/VIDEO_ID

Response 201

{
  "id": 4,
  "name": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "type": "youtube",
  "status": "processing",
  "created_at": "2026-03-07T14:00:00Z"
}

The transcript is extracted and indexed asynchronously. Check status via List Sources.

Note: The video must have captions/subtitles available (auto-generated or manual).


Errors

CodeDescription
401Missing or invalid authentication
404Agent not found
422Invalid YouTube URL or no transcript available

On this page