AI writing

Write a native post per network from one idea, without publishing.

View as MarkdownOpenAPIBase URL https://postwire.io

POST /api/generate writes one draft per network: each within that network's length, with its own hashtags and format. Nothing is published. Feed drafts back into POST /api/post as per_platform to publish exactly what was written. Drafts count against the plan's AI drafts a day.

Write a native post per network, without publishing

POST/api/generate

Returns one draft per requested network. Feed `drafts` straight back into /api/post as `per_platform` to publish exactly what was written. platforms may be an array or a comma-separated string ("tiktok, instagram"); the idea may be sent as prompt, idea, text or topic. With no platforms, the account's connected networks are used. 400 codes: prompt_required, platforms_required, unknown_platform; 502 ai_failed when the writer fails.

Needs an API key: Authorization: Bearer pw_live_….

Body (JSON)

FieldTypeDescription
prompt requiredstringThe idea to communicate. Up to 4000 characters.
platforms requiredarray of stringOne of: tiktok, instagram, youtube, linkedin, facebook, bluesky, mastodon, telegram, discord.
media_urlstring (uri)
brand_voicestringUp to 1500 characters.

Responses

StatusMeans
200{ drafts: { <platform>: { text } } }
400prompt or platforms[] missing
429Daily generation cap for the plan reached
503AI not configured
curl
curl -X POST "https://postwire.io/api/generate" \
  -H "Authorization: Bearer $POSTWIRE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "prompt": "We now proof our sourdough for 36 hours",
  "platforms": [
    "tiktok",
    "linkedin",
    "bluesky"
  ],
  "brand_voice": "warm, specific, no hype"
}'
Node
const res = await fetch("https://postwire.io/api/generate", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.POSTWIRE_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    "prompt": "We now proof our sourdough for 36 hours",
    "platforms": [
      "tiktok",
      "linkedin",
      "bluesky"
    ],
    "brand_voice": "warm, specific, no hype"
  }),
});
console.log(res.status, await res.json());
Python
import os, requests

r = requests.post(
    "https://postwire.io/api/generate",
    headers={"Authorization": f"Bearer {os.environ['POSTWIRE_API_KEY']}"},
    json={
        "prompt": "We now proof our sourdough for 36 hours",
        "platforms": ["tiktok", "linkedin", "bluesky"],
        "brand_voice": "warm, specific, no hype",
    },
)
print(r.status_code, r.json())

Example response

JSON
{
  "drafts": {
    "tiktok": {
      "text": "36 hours. That's how long this dough rests… #sourdough #bakery"
    },
    "linkedin": {
      "text": "We doubled our proofing time to 36 hours. Three things changed…"
    },
    "bluesky": {
      "text": "Sourdough, now proofed for 36 hours. The crumb is open, the crust cracks. Worth the wait."
    }
  }
}

Texts shortened. Publish them with POST /api/post and per_platform: drafts.