Skip to main content
POST
/
knowledge
/
add-youtube
curl -X POST https://api.thinnest.ai/knowledge/add-youtube \
  -H "Authorization: Bearer $THINNESTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "agent_id": "ag_c47e7c97_b2f2",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}'
{
  "id": 4,
  "name": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
  "type": "youtube",
  "status": "processing",
  "created_at": "2026-03-07T14:00:00Z"
}
curl -X POST https://api.thinnest.ai/knowledge/add-youtube \
  -H "Authorization: Bearer $THINNESTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "agent_id": "ag_c47e7c97_b2f2",
  "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
}'

Request Body

agent_id
string
required
The agent’s public ID (ag_*)
url
string
required
YouTube 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

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request to add a YouTube video to knowledge base.

user_id
string
required
url
string
required

Response

Successful Response