arazzo: 1.0.1
info:
title: YouTube Upload and Update a Caption Track
summary: Upload a draft caption track for a video, then publish it by updating its draft status.
description: >-
A two-stage captioning flow. It uploads a caption track for a video as a
draft, captures the new caption id, and then updates the caption resource to
clear the draft flag so the track becomes visible. Note the YouTube captions
endpoints also support resumable media upload of the caption file; this
workflow handles the JSON caption resource the OpenAPI description models.
Every step spells out its request inline so the flow can be read and executed
without opening the underlying OpenAPI description.
version: 1.0.0
x-realizes-capability-ids:
- BC-3700.60
x-capability-derivation:
method: 'deterministic join: sourceDescriptions -> per-tag OpenAPI -> tag/capability edge. No classification at this step.'
min_confidence: 0.7
sources:
- capability_id: BC-3700.60
capability_name: Localisation & Versioning Management
spec: youtube-captions-api-openapi.yml
confidence: 0.8
model: Turbo EA Capabilities by Vincent Verdet — Turbo EA, https://github.com/vincentmakes/turbo-ea-capabilities, CC BY 4.0
sourceDescriptions:
- name: captionsApi
url: ../openapi/youtube-captions-api-openapi.yml
type: openapi
workflows:
- workflowId: upload-update-caption
summary: Insert a draft caption track and then publish it.
description: >-
Inserts a caption resource as a draft for a video, then updates that caption
resource to set isDraft to false.
inputs:
type: object
required:
- apiKey
- videoId
- language
- name
properties:
apiKey:
type: string
description: The Google API key used to authorize each YouTube Data API request.
videoId:
type: string
description: The id of the video the caption track belongs to.
language:
type: string
description: The BCP-47 language code of the caption track.
name:
type: string
description: The display name of the caption track.
steps:
- stepId: insertCaption
description: Upload the caption track as a draft and capture its id.
operationId: youtube.captions.insert
parameters:
- name: part
in: query
value: snippet
- name: key
in: query
value: $inputs.apiKey
requestBody:
contentType: application/json
payload:
snippet:
videoId: $inputs.videoId
language: $inputs.language
name: $inputs.name
isDraft: true
successCriteria:
- condition: $statusCode == 200
outputs:
captionId: $response.body#/id
- stepId: publishCaption
description: Update the caption track to clear the draft flag so it becomes visible.
operationId: youtube.captions.update
parameters:
- name: part
in: query
value: snippet
- name: key
in: query
value: $inputs.apiKey
requestBody:
contentType: application/json
payload:
id: $steps.insertCaption.outputs.captionId
snippet:
videoId: $inputs.videoId
language: $inputs.language
name: $inputs.name
isDraft: false
successCriteria:
- condition: $statusCode == 200
outputs:
captionId: $response.body#/id
isDraft: $response.body#/snippet/isDraft
outputs:
captionId: $steps.publishCaption.outputs.captionId
isDraft: $steps.publishCaption.outputs.isDraft
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.