Networks and connections
List networks, connect accounts (yours or your clients'), check and move connections.
Telegram, Bluesky, Mastodon, Discord, WordPress, Dev.to, Hashnode, Slack and Nostr connect with credentials (POST /api/connect), checked with the network before they are saved. TikTok, YouTube, Instagram, Facebook Pages, LinkedIn (personal profile) and X connect with OAuth: get the authorize URL and open it in a browser. X is a pay-per-use add-on of the paid plans: see X credits. To let a client connect their own account without a PostWire login, send them a connect link.
No app review, the user's own key. What each of these takes; the AI writer drafts a full article (title, summary, Markdown with H2 sections, tags) for the blogs and a short post for Slack and Nostr:
WordPress (wordpress, POST /api/connect with site_url, username, app_password; optional default_status). Your site address, username and an Application Password. An article: title, Markdown body (sent as HTML), excerpt, up to 10 tags and 10 categories by name, one featured image (up to 15 MB). Published or saved as a draft.
Dev.to (devto, POST /api/connect with api_key; optional default_status). A DEV Community API key. An article: title (up to 128 characters), Markdown body, up to 4 tags (lowercase letters and digits), cover image, canonical URL. Published or saved as a draft.
Hashnode (hashnode, POST /api/connect with token; optional publication, default_status). A Personal Access Token, and a blog on Hashnode Pro. An article: title, Markdown body, up to 5 tags, cover image, canonical URL. Published, or saved as a draft.
Slack (slack, POST /api/connect with webhook_url). An incoming webhook URL for the channel. Messages up to 4,000 characters with Slack formatting, one image shown in the channel, links unfurled. Slack returns no link to the message.
Nostr (nostr, POST /api/connect with nsec; optional relays). Your secret key (nsec) and, optionally, your relays. Notes of any length (past 2,000 characters a long-form article, NIP-23), up to 8 relays, a link to an image or video. The post's link is on njump.me.
GET /api/platforms: List supported platformsPOST /api/connect: Connect a credential-based platform (telegram, bluesky, mastodon, discord, wordpress, devto, hashnode, slack, nostr)POST /api/oauth/{platform}/url: Get an OAuth authorize URL for an OAuth platform (tiktok, youtube, linkedin, facebook, instagram)POST /api/connect-link: Generate a hosted connect link for an end-user (multi-tenant)GET /api/connections: The connected accounts, with their brand and the identity each network reportsGET /api/connect/{platform}/health: Check that a connection still worksDELETE /api/connect/{platform}: Disconnect one network of one brandPOST /api/connect/{platform}/move: Move a connected account to another brand of the same PostWire accountGET /api/tiktok/creator-info: The connected TikTok creator and what it may post with
List supported platforms
/api/platformsNo API key needed.
Responses
| Status | Means |
|---|---|
200 | OK |
curl "https://postwire.io/api/platforms"const res = await fetch("https://postwire.io/api/platforms", {
method: "GET",
});
console.log(res.status, await res.json());import os, requests
r = requests.get(
"https://postwire.io/api/platforms",
)
print(r.status_code, r.json())Connect a credential-based platform (telegram, bluesky, mastodon, discord, wordpress, devto, hashnode, slack, nostr)
/api/connectNeeds an API key: Authorization: Bearer pw_live_….
Body (JSON)
| Field | Type | Description |
|---|---|---|
platform required | string | One of: telegram, bluesky, mastodon, discord, wordpress, devto, hashnode, slack, nostr. |
credentials required | object | telegram { bot_token, chat_id } · bluesky { handle, app_password } · mastodon { instance_url, access_token } · discord { webhook_url } · wordpress { site_url, username, app_password, default_status? (publish|draft) } · devto { api_key, default_status? } · hashnode { token, publication? (the blog's address or id; default: the first blog), default_status? } · slack { webhook_url (https://hooks.slack.com/services/…) } · nostr { nsec, relays? (wss:// list or comma-separated; default: public relays) }. Checked with the network before they are saved; a refusal comes back as code invalid_credentials with what to fix. |
dry_run | boolean | true: only test the credentials with the network (the dashboard's Test connection); nothing is saved. Answers { ok, tested: true, connected: false } or the same invalid_credentials error a connect would. |
brand_id | string (uuid) |
Responses
| Status | Means |
|---|---|
200 | Connected |
curl -X POST "https://postwire.io/api/connect" \
-H "Authorization: Bearer $POSTWIRE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"platform": "telegram",
"credentials": {
"bot_token": "123456789:AAF…",
"chat_id": "@bakerynews"
}
}'const res = await fetch("https://postwire.io/api/connect", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"platform": "telegram",
"credentials": {
"bot_token": "123456789:AAF…",
"chat_id": "@bakerynews"
}
}),
});
console.log(res.status, await res.json());import os, requests
r = requests.post(
"https://postwire.io/api/connect",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
json={
"platform": "telegram",
"credentials": {
"bot_token": "123456789:AAF…",
"chat_id": "@bakerynews",
},
},
)
print(r.status_code, r.json())Get an OAuth authorize URL for an OAuth platform (tiktok, youtube, linkedin, facebook, instagram)
/api/oauth/{platform}/urlNeeds an API key: Authorization: Bearer pw_live_….
Parameters
| Field | Type | Description |
|---|---|---|
platform required | path, string |
Responses
| Status | Means |
|---|---|
200 | { url } |
curl -X POST "https://postwire.io/api/oauth/tiktok/url" \
-H "Authorization: Bearer $POSTWIRE_API_KEY"const res = await fetch("https://postwire.io/api/oauth/tiktok/url", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}` },
});
console.log(res.status, await res.json());import os, requests
r = requests.post(
"https://postwire.io/api/oauth/tiktok/url",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
)
print(r.status_code, r.json())Example response
{
"url": "https://www.tiktok.com/v2/auth/authorize/?client_key=…"
}Generate a hosted connect link for an end-user (multi-tenant)
/api/connect-linkA hosted page (valid 1 hour) where your client connects their own account, without a PostWire login: send them the url. The connection lands in brand_id.
Needs an API key: Authorization: Bearer pw_live_….
Body (JSON)
| Field | Type | Description |
|---|---|---|
platform | string | Offer only this network; without it the page offers every network. One of: tiktok, instagram, youtube, linkedin, facebook, bluesky, mastodon, telegram, discord, wordpress, devto, hashnode, slack, nostr, x. |
brand_id | string (uuid) | The brand the connection is saved into. |
ig_username | string | Instagram: the @handle to connect, when the person's Pages have several. |
Responses
| Status | Means |
|---|---|
200 | { url, token, expires_in } |
curl -X POST "https://postwire.io/api/connect-link" \
-H "Authorization: Bearer $POSTWIRE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"platform": "instagram",
"brand_id": "b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c"
}'const res = await fetch("https://postwire.io/api/connect-link", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"platform": "instagram",
"brand_id": "b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c"
}),
});
console.log(res.status, await res.json());import os, requests
r = requests.post(
"https://postwire.io/api/connect-link",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
json={
"platform": "instagram",
"brand_id": "b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c",
},
)
print(r.status_code, r.json())Example response
{
"url": "https://postwire.io/connect/#eyJ…",
"token": "eyJ…",
"expires_in": 3600,
"platform": "instagram",
"brand_id": "b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c"
}The connected accounts, with their brand and the identity each network reports
/api/connectionsNeeds an API key: Authorization: Bearer pw_live_….
Responses
| Status | Means |
|---|---|
200 | { connections: [{ platform, brand_id, brand_name, label?, identity, needs }] } |
curl "https://postwire.io/api/connections" \
-H "Authorization: Bearer $POSTWIRE_API_KEY"const res = await fetch("https://postwire.io/api/connections", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}` },
});
console.log(res.status, await res.json());import os, requests
r = requests.get(
"https://postwire.io/api/connections",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
)
print(r.status_code, r.json())Check that a connection still works
/api/connect/{platform}/healthAsks the network whether the stored login is still accepted (a revoked token, a Telegram bot removed from its chat, a deleted Discord or Slack webhook, a revoked WordPress application password or Dev.to / Hashnode key). healthy null means the network has no check. 240 checks an hour.
Needs an API key: Authorization: Bearer pw_live_….
Parameters
| Field | Type | Description |
|---|---|---|
platform required | path, string | |
brand_id | query, string (uuid) | Which brand's connection, when the network is connected in more than one brand. |
Responses
| Status | Means |
|---|---|
200 | { platform, brand_id, connected, healthy: true|false|null, reason, action: null|"reconnect", account, label } |
curl "https://postwire.io/api/connect/linkedin/health" \
-H "Authorization: Bearer $POSTWIRE_API_KEY"const res = await fetch("https://postwire.io/api/connect/linkedin/health", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}` },
});
console.log(res.status, await res.json());import os, requests
r = requests.get(
"https://postwire.io/api/connect/linkedin/health",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
)
print(r.status_code, r.json())Disconnect one network of one brand
/api/connect/{platform}Needs an API key: Authorization: Bearer pw_live_….
Parameters
| Field | Type | Description |
|---|---|---|
platform required | path, string | |
brand_id | query, string (uuid) | Which brand's connection, when the network is connected in more than one brand. |
Responses
| Status | Means |
|---|---|
200 | { ok, platform, brand_id, connected: false } |
404 | not_connected in that brand |
409 | ambiguous_brand: connected in several brands, say which with ?brand_id= |
curl -X DELETE "https://postwire.io/api/connect/discord?brand_id=b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c" \
-H "Authorization: Bearer $POSTWIRE_API_KEY"const res = await fetch("https://postwire.io/api/connect/discord?brand_id=b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c", {
method: "DELETE",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}` },
});
console.log(res.status, await res.json());import os, requests
r = requests.delete(
"https://postwire.io/api/connect/discord?brand_id=b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
)
print(r.status_code, r.json())Move a connected account to another brand of the same PostWire account
/api/connect/{platform}/moveKeeps the same login and token; only the brand changes. Without confirm:true nothing moves and the response describes the move (which account, from which brand, to which). Refused with 409 when the target brand already has that network, or when queued posts of the source brand still publish to it (they are listed).
Needs an API key: Authorization: Bearer pw_live_….
Parameters
| Field | Type | Description |
|---|---|---|
platform required | path, string |
Body (JSON)
| Field | Type | Description |
|---|---|---|
to_brand_id required | string | |
from_brand_id | string | Needed only when the network is connected in more than one brand. |
confirm | boolean | true performs the move; otherwise it is a preview. |
Responses
| Status | Means |
|---|---|
200 | { ok, preview?|moved?, platform, account, from: { brand_id, name }, to: { brand_id, name }, message } |
409 | ambiguous_brand | target_has_platform | scheduled_posts_use_it |
curl -X POST "https://postwire.io/api/connect/tiktok/move" \
-H "Authorization: Bearer $POSTWIRE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to_brand_id": "b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c",
"confirm": true
}'const res = await fetch("https://postwire.io/api/connect/tiktok/move", {
method: "POST",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}`, "Content-Type": "application/json" },
body: JSON.stringify({
"to_brand_id": "b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c",
"confirm": true
}),
});
console.log(res.status, await res.json());import os, requests
r = requests.post(
"https://postwire.io/api/connect/tiktok/move",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
json={
"to_brand_id": "b3f1c2d4-8a9e-4f6b-a1c2-3d4e5f6a7b8c",
"confirm": True,
},
)
print(r.status_code, r.json())The connected TikTok creator and what it may post with
/api/tiktok/creator-infoTikTok's own answer for this creator: the privacy levels it allows (use one in options.tiktok.privacy_level), whether comments, duets and stitches are switched off, and the longest video it may post.
Needs an API key: Authorization: Bearer pw_live_….
Parameters
| Field | Type | Description |
|---|---|---|
brand_id | query, string (uuid) | Which brand's connection, when the network is connected in more than one brand. |
Responses
| Status | Means |
|---|---|
200 | { ok, brand_id, creator_nickname, creator_username, creator_avatar_url, privacy_level_options[], comment_disabled, duet_disabled, stitch_disabled, max_video_post_duration_sec } |
400 | TikTok not connected |
curl "https://postwire.io/api/tiktok/creator-info" \
-H "Authorization: Bearer $POSTWIRE_API_KEY"const res = await fetch("https://postwire.io/api/tiktok/creator-info", {
method: "GET",
headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}` },
});
console.log(res.status, await res.json());import os, requests
r = requests.get(
"https://postwire.io/api/tiktok/creator-info",
headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
)
print(r.status_code, r.json())