> ## Documentation Index
> Fetch the complete documentation index at: https://docs.postsyncer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Post to YouTube

> What a YouTube channel takes through the API: one video with a title, description, privacy and tags, media limits, first comments, deletes, comments and analytics.

A YouTube account is a channel, with `platform` `youtube`. Each post uploads one video. A YouTube post needs a video: photos aren't taken.

## What you can post

* One video, with a title and a description.
* The video goes out `public`, `unlisted` or `private`.
* `video_type` `short` is saved with the post, but the video is uploaded the same way as any other. YouTube itself decides whether it shows as a Short.

## Settings

Every key is optional. [Create a post](https://docs.postsyncer.com/api-reference/posts/create.md#platform-specific-settings) has the full list.

| Key | What it does |
| - | - |
| `title` | The video's title. Without it, the title is the start of the description. |
| `description` | YouTube's own description, instead of the post's text. |
| `privacyStatus` | `public` (the default), `unlisted` or `private`. |
| `tags` | A list of tags. |
| `category_id` | A YouTube category id. |
| `embeddable` | Allow embedding on other sites (default `true`). |
| `selfDeclaredMadeForKids` | Mark the video as made for kids (default `false`). |
| `notifySubscribers` | Tell subscribers about the upload (default `true`). |
| `video_type` | `video` or `short`, as above. |
| `media` | This account's own media library ids, instead of the post's media. |

## Text

* The description takes 5,000 characters and the title 100. PostSyncer cuts longer text to those limits when it's sent.
* YouTube refuses `<` and `>` in a title or description, so PostSyncer takes them out.

## Media

| | Limit |
| - | - |
| Video | 1, up to 10 GB |
| Photos | None |
| Video types | MP4, MOV, WebM |

* YouTube itself also takes AVI, WMV and FLV, but the API doesn't take those files: convert them to MP4 first.
* PostSyncer doesn't check a video's length for YouTube. YouTube's own limits apply to the channel.
* Set the video's thumbnail with `cover_image.thumbnail` on the first item: a picture, as a library id or a link. YouTube takes a picture, never a frame. See [Video covers](https://docs.postsyncer.com/guides/media.md#video-covers).

## More than one item and first comments

* YouTube has no threads. The items are joined into one description, with blank lines between them.
* A first comment (`is_first_comment: true`) is a comment under the video, `first_comment_delay` minutes after it goes out (1 when you leave it out). It's text only: a first comment with media answers `422`.

## Delete a post

Deleting the post in PostSyncer asks YouTube to delete the video. [Test safely](https://docs.postsyncer.com/test-safely.md#what-cant-be-undone) says what happens when YouTube refuses.

## Comments

* PostSyncer reads comments an hour after the video goes out, every 6 hours for its first day, then once a day until it's 7 days old, and whenever you ask with [Sync comments](https://docs.postsyncer.com/api-reference/comments/sync.md).
* A channel needs comment access, which it grants when it connects. A channel connected without it isn't read on the schedule, and hiding a comment answers `422` with `YouTube did not hide the comment. Reconnect YouTube and allow comment access.` Reconnect the channel to fix it.
* Replies go out from the channel, as text. Media on a reply isn't sent to YouTube.
* Hide holds the comment for review on YouTube, and `"hidden": false` publishes it again.
* Delete removes the channel's own comment, a reply sent from PostSyncer included. Someone else's comment is rejected instead, which takes it off YouTube for good. Either way it's `is_deleted_on_platform: true` and can't be shown again.
* A delete answers `200`, also when YouTube refuses or the channel needs reconnecting. [Get comment](https://docs.postsyncer.com/api-reference/comments/get.md) shows whether it was removed.

## Analytics

YouTube gives `impressions`, `likes`, `comments` and `shares`. See [Read analytics](https://docs.postsyncer.com/guides/analytics.md).

## Example

A draft video, unlisted, with a title and tags:

```json theme={null}
{
  "workspace_id": 4815,
  "schedule_type": "draft",
  "content": [
    {
      "text": "Two minutes of pouring latte art at Halden Coffee.",
      "media": ["https://cdn.postsyncer.com/examples/rosetta-pour.mp4"],
      "cover_image": { "thumbnail": "https://cdn.postsyncer.com/examples/rosetta-cover.jpg" }
    }
  ],
  "accounts": [
    {
      "id": 16241,
      "settings": {
        "title": "How we pour a rosetta",
        "privacyStatus": "unlisted",
        "tags": ["latte art", "coffee"]
      }
    }
  ]
}
```

## Related

> [card] [Answer comments](https://docs.postsyncer.com/guides/comments.md)
>
> Read, reply, hide and delete.

> [card] [Compare the 12 networks](https://docs.postsyncer.com/platforms/overview.md)
>
> How YouTube differs from the other networks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.