PostHero API

v1 Reference

Post Schema

In PostHero, a post is a single piece of content that can be published to one or multiple platforms at once. This is the core concept of the API. One post, multiple platforms When you create a post, you specify which platforms and accounts to publish to via the platforms array. Each entry is a {platform, accountId} pair. The same post can target LinkedIn, Twitter, TikTok, Instagram, and more — all in one request. Platform-specific content By default, all platforms receive the same text. When you need different content per platform (e.g. shorter text for Twitter, a different caption for TikTok), use the platformContent object to override text and settings for each platform individually. See Platform Content for details. Post lifecycle: - Draft — created without a schedule or publishNow. Can be edited later. - Scheduled — has a schedule date. Will be published automatically at that time. - Published — either published immediately via publishNow: true or when the scheduled time arrived. Media support: - Images — attach one or more images via media.images (array of URLs) - Video — attach a single video via media.video (URL) - PDF carousel — attach a PDF via media.carousel (URL, LinkedIn only) Upload files first using the Upload Media endpoint, then reference the returned URLs when creating a post.

Example request

curl --request POST \
  --url https://server.posthero.ai/api/v1/posts \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "text": "Main post content shared across platforms",
  "platforms": [
    { "platform": "linkedin", "accountId": "acc_linkedin_1" },
    { "platform": "twitter", "accountId": "acc_twitter_1" },
    { "platform": "tiktok", "accountId": "acc_tiktok_1" }
  ],
  "platformContent": {
    "twitter": { "text": "Shorter version for Twitter" },
    "tiktok": { "text": "TikTok caption with #hashtags" }
  },
  "media": { "images": ["https://s3.amazonaws.com/..."] },
  "schedule": "2025-03-15T14:00:00Z"
}'