Skip to content

Trigger Analysis

POST
/api/agents/youtube/analyze/{job_id}

Trigger LLM analysis on a completed transcript.

The endpoint sets status to “analyzing”, runs analyze_transcript, and only marks the job “complete” if analysis actually succeeded. On failure the job is persisted with status=“error” and the real cause surfaces as a 502 so the UI can show why and offer a retry.

Args: job_id: The job identifier.

Returns: The updated job record with status=“complete” and progress=100.

Raises: HTTPException(404): No job exists with the given id, or no transcript is available to analyze. HTTPException(409): The job is not in complete status (can’t analyze mid-transcription). HTTPException(502): The handler dispatch failed or the response couldn’t be parsed — error_message on the persisted job carries the underlying reason.

job_id
required
Job Id
string

Successful Response

YouTubeJobResponse

Transcription job status.

object
jobId
required
Jobid

Unique job identifier

string
videoId
required
Videoid

YouTube video ID

string
url
required
Url

Original YouTube URL

string
title
required
Title

Video title

string
channel
required
Channel

Channel name

string
durationSeconds
required
Durationseconds

Video duration in seconds

integer
status
required
Status

Current job status

string
Allowed values: queued downloading transcribing analyzing complete error
progressPercent
required
Progresspercent

Progress percentage

integer
<= 100
errorMessage
Any of:
string
captionSource
Any of:
string
Allowed values: manual auto whisper
createdAt
required
Createdat

ISO timestamp of job creation

string

Validation Error

HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object