---
title: "Connect channel"
method: POST
path: "/api/v1/tools/connect_channel"
---

# Connect channel

`POST /api/v1/tools/connect_channel`

## Request

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

A link the person opens to connect a YouTube channel or a TikTok account to their Treza account, so a pipeline can post there. Returns what is already connected on that platform and connectUrl. Only the person can finish it, in their own browser: give them the link, tell them the platform will ask their permission to post and that the page says when it is connected, and after they say so check list_connected_channels. The link asks them to sign in to Treza first with the Google account this connection uses, and it does not expire. When something is already connected, the link adds another, so only offer it when that is what they want.

## Request body

- object
  - `platform` 'youtube' | 'tiktok', required: Which account to connect.

## 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)
