DocumentationPost to a community
How to post to a subreddit, Facebook group or Telegram channel
A post goes to the account's own profile unless you name a destination. With one, ViceVox posts into a subreddit, a Facebook Page or group, a LinkedIn company page, a Pinterest board or a Telegram channel or group, as the signed-in account.
You need a ViceVox API key and an active account that is allowed to post in that place.
Name the destination the way the platform expects
| Platform | destination | Rules |
|---|---|---|
r/name, name, u/name or a Reddit URL | title is required. Text alone is a text post; add link for a link post or media for an image post, not both. | |
| A Page or group URL, or a group id | Text, media or both, up to 30 photos or videos. link is ignored: put the link in text. | |
A company page: acme, company/acme or its URL | The account must be an admin of the page. visibility is public or connections. | |
| A board name, in any case | Exactly one image or video. title and link are optional; without a title, the first line of text is used. | |
| Twitch | A channel: its login or its URL | A chat message of at most 500 characters. Without destination it goes to the account's own channel. |
| GitHub | A repository: owner/name or its URL. Required. | Opens an issue. title is required, at most 256 characters; text is the body. Images and videos attach to the body. |
| DEV Community | The tags: at most 4, letters and digits, separated by commas. Optional. | An article in Markdown. title is required, at most 128 characters. visibility: draft saves it unpublished. |
| Hashnode | A publication of the account: its title or hashnode.dev address. Optional when it has one. | A post in Markdown. title is required, at most 250 characters. visibility is public, unlisted or draft. |
| Telegram | @name, a t.me link, a numeric chat id or a +phone | Text only. The account must be a member that can write in the chat. |
destination, so a post to an X Community lands on the
account's own profile. For a community post on X, use
browser steps.
Post to a subreddit
POST/v1/accounts/{id}/actions
A Reddit post needs destination and title. Every ViceVox post also needs text or media, so a link post carries a short body in text. link must start with http:// or https://.
curl
curl https://api.vicevox.com/v1/accounts/$ACCOUNT_ID/actions \
-H "Authorization: Bearer $VICEVOX_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: reddit-release-0-9" \
-d '{
"type": "post",
"destination": "r/selfhosted",
"title": "Release 0.9: dark mode and a smaller image",
"text": "Notes and upgrade steps are in the changelog.",
"link": "https://example.com/changelog/0-9",
"wait": 90
}'JavaScript
const res = await fetch(
`https://api.vicevox.com/v1/accounts/${process.env.ACCOUNT_ID}/actions`,
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.VICEVOX_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": "reddit-release-0-9",
},
body: JSON.stringify({
type: "post",
destination: "r/selfhosted",
title: "Release 0.9: dark mode and a smaller image",
text: "Notes and upgrade steps are in the changelog.",
link: "https://example.com/changelog/0-9",
wait: 90,
}),
},
);
if (!res.ok) throw new Error(`${res.status}: ${await res.text()}`);
const action = await res.json();
console.log(action.status, action.result?.url ?? action.error?.message ?? "");Python
import os
import requests
resp = requests.post(
f"https://api.vicevox.com/v1/accounts/{os.environ['ACCOUNT_ID']}/actions",
headers={
"Authorization": f"Bearer {os.environ['VICEVOX_API_KEY']}",
"Idempotency-Key": "reddit-release-0-9",
},
json={
"type": "post",
"destination": "r/selfhosted",
"title": "Release 0.9: dark mode and a smaller image",
"text": "Notes and upgrade steps are in the changelog.",
"link": "https://example.com/changelog/0-9",
"wait": 90,
},
timeout=100,
)
if not resp.ok:
raise SystemExit(f"{resp.status_code}: {resp.text}")
action = resp.json()
print(action["status"], (action.get("result") or {}).get("url") or action.get("error"))A succeeded action has result.url, the new post. flair is the community's post flair, by its template id or its text. A flair the community does not have fails with not_found, and nothing is posted. A community that requires a flair fails with rejected when you send none.
Post to a Facebook group or a LinkedIn company page
Send the same action with the destination for that platform. Facebook ignores link, so put links in the text.
{
"type": "post",
"destination": "https://www.facebook.com/groups/selfhosting.club",
"text": "Release 0.9 is out: https://example.com/changelog/0-9",
"wait": 90
}On LinkedIn, the account must be an admin of the company page. visibility takes public (Anyone) or connections (Connections only).
{
"type": "post",
"destination": "company/acme",
"text": "Release 0.9 is out. Dark mode, and a smaller image.",
"visibility": "public",
"wait": 90
}Pin to a Pinterest board
A Pin needs exactly one image or video in media; upload it first asthe quickstart shows. destination is the board's name as the account sees it.
{
"type": "post",
"destination": "Product screenshots",
"media": ["0199f7a8-..."],
"title": "Dark mode",
"link": "https://example.com/changelog/0-9",
"wait": 120
}Post to a Telegram channel or group
Telegram posts are text only. The account must already be a member of the chat. If it is not, join with the follow action, which is Join on Telegram:
curl https://api.vicevox.com/v1/accounts/$ACCOUNT_ID/actions \
-H "Authorization: Bearer $VICEVOX_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "type": "follow", "user": "@acme_updates", "wait": 60 }'{
"type": "post",
"destination": "@acme_updates",
"text": "Release 0.9 is out: https://example.com/changelog/0-9",
"wait": 60
}Post to several places at once
One action has one destination. To post into three subreddits, send three actions, each with its own Idempotency-Key. The batch route posts from many accounts, but each account gets the same destination, so it suits several accounts posting into one place.
Common errors
These come back on the action as error.code and error.message.
- invalid_input
- "invalid input: a Reddit post needs
destination: a community such as r/rust, or u/<you>" - invalid_input
- "invalid input: a Reddit post needs a title"
- invalid_input
- "invalid input: a Reddit post is a link post or a media post, not both"
- invalid_input
- "invalid input:
destinationmust name a company page (acme, company/acme or its URL)" - invalid_input
- "invalid input: a pin needs exactly one image or video"
- invalid_input
- "invalid input: the Telegram driver sends text only"
- not_found
- "not found: no board named
Product screenshots". Check the board's name in Pinterest. - rejected
- "the community requires a post flair", "the member does not admin the company page", or "join the chat before writing to it", each after "the platform rejected the action: ".
The invalid_input errors come before anything is posted, and their usage is given back.
See also
- The post action
- Reddit for AI agents
- How to post to many social media accounts at once
- How to post a thread on X, Threads, Bluesky or Mastodon
- How to read and reply to comments on your posts
To run this on your own accounts, create a ViceVox account, then add an account and an API key.