---
title: "Publish asset"
method: POST
path: "/api/v1/tools/publish_asset"
---

# Publish asset

`POST /api/v1/tools/publish_asset`

## Request

- Base URL: `https://www.trezalabs.com`
- URL: `https://www.trezalabs.com/api/v1/tools/publish_asset`
- Auth: HTTP bearer

Prepare a post of one finished video to a connected YouTube channel or TikTok account, for the person to review and confirm. It posts nothing itself: clients that show panels put the video, the account and the post's settings in front of the person, and it goes out only when they press Post there (TikTok requires them to choose who can view it and to confirm its disclosures themselves). Call it only when the person asked to publish. The video must come from list_assets or a finished run's outputs in get_run, copied exactly; write a real title (on TikTok it is the caption, hashtags allowed). channelId picks the channel or TikTok account from list_connected_channels when more than one is connected; with none connected, call connect_channel first. A client without panels cannot post from here: build a pipeline that ends in a youtube-upload or tiktok-upload node instead. Needs the pipelines:write scope.

## Request body

- object
  - `videoUrl` string, required: The video to post, from list_assets or a run output.
  - `platform` 'youtube' | 'tiktok', required: Where to post.
  - `channelId` string: A YouTube channelId or TikTok openId from list_connected_channels. Omit when only one is connected.
  - `title` string, required: The title (YouTube, up to 100 characters) or the caption (TikTok).
  - `description` string: YouTube description. Ignored on TikTok.
  - `tags` string[]: YouTube tags. Ignored on TikTok.
  - `visibility` 'public' | 'unlisted' | 'private': YouTube visibility to suggest; the person can change it before posting. On TikTok the person chooses.

## Response `200`

The tool's result.

- object

## Other responses

- `400`: The arguments were refused. `error` says why.
- `401`: No API key, or one that is not valid.
- `402`: The credit balance does not cover this run.
- `403`: The API key lacks a permission this tool needs.
- `404`: No such tool, or the pipeline, run or asset is not on this account.
- `429`: Too many runs started or in progress. Wait, then try again.

---

[API](https://skmtc.dev/trezalabs/apis/treza-pipelines-api.md) · [All operations](https://skmtc.dev/trezalabs/apis/treza-pipelines-api/llms.txt) · [OpenAPI document](https://skmtc.dev/trezalabs/apis/treza-pipelines-api/revisions/a76574c1731b?raw)
