PlatformsYouTube

YouTube

YouTube channels through your Google Cloud project, with the single youtube.force-ssl scope.

The permissions each operation needs are in App Review: YouTube.

  • YouTube has no Shorts flag: it makes any square or vertical upload of up to three minutes a Short, so publishing takes no Shorts option, and reads report durationSeconds and aspectRatio for telling the two apart.
  • YouTube publishes no comment webhooks, so uploads and comments are collected by polling against your project's daily quota; a spent quota answers platform_rate_limit with Retry-After set to Google's midnight-Pacific reset.
  • Uploads from a project that has not passed Google's compliance audit are made private by YouTube, whatever privacyStatus you asked for.
  • Livestreams and live chat are not a surface yet.
CollectionOperationsEventsBackfill
youtube.videos.postslist, get, publish, update, perform_action, deletecreatedyes
youtube.videos.commentslist, get, publish, update, perform_action, deletecreatedyes

youtube.videos.posts

The channel's uploads, videos and Shorts alike.

list

List the channel's videos and Shorts, newest first.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
cursorstringnoOpaque cursor for fetching the next result page.
limitintegernoMaximum number of items to return.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "cursor": {
      "type": "string",
      "description": "Opaque cursor for fetching the next result page.",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of items to return.",
      "minimum": 1,
      "maximum": 100
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

get

Get one YouTube video by platform id.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

publish

Upload a YouTube video or Short through the resumable upload protocol.

Submit through POST /v1/publish-requests with collection: "youtube.videos.posts". These fields go in the item's args; profileId and variant are item fields.

FieldTypeRequiredDescription
titlestringyesUp to 100 characters; YouTube refuses < and >.
textstringnoDescription, up to 5,000 bytes; YouTube refuses < and >.
tagsstring[]noKeyword tags; at most 500 characters in total.
categoryIdstringnoA YouTube video category id, e.g. 22 for People & Blogs.
privacyStatus"public" | "private" | "unlisted"yesWho can see the video.
scheduledPublishAtstring (date-time)noWhen YouTube makes the uploaded video public; requires privacyStatus private. The upload itself runs now, or at the item's scheduledAt, which delays the whole publish instead.
madeForKidsbooleannoThe self-declared audience setting YouTube requires an answer for.
aiGeneratedbooleannoLabel the post as AI-generated, with the platform's own AI label.
paidPartnershipbooleannoLabel the post as a paid partnership with a brand.
notifySubscribersbooleannoWhether YouTube notifies subscribers; defaults to true.
mediaobject | object[]yes
JSON Schema
{
  "type": "object",
  "required": [
    "title",
    "privacyStatus",
    "media"
  ],
  "properties": {
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "pattern": "^[^<>]*$",
      "description": "Up to 100 characters; YouTube refuses < and >."
    },
    "text": {
      "type": "string",
      "maxLength": 5000,
      "pattern": "^[^<>]*$",
      "description": "Description, up to 5,000 bytes; YouTube refuses < and >."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "description": "Keyword tags; at most 500 characters in total."
    },
    "categoryId": {
      "type": "string",
      "minLength": 1,
      "description": "A YouTube video category id, e.g. 22 for People & Blogs."
    },
    "privacyStatus": {
      "enum": [
        "public",
        "private",
        "unlisted"
      ],
      "description": "Who can see the video."
    },
    "scheduledPublishAt": {
      "type": "string",
      "format": "date-time",
      "description": "When YouTube makes the uploaded video public; requires privacyStatus private. The upload itself runs now, or at the item's `scheduledAt`, which delays the whole publish instead."
    },
    "madeForKids": {
      "type": "boolean",
      "description": "The self-declared audience setting YouTube requires an answer for."
    },
    "aiGenerated": {
      "type": "boolean",
      "description": "Label the post as AI-generated, with the platform's own AI label."
    },
    "paidPartnership": {
      "type": "boolean",
      "description": "Label the post as a paid partnership with a brand."
    },
    "notifySubscribers": {
      "type": "boolean",
      "description": "Whether YouTube notifies subscribers; defaults to true."
    },
    "media": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "object",
            "required": [
              "mediaId"
            ],
            "properties": {
              "mediaId": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1,
                "pattern": "^video/"
              },
              "altText": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": [
              "sourceUrl"
            ],
            "properties": {
              "sourceUrl": {
                "type": "string",
                "minLength": 1
              },
              "contentType": {
                "type": "string",
                "minLength": 1,
                "pattern": "^video/"
              },
              "altText": {
                "type": "string",
                "minLength": 1
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "minItems": 1,
      "maxItems": 1
    }
  },
  "additionalProperties": false
}

