# Draft, publish or schedule a video

Prepare text and settings for each destination and review the preview.

![Draft, publish or schedule a video](../media/publish.webp)

## In the studio

1. Open **Nova publicação**, select a video, enter the caption and hashtags, and select accounts. For YouTube check the title, visibility and audience designation. Check Reel requirements for Instagram. For TikTok, review the profile, allowed visibility and interaction settings.
2. **Agendar no melhor horário** suggests a time for each destination in the selected time zone. You can set each account’s preferred daily times, pick a specific date, publish immediately or save a draft. Review the destination, caption and time before confirming. The owner chooses privacy and confirms each TikTok video.

## Choosing a time

OpenSocial checks the account calendar for occupied slots. With authorized Instagram or TikTok data, it compares local hours with at least three videos from that account over the past 90 days, using view counts collected roughly 24 hours after confirmation. YouTube suggestions use the account calendar and preferred times. With insufficient data and no preferred times, the estimate is the next available 6 p.m. in the selected time zone.

If the computer was offline and a post is more than five minutes late before submission starts, open the publication to reschedule or send now. A submission already in progress continues through its existing delivery record.

## Publishing from the terminal

Choose a library video and an account from `opensocial accounts list`. Save this as `post.json` and replace the IDs.

```json
{
  "mediaId": "MEDIA_ID",
  "target": { "accountId": "ACCOUNT_ID" },
  "caption": "A morning on the trail",
  "hashtags": ["hiking"],
  "timezone": "America/Sao_Paulo",
  "mode": "best"
}
```

Run `opensocial publications post post.json --dry-run`. Review the preview and copy its `requestKey` and `at` into `opensocial publications post post.json --confirm --key KEY --at ISO_TIME`. Reuse the same key and time when retrying. For immediate delivery, use `"mode": "now"` and confirm with the key. For a specific time, use `"mode": "schedule"` and include an `at` timestamp with a time zone offset in the file. TikTok returns an owner review link.

Use `opensocial schedule windows --account ACCOUNT_ID --windows 12:00,18:00` to save preferred times and `opensocial schedule suggest --account ACCOUNT_ID --timezone America/Sao_Paulo` to inspect the next suggestion. After publication, run `opensocial analytics list --account ACCOUNT_ID` to retrieve available measurements.

## Check the result

Check each destination in **Publicações**. A failure may affect only one account. Open the corresponding row and retain its ID before retrying.

Open a confirmed post from **Publicações** or **Calendário** to see views, likes and comment totals from the platform. A dash indicates that a count is unavailable. TikTok requires a public video and read access to the account.
