Skip to content

LectureAttachment

Defined in: v1/schemas.ts:344

An attachment on a lecture. The shape varies depending on the kind field.

kind values and their behaviour:

Kindnameurltextfile_sizequiz
textnullnullHTML stringnullnull
code_displaynullnullHTML stringnullnull
code_embednullnullHTML stringnullnull
native_commentsnullnullnullnullnull
upsellnullnullnullnullnull
videofilenameCDN URLnullbytesnull
audiofilenameCDN URLnullbytesnull
imagefilenameCDN URLnullbytesnull
pdffilenameCDN URLnullbytesnull
quiznullnullnullnullquiz object

text — contains raw HTML for text, code_display, and code_embed kinds. Sanitise before rendering directly in a browser context.

position — documented as required but may be null in some responses.

url for video kind — points to the original upload URL, not a streamable URL. Use CoursesAPI.getVideo with the attachment id to retrieve a playable HLS stream URL.

file_size — documented as file size in bytes for video, audio, image, and PDF attachments, but observed returning 0 for video files in live API responses. Do not rely on this value for video attachments.

  • output<typeof LectureAttachmentSchema>

optional file_extension?: string | null

Defined in: v1/schemas.ts:305

z.infer.file_extension


optional file_size?: number | null

Defined in: v1/schemas.ts:304

z.infer.file_size


id: number

Defined in: v1/schemas.ts:287

z.infer.id


kind: "text" | "native_comments" | "video" | "audio" | "image" | "pdf" | "quiz" | "code_display" | "code_embed" | "upsell"

Defined in: v1/schemas.ts:289

z.infer.kind


name: string | null

Defined in: v1/schemas.ts:288

z.infer.name


position: number | null

Defined in: v1/schemas.ts:303

z.infer.position


optional quiz?: { id: number; questions: { answers: string[]; correct_answers: string[]; graded: boolean; question: string; question_type: "single" | "multiple"; }[]; } | null

Defined in: v1/schemas.ts:306

z.infer.quiz


optional text?: string | null

Defined in: v1/schemas.ts:302

z.infer.text


optional url?: string | null

Defined in: v1/schemas.ts:301

z.infer.url