Media requirements

An asset that meets everything under Copied as is is published exactly as uploaded. Otherwise Koil converts only what misses, a billed media add-on that needs a paid plan. Anything under Refused fails the publish request, since no conversion fixes it.

MediaCopied as isOtherwise convertedRefused
VideoMP4/MOV or MKV/WebM, H.264, HEVC, VP8, VP9, AV1, ProRes, DNxHD/DNxHR, CineForm, MPEG-4 Part 2 or MPEG-2re-encoded to H.264 in MP4longer than 12 h; over 256 GB once staged

update

Edit a video's title, description, tags, category, or privacy.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
titlestringno
textstringno
tagsstring[]no
categoryIdstringno
privacyStatus"public" | "private" | "unlisted"noWho can see the video.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100,
      "pattern": "^[^<>]*$"
    },
    "text": {
      "type": "string",
      "maxLength": 5000,
      "pattern": "^[^<>]*$"
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "categoryId": {
      "type": "string",
      "minLength": 1
    },
    "privacyStatus": {
      "enum": [
        "public",
        "private",
        "unlisted"
      ],
      "description": "Who can see the video."
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

perform_action

Like a video as the channel, or remove the channel's like. Answers with the action applied.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
action"like" | "unlike"yesWhat to do with the item: like (like it as the profile), unlike (remove the profile's like).
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "action"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "action": {
      "enum": [
        "like",
        "unlike"
      ],
      "description": "What to do with the item: `like` (like it as the profile), `unlike` (remove the profile's like).",
      "x-koil-narrows": "ContentAction"
    }
  },
  "additionalProperties": false
}

delete

Delete one of the channel's videos.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    }
  },
  "additionalProperties": false
}

Not offered

  • resolve_attachment: not applicable

Events

Backfill: supported (bounded coverage); see Backfill history.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
referencesobject[]no
textstringnoCaption/body text for content.
mediaobject[]no
engagementobjectnoPlatform-reported engagement counts.
permalinkstring (uri)noThe thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired.
publishedAtstring (date-time)noWhen the platform published it.
externalIdstringyesPlatform-owned content identifier.
titlestringyes
tagsstring[]no
privacyStatus"public" | "private" | "unlisted" | "other"noWho can see the video. other is a setting YouTube added that Koil does not model yet.
aspectRationumberno
uploadStatus"uploaded" | "processed" | "failed" | "rejected" | "deleted" | "other"nouploaded until YouTube has processed the file, then processed; failed, rejected, or deleted otherwise. other is a state YouTube added that Koil does not model yet.
liveBroadcast"none" | "live" | "upcoming" | "other"nolive or upcoming while the video is a broadcast; none for an ordinary upload.
madeForKidsbooleanno
durationSecondsnumberno
scheduledPublishAtstring (date-time)noWhen a private video is scheduled to go public.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"youtube.videos.posts"yesThe collection that delivered this item.

youtube.videos.comments

Comments on the channel's videos, and replies to them.

list

List comments across the channel's videos (newest thread first, replies inline), one video's comments, or the replies to one comment.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
containerIdstringnoOnly this video's comments; every video of the channel otherwise.
targetIdstringnoThe replies to this top-level comment instead of the threads.
moderationStatus"published" | "held_for_review" | "likely_spam"noWhich of YouTube's queues to read; defaults to published. Ignored with targetId.
searchTermsstringnoOnly threads containing these terms. Ignored with targetId.
cursorstringnoOpaque cursor for fetching the next result page.
limitintegernoMaximum number of items to return.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "containerId": {
      "type": "string",
      "minLength": 1,
      "description": "Only this video's comments; every video of the channel otherwise."
    },
    "targetId": {
      "type": "string",
      "minLength": 1,
      "description": "The replies to this top-level comment instead of the threads."
    },
    "moderationStatus": {
      "enum": [
        "published",
        "held_for_review",
        "likely_spam"
      ],
      "description": "Which of YouTube's queues to read; defaults to published. Ignored with targetId."
    },
    "searchTerms": {
      "type": "string",
      "minLength": 1,
      "description": "Only threads containing these terms. Ignored with targetId."
    },
    "cursor": {
      "type": "string",
      "description": "Opaque cursor for fetching the next result page.",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of items to return.",
      "minimum": 1,
      "maximum": 100
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

get

Get one YouTube comment by platform id.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

publish

Publish a YouTube comment: a top-level comment on a video, or a reply to a top-level comment.

Submit through POST /v1/publish-requests with collection: "youtube.videos.comments". These fields go in the item's args; profileId and variant are item fields.

FieldTypeRequiredDescription
targetobjectyesOne thing on the platform outside this item: content, an account, or anything else the platform gives an id or a URL.
textstringyesComment text as the author wrote it.
JSON Schema
{
  "type": "object",
  "required": [
    "target",
    "text"
  ],
  "properties": {
    "target": {
      "type": "object",
      "required": [
        "kind",
        "externalId"
      ],
      "properties": {
        "kind": {
          "enum": [
            "youtube.videos.comments",
            "youtube.videos.posts"
          ]
        },
        "externalId": {
          "type": "string",
          "description": "Platform-owned content identifier.",
          "minLength": 1
        }
      },
      "additionalProperties": false,
      "description": "One thing on the platform outside this item: content, an account, or anything else the platform gives an id or a URL."
    },
    "text": {
      "type": "string",
      "description": "Comment text as the author wrote it.",
      "minLength": 1,
      "maxLength": 10000
    }
  },
  "additionalProperties": false
}

update

Edit the text of a comment the channel made.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
textstringyesComment text as the author wrote it.
includePlatformRawbooleannoWhether to include transient platform-native payloads.
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "text"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "text": {
      "type": "string",
      "description": "Comment text as the author wrote it.",
      "minLength": 1,
      "maxLength": 10000
    },
    "includePlatformRaw": {
      "type": "boolean",
      "description": "Whether to include transient platform-native payloads."
    }
  },
  "additionalProperties": false
}

