Publish a post
publishPost to social channels. Channels open today: threads, youtube. Get accountIds from select_channels — do not guess which channel the person meant. Text limits differ per channel: Threads 500 characters, YouTube 5000 UTF-8 bytes. Over the limit nothing goes out to any channel, so shorten it before calling. Images and video both work on the channels that take them, and a carousel can mix them. YouTube is different: it takes exactly one video, no images, and it needs options.youtube.title. Its description is measured in UTF-8 bytes, so Korean and Japanese cost three per character. There are three ways to get a media id, pick by where the file is: media_from_url when it already has a public https address, media_upload_link when it is on the person's own device, media_presign plus media_complete when you can PUT the bytes yourself. Then pass the media ids here. This publishes immediately on every channel except YouTube, which can be scheduled with options.youtube.publishAt while privacyStatus is private. If the user asks to schedule anywhere else, tell them uplika cannot do that yet. A YouTube video published before Google finishes reviewing this app is locked to private viewing, so say that when you report a YouTube post as done. Returns while the post is still publishing. The permalink is null at that moment. Call get_post with the returned id to see the final status and link. Pass wait: true to hold the response until it is really out — then you can tell the person it is posted instead of guessing. For a long post use threadItems instead of publish-then-reply: we keep the order and wait for each piece to land before sending the next one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | Hold the response until the post is really out. Text waits up to 10 seconds, posts with media up to 90 seconds. If it is still going after that you get the usual publishing response and should poll get_post. Defaults to false. | |
| content | No | Post text | |
| options | No | Per-channel settings. Only the channels you are posting to need an entry. | |
| mediaIds | No | Media ids from media_presign, each already confirmed with media_complete | |
| topicTag | No | One topic to tag the post with, like a category. Only some channels take one, and those reject periods and ampersands in it. If any channel in accountIds does not take topics the whole call is refused, so publish to it separately. On a thread it goes on the first piece only. Leave it out unless the person asked for a topic. | |
| accountIds | Yes | Account ids from select_channels | |
| threadItems | No | Split a long post into a chain instead of calling publish and then reply. The first item is the root and the rest become replies under it, in order. We handle the ordering and the waiting. Each item obeys the character limit on its own. Pass either content or threadItems, not both. If a later item fails, the ones already up stay up and the response tells you where to resume. | |
| workspaceId | No | Which workspace this is for. Only needed when the account has more than one — the error tells you the ids when it matters. Leave it out if it is already decided; do not ask the person again. |