calmposts

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 customer

Scope
accounts:read
Answer
200 AccountList
NameInTypeDescription
customer_id querystringOnly 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
200 CustomerList

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
200 GateList

POST /api/v1/gates

Create a gated page (a draft)

Scope
gates:write
Body
GateInput
Answer
201 GateView

GET /api/v1/gates/{id}

Get a gated page

Scope
gates:read
Answer
200 GateView
NameInTypeDescription
id
required
pathstringThe gated page's id.

PATCH /api/v1/gates/{id}

Edit a gated page (what the body leaves out stays)

Scope
gates:write
Body
GatePatch
Answer
200 GateView
NameInTypeDescription
id
required
pathstringThe 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
200 LeadList
NameInTypeDescription
id
required
pathstringThe gated page's id.
offset querystringAddresses to skip.
limit querystringPage 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
200 GateView
NameInTypeDescription
id
required
pathstringThe 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
200 GateView
NameInTypeDescription
id
required
pathstringThe gated page's id.

GET /api/v1/gates/{id}/stats

A gated page's counts by day

Scope
gates:read
Answer
200 GateStats
NameInTypeDescription
id
required
pathstringThe gated page's id.
days querystringHow 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
200 Limits

POST /api/v1/media

Upload an image, GIF or video (multipart: file, alt?)

Scope
media:write
Body
multipart/form-data
Answer
201 MediaView
NameTypeDescription
alt stringDescription 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
201 UploadTicket

GET /api/v1/posts

List posts

Scope
posts:read
Answer
200 PostList
NameInTypeDescription
status querystringComma-separated statuses: draft, pending_approval, scheduled, publishing, published, partial, failed, canceled.
account_id querystringOnly posts that go to this account.
customer_id querystringOnly posts that go to at least one channel of this customer (GET /api/v1/customers).
from querystringScheduled at or after (RFC 3339).
to querystringScheduled before (RFC 3339).
q querystringPart of a post's text.
limit querystringPage size (default 50, at most 500).
offset querystringPosts to skip.

POST /api/v1/posts

Create a post (draft, queue, at or now)

Scope
posts:write
Body
PostInput
Answer
201 PostView

GET /api/v1/posts/{id}

Get a post

Scope
posts:read
Answer
200 PostView
NameInTypeDescription
id
required
pathstringThe post's id.

PATCH /api/v1/posts/{id}

Edit a draft or scheduled post (what the body leaves out stays)

Scope
posts:write
Body
PostPatch
Answer
200 PostView
NameInTypeDescription
id
required
pathstringThe post's id.

DELETE /api/v1/posts/{id}

Delete a post (a scheduled one is canceled)

Scope
posts:write
Answer
204 no body
NameInTypeDescription
id
required
pathstringThe 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
200 PostMetrics
NameInTypeDescription
id
required
pathstringThe post's id.

POST /api/v1/posts/{id}/retry

Send the failed channels again, now

Scope
posts:write
Answer
200 PostView
NameInTypeDescription
id
required
pathstringThe post's id.

GET /api/v1/queue/next

The accounts' next free posting slot

Scope
posts:read
Answer
200 NextSlot
NameInTypeDescription
account_ids querystringComma-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

NameTypeDescription
items Account[]

Account

NameTypeDescription
capabilities object | null
char_limit integer
customer object | nullThat customer: {id, name, color}; null when none.
customer_id string | nullThe customer the channel is grouped under; null when none.
handle string
id string
provider string
status stringactive or needs_reconnect

CustomerList

NameTypeDescription
items Customer[]

Customer

NameTypeDescription
account_ids string[]A channel of this customer (GET /api/v1/accounts).
color stringOne of slate, red, orange, amber, emerald, teal, sky, indigo, violet, pink.
id string
name stringUnique in the workspace, case aside; at most 60 characters.
sort integerOrders the list before the name.

GateList

NameTypeDescription
handle stringThe workspace's address; empty: none yet.
items object[]
limit integerThe plan's cap; -1: none.
used integerPages counting toward the plan (published or paused).

GateInput

NameTypeDescription
content
required
GateBlock[]What the steps unlock.
hide_badge booleanHide «Made with calmposts» (plans that allow it).
slug stringIts 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
stringThe page's title.

GateBlock

