SDKs: install and use the OmniSocials API in 8 languages
Official client libraries for the OmniSocials API in 8 languages. Every SDK has the
same shape: resource-based clients (client.posts.create(...)), typed requests and
responses, automatic retries with backoff, a shared error hierarchy, and a webhook
signature verification helper. Pick your language and you are posting in five lines.
These pages are the reference. For an overview of the SDKs and what you can build with them, see omnisocials.com/sdk.
Install
Each language has its own page with full examples: install, auth, posting, media, analytics, the social inbox, Pinterest product tags, webhooks, and error handling.
| Language | Package | Install | Docs |
|---|---|---|---|
| Node.js / TypeScript | @omnisocials/sdk | npm install @omnisocials/sdk | Node.js |
| Python | omnisocials | pip install omnisocials | Python |
| Go | github.com/OmniSocials/omnisocials-go | go get github.com/OmniSocials/omnisocials-go | Go |
| Ruby | omnisocials | gem install omnisocials | Ruby |
| Java | com.omnisocials:omnisocials-java | Maven / Gradle dependency | Java |
| PHP | omnisocials/omnisocials-php | composer require omnisocials/omnisocials-php | PHP |
| .NET | OmniSocials | dotnet add package OmniSocials | .NET |
| Rust | omnisocials | cargo add omnisocials | Rust |
All 8 cover the full v1 surface: posts (including create-and-publish, retrying the
failed platforms of a failed or partially failed post via posts.retry, approving or
rejecting a post waiting in an approval workflow via posts.approve / posts.reject
(with the optional step_order of the step you reviewed),
reading the review of a post (steps, approvers, the rejection reason and the comment
thread) via posts.getApproval,
per-platform options, and thread chains on X, Bluesky, Mastodon, and Threads), media (URL, base64, multipart, PDF
carousels, presigned large-file uploads), folders, hashtag sets (CRUD plus applying
a set at post create via hashtag_set / hashtag_placement), post tags (CRUD, bulk
tagging, the tag filter and the tag comparison in analytics), approval workflows
(approvalWorkflows.list), accounts (with the X statistics setting via
accounts.update), analytics (post, bulk, overview, accounts, best times, and
Update now on X via analytics.refreshPost), credits (credits.get), Instagram locations, Instagram Reel
music search, Pinterest product Pins for product tags (pinterest.listProducts,
pinterest.validateProduct), automations (comment-to-DM on Instagram and Facebook,
DM keywords on X, how one automation did via automations.results, and one person's story via automations.eventStory), the social inbox, and webhooks (CRUD plus secret rotation and signature verification).
Post tags
Every SDK has a tags resource for post tags: your workspace's own labels for posts
(a hook style, a format, a campaign), to filter posts and compare how each tag did.
Tags never go to a platform. A tag is { id, name, color, created_at }. It uses the
posts:read / posts:write scopes; the comparison uses analytics:read.
| Method (Node names) | What it does |
|---|---|
tags.list(), tags.create({ name, color? }), tags.update(id, params), tags.delete(id) | Manage the workspace's tags. Delete takes the tag off every post. |
tags.apply({ post_ids, add?, remove?, set? }) | Adds, removes or replaces the tags of up to 500 posts, published ones included. |
analytics.tags({ start_date?, end_date?, platform?, min_posts? }) | Compares each tag with your normal: vs_normal (0.38 = 38% above), enough_posts, untagged. |
tags on posts.create / posts.update (ids or names, a new name becomes a tag;
null or [] on update removes them) and tag on posts.list / analytics.overview
(an id or name, several = any of them) work the same way. Every post carries tags
and trial_reel.
TypeScript
X statistics
X bills every read of a post's statistics, and OmniSocials passes that price on as credits. Every SDK can change how often an X account is read, check one post now and read the credit balance. See X statistics and credits for the prices and the rules.
| Method (Node names) | What it does |
|---|---|
accounts.update(id, { x_statistics }) | Sets posts (full = 5 checks, light = 2 checks, off) and followers (daily, weekly, off) of an X account. Send one key or both. Needs the opt-in accounts:write scope and billing rights for the key's creator. |
analytics.refreshPost(postId) | "Update now": reads the X numbers of one published post now. credits_used says what it cost (0 when the post was already read that UTC day). |
credits.get() | The balance, this month's use per reason and the X statistics overview with an estimate per account. Needs the opt-in credits:read scope and billing rights for the key's creator. |
Both opt-in scopes come from one switch, Credits and X statistics, when you create
the key. Every account read (accounts.list, accounts.get) carries x_statistics on X accounts.
Because Update now can cost credits, the SDKs retry it only after a 429, never
after a 5xx or a timeout.
TypeScript
Social Inbox
Every SDK has an inbox resource for the DMs, comments and mentions of your connected
accounts. It needs an API key with the opt-in inbox:read / inbox:write scopes.
| Method (Node names) | What it does |
|---|---|
inbox.listConversations() | Lists conversations. Filters: platform, type, unread, unanswered. |
inbox.getMessages(conversationId) | Returns the messages of one conversation. |
inbox.reply(conversationId, { text }) | Sends a reply. Pass message_id on a comment thread. On a Facebook comment, mention_author: true tags the commenter (the answer carries mention). |
inbox.markRead(conversationId) | Marks the conversation as read. |
inbox.hide(messageId) | Hides or unhides a comment on one of your posts. |
inbox.deleteMessage(messageId) | Deletes a comment on one of your posts, or one of your own replies. |
inbox.like(messageId) | Likes or unlikes a Facebook, LinkedIn Page, or TikTok comment as the account. |
inbox.next() | Hands out the next conversation that still needs an answer. |
TypeScript
Each language page has the same calls in its own idiom. See the Social Inbox guide for the platforms, the reply rules and the error codes.
Pinterest product tags
Every SDK has a pinterest resource for product tagging: it lists the product Pins of
the connected Pinterest account, so you can tag up to 24 of them on a Pin with
product_tags in the pinterest options of a post. It uses the posts:read scope.
| Method (Node names) | What it does |
|---|---|
pinterest.listProducts() | Lists product Pins. Filters: source (catalog or pins), product_group_id, bookmark, page_size. |
pinterest.validateProduct(id) | Checks one Pin id or Pin link before you use it as a product tag. |
TypeScript
The list answers with HTTP 200 in both cases: products on success, or an error object
(pinterest_not_connected, pinterest_catalog_access_required, platform_error) when
it could not be read. Only product Pins of your own account can be tagged; products of
other merchants cannot. The tags are added right after the Pin is published. A product
that Pinterest refuses never fails the post: the post then carries
pinterest.product_tags_result with the tagged and the skipped Pin ids. Each language
page has the same calls in its own idiom.
Authentication
Every SDK reads the OMNISOCIALS_API_KEY environment variable, or takes the key in
the constructor. Create a key in the OmniSocials app under Settings → API. Keys
start with omsk_live_; there is no separate test mode.
Terminal
Quickstart
Node.js / TypeScript
TypeScript
Python
Python
SDK names vs REST names
The SDKs send a few fields under other names than the REST examples in these docs. The API accepts both names, so either one works in a raw HTTP body too. If you move between an SDK and raw HTTP (or read both docs), map them like this:
| SDK parameter | REST field |
|---|---|
channels: ["instagram"] | accounts: ["instagram"] |
scheduled_at | schedule_at |
content: "one string" | content: { "default": "one string" } |
Everything else has the same name in both.
A synchronous and an async client (AsyncOmniSocials) ship in the Python package.
The Go, Ruby, PHP, Java, .NET, and Rust clients expose the same resources and methods
adapted to each language's idiom. Full runnable examples for every resource live in
each package's README (linked in the table above).
X link posts use credits. When a create targets X and the text contains a URL,
the create response carries a top-level warnings array next to data (code
x_url_post_credits): X's link-post fee passed through as prepaid credits. Every
SDK returns it as part of the parsed response body (typed as PostWarning in the
Node and Go SDKs). See
Creating Posts for the shape and the
publish-time behavior.
Configuration
Every client accepts the same options: apiKey, baseUrl, timeout (default 30s),
and maxRetries (default 2). Retries use exponential backoff with jitter on 429,
5xx, and network errors, and honor the Retry-After header. Other 4xx responses
are never retried.
Errors
Non-2xx responses raise a typed error from a shared hierarchy: a base error, an API
error carrying status / code / body, and per-status subclasses (authentication,
permission, not-found, validation, rate-limit with retry_after, server), plus a
connection error and a webhook-verification error. See
Rate limits and errors for the status codes.
Webhook verification
Each SDK ships a helper that verifies the X-OmniSocials-Signature header (HMAC-SHA256
over "{timestamp}.{rawBody}", constant-time compare, replay-window check) and returns
the parsed event. Node example:
TypeScript
The events are post.scheduled, post.published, post.failed, post.approved and
post.rejected. The two approval events carry data.approval with status,
decided_by and reason. See Webhooks for event types and payloads.
For 24 hours after a secret rotation, every delivery also carries
X-OmniSocials-Signature-Previous, signed with the old secret (same format, same
timestamp and body). The helpers take one signature and one secret, so to keep
accepting deliveries while you switch secrets, verify X-OmniSocials-Signature with
the new secret and, when that fails, X-OmniSocials-Signature-Previous with the old one:
TypeScript
Approvals
posts.approve and posts.reject take an optional step_order: the current_step
of posts.getApproval, the step you reviewed. When the review is on another step now
(somebody decided since you read it, or a retried call already went through), nothing
is decided and the call fails with 409 step_changed and error.current_step_order,
the step the review is on now. Read the approval again before you decide. Without
step_order the call acts on whatever step is current. The per-language pages show
the exact signature.
Prefer a different integration?
- MCP Server for AI assistants (Claude, ChatGPT, Cursor, and more)
- Agent Skills for AI coding tools without MCP support
- API Reference for the raw HTTP endpoints