Publish to Social
Publish a generated Agent-Media UGC Video to the user''s connected TikTok, Instagram, or X. Connect channels (OAuth) and post or schedule via the REST API. Use after producing a video with make_ugc.
Works with
---
name: Publish to Social
description: Publish a generated Agent-Media UGC Video to the user''s connected TikTok, Instagram, or X. Connect channels (OAuth) and post or schedule via the REST API. Use after producing a video with make_ugc.
license: Apache-2.0
---
# Publish to Social
Post a finished agent-media video (an R2 `video_url` from any of the video skills) to the user's connected social channels — **TikTok, Instagram, or X**. Works from three surfaces: REST, the CLI (`agent-media social ...`), and MCP tools (`social_channels` / `social_connect` / `social_publish`). All calls use the user's `Authorization: Bearer ma_...` token against `https://api.agent-media.ai`.
## 1. Connect a channel (one-time, requires the human)
```
GET /v1/social/providers -> connectable networks: tiktok, instagram, instagram-standalone, x
POST /v1/social/connect { provider } -> { url } # the user opens this OAuth url and authorizes
GET /v1/social/channels -> { channels: [{ id, name, provider, profile, picture }] }
DELETE /v1/social/channels/:channelId -> disconnect
```
The connect step returns an OAuth URL the **human** must open and authorize — an agent cannot complete OAuth itself. Once authorized, the channel appears in `/v1/social/channels` with an `id` you pass to publish.
CLI: `agent-media social providers` · `agent-media social connect x` · `agent-media social channels`.
MCP: `social_connect { provider }` (returns the URL for the user) · `social_channels`.
## 2. Publish a video
```bash
curl -X POST https://api.agent-media.ai/v1/social/publish \
-H "Authorization: Bearer ma_..." -H "Content-Type: application/json" \
-d '{ "video_url": "https://pub-...r2.dev/generation-outputs/<user>/<job>/...mp4",
"channel_ids": ["<channel-id-from-/channels>"],
"caption": "made with agent-media",
"type": "now" }' # or "type":"schedule" + "date":"2026-06-01T10:00:00.000Z"
```
CLI: `agent-media social publish --video <url> --channels <id,id> --caption "..."` (add `--at <iso>` to schedule).
MCP: `social_publish { video_url, channel_ids, caption, type }`.
`video_url` must be an agent-media R2 URL (the output of a video skill) — agent-media re-hosts it on the publishing provider for you. `channel_ids` come from `/v1/social/channels`. Per-network requirements (e.g. X reply settings) are filled in server-side; you don't send them.
**Returns** `{ success: true, media_id, post_ids: ["..."] }`. A real post was created only when `post_ids` is non-empty — treat an empty `post_ids` as a failure, not a success.
## Typical flow
1. Produce a video → `make_ugc` → `final_output.video_url`.
2. If the user has no connected channel, send them to connect (step 1) — you can't OAuth for them.
3. Publish that `video_url` to the chosen `channel_ids`; confirm `post_ids` came back.
Note: social operations run on a shared rate budget — don't poll; connect once and publish on demand.More API Design skills
lark-event
larksuite/cli
Lark/Feishu real-time event listening / subscribing / consuming: stream events as NDJSON via `lark-cli event consume <EventKey>` (covers IM messages/reactions/chat changes, Approval status changes, Task updates, VC meeting started/joined/ended, Minutes generated, Whiteboard updated, etc.). Use for Lark bots, real-time message processing, long-running subscribers, streaming webhook/push handlers. Supports `--max-events` / `--timeout` bounded runs and a stderr ready-marker contract — designed for AI agents running as subprocesses.
lark-contact
larksuite/cli
飞书 / Lark 通讯录:按姓名 / 邮箱解析成 open_id,或按 open_id 反查姓名 / 部门 / 邮箱 / 联系方式 / 个人状态 / 签名,以及按关键词搜索当前用户可见的机器人 / 智能体(agent)。当用户提到一个名字要下一步发消息 / 排日程,或拿到 open_id 想查具体信息时使用。不负责部门树遍历、按部门列员工、组织架构图,这类需求走原生 OpenAPI。
lark-openapi-explorer
larksuite/cli
飞书/Lark 原生 OpenAPI 探索:从官方文档库中挖掘未经 CLI 封装的原生 OpenAPI 接口。当用户的需求无法被现有 lark-* skill 或 lark-cli 已注册命令满足,需要查找并调用原生飞书 OpenAPI 时使用。

