Add YouTube
Add a YouTube video transcript to an agent's knowledge base.
POST
/knowledge/add-youtubeExtract a YouTube video's transcript and index it for retrieval.
No parameters for this endpoint.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
agent_id | string | Yes | The agent's public ID (ag_*) |
url | string | Yes | YouTube video URL |
Supported URL formats:
https://www.youtube.com/watch?v=VIDEO_IDhttps://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
| Code | Description |
|---|---|
401 | Missing or invalid authentication |
404 | Agent not found |
422 | Invalid YouTube URL or no transcript available |