NameTypeDescription
alt stringThe image's description for screen readers.
media_id stringAn image (POST /api/v1/media).
text stringA heading's or a text's words (text takes **bold**, *italic* and [links](https://…)), a button's label.
type
required
string
url stringWhere a button leads (http or https).

GateStep

NameTypeDescription
account_id stringAn 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
stringWhat the visitor does.
post_gone booleanRead-only: X says the post is gone; the step is hidden until another post is linked.
post_id stringFor 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 stringOptional. What X's reply box starts with (the visitor may change it).

GateTeaser

NameTypeDescription
cover_media_id stringOptional. A cover image (POST /api/v1/media).
subtitle stringA line under the title.
text stringWhat the visitor gets, shown before the steps.

GateView

NameTypeDescription
block_reason stringWhy a moderator took it down: phishing, spam, illegal, rights or other.
block_text stringThe moderator's words.
content GateBlock[]What the steps unlock.
created_at date-time
hide_badge booleanHide «Made with calmposts» (plans that allow it).
id string
publish_asked_at date-time | nullWhen it asked.
publish_asked_by stringThe 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 | nullWhen it was first published.
slug stringIts address after /@handle/ (lowercase letters, digits, hyphens); empty: made from the title. Fixed once published.
status stringdraft, 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 stringThe page's title.
updated_at date-time
url stringThe page's public address; empty while the workspace has no handle.
waits_for_person booleanOnly in publish's answer: the page waits for a person to publish it.
workspace_id string

GatePatch

NameTypeDescription
content GateBlock[]What the steps unlock.
hide_badge booleanHide «Made with calmposts» (plans that allow it).
slug stringIts 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 stringThe page's title.

LeadList

NameTypeDescription
items object[]
items[].address stringThe email, lowercased.
items[].created_at date-time
items[].id string
items[].lang stringThe language the visitor read the page in (en, ru, de).
total integer

GatePublish

NameTypeDescription
handle stringOptional. The workspace's address (calmposts.com/@handle) when it has none yet.

GateStats

NameTypeDescription
days object[]
days[].counts objectBy metric: view, unlock, email and step clicks (click_follow, click_reply, …).
days[].day stringYYYY-MM-DD
from stringThe first day (YYYY-MM-DD, UTC).
to stringThe last day.
totals objectBy metric: view, unlock, email and step clicks (click_follow, click_reply, …).

Limits

NameTypeDescription
billing Usage
networks NetworkLimits[]
timezone stringIANA zone

Usage

NameTypeDescription
plan objectThe plan: {code, name, limits}; code none while the workspace has no plan.
subscription object | nullnull for a workspace that never subscribed.
trial_days integerThe trial a checkout starts with now; 0 for none.
usage objectPer metric (posts_per_day, link_posts_per_month, …): {used, limit, period}.

NetworkLimits

NameTypeDescription
accounts integerThe workspace's accounts on it.
available booleanfalse: calmposts cannot post to this network now.
counting stringweighted (X: links count as link_length, emoji and CJK twice) or graphemes
link_length integerWhat a link counts as; 0: as written.
link_surcharge booleanA post with a link costs more on the network (X).
max_chars integerThe characters a post may have.
max_images integer
max_text_bytes integerThe UTF-8 bytes a post's text may have after NFC (Bluesky: 3000); absent: no such cap.
max_thread_parts integer0: no threads.
max_title integerThe characters (Unicode code points) of a channel's title; absent: no titles.
max_videos integer
name stringThe network's name.
provider string
requires_media booleanA post needs an image or a video.
thread_as_one booleanA thread goes out as one post, its parts joined (LinkedIn).
title_required booleanA post needs a title here.

MediaView

NameTypeDescription
alt string
height integer
id string
kind stringimage, gif or video
mime string
size integer
url string
width integer

UploadRequest

NameTypeDescription
alt stringOptional. The file's description for screen readers (at most 1000 characters).

UploadTicket

NameTypeDescription
chunk_bytes integerThe part size to send a large file in.
command stringA 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-timeThe URL takes no file after this.
max_bytes integerThe largest video it takes.
max_image_bytes integerThe largest image or GIF it takes.
media_id stringThe id the file gets: pass it in a part's media_ids once the PUT answered 201.
method stringAlways PUT.
types string[]A MIME type it takes (sniffed from the bytes).
upload_url stringPUT 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

NameTypeDescription
items PostView[]
total integer

PostView

NameTypeDescription
approval object | nullThe 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 | nullThe credential: {kind: api_key|oauth, name}; null for a person.
author.former booleanNo longer a member of the workspace.
author.kind stringmember (a person wrote it) or agent (an API key or a connector)
author.name stringTheir name
author.user_id stringThe 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 | nullWhen it went out.
scheduled_at date-time | nullWhen it goes out.
source stringweb, api or mcp
status stringdraft, pending_approval (an agent's post waiting for a person), scheduled, publishing, published, partial, failed or canceled
targets TargetView[]
updated_at date-time
version integerGrows 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

NameTypeDescription
media MediaView[]
text stringThe text.

TargetView

NameTypeDescription
account object
account.avatar_url string
account.handle string
account.id string
account.name string
account.provider stringx, bluesky, threads or linkedin
account.status stringactive, needs_reconnect, or disconnected once the account was removed
error stringWhy the channel failed, for people.
error_code stringWhy the channel failed: a stable machine code.
id stringThe post's channel.
metrics objectThe latest counts once one was read, on plans with analytics (the fields of GET /api/v1/posts/{id}/metrics' points).
metrics_limited booleanIt went out past the plan's analysed posts of the month and is never read.
next_attempt_at date-time | nullWhen a pending channel is tried next (null: a draft's).
parts PartView[] | nullOwn wording; null = the post's.
published_at date-time | nullWhen the channel went out.
status stringawaiting_approval, pending, publishing, published, failed or canceled
title stringThe channel's title, where its network takes one.
url stringThe post on the network, once it went out.

PostInput

NameTypeDescription
gate_id stringOptional (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

NameTypeDescription
media_ids string[]A media id (POST /api/v1/media).
text
required
stringThe text.

Schedule

NameTypeDescription
at date-timeRequired for modes at and day (RFC 3339).
mode
required
stringqueue: 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

NameTypeDescription
account_id
required
stringA connected account (GET /api/v1/accounts).
parts Part[] | nullOwn wording; null = the post's.
title stringThe 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

NameTypeDescription
parts Part[]
schedule Schedule
targets Target[]
version
required
integerThe version the edit was made from.

PostMetrics

NameTypeDescription
post_id string
targets object[]
targets[].account object
targets[].available booleanfalse: the network's counts cannot be read (LinkedIn)
targets[].latest object | nullthe latest of points
targets[].next_at date-time | null
targets[].next_point stringthe 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 stringnot_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

NameTypeDescription
at date-time

Error

NameTypeDescription
code
required
stringA stable machine code.
error
required
stringA message for people.
errors object[]
errors[].code string
errors[].error string
errors[].field string
field stringThe input it is about.

REST API guide