# Syndicate Creators: API for your agent (Claude, GPT, scripts)

**Если что-то непонятно:** отправь эту страницу своему Claude или GPT и спроси его, он объяснит и поможет. (If anything is unclear, send this page to your Claude or GPT and ask it to explain.)

Give this page to your AI agent. It explains what the agent can do for you.

## How the system works
- You are a creator with your own TikTok account. You log in at the site with your email and then connect your TikTok account(s).
- The site lists products you can make videos about (offers). Each offer has a description, assets and a payout rule.
- You get a personal tagged link per offer. People who come through it are counted for you.
- Your agent can prepare your videos and put them in your queue. **Nothing is posted until you open the cabinet, watch the preview, choose the privacy settings yourself and press Publish.** An API key cannot publish or approve. This is a TikTok requirement and it protects your account.

## Authentication
Create a key in the cabinet (Settings, API keys). It is shown once. Send it on every request:
`Authorization: Bearer sk_...`
Keep it secret. Revoke it in the cabinet if it leaks. Up to 5 keys per account.

Base URL: `https://<your-site>/api/v1`

## Several TikTok accounts
One creator can connect several TikTok accounts they own (cabinet, "Connect another account"). When approving a queued video the creator chooses by hand which account to post to. Each TikTok account can belong to only one creator.

## Endpoints
- `GET /offers`: active offers with your link if you already have one (`link_url`).
- `POST /links` body `{"offer":"<slug>"}`: create or return your tagged link for the offer.
- `GET /stats`: per link: clicks, installs, payments.
- `POST /queue` body `{"title":"...","offer":"<slug, optional>","duration_sec":30}`: create a draft, returns `id`.
- `PUT /queue/<id>/video`: raw video bytes (mp4 or mov, up to 64 MB, `Content-Type: video/mp4`). Status becomes `queued`.
- `GET /queue`: your items with status. `GET /queue/<id>`: one item.
- `DELETE /queue/<id>`: remove an unpublished item.

Statuses: `draft` (no file), `queued` (waiting for your approval), `publishing`, `published`, `rejected`, `failed`.
Limits: at most 200 open items in the queue. TikTok allows roughly 15 posts per day per account.

## Rules for content
- Original videos you have the right to use. No watermarks or links added by us.
- If a video promotes a product or brand, you mark it as promotional or branded content when you approve it.
- Do not make false claims or promises about income or results.

## Typical agent flow
1. `GET /offers`, pick an offer, `POST /links` for the link.
2. Make the video, put the link in your profile bio (not in the video).
3. `POST /queue`, then `PUT /queue/<id>/video`.
4. Tell the creator to open the cabinet, review and approve.
5. `GET /stats` to see results.