perform_action

Publish, hold for review, or reject a comment on one of the channel's videos, optionally banning its author. Answers with the status applied rather than the comment: YouTube's read by id never reports moderationStatus, and no read returns a rejected comment.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
action"approve" | "hold" | "reject" | "ban_author"yesWhat to do with the item: approve (publish it, clearing a hold or rejection), hold (hold it for review), reject (reject it, removing it from public view), ban_author (reject it and block its author from the profile).
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId",
    "action"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    },
    "action": {
      "enum": [
        "approve",
        "hold",
        "reject",
        "ban_author"
      ],
      "description": "What to do with the item: `approve` (publish it, clearing a hold or rejection), `hold` (hold it for review), `reject` (reject it, removing it from public view), `ban_author` (reject it and block its author from the profile).",
      "x-koil-narrows": "ContentAction"
    }
  },
  "additionalProperties": false
}

delete

Delete a comment on one of the channel's videos.

FieldTypeRequiredDescription
profileIdstringyesKoil Profile associated with the operation.
externalIdstringyes
JSON Schema
{
  "type": "object",
  "required": [
    "profileId",
    "externalId"
  ],
  "properties": {
    "profileId": {
      "type": "string",
      "description": "Koil Profile associated with the operation.",
      "minLength": 1
    },
    "externalId": {
      "type": "string",
      "minLength": 1
    }
  },
  "additionalProperties": false
}

Not offered

  • resolve_attachment: not applicable

Events

Backfill: supported (bounded coverage); see Backfill history.

Item schema

What list and get return and what events carry as data.

FieldTypeRequiredDescription
containerIdstringnoThe place the item was published into and lives in: the post or video a comment is on, or the conversation a message is in. Every item in the same place has the same containerId, replies to replies included. A post in the account has none.
targetobjectyesThe one thing on the platform this item directly responds to: a comment's post, or the comment it replies to; a message's quoted or replied-to message, story or comment; what a reaction reacts to. Absent when the platform reports nothing it responds to.
referencesobject[]no
textstringnoCaption/body text for content.
authorobjectnoPlatform actor reference for observed content.
ownerAuthoredbooleannoWhether the Profile's own account wrote it. Absent when Koil cannot tell, which does not mean someone else did.
attachmentsunknown | unknown | unknown[]no
hiddenbooleannoWhether the account hid the comment from the public. Absent when the platform did not say.
engagementobjectnoPlatform-reported engagement counts.
permalinkstring (uri)noThe thing's URL on the platform, for display and linking only, never as a key. It may point at something private or expired.
publishedAtstring (date-time)noWhen the platform published it.
updatedAtstring (date-time)noWhen the platform last updated it.
externalIdstringyesPlatform-owned content identifier.
moderationStatus"published" | "held_for_review" | "likely_spam" | "rejected" | "other"noYouTube's moderation state of a comment. other is a state YouTube added that Koil does not model yet.
platformRawunknownnoOptional platform-native payload included only for transient delivery/debug use.
kind"youtube.videos.comments"yesThe collection that delivered this item.

On this page