API reference · v1

Build on Postkit

A small REST API for scheduling posts, uploading media and reading analytics across every network you've connected. JSON in, JSON out. It runs the same code as the app, so anything you can do there behaves the same here.

https://api.postkit.online/v1

Get a key

Create one in Settings → API and MCP, then send it as a Bearer token.

Schedule a post

One call, any number of channels.

Listen with webhooks

Know the moment a post goes live or fails.

Authentication

Create a key in Settings → API and MCP. It's shown once, so store it somewhere safe. Send it on every request:

Authorization: Bearer pk_live_…

Keys are either read only (GET requests) or read and write. Revoke a key at any time and it stops working right away.

Rate limits

Free

60 requests / minute

Creator and Team

600 requests / minute

Every response carries X-RateLimit-Limit and X-RateLimit-Remaining. Over the limit you get 429 with Retry-After in seconds. Each network's own limits still apply on top of ours.

Errors

Errors always have the same shape, with a stable code you can match on:

{
  "error": {
    "code": "invalid_content",
    "message": "Write something or add media.",
    "details": { "issues": [{ "channel_id": "ch_…", "code": "empty", "message": "…" }] }
  }
}
400invalid_request
The body or query didn't match the schema. details.issues says where.
401unauthorized / invalid_api_key
No key, or a revoked one.
403insufficient_scope / channel_not_allowed
The key can't do that.
404not_found
No such post, idea or webhook in your workspace.
409not_editable
The post has already started going out.
422invalid_content, no_slots, …
A network would reject it, or the queue has no free slot.
429rate_limited
Slow down; see Retry-After.

Retries and idempotency

Send an Idempotency-Key header with any write. If the same key arrives again within 24 hours, you get the first response back (with Idempotent-Replayed: true) and nothing is posted twice. Reusing a key for a different request returns 422 idempotency_conflict.

Posts

POST/v1/posts

Schedules one post to one or more channels. Each channel becomes its own job, so a failure on one network never blocks the others.

channelsstring[]required
Channel ids from GET /v1/channels.
textstring
The caption. Checked against each channel's limit.
mediastring[]
Media ids from POST /v1/media, in order.
scheduleobject
{ "type": "queue" } (default: the next free slot), { "type": "at", "at": "<ISO 8601 with offset>" }, { "type": "now" }, or { "type": "draft" }.
overridesobject
Per channel id: { "text": "…", "options": { … } }. A different caption, and network settings listed in that channel's capabilities.options.
coverobject
{ "media_id": "med_…" } or { "offset_ms": 1500 }: the cover for a video post.
curl -X POST https://api.postkit.online/v1/posts \
  -H "Authorization: Bearer pk_live_…" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 7f3a-launch" \
  -d '{
    "text": "Shipping v1 today",
    "channels": ["ch_…", "ch_…"],
    "media": ["med_…"],
    "schedule": { "type": "at", "at": "2026-10-20T18:30:00+05:30" }
  }'

201 Response

{
  "id": "post_8Kd2…",
  "status": "scheduled",
  "text": "Shipping v1 today",
  "scheduled_for": "2026-10-20T13:00:00.000Z",
  "needs_approval": false,
  "source": "api",
  "media": [{ "id": "med_…", "mime_type": "image/jpeg", "alt_text": null }],
  "targets": [
    { "id": "pt_…", "channel_id": "ch_…", "network": "…", "status": "scheduled",
      "text": null, "options": {}, "url": null, "published_at": null, "error": null }
  ]
}

GET /v1/posts takes status, channel, from, to and limit (up to 200). PATCH /v1/posts/:id takes the same fields as create; only the ones you send change, and sending only schedule just moves it. DELETE cancels whatever hasn't gone out yet.

Channels

GET /v1/channels lists your connected accounts with their status and what each accepts: max_chars, requires_media, max_images, video, and options, the network settings you can set per channel in overrides.

Media

Upload first, then attach the id to a post. Send the file as multipart/form-data (a file field and optional alt_text), or JSON with a public https url for us to fetch. JPEG, PNG, WebP, GIF, AVIF, MP4 and MOV; images are stored as JPEG.

curl -X POST https://api.postkit.online/v1/media \
  -H "Authorization: Bearer pk_live_…" \
  -F file=@photo.jpg -F alt_text="Our new office"

Analytics

GET /v1/analytics?from=…&to=… (ISO 8601) returns totals and the previous period for comparison, follower change, daily numbers, a per-channel breakdown and top posts. Add channel to narrow it to one account.

Ideas

GET /v1/ideas, POST /v1/ideas with text and optional body, tags and column (idea, drafting or ready), and DELETE /v1/ideas/:id.

Webhooks

Add an endpoint in Settings or with POST /v1/webhooks (url, events). Events: post.published, post.failed, channel.disconnected and queue.low (daily, when fewer than 3 posts are scheduled). Endpoints must be public https addresses. Failed deliveries are retried with backoff, up to 6 tries.

POST to your endpoint
X-Postkit-Event: post.published
X-Postkit-Delivery: whd_…
X-Postkit-Signature: t=1760000000,v1=5f2b…

{ "id": "whd_…", "event": "post.published", "created_at": "…",
  "data": { "post_id": "post_…", "channel": { "id": "ch_…", "network": "…", "handle": "…" },
            "url": "https://…" } }

Every delivery is signed with your endpoint's secret: HMAC-SHA256 of <t>.<raw body>. Check it before trusting the body:

verify.js
import { createHmac, timingSafeEqual } from "node:crypto";

// header: X-Postkit-Signature: t=1760000000,v1=5f2b…
export function verify(secret, header, rawBody) {
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false; // too old
  const expected = createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
}

OpenAPI

The full schema is at https://api.postkit.online/v1/openapi.json. Load it into Postman, Insomnia or a code generator.

GET/v1/postsList posts, filtered by status, channel or time
POST/v1/postsCreate and schedule a post
GET/v1/posts/:idGet one post and where it went out
PATCH/v1/posts/:idEdit text, media, channels or time before it posts
DELETE/v1/posts/:idCancel a scheduled post or draft
GET/v1/channelsYour connected channels, their limits and settings
POST/v1/mediaUpload an image or video
GET/v1/analyticsMetrics for a date range, per channel
GET/v1/ideasYour ideas board
POST/v1/ideasSave an idea
DELETE/v1/ideas/:idDelete an idea
GET/v1/webhooksYour webhook endpoints
POST/v1/webhooksAdd an endpoint (the secret is returned once)
DELETE/v1/webhooks/:idRemove an endpoint

MCP server

Prefer to ask an AI assistant? The same actions are available as MCP tools at https://api.postkit.online/mcp.

Set up MCP