Developer API

Post from your own code, not just our app

A clean REST API for everything PostRocket does: create and schedule posts, write captions, plan campaigns and run workflows, all with one key.

7-day free trial on every plan. Cancel anytime.

POST /v1/posts
$ curl -X POST https://api.postrocket.co/v1/posts \
    -H "X-API-Key: $POSTROCKET_API_KEY" \
    -d @post.json

HTTP/1.1 201 Created
{
  "id": "pst_4Qm9",
  "status": "queued",
  "channels": ["instagram", "linkedin"],
  "scheduled_at": "2026-11-12T17:00:00Z"
}

A small, predictable API surface

Resources are grouped the way you think about them. Pick a group and an endpoint to see what it returns.

POST/v1/posts

Create a post and publish now, schedule it or save a draft.

Example response
{ "id": "pst_4Qm9", "status": "queued" }
https://api.postrocket.co/v1/posts
Authentication

Authenticate in three lines

Create a key in Settings, send it in the X-API-Key header, and you’re in. Keys belong to a workspace, so you can revoke one without touching the others.
  • One header, no OAuth dance for server-to-server calls
  • Separate keys per app or environment
  • Revoke or rotate a key at any time
terminal
curl https://api.postrocket.co/v1/me \
  -H "X-API-Key: pr_live_••••••••••••3f9a"
# → { "workspace": "Juniper Plant Co.", "plan": "team" }
Code examples

Schedule a post in the language you already use

The same request in cURL, JavaScript, Python and PHP. Copy it, swap in your key and brand ID, run it.

terminal
curl -X POST https://api.postrocket.co/v1/posts \
  -H "X-API-Key: $POSTROCKET_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "brand_id": "brd_8f2k",
    "channels": [
      "instagram",
      "linkedin"
    ],
    "text": "Spring workshop seats are open 🌿 Learn to repot without the mess.",
    "media_urls": [
      "https://example.com/workshop.jpg"
    ],
    "scheduled_at": "2026-11-12T17:00:00Z"
  }'

Requests return fast; publishing happens in the background

Creating a post returns 201 with an ID immediately. Check GET /v1/posts/{id} to follow it through each status.

  1. Queued

    Accepted and waiting for its time slot. You get the post ID straight away.

  2. Publishing

    Being sent to each channel. Networks can take a few seconds to confirm.

  3. Published

    Live. The post includes a link to the published version on every channel.

  4. Failed

    A channel refused it. The reason is attached so you can fix and retry.

Custom webhook channel

Treat your own app like another channel

Add a custom webhook as a channel and PostRocket will send each post to your endpoint as JSON at its scheduled time. Handy for in-app feeds, digital signage or a network we don’t support yet.
  • Schedule to it like any other channel
  • Text, media URLs and timing in one payload
  • Mix it with social channels in the same post
Custom webhook integration
Example payload
POST https://your-app.example.com/hooks/postrocket
Content-Type: application/json

{
  "event": "post.publish",
  "post_id": "pst_4Qm9",
  "brand": "Juniper Plant Co.",
  "text": "Spring workshop seats are open 🌿",
  "media": ["https://cdn.postrocket.co/m/workshop.jpg"],
  "scheduled_at": "2026-11-12T17:00:00Z"
}
Recipes

Ideas to get you building

Share every new blog post

When your CMS publishes, call POST /posts with the title and link. Add /ai/captions to tailor it per network.

Schedule from a spreadsheet

Loop over rows of text, image URLs and times, and create one scheduled post per row.

Captions inside your product

Let your own users generate on-brand captions by calling /ai/captions behind your UI.

Kick off a workflow

Start a saved PostRocket workflow from your backend and pass in variables like a product name.

Plan a campaign from your CRM

Send a goal, audience and dates to /campaigns and review the drafted posts in PostRocket.

Report on what went out

Pull published posts and their live links into your own dashboard or weekly report.

Questions

Something else? Ask us

How do I get an API key?
Open Settings → API in your workspace and create a key. Copy it once; we only show the full key at creation time.
Do API calls use credits?
Only AI calls do, at the same rates as the app: 1 credit per caption request and 2 per image (failed images are refunded). Creating, scheduling and publishing posts is free.
Which networks can I post to through the API?
Every channel you’ve connected in PostRocket. The API respects each network’s limits, so a post that’s too long for X is rejected with a clear error instead of failing later.
Is publishing instant?
Requests return straight away with a post ID and the status “queued”. Publishing runs in the background; poll the post to see when it’s published or why it failed.
Should I use the API or MCP?
Use the API when your own code needs to post or plan. Use MCP when you want to drive PostRocket by chatting with an AI assistant. Both reach the same brands and channels.
How do I keep my key safe?
Store it as a server-side environment variable, never in browser code. If a key leaks, revoke it in Settings and create a new one.

Get your API key and ship your first post

7-day free trial on every plan. Cancel anytime.