Creates and publishes a text-only post or an image post. An image post contains 1 to 10 images, which you upload with the posts.imageUpload method before you call this method, and optional text.
Posts that you create with this method are public and are published immediately. Scheduled posts aren't supported.
Quota impact: A call to this method has a quota cost of 1 unit. The cost counts against the Post Uploads quota, which is separate from the default YouTube Data API quota.
Request
HTTP request
POST https://www.googleapis.com/youtube/v3/posts
Authorization
This request requires authorization with at least one of the following scopes (read more about authentication and authorization).
| Scope |
|---|
https://www.googleapis.com/auth/youtubepartner |
https://www.googleapis.com/auth/youtube |
https://www.googleapis.com/auth/youtube.force-ssl |
The authorized user must own the channel or have permission to create posts for it.
Parameters
The following table lists the parameters that this query supports. All of the parameters listed are query parameters.
| Parameters | |
|---|---|
| Required parameters | |
part |
stringThe part parameter serves two purposes in this operation. It identifies the properties that the write operation sets as well as the properties that the API response includes.Set the parameter value to snippet for a text-only post, or snippet,attachments for an image post. You can also include id and status to add those properties to the response. |
Request body
Provide a post resource in the request body. For that resource:
-
You must specify a value for
snippet.channelIdand at least one of the following properties:snippet.textDisplay(required for text-only posts; optional for image posts)attachments.imageAttachments[].uploadToken, for 1 to 10 images
Each upload token must come from a posts.imageUpload request for the same channel. Upload the image again for each post instead of reusing a token in more than one post.
Response
If successful, this method returns a post resource in the response body.
Errors
The following table identifies error messages that the API could return in response to a call to this method. For more detail, see the error message documentation.
| Error type | Error detail | Description |
|---|---|---|
invalidValue (400) |
invalidMetadata |
The request contains invalid metadata values. |
invalidValue (400) |
invalidImageUploadToken |
The uploaded image token is invalid. |
forbidden (403) |
forbidden |
The request is not properly authorized. |
rateLimitExceeded (403) |
rateLimitExceeded |
The request cannot be completed because you have exceeded your rate limit. |
notFound (404) |
channelNotFound |
The specified channel was not found. |