Expand description
§OmniSocials Rust SDK
The official Rust client for the OmniSocials API: schedule and publish social media posts to Instagram, Facebook, LinkedIn, YouTube, TikTok, X, Pinterest, Bluesky, Threads, Mastodon, and Google Business from one API.
use omnisocials::{Client, CreatePostParams};
#[tokio::main]
async fn main() -> Result<(), omnisocials::Error> {
let client = Client::from_env()?; // reads OMNISOCIALS_API_KEY
let post = client
.posts()
.create(CreatePostParams {
content: "Hello from the SDK".into(),
channels: Some(vec!["instagram".into(), "linkedin".into()]),
scheduled_at: Some("2026-08-01T09:00:00Z".into()),
..Default::default()
})
.await?;
println!("created {}", post["data"]["id"]);
Ok(())
}All methods return the parsed response body as a serde_json::Value,
as-is (single items as {"data": {...}}, lists as
{"data": [...], "pagination": {...}}); 204 No Content returns
serde_json::Value::Null. Retries on 429 / 5xx / connection errors are
automatic, with exponential backoff and Retry-After support.
Webhook deliveries are verified with
webhooks::verify_signature.
Modules§
- resources
- Resource accessors, one per API endpoint group. Obtain them from
crate::Client:client.posts(),client.media(), and so on. - webhooks
- Webhook signature verification (Stripe-style scheme).
Structs§
- Account
Analytics Params - Query for
GET /analytics/accounts. - AdBudget
- A campaign budget, in MAJOR currency units (10 = 10 EUR). Network minimums apply (for example TikTok 20 a day).
- AdDraft
Ad - One ad of a draft: written once, mapped onto every network.
- AdDraft
Params - Body for
POST /ads/draftsandPUT /ads/drafts/:group_id(the full draft; seecrate::resources::AdDrafts::create). - AdDraft
Schedule - How long a draft runs.
- AdDraft
Targeting - Who a draft reaches.
- AdMedia
File - One picture or video of a draft ad.
- AdPlacement
Media - Extra files for one kind of placement.
- AdSchedule
- When a campaign runs (ISO 8601 datetimes).
- Analytics
Overview Params - Query for
GET /analytics/overview. - Apply
Tags Params - Body for
POST /tags/apply: change the tags of up to 500 posts at once, published ones included. - Approve
Post Params - Body for
POST /posts/:id/approve(seecrate::resources::Posts::approve_with). - Attach
AdDraft Account Params - Body for
POST /ads/drafts/:group_id/account(seecrate::resources::AdDrafts::attach_account). - Best
Times Params - Query for
GET /analytics/best-times. - Boost
Post Multi Params - Body for
POST /ads/boost-multi(seecrate::resources::Ads::boost_multi): one draft boost per ad account, each with the SAME budget. - Boost
Post Params - Body for
POST /ads/boost(seecrate::resources::Ads::boost). - Check
Media Params - Body for
POST /media/check. Provide one of: a publicurl, an existingmedia_id, orsize_bytes+mime. - Client
- Async client for the OmniSocials API.
- Client
Builder - Builder for
Client. Created viaClient::builder. - Create
Automation Params - Body for
POST /automations(seecrate::resources::Automations::create). - Create
Feature Request Params - Body for
POST /feature-requests. - Create
Folder Params - Body for
POST /folders. - Create
Hashtag SetParams - Body for
POST /hashtag-sets. - Create
Post Params - Body for
POST /posts/createandPOST /posts/create-and-publish. - Create
TagParams - Body for
POST /tags. - Create
Webhook Params - Body for
POST /webhooks. - GetMessages
Params - Query for
GET /inbox/conversations/:id/messages. - Keyword
Metrics Params - Body for
POST /ads/research/keywords/metrics(seecrate::resources::Ads::keyword_metrics). - Keyword
Research Params - Body for
POST /ads/research/keywords(seecrate::resources::Ads::research_keywords). Givekeywords,urlor both. - Launch
AdDraft Params - Body for
POST /ads/drafts/:group_id/launch(seecrate::resources::AdDrafts::launch). Giveconfirm_budget_amount(one daily amount for every network) orconfirm_budget_amounts(per campaign id). Each must equal that campaign’s daily amount, else400 budget_confirmation_requiredand nothing is written. Needs a key withads:spend: without it the call answers403 start_in_appwith the draft’s page. A network inapi_draft_only(Google) is skipped with codestart_in_app. - List
AdCampaigns Params - Query for
GET /ads/campaigns(seecrate::resources::Ads::list). Every field is optional. - List
Automation Events Params - Query for
GET /automations/:id/events(seecrate::resources::Automations::list_events). Every field is optional. - List
Automations Params - Query for
GET /automations(seecrate::resources::Automations::list). Every field is optional. - List
Conversations Params - Query for
GET /inbox/conversations. - List
Limits Params - Query for
GET /limits. - List
Media Params - Query for
GET /media. - List
Pinterest Products Params - Query for
GET /pinterest/products(seecrate::resources::Pinterest::list_products). Every field is optional. - List
Posts Params - Query for
GET /posts. - Next
Unanswered Params - Query for
GET /inbox/next. All fields are optional. - Recent
Platform Posts Params - Query for
GET /posts/recent-platform. - Reject
Post Params - Body for
POST /posts/:id/reject(seecrate::resources::Posts::reject_with). - Reply
Params - Body for
POST /inbox/conversations/:id/reply. - Search
Locations Params - Query for
GET /locations/search(seecrate::resources::Locations::search_with). - TagAnalytics
Params - Query for
GET /analytics/tags. - Update
Account Params - Body for
PATCH /accounts/{id}. - Update
AdCampaign Params - Body for
PATCH /ads/campaigns/:id(seecrate::resources::Ads::update). Every field is optional. A draft changes withads:write. A campaign that reached the network changes only with a key that hasads:spend(never on Google); without it the call answers403 start_in_app. - Update
Automation Params - Body for
PATCH /automations/:id(seecrate::resources::Automations::update). Every field is optional; a body with nothing is a400 no_fields. - Update
Folder Params - Body for
PATCH /folders/:id. - Update
Hashtag SetParams - Body for
PATCH /hashtag-sets/:id. - Update
Media Params - Body for
PATCH /media/:id. - Update
Post Params - Body for
PATCH /posts/:id. - Update
TagParams - Body for
PATCH /tags/:id. A field leftNonekeeps its value. - Update
Webhook Params - Body for
PATCH /webhooks/:id. - Upload
Media From Base64 Params - Body for
POST /media/upload-from-base64. - Upload
Media From UrlParams - Body for
POST /media/upload-from-url. - Upload
Media Params - Multipart body for
POST /media/upload(max 50MB for images, 100MB request cap overall; useupload_from_urlorcreate_upload_urlfor larger videos, up to 1GB). - UserTag
- An Instagram user tag positioned on an image.
- XStatistics
Input - The X statistics change. Set one field or more; a
Nonefield is left out and keeps its value. - XStatistics
Post Schedule - A custom check schedule (OmniSocials Connect keys, with
posts: "custom").
Enums§
- AdDraft
Platform - One network of
AdDraftParams::platforms: a network key, or a key with its own daily amount or ad account. - Content
- Post caption: either a single string used everywhere, or a per-platform
map with a
defaultkey (e.g.{"default": "...", "x": "..."}). - Error
- All errors returned by this crate.
- Hashtags
- The tags of a hashtag set: a list of tags, or one string of tags.
- Media
Entry - One media entry, optionally carrying alt text (accessibility description, max 1500 chars). Alt text is delivered to Mastodon (media description), Bluesky (embed alt), X (photo/GIF media metadata), Pinterest (pin alt_text fallback), Instagram (images), and LinkedIn (images). Plain and alt-carrying entries can be mixed in the same list.
- Media
Refs - Media attachments: either a list shared by all platforms, or a
per-platform map (e.g.
{"instagram": ["id1"], "x": ["id2"]}). The*Entriesvariants acceptMediaEntryvalues for per-media alt text. - TagRef
- One tag in a list of tags: a tag id, or a tag name. A name matches
case-insensitively; a new name in
tagson a post, or inadd/setofApplyTagsParams, becomes a tag of the workspace.
Constants§
- VERSION
- Crate version, used in the
User-Agentheader. - X_
STATISTICS_ WEBHOOK_ EVENTS - The X statistics webhook events:
x_statistics.paused(the organisation’s X statistics stopped at 0 credits) andx_statistics.resumed(they started again after a top-up). One delivery per workspace with X;datais{ workspace_id, account_id, reason }withreasoninsufficient_creditsorcredits_added.