REST API reference
Each call of /api/v1 with the scope its key needs, its parameters, its body and its answer, then the objects field by field. The page is drawn from the OpenAPI document the API serves, so it changes when the API does.
Keys, rate limits, examples and webhooks are in the REST API guide . Any call can also answer 401, 403 or 429 with an Error, and the error codes are listed there too.
Calls
GET /api/v1/accounts· The connected accounts with each network's rules and their customerGET /api/v1/customers· The customers (groups of channels) with their channels' idsGET /api/v1/gates· The gated pages with their addresses and counts for the last 30 days, and the plan's cap on live pagesPOST /api/v1/gates· Create a gated page (a draft)GET /api/v1/gates/{id}· Get a gated pagePATCH /api/v1/gates/{id}· Edit a gated page (what the body leaves out stays)GET /api/v1/gates/{id}/leads· The email addresses visitors left on a gated page, newest firstPOST /api/v1/gates/{id}/pause· Take a published gated page off the site for nowPOST /api/v1/gates/{id}/publish· Publish a gated page; where agents' work waits for a person, ask one to publish it instead (waits_for_person)GET /api/v1/gates/{id}/stats· A gated page's counts by dayGET /api/v1/limits· The plan's usage, the workspace's time zone and each network's limitsPOST /api/v1/media· Upload an image, GIF or video (multipart: file, alt?)POST /api/v1/media/uploads· A one-time URL that takes one file with PUT, without the key (run the answer's command: it sends the file in parts; 201 MediaView); valid 15 minutesGET /api/v1/posts· List postsPOST /api/v1/posts· Create a post (draft, queue, at or now)GET /api/v1/posts/{id}· Get a postPATCH /api/v1/posts/{id}· Edit a draft or scheduled post (what the body leaves out stays)DELETE /api/v1/posts/{id}· Delete a post (a scheduled one is canceled)GET /api/v1/posts/{id}/metrics· A published post's counts on each channel at 1 h, 24 h and 7 days (plans with analytics)POST /api/v1/posts/{id}/retry· Send the failed channels again, nowGET /api/v1/queue/next· The accounts' next free posting slot
GET /api/v1/accounts
The connected accounts with each network's rules and their customer
- Scope
accounts:read- Answer
200AccountList
| Name | In | Type | Description |
|---|---|---|---|
customer_id | query | string | Only this customer's channels (GET /api/v1/customers). |
GET /api/v1/customers
The customers (groups of channels) with their channels' ids
- Scope
accounts:read- Answer
200CustomerList
GET /api/v1/gates
The gated pages with their addresses and counts for the last 30 days, and the plan's cap on live pages
- Scope
gates:read- Answer
200GateList
GET /api/v1/gates/{id}
Get a gated page
- Scope
gates:read- Answer
200GateView
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The gated page's id. |
PATCH /api/v1/gates/{id}
Edit a gated page (what the body leaves out stays)
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The gated page's id. |
GET /api/v1/gates/{id}/leads
The email addresses visitors left on a gated page, newest first
- Scope
leads:read- Answer
200LeadList
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The gated page's id. |
offset | query | string | Addresses to skip. |
limit | query | string | Page size (default and at most 100). |
POST /api/v1/gates/{id}/pause
Take a published gated page off the site for now
- Scope
gates:write- Answer
200GateView
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The gated page's id. |
POST /api/v1/gates/{id}/publish
Publish a gated page; where agents' work waits for a person, ask one to publish it instead (waits_for_person)
- Scope
gates:write- Body
GatePublish- Answer
200GateView
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The gated page's id. |
GET /api/v1/gates/{id}/stats
A gated page's counts by day
- Scope
gates:read- Answer
200GateStats
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The gated page's id. |
days | query | string | How many days back to count (1–365, default 30). |
GET /api/v1/limits
The plan's usage, the workspace's time zone and each network's limits
- Scope
accounts:read- Answer
200Limits
POST /api/v1/media
Upload an image, GIF or video (multipart: file, alt?)
- Scope
media:write- Body
multipart/form-data- Answer
201MediaView
| Name | Type | Description |
|---|---|---|
alt | string | Description for screen readers. |
file required | file |
POST /api/v1/media/uploads
A one-time URL that takes one file with PUT, without the key (run the answer's command: it sends the file in parts; 201 MediaView); valid 15 minutes
- Scope
media:write- Body
UploadRequest- Answer
201UploadTicket
GET /api/v1/posts
List posts
- Scope
posts:read- Answer
200PostList
| Name | In | Type | Description |
|---|---|---|---|
status | query | string | Comma-separated statuses: draft, pending_approval, scheduled, publishing, published, partial, failed, canceled. |
account_id | query | string | Only posts that go to this account. |
customer_id | query | string | Only posts that go to at least one channel of this customer (GET /api/v1/customers). |
from | query | string | Scheduled at or after (RFC 3339). |
to | query | string | Scheduled before (RFC 3339). |
q | query | string | Part of a post's text. |
limit | query | string | Page size (default 50, at most 500). |
offset | query | string | Posts to skip. |
POST /api/v1/posts
Create a post (draft, queue, at or now)
GET /api/v1/posts/{id}
Get a post
- Scope
posts:read- Answer
200PostView
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The post's id. |
PATCH /api/v1/posts/{id}
Edit a draft or scheduled post (what the body leaves out stays)
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The post's id. |
DELETE /api/v1/posts/{id}
Delete a post (a scheduled one is canceled)
- Scope
posts:write- Answer
204no body
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The post's id. |
GET /api/v1/posts/{id}/metrics
A published post's counts on each channel at 1 h, 24 h and 7 days (plans with analytics)
- Scope
posts:read- Answer
200PostMetrics
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The post's id. |
POST /api/v1/posts/{id}/retry
Send the failed channels again, now
- Scope
posts:write- Answer
200PostView
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The post's id. |
GET /api/v1/queue/next
The accounts' next free posting slot
- Scope
posts:read- Answer
200NextSlot
| Name | In | Type | Description |
|---|---|---|---|
account_ids | query | string | Comma-separated account ids (required). |
Objects
The bodies and answers the calls name. A dotted name is a field of an object inside, and [] marks an array.
AccountList
| Name | Type | Description |
|---|---|---|
items | Account[] |
Account
| Name | Type | Description |
|---|---|---|
capabilities | object | null | |
char_limit | integer | |
customer | object | null | That customer: {id, name, color}; null when none. |
customer_id | string | null | The customer the channel is grouped under; null when none. |
handle | string | |
id | string | |
provider | string | |
status | string | active or needs_reconnect |
CustomerList
| Name | Type | Description |
|---|---|---|
items | Customer[] |
Customer
| Name | Type | Description |
|---|---|---|
account_ids | string[] | A channel of this customer (GET /api/v1/accounts). |
color | string | One of slate, red, orange, amber, emerald, teal, sky, indigo, violet, pink. |
id | string | |
name | string | Unique in the workspace, case aside; at most 60 characters. |
sort | integer | Orders the list before the name. |
GateList
| Name | Type | Description |
|---|---|---|
handle | string | The workspace's address; empty: none yet. |
items | object[] | |
limit | integer | The plan's cap; -1: none. |
used | integer | Pages counting toward the plan (published or paused). |
GateInput
| Name | Type | Description |
|---|---|---|
content required | GateBlock[] | What the steps unlock. |
hide_badge | boolean | Hide «Made with calmposts» (plans that allow it). |
slug | string | Its address after /@handle/ (lowercase letters, digits, hyphens); empty: made from the title. Fixed once published. |
steps required | GateStep[] | What unlocks the content, in this order (at most 10). |
teaser | GateTeaser | |
title required | string | The page's title. |
GateBlock
| Name | Type | Description |
|---|---|---|
alt | string | The image's description for screen readers. |
media_id | string | An image (POST /api/v1/media). |
text | string | A heading's or a text's words (text takes **bold**, *italic* and [links](https://…)), a button's label. |
type required | string | |
url | string | Where a button leads (http or https). |
GateStep
| Name | Type | Description |
|---|---|---|
account_id | string | An X account of the workspace (GET /api/v1/accounts): whom to follow, whose post to reply to, repost or like. None for email. |
kind required | string | What the visitor does. |
post_gone | boolean | Read-only: X says the post is gone; the step is hidden until another post is linked. |
post_id | string | For reply, repost and like: the address of one of that account's own posts on X (x.com/name/status/…); empty until one is linked. |
reply_text | string | Optional. What X's reply box starts with (the visitor may change it). |
GateTeaser
| Name | Type | Description |
|---|---|---|
cover_media_id | string | Optional. A cover image (POST /api/v1/media). |
subtitle | string | A line under the title. |
text | string | What the visitor gets, shown before the steps. |
GateView
| Name | Type | Description |
|---|---|---|
block_reason | string | Why a moderator took it down: phishing, spam, illegal, rights or other. |
block_text | string | The moderator's words. |
content | GateBlock[] | What the steps unlock. |
created_at | date-time | |
hide_badge | boolean | Hide «Made with calmposts» (plans that allow it). |
id | string | |
publish_asked_at | date-time | null | When it asked. |
publish_asked_by | string | The agent that asked a person to publish it (its key's or connector's name); absent when none did, or once it was published. |
published_at | date-time | null | When it was first published. |
slug | string | Its address after /@handle/ (lowercase letters, digits, hyphens); empty: made from the title. Fixed once published. |
status | string | draft, published, paused (off the site for now) or blocked (taken down by a moderator) |
steps | GateStep[] | What unlocks the content, in this order (at most 10). |
teaser | GateTeaser | |
title | string | The page's title. |
updated_at | date-time | |
url | string | The page's public address; empty while the workspace has no handle. |
waits_for_person | boolean | Only in publish's answer: the page waits for a person to publish it. |
workspace_id | string |
GatePatch
| Name | Type | Description |
|---|---|---|
content | GateBlock[] | What the steps unlock. |
hide_badge | boolean | Hide «Made with calmposts» (plans that allow it). |
slug | string | Its address after /@handle/ (lowercase letters, digits, hyphens); empty: made from the title. Fixed once published. |
steps | GateStep[] | What unlocks the content, in this order (at most 10). |
teaser | GateTeaser | |
title | string | The page's title. |
LeadList
| Name | Type | Description |
|---|---|---|
items | object[] | |
items[].address | string | The email, lowercased. |
items[].created_at | date-time | |
items[].id | string | |
items[].lang | string | The language the visitor read the page in (en, ru, de). |
total | integer |
GatePublish
| Name | Type | Description |
|---|---|---|
handle | string | Optional. The workspace's address (calmposts.com/@handle) when it has none yet. |
GateStats
| Name | Type | Description |
|---|---|---|
days | object[] | |
days[].counts | object | By metric: view, unlock, email and step clicks (click_follow, click_reply, …). |
days[].day | string | YYYY-MM-DD |
from | string | The first day (YYYY-MM-DD, UTC). |
to | string | The last day. |
totals | object | By metric: view, unlock, email and step clicks (click_follow, click_reply, …). |
Limits
| Name | Type | Description |
|---|---|---|
billing | Usage | |
networks | NetworkLimits[] | |
timezone | string | IANA zone |
Usage
| Name | Type | Description |
|---|---|---|
plan | object | The plan: {code, name, limits}; code none while the workspace has no plan. |
subscription | object | null | null for a workspace that never subscribed. |
trial_days | integer | The trial a checkout starts with now; 0 for none. |
usage | object | Per metric (posts_per_day, link_posts_per_month, …): {used, limit, period}. |
NetworkLimits
| Name | Type | Description |
|---|---|---|
accounts | integer | The workspace's accounts on it. |
available | boolean | false: calmposts cannot post to this network now. |
counting | string | weighted (X: links count as link_length, emoji and CJK twice) or graphemes |
link_length | integer | What a link counts as; 0: as written. |
link_surcharge | boolean | A post with a link costs more on the network (X). |
max_chars | integer | The characters a post may have. |
max_images | integer | |
max_text_bytes | integer | The UTF-8 bytes a post's text may have after NFC (Bluesky: 3000); absent: no such cap. |
max_thread_parts | integer | 0: no threads. |
max_title | integer | The characters (Unicode code points) of a channel's title; absent: no titles. |
max_videos | integer | |
name | string | The network's name. |
provider | string | |
requires_media | boolean | A post needs an image or a video. |
thread_as_one | boolean | A thread goes out as one post, its parts joined (LinkedIn). |
title_required | boolean | A post needs a title here. |
MediaView
| Name | Type | Description |
|---|---|---|
alt | string | |
height | integer | |
id | string | |
kind | string | image, gif or video |
mime | string | |
size | integer | |
url | string | |
width | integer |
UploadRequest
| Name | Type | Description |
|---|---|---|
alt | string | Optional. The file's description for screen readers (at most 1000 characters). |
UploadTicket
| Name | Type | Description |
|---|---|---|
chunk_bytes | integer | The part size to send a large file in. |
command | string | A shell command (sh, dd and curl 7.76+) that sends ./FILE here in parts of chunk_bytes and prints the media: replace ./FILE with the path to your file. |
expires_at | date-time | The URL takes no file after this. |
max_bytes | integer | The largest video it takes. |
max_image_bytes | integer | The largest image or GIF it takes. |
media_id | string | The id the file gets: pass it in a part's media_ids once the PUT answered 201. |
method | string | Always PUT. |
types | string[] | A MIME type it takes (sniffed from the bytes). |
upload_url | string | PUT the file here, without the API key. It takes one file: whole, or in parts of up to chunk_bytes, each PUT with Content-Range: bytes FIRST-LAST/TOTAL (200 {received} until the last answers 201; 416 with Upload-Offset says where to go on from). A request over 100 MB is refused on the way, so send a large file in parts, as command does. |
PostList
| Name | Type | Description |
|---|---|---|
items | PostView[] | |
total | integer |
PostView
| Name | Type | Description |
|---|---|---|
approval | object | null | The latest request for a person's approval {id, state: pending|approved|rejected|withdrawn, requested_by, requested_at, schedule, decided_by, decided_at, via, reason}; null when the post never waited. |
author | object | |
author.agent | object | null | The credential: {kind: api_key|oauth, name}; null for a person. |
author.former | boolean | No longer a member of the workspace. |
author.kind | string | member (a person wrote it) or agent (an API key or a connector) |
author.name | string | Their name |
author.user_id | string | The person; for an agent, whose key or connector it is. Empty once their account was deleted. |
created_at | date-time | |
id | string | |
parts | PartView[] | |
published_at | date-time | null | When it went out. |
scheduled_at | date-time | null | When it goes out. |
source | string | web, api or mcp |
status | string | draft, pending_approval (an agent's post waiting for a person), scheduled, publishing, published, partial, failed or canceled |
targets | TargetView[] | |
updated_at | date-time | |
version | integer | Grows with each edit; PATCH sends the one it read. |
warnings | string[] | Only in POST's answer with gate_id: what to know about the page's link (its cost on X, a page the post waits for). |
PartView
| Name | Type | Description |
|---|---|---|
media | MediaView[] | |
text | string | The text. |
TargetView
| Name | Type | Description |
|---|---|---|
account | object | |
account.avatar_url | string | |
account.handle | string | |
account.id | string | |
account.name | string | |
account.provider | string | x, bluesky, threads or linkedin |
account.status | string | active, needs_reconnect, or disconnected once the account was removed |
error | string | Why the channel failed, for people. |
error_code | string | Why the channel failed: a stable machine code. |
id | string | The post's channel. |
metrics | object | The latest counts once one was read, on plans with analytics (the fields of GET /api/v1/posts/{id}/metrics' points). |
metrics_limited | boolean | It went out past the plan's analysed posts of the month and is never read. |
next_attempt_at | date-time | null | When a pending channel is tried next (null: a draft's). |
parts | PartView[] | null | Own wording; null = the post's. |
published_at | date-time | null | When the channel went out. |
status | string | awaiting_approval, pending, publishing, published, failed or canceled |
title | string | The channel's title, where its network takes one. |
url | string | The post on the network, once it went out. |
PostInput
| Name | Type | Description |
|---|---|---|
gate_id | string | Optional (scope gates:read). A gated page (GET /api/v1/gates): its address goes at the end of the first part, and of each channel's own wording, unless it is there already. A page not published yet cannot go out now (gate_not_published); queued or a draft, the post waits until the page is published. |
parts required | Part[] | |
schedule required | Schedule | |
targets required | Target[] |
Part
| Name | Type | Description |
|---|---|---|
media_ids | string[] | A media id (POST /api/v1/media). |
text required | string | The text. |
Schedule
| Name | Type | Description |
|---|---|---|
at | date-time | Required for modes at and day (RFC 3339). |
mode required | string | queue: the accounts' next free slot, moved a few minutes either side when the workspace's owner turned on the queue's jitter; at: exactly at; day: at, unless the accounts post at that minute already; then the day's nearest free slot. |
Target
| Name | Type | Description |
|---|---|---|
account_id required | string | A connected account (GET /api/v1/accounts). |
parts | Part[] | null | Own wording; null = the post's. |
title | string | The channel's title where its network takes one (a pin's, a video's: max_title and title_required in GET /api/v1/limits), on one line; other networks ignore it. |
PostPatch
PostMetrics
| Name | Type | Description |
|---|---|---|
post_id | string | |
targets | object[] | |
targets[].account | object | |
targets[].available | boolean | false: the network's counts cannot be read (LinkedIn) |
targets[].latest | object | null | the latest of points |
targets[].next_at | date-time | null | |
targets[].next_point | string | the point read next ("" when none) |
targets[].points | object[] | point (1h, 24h or 7d), read_at, impressions, likes, reposts, replies, quotes, bookmarks, url_clicks, profile_clicks (null: the network does not give it, as Bluesky gives no impressions), engagements (likes + reposts + replies + quotes + bookmarks) |
targets[].skipped | string[] | a point given up: more than 48 h late |
targets[].state | string | not_published, unavailable, pending, tracking, done, gone (deleted on the network) or over_limit (past the plan's analysed posts of the month: never read) |
targets[].target_id | string |
NextSlot
| Name | Type | Description |
|---|---|---|
at | date-time |
Error
| Name | Type | Description |
|---|---|---|
code required | string | A stable machine code. |
error required | string | A message for people. |
errors | object[] | |
errors[].code | string | |
errors[].error | string | |
errors[].field | string | |
field | string | The input it is about. |