PostLoom API
Schedule posts, upload media and read results from your own platform. The API is a JSON REST API at https://social.klixsoft.com/api/v1. Webhooks tell your system when posts are published or fail.
- Authentication · Errors and limits · Endpoints · Publishing a post · Uploading media · Inbox contacts · Auto-reply rules · Webhooks · What changed
Authentication
Create a key in Settings → Developers of your workspace. Send it in the Authorization header (or as X-API-Key: sap_...). A key belongs to one workspace and acts as the person who created it, limited to the permissions (scopes) you chose. Keep keys on your server; never put them in browser or mobile code.
curl https://social.klixsoft.com/api/v1/me \
-H "Authorization: Bearer sap_your_key_here"| Scope | Allows |
|---|---|
accounts:read | Read connected social accounts |
media:read | Read media |
media:write | Upload and delete media |
posts:read | Read posts and their results |
posts:write | Create, edit and delete posts (drafts) |
posts:publish | Schedule and publish posts |
webhooks:manage | Manage webhook endpoints |
inbox:read | Read inbox conversations and messages |
inbox:write | Reply to conversations and change their status |
automations:manage | Manage auto-reply rules and settings |
analytics:read | Read analytics: post engagement and follower counts |
Errors and limits
Errors use HTTP status codes and a JSON body:
{ "error": { "code": "VALIDATION", "message": "Select at least one account", "details": { "issues": [...] } } }- Success:
200, or201when a request creates something (POST /posts,/media,/webhooks,/conversations/<id>/messages). 401missing or revoked key ·403missing scope ·404not found ·409conflict ·422invalid input ·402plan limit reached (PLAN_LIMIT) ·429too many requests.- 120 requests per minute per key (60 for creating and changing posts).
- Idempotency: send an
Idempotency-Keyheader (any unique string, e.g. a UUID) withPOST /postsandPOST /media. Retrying with the same key and body within 24 hours returns the first response instead of creating a duplicate. - Times are ISO 8601 with an offset, e.g.
2026-11-02T09:30:00+01:00. Responses are in UTC.
Endpoints
All paths are relative to https://social.klixsoft.com/api/v1.
| Method | Path | Scope | Description |
|---|---|---|---|
GET | /me | — | Workspace, plan, limits and the key’s scopes |
GET | /accounts | accounts:read | Connected social accounts |
GET | /media | media:read | List media (query: folderId, q, kind, status, page) |
POST | /media | media:write | Start an upload; returns a presigned URL |
POST | /media/{id}/complete | media:write | Finish an upload and process it |
GET | /media/{id} | media:read | Media details and processing status |
DELETE | /media/{id} | media:write | Delete a file (not used by a post) |
GET | /posts | posts:read | List posts (query: from, to, status, externalId, limit) |
POST | /posts | posts:write | Create a draft, schedule or publish now |
POST | /posts/validate | posts:write | Check a post against each network’s rules without saving |
GET | /posts/{id} | posts:read | Post with per-account status, URL and error |
PUT | /posts/{id} | posts:write | Replace a post that has not been published |
DELETE | /posts/{id} | posts:write | Delete a post |
POST | /posts/{id}/cancel | posts:write | Cancel a scheduled post |
POST | /posts/{id}/retry | posts:publish | Retry the accounts that failed |
GET | /conversations | inbox:read | Inbox conversations (query: status, channelId, assignee, kind, q, before) |
GET | /conversations/{id} | inbox:read | One conversation: contact, contact details (email, phone, profile, the same person on other channels) and reply window |
PATCH | /conversations/{id} | inbox:write | Change status (open, pending, closed) or assignee |
GET | /conversations/{id}/messages | inbox:read | Messages, newest first (query: before) |
POST | /conversations/{id}/messages | inbox:write | Reply: body, mediaIds, or an internal note |
PATCH | /contacts/{id} | inbox:write | Set a contact’s name, email, phone or notes (email and phone link the person across channels) |
PUT | /messages/{id}/hidden | inbox:write | Hide a customer’s comment on Facebook, Instagram or YouTube, or show it again ({ "hidden": true | false }) |
GET | /auto-replies | inbox:read | Auto-reply rules in the order they are checked, and the settings |
POST | /auto-replies | automations:manage | Create a rule (added last) |
PUT | /auto-replies/{id} | automations:manage | Replace a rule |
DELETE | /auto-replies/{id} | automations:manage | Delete a rule |
PUT | /auto-replies/order | automations:manage | Set the order: { "ids": [...] }, first is checked first |
PATCH | /auto-replies/settings | automations:manage | On/off, per-person limit and pause after a team reply (minutes) |
POST | /auto-replies/test | inbox:read | Which rule would answer a text, and what it would send (sends nothing) |
GET | /auto-replies/activity | inbox:read | What the rules did recently, or why they skipped |
POST | /ai/captions | posts:write | Three caption options for a topic (topic, platforms, tone, length, hashtags, emojis, language). Uses one AI credit |
GET | /analytics?from=&to=&platform=&accountIds= | analytics:read | Engagement totals vs the previous period, daily series, top posts, followers per account |
GET | /webhooks | webhooks:manage | List webhook endpoints |
POST | /webhooks | webhooks:manage | Add an endpoint; returns its signing secret once |
PATCH | /webhooks/{id} | webhooks:manage | Change url, events or description; turn on/off (isActive) |
DELETE | /webhooks/{id} | webhooks:manage | Remove an endpoint |
Publishing a post
Get your account ids from GET /accounts, then create the post. action is draft, schedule (with scheduledAt) or publish_now. Without the posts:publish scope, or when the workspace requires approval, the post waits for approval in the app. Use externalId to store your own id for the post.
curl -X POST https://social.klixsoft.com/api/v1/posts \
-H "Authorization: Bearer sap_your_key_here" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 6f1c2a8e-order-1234" \
-d '{
"externalId": "order-1234",
"caption": "Our autumn menu is here!",
"mediaIds": ["<media id>"],
"targets": [
{ "socialAccountId": "<facebook page id>" },
{ "socialAccountId": "<instagram id>", "captionOverride": "Autumn menu 🍂 #coffee" }
],
"action": "schedule",
"scheduledAt": "2026-11-02T09:30:00+01:00"
}'The response is the post. Each entry in targets has its own status (scheduled, publishing, published, failed…), platformUrl once published and lastError when it failed. Poll GET /posts/{id} or use webhooks.
Per-network options
- Instagram:
"options": { "instagramType": "story" }for a story,"feed_story"for the feed and a story in one request (default: feed post, carousel or reel). Withfeed_storythe post gets two targets for that account, a feed one and a story one, each with its own status and URL. - TikTok:
"options": { "tiktokPrivacy": "PUBLIC_TO_EVERYONE" }(required), plustiktokDisableComment,tiktokDisableDuet,tiktokDisableStitch. - Facebook / LinkedIn:
"options": { "link": "https://..." }to share a link. - YouTube (one video):
"options": { "youtubeTitle": "My video", "youtubePrivacy": "public", "youtubeMadeForKids": false }. The caption is the description. Optional:youtubeShort,youtubeTags(comma separated),youtubeCategoryId,youtubePlaylistId,youtubeThumbnailMediaId(an image from your media),youtubeNotifySubscribers. - Bluesky:
altTextfor images. Threads needs no options.
Uploading media
Uploads go straight to storage in three steps:
# 1. Ask for an upload URL
curl -X POST https://social.klixsoft.com/api/v1/media -H "Authorization: Bearer sap_..." -H "Content-Type: application/json" \
-d '{ "fileName": "menu.jpg", "mime": "image/jpeg", "size": 482113 }'
# → { "media": { "id": "...", "status": "uploading" }, "uploadUrl": "https://...", "headers": { "Content-Type": "image/jpeg" } }
# 2. Upload the file to uploadUrl with those headers
curl -X PUT "<uploadUrl>" -H "Content-Type: image/jpeg" --data-binary @menu.jpg
# 3. Tell us it is done, then wait until status is "ready"
curl -X POST https://social.klixsoft.com/api/v1/media/<id>/complete -H "Authorization: Bearer sap_..."
curl https://social.klixsoft.com/api/v1/media/<id> -H "Authorization: Bearer sap_..."Images: JPEG, PNG, WebP. Videos: MP4, MOV, WebM. Upload URLs expire after 15 minutes; send the exact Content-Type and file size you declared.
Inbox contacts
GET /conversations/{id} returns the person in contact and more in contactDetails:
"contactDetails": {
"email": "jane@example.com", // added by your team or with PATCH /contacts/{id}
"phone": "+977 981-2345678", // added by your team; Meta never shares it for Messenger/Instagram
"profile": { "followers": 2380, "verified": false, "followsYou": true }, // Instagram
"profileSyncedAt": "2026-10-16T09:12:00Z",
"linked": [ // the same person on your other channels
{ "contactId": "…", "channelType": "telegram", "name": "Jane", "username": null,
"conversationId": "…", "matchedBy": "phone" }
]
}People are linked when their email matches, or their phone numbers end in the same 9 digits (so +977 981-2345678 and 9779812345678 match). Set them with:
curl -X PATCH https://social.klixsoft.com/api/v1/contacts/<contactId> -H "Authorization: Bearer sap_..." -H "Content-Type: application/json" -d '{ "email": "jane@example.com", "phone": "+977 981-2345678" }'Webhooks
Add an endpoint (an HTTPS URL on your server) in Settings → Developers or with POST /webhooks. We send a POST with a JSON body for each event you subscribe to. Create one with { "url": "https://...", "events": ["post.published", "post.failed"] }; the response contains the signing secret, shown only once.
| Event | When |
|---|---|
post.published | Every account of a post was published |
post.partially_failed | Some accounts were published, some failed |
post.failed | No account could be published |
account.expired | A connected account must be reconnected |
media.ready / media.failed | An upload finished processing |
message.received | A new message arrived in the inbox |
POST https://your-server.example/webhooks/postora
X-Webhook-Id: 3b0c... (the event id: the same on retries and re-sends; use it to ignore duplicates)
X-Webhook-Event: post.published
X-Webhook-Signature: t=1793000000,v1=5f2b...
{ "id": "3b0c...", "type": "post.published", "createdAt": "2026-11-02T08:30:04Z",
"workspaceId": "...", "data": { "post": { "id": "...", "externalId": "order-1234", "status": "published", "targets": [...] } } }Verify the signature: compute HMAC-SHA256 of `${t}.${rawBody}` with your endpoint’s signing secret and compare it with v1. Reject requests where t is more than 5 minutes old.
import crypto from 'node:crypto';
function verify(rawBody, header, secret) {
const { t, v1 } = Object.fromEntries(header.split(',').map((p) => p.split('=')));
const expected = crypto.createHmac('sha256', secret).update(`${t}.${rawBody}`).digest('hex');
const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
return fresh && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
}Answer with any 2xx status within 10 seconds. Failed deliveries are retried with increasing delays for about a day; an endpoint that keeps failing is turned off and the workspace owner is emailed.
Auto-reply rules
Rules answer new messages and comments without a person. For each one, rules are checked in order and the first match runs. A rule has:
scope:messages,commentsorboth.match:any_words,all_words,exact,starts_with(withkeywords),any_messageorfirst_message. Capital letters and accents are ignored; words match whole words only.channelIds(empty = all) and, for comments,postIds(platform post ids; empty = all posts).actions:reply,publicReply,privateReply(lists of 1–3 versions, one picked at random;{first_name},{name},{business_name}are filled in),hide,assigneeId,close.
curl -X POST https://social.klixsoft.com/api/v1/auto-replies -H "Authorization: Bearer sap_..." -H "Content-Type: application/json" -d '{
"name": "Price campaign",
"scope": "comments",
"match": "any_words",
"keywords": ["price", "how much"],
"postIds": ["17890012345678901"],
"actions": { "publicReply": ["Sent you a DM 📩"], "privateReply": ["Hi {first_name}! Prices: …"] }
}'Private replies work on Facebook and Instagram (once per comment, within 7 days); hiding works on Facebook, Instagram and YouTube. A rule answers the same person at most once per personCooldownMinutes (default 12 hours) and stays quiet for pauseMinutes (default 60) after a team member replied. Automatic messages carry "isAutoReply": true and an author of "Auto-reply · rule name".
What changed
- November 2026. Auto-reply rules for messages and comments (
/auto-replies, new scopeautomations:manage) and hiding comments (PUT /messages/{id}/hidden). Messages includeisAutoReplyandhiddenAt. - October 2026. Requests that create something answer
201 Created(they answered200). Keys are also accepted in anX-API-Keyheader. Unknown endpoints answer a JSON404. Instagram"instagramType": "feed_story"posts to the feed and a story in one target. Conversations includecontactDetails; newPATCH /contacts/{id}. Links in webhooks and emails point to/portal/<workspace>/…(old/o/…links still redirect).