Skip to main content

Module posts_api

Module posts_api 

Source

Enums§

BulkUploadPostsError
struct for typed errors of method bulk_upload_posts
CreatePostError
struct for typed errors of method create_post
DeletePostError
struct for typed errors of method delete_post
EditPostError
struct for typed errors of method edit_post
GetPostError
struct for typed errors of method get_post
ListPostsError
struct for typed errors of method list_posts
RetryPostError
struct for typed errors of method retry_post
UnpublishPostError
struct for typed errors of method unpublish_post
UpdatePostError
struct for typed errors of method update_post
UpdatePostMetadataError
struct for typed errors of method update_post_metadata

Functions§

bulk_upload_posts
Create multiple posts by uploading a CSV file. Use dryRun=true to validate without creating posts.
create_post
Create and optionally publish a post. Immediate posts (publishNow: true) include platformPostUrl in the response. Content is optional when media is attached or all platforms have customContent. See each platform’s schema for media constraints. ## Idempotency Two layers of duplicate-protection apply, so safe-to-retry callers (network blips, n8n / Zapier retries, etc.) don’t accidentally double-post. 1. Same-request idempotency (5-minute window). Pass an x-request-id header to mark a logical request. If a second request arrives with the same x-request-id while the first is in-flight (or within ~5 minutes of completion), we return HTTP 200 with the original post in the existingPost field — no new post is created. The official Zernio SDKs auto-generate a unique x-request-id per call. If you’re using a generic HTTP client (curl, n8n’s HTTP node, Zapier, custom code), either: - Set a unique x-request-id per logical call (recommended — UUIDv4 is fine) - Or simply omit the header — we’ll treat each request as new Common pitfall: if your workflow tool uses a single execution-level request ID and reuses it across multiple HTTP nodes (e.g. one ID for the whole run, shared across 6 different platform calls), every call after the first will look like a retry of the first and return its post. Generate a fresh ID per node. 2. Content-hash dedup (24-hour window). Independently, we hash (platform, accountId, content + media URLs) and reject duplicates within 24 hours with HTTP 409. This catches genuine "same content posted twice to the same account" cases regardless of x-request-id. Returns error, accountId, platform, and existingPostId so you can find the original. To intentionally re-post identical content within 24h, change something (the caption, the media, the account) — the dedup is keyed on the full content fingerprint. Order: same-x-request-id retries (200) are checked first; if no idempotency match, the content-hash dedup (409) runs.
delete_post
Delete a draft or scheduled post from Zernio. Published posts cannot be deleted; use the Unpublish endpoint instead. Upload quota is automatically refunded.
edit_post
Edit the text of an already-published post. Supported on X (Twitter), Discord, Facebook, and Reddit. Each platform enforces its own rules: X (Twitter) - Connected X account must have an active X Premium subscription - Must be within 1 hour of original publish time - Maximum 5 edits per tweet (enforced by X) - Threads cannot be edited, only single tweets - X assigns a NEW post ID on edit, returned as id Discord - No time limit and no premium requirement - The message ID is unchanged after the edit Facebook - Graph only permits editing a post that the same app created, so this works on posts published through Zernio and is rejected for posts created in Meta Business Suite / Composer or by another tool - Media cannot be swapped, only the message text - Reactions, comments, and shares are preserved. The post ID is unchanged Reddit - Self-posts only. A link post has no editable body and is rejected before the write - Body only. Reddit exposes no API to edit a post title, ever - The post ID is unchanged Media edits are not supported on any platform. The post record in Zernio is updated with the new content and an edit-history entry.
get_post
Fetch a single post by ID. For published posts, this returns platformPostUrl for each platform.
list_posts
Returns a paginated list of posts. Published posts include platformPostUrl with the public URL on each platform.
retry_post
Immediately retries publishing a failed post. Returns the updated post with its new status.
unpublish_post
Deletes a published post from the specified platform. The post record in Zernio is kept but its status is updated to cancelled. Not supported on Instagram, TikTok, or Snapchat. Threaded posts delete all items. YouTube deletion is permanent.
update_post
Update an existing post. Draft, scheduled, failed, partial, and cancelled posts can be edited. Published posts can only have their recycling config updated. To promote a draft to scheduled, send isDraft: false together with scheduledFor (or publishNow: true, or queuedFromProfile). If isDraft is omitted the post keeps its current draft status, so sending only scheduledFor to a draft returns 200 but the post remains a draft.
update_post_metadata
Updates metadata of a published video on the specified platform without re-uploading. Currently only supported for YouTube. At least one updatable field is required. Two modes: 1. Post-based (video published through Zernio): pass the Zernio postId in the URL and platform in the body. 2. Direct video ID (video uploaded outside Zernio, e.g. directly to YouTube): use _ as the postId, and pass videoId + accountId + platform in the body. The accountId is the Zernio social account ID for the connected YouTube channel.