{
  "openapi": "3.0.0",
  "info": {
    "title": "OmniSocials API",
    "version": "1.0.0",
    "description": "The OmniSocials REST API schedules, publishes and analyzes posts on 13 social platforms. Upload media, receive webhooks and answer your social inbox.\n\nIt covers 13 platforms and 14 channels, because LinkedIn has a personal profile and a company page: Instagram, Facebook, LinkedIn (profile and page), YouTube, TikTok, X, Pinterest, Threads, Bluesky, Mastodon, Google Business, Telegram and Discord.\n\n## Base URL\n\n```\nhttps://api.omnisocials.com/v1\n```\n\n## Authentication\n\nSend an API key as a Bearer token in the `Authorization` header:\n\n```\nAuthorization: Bearer omsk_live_your_api_key_here\n```\n\nCreate keys in the OmniSocials dashboard under **Settings > API**, and give each key only the scopes it needs. The [Authentication](https://docs.omnisocials.com/authentication) guide lists every scope. Each operation names the scope it needs in `x-required-scopes` (an empty list: any valid key), and `components.securitySchemes.bearerAuth.x-scopes` describes every scope.\n\nA `401` answer carries a `WWW-Authenticate: Bearer` challenge (RFC 6750) whose `resource_metadata` points to the RFC 9728 metadata of this API: `https://api.omnisocials.com/.well-known/oauth-protected-resource/v1`.\n\n## Rate limits\n\nEach API key can make 100 requests per minute, counted over a sliding 60 second window. Authenticated responses carry these headers:\n\n- `X-RateLimit-Limit`: requests allowed per minute\n- `X-RateLimit-Remaining`: requests left in the current window\n- `X-RateLimit-Reset`: Unix time, in seconds, when the oldest request in the window leaves it\n- `RateLimit-Policy`: the policy in the IETF draft syntax (draft-ietf-httpapi-ratelimit-headers-12), `\"default\";q=100;w=60`\n- `RateLimit`: the current state in the same syntax, for example `\"default\";a=42;w=17` (`a` = requests left, `w` = seconds until a request leaves the window)\n\nOver the limit, the API returns `429` with the code `rate_limit_exceeded` and a `Retry-After` header in seconds. See [Rate limits and errors](https://docs.omnisocials.com/rate-limits-and-errors).\n\n## Versioning and deprecation\n\nThe version is in the path (`/v1`). Within v1 we only make additive changes: new endpoints, optional parameters, response fields, enum values, error codes and headers. Ignore fields you do not know. A breaking change comes as a new version (`/v2`) or as a deprecation within v1: the endpoint's responses carry a `Deprecation` header (RFC 9745) and, once the removal date is set, a `Sunset` header (RFC 8594), the operation is marked `deprecated: true` here, and the changelog and an email to the key owners announce it. The old behavior keeps working for at least 6 months after the announcement; only security fixes and changes a social network forces on us can come sooner. See [Versioning](https://docs.omnisocials.com/versioning)."
  },
  "servers": [
    {
      "url": "https://api.omnisocials.com/v1",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Posts",
      "description": "Create, schedule, update, publish, and delete social media posts across every connected channel. This is the core of the OmniSocials API."
    },
    {
      "name": "Media",
      "description": "Upload and manage images, video, and PDFs (up to 100 MB per upload, 1 GB from a URL) for use in posts, reels, stories, and PDF carousels."
    },
    {
      "name": "Folders",
      "description": "Organize uploaded media into folders: list, create, and delete them to keep large asset libraries manageable."
    },
    {
      "name": "Hashtag Sets",
      "description": "Save reusable, named groups of hashtags per workspace and apply one to a new post in a single call, appended to captions or dropped into the auto first comment."
    },
    {
      "name": "Tags",
      "description": "Label your own posts (a hook style, a format, a campaign) and compare them: tags filter GET /posts and the analytics, and GET /analytics/tags shows how each tag did against your normal per channel. Tags never go to a platform."
    },
    {
      "name": "Accounts",
      "description": "List and inspect the social accounts connected to a workspace across all 13 supported platforms."
    },
    {
      "name": "Analytics",
      "description": "Fetch post-level and account-level metrics (impressions, engagement, reach, and follower stats) in single or bulk requests."
    },
    {
      "name": "Credits",
      "description": "The organisation's credit balance and X statistics: X bills every statistics read, and OmniSocials passes X's price on as credits."
    },
    {
      "name": "Approvals",
      "description": "Approval workflows (configured in the dashboard). List them here, route a new post through one with `approval_workflow_id` on POST /posts/create, and decide with POST /posts/{id}/approve or /reject."
    },
    {
      "name": "Webhooks",
      "description": "Manage webhook subscriptions for real-time events (post.scheduled, post.published, post.failed, post.approved, post.rejected). Deliveries are signed with HMAC-SHA256."
    },
    {
      "name": "Locations",
      "description": "Search and attach location tags (such as Instagram place tags) to posts."
    },
    {
      "name": "Audio",
      "description": "Search and attach Instagram audio tracks, including trending music, to reels."
    },
    {
      "name": "Pinterest",
      "description": "List and check the product Pins of the connected Pinterest account, to tag products on a Pin with `pinterest.product_tags`."
    },
    {
      "name": "Inbox",
      "description": "Read and reply to Instagram and Facebook DMs, comments, and mentions, LinkedIn company-page comments and mentions (LinkedIn has no API DMs), TikTok video comments (comments only; replies capped at 150 characters), YouTube video comments, X DMs for opted-in workspaces, and Threads replies and mentions. GET /inbox/next is a work queue: it serves the next item that needs an answer together with its conversation and the post it is on, and a reply sent with include_next chains straight to the following one. Comments on Facebook, Instagram, TikTok, YouTube and Threads can be hidden (POST /inbox/messages/{id}/hide); Facebook, Instagram and TikTok comments can be deleted (DELETE /inbox/messages/{id}). Replies sent from the native apps are mirrored into the inbox and count as answers. Reads require the inbox:read scope; replies, marking read, hiding and deleting require inbox:write. Replies are limited to existing conversations (no cold outreach) and to the platform messaging window. Each workspace can send up to 1,000 replies per rolling 24 hours; contact support@omnisocials.com for a higher limit."
    },
    {
      "name": "Automations",
      "description": "Comment-to-DM automations on the connected Instagram account or Facebook Page (`platform`): a keyword in a comment on a post (or in a DM, or in an Instagram story reply) gets a DM back, once per person, with an optional public reply under the comment. On Facebook the DM lands in Messenger. Create one for an OmniSocials post (`post_id`), for a post published outside OmniSocials (`instagram_media_id` or `facebook_post_id`), for the next post the workspace publishes, or for every post. Opt-in scopes `automations:read` and `automations:write`. A post can also carry its automations at create time (`comment_dm_automation` on POST /posts/create, with `platforms` for Instagram, Facebook or both)."
    },
    {
      "name": "Feature requests",
      "description": "What OmniSocials cannot do, why, and what to do instead (GET /limits), and feature requests for the person who owns the key. Built for AI agents: read the limits before you tell a person something is not possible, and send a request only after they agree. No scope needed."
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key authentication: `Authorization: Bearer omsk_live_...`. Get your key from Settings > API. A key holds the scopes chosen when it was made; `x-scopes` lists them (the opt-in ones only when their switch was on), and each operation's `x-required-scopes` names the scope it needs. A `:write` scope also grants the `:read` scope of the same resource. A missing scope answers `403 insufficient_scope`.",
        "x-scopes": {
          "posts:read": {
            "description": "Read posts, their approval state, approval workflows, hashtag sets and tags, and search locations, Instagram audio and Pinterest products.",
            "opt_in": false
          },
          "posts:write": {
            "description": "Create, update, publish, retry, approve, reject and delete posts, and manage hashtag sets and tags.",
            "opt_in": false
          },
          "media:read": {
            "description": "List and read media and media folders.",
            "opt_in": false
          },
          "media:write": {
            "description": "Upload, update, split, check and delete media, and manage media folders.",
            "opt_in": false
          },
          "accounts:read": {
            "description": "List and read the connected social accounts.",
            "opt_in": false
          },
          "analytics:read": {
            "description": "Read post, account and tag statistics, the overview and best times, the recent posts read from the platforms, and refresh the statistics of one post.",
            "opt_in": false
          },
          "webhooks:manage": {
            "description": "List, create, update and delete webhooks, and rotate their signing secrets.",
            "opt_in": false
          },
          "inbox:read": {
            "description": "Read Social Inbox conversations and messages, and the next item that needs an answer.",
            "opt_in": true,
            "opt_in_switch": "Social Inbox access"
          },
          "inbox:write": {
            "description": "Reply in the Social Inbox, mark conversations read, and like, hide and delete comments.",
            "opt_in": true,
            "opt_in_switch": "Social Inbox access"
          },
          "automations:read": {
            "description": "List and read comment-to-DM automations and their activity.",
            "opt_in": true,
            "opt_in_switch": "Automations"
          },
          "automations:write": {
            "description": "Create, update and delete comment-to-DM automations, also through `comment_dm_automation` on a post.",
            "opt_in": true,
            "opt_in_switch": "Automations"
          },
          "accounts:write": {
            "description": "Set how often the statistics of an X account are read, which changes what they cost in credits.",
            "opt_in": true,
            "opt_in_switch": "Credits and X statistics"
          },
          "credits:read": {
            "description": "Read the credit balance and the X statistics use.",
            "opt_in": true,
            "opt_in_switch": "Credits and X statistics"
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Error code for programmatic handling",
                "example": "not_found"
              },
              "message": {
                "type": "string",
                "description": "Human-readable error message",
                "example": "Post not found."
              },
              "details": {
                "type": "array",
                "description": "Optional structured details. Returned today by validation_error responses on POST /posts/create, POST /posts/create-and-publish, and POST /posts/{id}/publish when one or more media items violate a target platform's size/format limits. Each entry pinpoints a single platform/file combo so clients can surface inline errors.",
                "items": {
                  "type": "object",
                  "properties": {
                    "platform": {
                      "type": "string",
                      "description": "Channel that rejected the media (instagram, facebook, x, etc.)",
                      "example": "instagram"
                    },
                    "mediaUrl": {
                      "type": "string",
                      "description": "URL of the offending media item",
                      "example": "https://example.com/video.mov"
                    },
                    "code": {
                      "type": "string",
                      "enum": [
                        "media_too_large",
                        "media_format_unsupported",
                        "media_unreachable",
                        "media_type_unsupported"
                      ],
                      "description": "Machine-readable failure reason"
                    },
                    "message": {
                      "type": "string",
                      "description": "Human-readable explanation",
                      "example": "This video (450 MB) is too large for Instagram."
                    }
                  }
                }
              }
            }
          }
        }
      },
      "Pagination": {
        "type": "object",
        "properties": {
          "total": {
            "type": "integer",
            "description": "Total number of items",
            "example": 42
          },
          "limit": {
            "type": "integer",
            "description": "Items per page",
            "example": 20
          },
          "offset": {
            "type": "integer",
            "description": "Number of items skipped",
            "example": 0
          },
          "has_more": {
            "type": "boolean",
            "description": "Whether there are more items",
            "example": true
          }
        }
      },
      "Post": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Post ID",
            "example": "1024"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "in_approval",
              "scheduled",
              "posting",
              "published",
              "failed",
              "warning",
              "rejected"
            ],
            "description": "`in_approval` = waiting for a reviewer in an approval workflow; PATCH /posts/{id} can still move its `schedule_at` without changing this status. `rejected` = an approver declined the post via POST /posts/{id}/reject; it will not be published. `posting` = a publish is in flight. `warning` = some platforms published and some failed (see `errors` for the failures, `published_urls` for the successes); retry the failures with POST /posts/{id}/retry. `failed` = every platform failed. NOTE: a failed post whose dashboard 'retry as new post' succeeded flips to `published` even though it has no `published_urls` of its own. Check `retries` for the post that actually carries the live URLs."
          },
          "type": {
            "type": "string",
            "enum": [
              "post",
              "story",
              "reel"
            ],
            "description": "Post type. 'reel' media must be a video (MP4/MOV): an image is rejected with 400 validation_error at schedule/publish; use 'post' to share an image. A 'story' carries 1 to 10 media items; every item is one slide and publishes as its own story, in order."
          },
          "story_slides": {
            "type": "object",
            "description": "Stories only, after publishing. Per-platform list of the published slides in publish order. `published_urls` keeps the first slide's URL per platform; this field has every slide.",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "index": {
                    "type": "integer",
                    "description": "Zero-based slide position.",
                    "example": 0
                  },
                  "native_post_id": {
                    "type": "string",
                    "description": "The slide's story id on the platform.",
                    "example": "17912345678901234"
                  },
                  "url": {
                    "type": "string",
                    "nullable": true,
                    "description": "Story URL (valid for 24 hours)."
                  },
                  "media_url": {
                    "type": "string",
                    "nullable": true
                  },
                  "media_type": {
                    "type": "string",
                    "enum": [
                      "image",
                      "video"
                    ]
                  },
                  "published_at": {
                    "type": "string",
                    "format": "date-time",
                    "example": "2026-10-21T09:00:07.000Z"
                  }
                }
              }
            }
          },
          "content": {
            "type": "object",
            "description": "Post content per platform",
            "example": {
              "default": "Our autumn menu is here.",
              "instagram": "Our autumn menu is here. #autumnmenu"
            }
          },
          "accounts": {
            "type": "object",
            "description": "The channels the post targets, as a map of platform key to true or false. Every platform key is present; the channels the post publishes to are true. Requests send `accounts` as an array of account IDs instead (POST /posts/create, PATCH /posts/{id}).",
            "additionalProperties": {
              "type": "boolean"
            },
            "example": {
              "instagram": true,
              "linkedin_page": true,
              "facebook": false,
              "x": false
            }
          },
          "media": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "example": "https://cdn.omnisocials.com/file/library-omnisocials/312a658f-2b45-4289-b240-890807221a74/library/1792573200000-k3j9xq_0c9e6b1a-2f4d-4b8e-a7c3-9d1e5f6a2b70.jpg"
                  },
                  "id": {
                    "type": "string",
                    "example": "482913"
                  },
                  "channel": {
                    "type": "string"
                  },
                  "alt": {
                    "type": "string",
                    "description": "Accessibility description (alt text) for this media item, when set.",
                    "example": "A bowl of pumpkin soup on a wooden table"
                  }
                }
              }
            },
            "description": "Per-platform media object. Keys: default, instagram, facebook, etc. Each value is an array of {url, id, channel, alt?}.",
            "example": {
              "default": [
                {
                  "url": "https://cdn.omnisocials.com/file/library-omnisocials/312a658f-2b45-4289-b240-890807221a74/library/1792573200000-k3j9xq_0c9e6b1a-2f4d-4b8e-a7c3-9d1e5f6a2b70.jpg",
                  "id": "482913",
                  "alt": "A bowl of pumpkin soup on a wooden table"
                }
              ]
            }
          },
          "location_id": {
            "type": "string",
            "description": "Instagram location tag (Facebook Place/Page ID), echoed back from the create/update request. Omitted when not set.",
            "example": "1234567890"
          },
          "collaborators": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "partnerbrand"
            },
            "description": "Instagram co-author usernames (the 'Collab' feature), echoed back from the create/update request. Omitted when none set."
          },
          "user_tags": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "username": {
                  "type": "string",
                  "example": "partnerbrand"
                },
                "x": {
                  "type": "number",
                  "example": 0.5
                },
                "y": {
                  "type": "number",
                  "example": 0.8
                },
                "image_index": {
                  "type": "integer",
                  "example": 0
                }
              }
            },
            "description": "Instagram photo user tags, echoed back from the create/update request. Omitted when none set."
          },
          "schedule_at": {
            "type": "string",
            "format": "date-time",
            "description": "Scheduled publish time (ISO 8601)",
            "example": "2026-10-21T09:00:00.000Z"
          },
          "app_url": {
            "type": "string",
            "format": "uri",
            "description": "Deep link to open this post inside the OmniSocials app, correct for the environment (staging vs production). Draft, scheduled, and failed posts open in the composer; published posts open in the details view. Hand this to the user so they can click straight through to review a draft you just created.",
            "example": "https://app.omnisocials.com/create-post/1024"
          },
          "tags": {
            "type": "array",
            "description": "The post's tags: the workspace's own labels (for example a hook style or a format) to filter and compare posts in Analytics. Never sent to a platform. Manage them with /tags; set them with `tags` on create or update, or in bulk with POST /tags/apply.",
            "items": {
              "$ref": "#/components/schemas/Tag"
            }
          },
          "trial_reel": {
            "type": "object",
            "nullable": true,
            "description": "Set when the post is an Instagram Trial Reel (`instagram.is_trial_reel`), null otherwise. `strategy`: SS_PERFORMANCE = Instagram shares it with followers when it does well, MANUAL = the person decides in the Instagram app. Instagram's API does not say whether a trial reel was later shared with followers.",
            "properties": {
              "strategy": {
                "type": "string",
                "enum": [
                  "MANUAL",
                  "SS_PERFORMANCE"
                ]
              }
            }
          },
          "published_urls": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "uri"
            },
            "description": "Live URLs of the post on each platform after publishing. Keys are platform identifiers (`facebook`, `instagram`, `linkedin`, `linkedin_page`, `youtube`, `tiktok`, `pinterest`, `x`, `threads`, `bluesky`, `mastodon`, `google_business`, `telegram`, `discord`). Only platforms that successfully published appear; failed platforms are omitted (see `errors`). Empty object `{}` while the post is still draft, scheduled, or processing.",
            "example": {
              "facebook": "https://www.facebook.com/123456789/posts/987654321",
              "instagram": "https://www.instagram.com/p/Cxyz123ABC/",
              "linkedin": "https://www.linkedin.com/feed/update/urn:li:share:7191234567890",
              "x": "https://x.com/yourhandle/status/1791234567890123456"
            }
          },
          "retry_of": {
            "type": "string",
            "example": "1023",
            "description": "Present when this post was created by the dashboard 'retry as new post' flow: the ID of the original failed post it retries. The live platform URLs are on THIS post's `published_urls`."
          },
          "retries": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "1031"
            },
            "description": "Present on a post that has been retried as a new post: the IDs of its retry posts (newest last). A `published` post with empty `published_urls` and `retries` set is a resolved failure: the actual publish lives on the retry post, so don't double-count it."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-20T14:32:10.000Z"
          },
          "approval_status": {
            "type": "string",
            "nullable": true,
            "enum": [
              "none",
              "pending",
              "approved",
              "rejected"
            ],
            "description": "Approval workflow status. `none` = no approval workflow attached. `pending` = waiting on an approver (post `status` is `in_approval`); act on it with POST /posts/{id}/approve or /reject. `approved` / `rejected` = the workflow finished. GET /posts/{id}/approval returns the review itself: steps, approvers, the rejection reason and the comments."
          },
          "errors": {
            "type": "object",
            "nullable": true,
            "additionalProperties": {
              "type": "string"
            },
            "description": "Per-platform user-friendly error messages, keyed by platform identifier (`facebook`, `instagram`, `linkedin`, `linkedin_page`, `youtube`, `tiktok`, `pinterest`, `x`, `threads`, `bluesky`, `mastodon`, `google_business`). Populated when `status` is `failed` or `warning`. Only platforms that failed appear; successful platforms are omitted (see `published_urls`). `null` while the post is still draft/scheduled/processing or every platform succeeded. A platform's entry is removed once a retry of it succeeds (via POST /posts/{id}/retry or the dashboard). Mirrors the per-platform error a user sees in the dashboard with a Retry button.",
            "example": {
              "facebook": "Already Posted: These photos were already posted.",
              "instagram": "Instagram couldn't accept one of your images. Check that every image is JPEG/PNG, at least 320×320, has an aspect ratio between 4:5 and 1.91:1, and isn't visually flagged by Instagram. Re-upload or replace the offending image and try again."
            }
          },
          "source": {
            "type": "string",
            "nullable": true,
            "example": "api",
            "description": "Origin of post creation: web, api, mcp, workflow, zapier, make, n8n, etc."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-20T14:35:42.000Z"
          },
          "x": {
            "type": "object",
            "nullable": true,
            "description": "X (Twitter) options on the post. Includes per-publish settings (reply_settings, made_with_ai, paid_partnership), the poll and the canonical thread shape. Present when the post has X-specific data; omitted otherwise.",
            "properties": {
              "reply_settings": {
                "type": "string",
                "enum": [
                  "",
                  "following",
                  "mentionedUsers"
                ]
              },
              "paid_partnership": {
                "type": "boolean",
                "example": false
              },
              "made_with_ai": {
                "type": "boolean",
                "example": false
              },
              "poll": {
                "$ref": "#/components/schemas/XPoll"
              },
              "thread_parts": {
                "type": "array",
                "description": "When the post is a chained X thread (2–25 parts), this returns the canonical tweet text in publish order. For single-tweet posts the array is omitted and the text lives in `content.x` (or `content.default`). Each part also includes any per-tweet `media_urls`.",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Stable client-side id for the part",
                      "example": "6f1d8e2a-4b7c-4d9e-8a3f-2c5b9e7d1a60"
                    },
                    "text": {
                      "type": "string",
                      "maxLength": 25000,
                      "description": "280 chars for standard accounts, 25,000 for X Premium/Premium+.",
                      "example": "1/3: our results are in"
                    },
                    "media_urls": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "string",
                            "format": "uri"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "alt": {
                                "type": "string",
                                "description": "Accessibility description (alt text) for this media item."
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "bluesky": {
            "type": "object",
            "nullable": true,
            "description": "Bluesky options on the post. Present when the post is a Bluesky thread; omitted otherwise.",
            "properties": {
              "thread_parts": {
                "type": "array",
                "description": "When the post is a chained Bluesky thread (2–25 parts), this returns the canonical post text in publish order. For single posts the array is omitted and the text lives in `content.bluesky` (or `content.default`). Each part also includes any per-post `media_urls`.",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Stable client-side id for the part",
                      "example": "6f1d8e2a-4b7c-4d9e-8a3f-2c5b9e7d1a60"
                    },
                    "text": {
                      "type": "string",
                      "maxLength": 300,
                      "example": "1/3: our results are in"
                    },
                    "media_urls": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "string",
                            "format": "uri"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "alt": {
                                "type": "string",
                                "description": "Accessibility description (alt text) for this media item."
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "mastodon": {
            "type": "object",
            "nullable": true,
            "description": "Mastodon options on the post. Present when the post is a Mastodon thread or carries a poll; omitted otherwise.",
            "properties": {
              "poll": {
                "$ref": "#/components/schemas/MastodonPoll"
              },
              "thread_parts": {
                "type": "array",
                "description": "When the post is a chained Mastodon thread (2–25 parts), this returns the canonical status text in publish order. For single posts the array is omitted and the text lives in `content.mastodon` (or `content.default`). Each part also includes any per-status `media_urls`.",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Stable client-side id for the part",
                      "example": "6f1d8e2a-4b7c-4d9e-8a3f-2c5b9e7d1a60"
                    },
                    "text": {
                      "type": "string",
                      "maxLength": 500,
                      "example": "1/3: our results are in"
                    },
                    "media_urls": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "string",
                            "format": "uri"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "alt": {
                                "type": "string",
                                "description": "Accessibility description (alt text) for this media item."
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "threads": {
            "type": "object",
            "nullable": true,
            "description": "Threads options on the post. Present when the post is a Threads thread (multi-post chain), carries a location tag, a poll or a topic; omitted otherwise.",
            "properties": {
              "poll": {
                "$ref": "#/components/schemas/ThreadsPoll"
              },
              "topic_tag": {
                "type": "string",
                "description": "The Threads topic of the post (sent to Threads as `topic_tag`; on a multi-post thread it goes on the first post). Present only when set.",
                "example": "Build in public"
              },
              "location": {
                "type": "object",
                "nullable": true,
                "description": "Location tagged on the Threads post (sent as `location_id` to Threads at publish; on a multi-post thread it is tagged on the first post). Present only when set. `name`/`address`/`city`/`country` are whatever the caller stored alongside the id (the dashboard stores the search result; the API stores what you pass in `threads.location`).",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "17841400000000000"
                  },
                  "name": {
                    "type": "string",
                    "nullable": true,
                    "example": "Griffith Observatory"
                  },
                  "address": {
                    "type": "string",
                    "nullable": true,
                    "example": "2800 E Observatory Rd"
                  },
                  "city": {
                    "type": "string",
                    "nullable": true,
                    "example": "Los Angeles"
                  },
                  "country": {
                    "type": "string",
                    "nullable": true,
                    "example": "United States"
                  }
                }
              },
              "thread_parts": {
                "type": "array",
                "description": "When the post is a chained Threads thread (2 to 25 parts), this returns the canonical post text in publish order. For single posts the array is omitted and the text lives in `content.threads` (or `content.default`). Each part also includes any per-post `media_urls`.",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "Stable client-side id for the part",
                      "example": "6f1d8e2a-4b7c-4d9e-8a3f-2c5b9e7d1a60"
                    },
                    "text": {
                      "type": "string",
                      "maxLength": 500,
                      "example": "1/3: our results are in"
                    },
                    "media_urls": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "type": "string",
                            "format": "uri"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "alt": {
                                "type": "string",
                                "description": "Accessibility description (alt text) for this media item."
                              }
                            }
                          }
                        ]
                      }
                    }
                  }
                }
              }
            }
          },
          "telegram": {
            "type": "object",
            "nullable": true,
            "description": "Telegram options on the post, and after publishing the `result`. Omitted when none are set.",
            "properties": {
              "silent": {
                "type": "boolean",
                "example": false
              },
              "link_preview": {
                "type": "boolean",
                "example": true
              },
              "pin": {
                "type": "boolean",
                "example": true
              },
              "protect_content": {
                "type": "boolean",
                "example": false
              },
              "spoiler": {
                "type": "boolean",
                "example": false
              },
              "caption_above_media": {
                "type": "boolean",
                "example": false
              },
              "buttons": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/TelegramButton"
                }
              },
              "poll": {
                "$ref": "#/components/schemas/TelegramPoll"
              },
              "result": {
                "type": "object",
                "description": "What was sent. Message ids are per chat.",
                "properties": {
                  "chat_id": {
                    "type": "string",
                    "example": "-1001234567890"
                  },
                  "message_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "example": "42"
                    },
                    "description": "The message ids of the post (several for an album)."
                  },
                  "text_message_id": {
                    "type": "string",
                    "description": "The reply that carries text over 1,024 characters, when the post had media.",
                    "example": "43"
                  },
                  "pinned": {
                    "type": "boolean",
                    "example": true
                  },
                  "pin_error": {
                    "type": "string",
                    "enum": [
                      "no_right",
                      "failed"
                    ]
                  },
                  "link_public": {
                    "type": "string",
                    "nullable": true,
                    "description": "t.me/<username>/<id>, for public chats.",
                    "example": "https://t.me/brand/42"
                  },
                  "link_private": {
                    "type": "string",
                    "nullable": true,
                    "description": "t.me/c/<id>/<id>, which members can open and which survives a username change.",
                    "example": "https://t.me/c/1234567890/42"
                  },
                  "sent_at": {
                    "type": "string",
                    "format": "date-time",
                    "example": "2026-10-21T09:00:07.000Z"
                  }
                }
              }
            }
          },
          "discord": {
            "type": "object",
            "nullable": true,
            "description": "Discord options on the post, and after publishing the `result`. Omitted when none are set.",
            "properties": {
              "silent": {
                "type": "boolean",
                "example": false
              },
              "link_preview": {
                "type": "boolean",
                "example": true
              },
              "allow_mentions": {
                "type": "boolean",
                "example": false
              },
              "spoiler": {
                "type": "boolean",
                "example": false
              },
              "thread_name": {
                "type": "string",
                "example": "October menu"
              },
              "buttons": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/DiscordButton"
                }
              },
              "poll": {
                "$ref": "#/components/schemas/DiscordPoll"
              },
              "result": {
                "type": "object",
                "description": "Where the message landed in Discord.",
                "properties": {
                  "webhook_id": {
                    "type": "string",
                    "example": "1290000000000000000"
                  },
                  "guild_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "The Discord server id.",
                    "example": "1180000000000000000"
                  },
                  "channel_id": {
                    "type": "string",
                    "example": "1180000000000000001"
                  },
                  "thread_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "The forum post (thread) the message opened, in a forum or media channel.",
                    "example": null
                  },
                  "message_id": {
                    "type": "string",
                    "example": "1300000000000000000"
                  },
                  "url": {
                    "type": "string",
                    "nullable": true,
                    "description": "discord.com/channels/<server>/<channel or thread>/<message>, which members of the server can open.",
                    "example": "https://discord.com/channels/1180000000000000000/1180000000000000001/1300000000000000000"
                  },
                  "sent_at": {
                    "type": "string",
                    "format": "date-time",
                    "example": "2026-10-22T09:00:03.000Z"
                  },
                  "video_links": {
                    "type": "array",
                    "description": "Media sent as a link in the message text instead of a file (videos and GIFs over Discord's 20 MB attachment limit, or every file after Discord refused them as too large).",
                    "items": {
                      "type": "string",
                      "format": "uri"
                    }
                  },
                  "link_message_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "A second message right after the post that holds the media links, when they did not fit in the 2,000-character text."
                  },
                  "warnings": {
                    "type": "array",
                    "description": "What was sent differently from the request; empty when everything went as asked. Codes: `media_sent_as_links`, `links_sent_as_follow_up`, `link_preview_by_brackets` (link previews off while a video link plays: the post's own links were wrapped in <...> instead), `poll_media_dropped`, `poll_buttons_dropped`, `follow_up_failed`, `thread_name_ignored` (a post title on a channel that is no forum: the post went out without it).",
                    "items": {
                      "type": "string",
                      "example": "media_sent_as_links"
                    }
                  }
                }
              }
            }
          },
          "instagram": {
            "type": "object",
            "nullable": true,
            "description": "Instagram options on the post. Present when set; includes `first_comment` (the configured auto first comment) and, after publish, `first_comment_result` describing the outcome.",
            "properties": {
              "first_comment": {
                "type": "string",
                "description": "The configured first-comment text.",
                "example": "Full menu at the link in our bio."
              },
              "first_comment_result": {
                "$ref": "#/components/schemas/FirstCommentResult"
              }
            }
          },
          "video_cover": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VideoCover"
              }
            ],
            "nullable": true,
            "description": "The post's video cover exactly as stored; null when none was chosen."
          },
          "facebook": {
            "type": "object",
            "nullable": true,
            "description": "Facebook options on the post: `first_comment`, its post-publish `first_comment_result`, and the video thumbnail (`thumbnail_type` + `thumb_offset` / `cover_url`) when one is set.",
            "properties": {
              "first_comment": {
                "type": "string",
                "example": "Full menu at the link in our bio."
              },
              "first_comment_result": {
                "$ref": "#/components/schemas/FirstCommentResult"
              }
            }
          },
          "linkedin": {
            "type": "object",
            "nullable": true,
            "description": "LinkedIn Profile options on the post: `first_comment`, its post-publish `first_comment_result`, `carousel_as_images` (present when the post opts out of the default PDF document carousel) and `document_source` (present as `slides` when the post opts out of sending the kept original PDF).",
            "properties": {
              "first_comment": {
                "type": "string",
                "example": "Full menu at the link in our bio."
              },
              "first_comment_result": {
                "$ref": "#/components/schemas/FirstCommentResult"
              },
              "carousel_as_images": {
                "type": "boolean",
                "example": false
              },
              "document_source": {
                "type": "string",
                "enum": [
                  "slides"
                ]
              }
            }
          },
          "linkedin_page": {
            "type": "object",
            "nullable": true,
            "description": "LinkedIn Company Page options on the post: `first_comment`, its post-publish `first_comment_result`, `carousel_as_images` (present when the post opts out of the default PDF document carousel) and `document_source` (present as `slides` when the post opts out of sending the kept original PDF).",
            "properties": {
              "first_comment": {
                "type": "string",
                "example": "Full menu at the link in our bio."
              },
              "first_comment_result": {
                "$ref": "#/components/schemas/FirstCommentResult"
              },
              "carousel_as_images": {
                "type": "boolean",
                "example": false
              },
              "document_source": {
                "type": "string",
                "enum": [
                  "slides"
                ]
              }
            }
          },
          "youtube": {
            "type": "object",
            "nullable": true,
            "description": "YouTube options on the post. After publish, `first_comment` and its `first_comment_result` are nested here alongside the Shorts metadata.",
            "properties": {
              "first_comment": {
                "type": "string",
                "example": "Full menu at the link in our bio."
              },
              "first_comment_result": {
                "$ref": "#/components/schemas/FirstCommentResult"
              }
            }
          },
          "tiktok": {
            "type": "object",
            "nullable": true,
            "description": "TikTok options on the post. After publish, `first_comment` and its `first_comment_result` are nested here alongside the TikTok publish options. First comments need the workspace's TikTok comments authorization.",
            "properties": {
              "title": {
                "type": "string",
                "nullable": true,
                "description": "Photo Mode title (photo carousels only, max 90 characters). Absent when no title was set.",
                "example": "Autumn menu"
              },
              "first_comment": {
                "type": "string",
                "example": "Full menu at the link in our bio."
              },
              "first_comment_result": {
                "$ref": "#/components/schemas/FirstCommentResult"
              }
            }
          },
          "comment_dm_automation": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Automation"
              },
              {
                "type": "object",
                "properties": {
                  "platforms": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "instagram",
                        "facebook"
                      ]
                    },
                    "description": "The channels that have an automation for this post.",
                    "example": [
                      "instagram",
                      "facebook"
                    ]
                  },
                  "automations": {
                    "type": "array",
                    "description": "One entry per channel: the automation's `id`, `platform` and `status`. Use the ids with the /automations endpoints.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "318"
                        },
                        "platform": {
                          "type": "string",
                          "enum": [
                            "instagram",
                            "facebook"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "active",
                            "paused",
                            "completed"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            ],
            "nullable": true,
            "description": "The comment-to-DM setup bound to this post, when one exists. Returned by GET /posts/{id} for a post that goes to Instagram or Facebook, and by create and update when the request carried `comment_dm_automation`. The fields are those of the first automation (Instagram first), plus `platforms` and `automations` (one per channel). Its `post` field is `null` here (the post is this one). `actions.follow_gate` is the Instagram automation's Follow first (`null` when the first automation is a Facebook one). `actions.follow_up` is the first automation's follow-up (`tap` is `null` when that is a Facebook one)."
          }
        }
      },
      "FirstCommentResult": {
        "type": "object",
        "description": "Outcome of an auto first-comment attempt, written after the main post publishes.",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "posted",
              "failed",
              "skipped",
              "posting"
            ],
            "description": "`posted` = comment is live; `failed` = the main post published but the comment did not (see `error`; retry via POST /posts/retry-first-comment); `skipped` = the main post did not publish so the comment was never attempted; `posting` = a retry of the comment is being sent right now (a few seconds; `claimed_at` says since when)."
          },
          "pending": {
            "type": "boolean",
            "nullable": true,
            "example": false,
            "description": "TikTok only. `true` while the comment waits for TikTok to return the final video id (status is `failed` with an explanatory error meanwhile); the comment is posted automatically once the id resolves, usually within minutes."
          },
          "comment_id": {
            "type": "string",
            "nullable": true
          },
          "url": {
            "type": "string",
            "nullable": true
          },
          "error": {
            "type": "string",
            "nullable": true
          },
          "posted_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "example": "2026-10-21T09:00:07.000Z"
          }
        }
      },
      "VideoCoverEntry": {
        "type": "object",
        "required": [
          "type"
        ],
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "frame",
              "custom"
            ],
            "description": "`frame` uses the video frame at `thumb_offset`; `custom` uploads the image at `cover_url`."
          },
          "thumb_offset": {
            "type": "integer",
            "minimum": 0,
            "description": "Milliseconds into the video (type `frame`).",
            "example": 3000
          },
          "cover_url": {
            "type": "string",
            "format": "uri",
            "description": "Public image URL, JPEG or PNG (type `custom`).",
            "example": "https://example.com/cover.jpg"
          }
        }
      },
      "VideoCover": {
        "allOf": [
          {
            "$ref": "#/components/schemas/VideoCoverEntry"
          },
          {
            "type": "object",
            "properties": {
              "overrides": {
                "type": "object",
                "description": "Per-platform overrides keyed by platform id (`instagram`, `facebook`, `linkedin`, `linkedin_page`, `tiktok`, `pinterest`, `youtube`). An override wins over the base cover for that platform.",
                "additionalProperties": {
                  "$ref": "#/components/schemas/VideoCoverEntry"
                }
              }
            }
          }
        ],
        "description": "Video thumbnail for a post whose media is one video. Applied on Instagram (feed videos and reels), Facebook (feed videos and reels), LinkedIn Profile and Page, TikTok, Pinterest and YouTube Shorts. On YouTube Shorts the cover shows only on channels where YouTube has enabled custom Shorts thumbnails (rolling out since July 2026, YouTube Partner Program channels first); on other channels YouTube stores it as the default thumbnail but shows a frame from the video on Shorts. TikTok only takes a frame, so a `custom` cover is skipped there (set a `tiktok` override with type `frame` to choose the frame). The per-platform reel fields (`instagram.thumb_offset` / `cover_url`, `tiktok.video_cover_timestamp_ms`, `pinterest.video_cover`) keep working and win over the base cover for their platform.",
        "example": {
          "type": "frame",
          "thumb_offset": 3000,
          "overrides": {
            "linkedin_page": {
              "type": "custom",
              "cover_url": "https://example.com/cover.jpg"
            }
          }
        }
      },
      "LinkedInPollFields": {
        "type": "object",
        "required": [
          "question",
          "options",
          "duration"
        ],
        "properties": {
          "question": {
            "type": "string",
            "maxLength": 140,
            "description": "The poll question.",
            "example": "Which feature should we build next?"
          },
          "options": {
            "type": "array",
            "minItems": 2,
            "maxItems": 4,
            "items": {
              "type": "string",
              "maxLength": 30,
              "example": "Bulk upload"
            },
            "description": "2-4 answer options."
          },
          "duration": {
            "type": "string",
            "enum": [
              "ONE_DAY",
              "THREE_DAYS",
              "SEVEN_DAYS",
              "FOURTEEN_DAYS"
            ],
            "description": "How long the poll stays open for votes."
          }
        }
      },
      "XPoll": {
        "type": "object",
        "description": "A poll on an X post. The tweet text is the question. Stored as `x.poll`.",
        "required": [
          "options"
        ],
        "properties": {
          "options": {
            "type": "array",
            "minItems": 2,
            "maxItems": 4,
            "items": {
              "type": "string",
              "maxLength": 25,
              "example": "Yes"
            },
            "description": "2 to 4 answer options of up to 25 characters, all different."
          },
          "duration_minutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 10080,
            "default": 1440,
            "description": "How long the poll stays open, in minutes (5 to 10080, 7 days)."
          }
        }
      },
      "ThreadsPoll": {
        "type": "object",
        "description": "A poll on a Threads post. The post text is the question; Threads closes the poll 24 hours after it is published. Stored as `threads.poll`.",
        "required": [
          "options"
        ],
        "properties": {
          "options": {
            "type": "array",
            "minItems": 2,
            "maxItems": 4,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 25,
              "example": "Yes"
            },
            "description": "2 to 4 answer options of 1 to 25 characters, all different."
          }
        }
      },
      "MastodonPoll": {
        "type": "object",
        "description": "A poll on a Mastodon status. The status text is the question. Limits come from the instance (Mastodon's defaults: 4 options of 50 characters, 5 minutes to 1 month). Stored as `mastodon.poll`.",
        "required": [
          "options"
        ],
        "properties": {
          "options": {
            "type": "array",
            "minItems": 2,
            "items": {
              "type": "string",
              "example": "Yes"
            },
            "description": "The answer options, all different; count and length within the instance's limits."
          },
          "expires_in": {
            "type": "integer",
            "default": 86400,
            "description": "How long the poll stays open, in seconds, within the instance's range (default one day)."
          },
          "multiple": {
            "type": "boolean",
            "default": false,
            "description": "Allow several answers per person."
          },
          "hide_totals": {
            "type": "boolean",
            "default": false,
            "description": "Hide the vote counts until the poll ends."
          }
        }
      },
      "TelegramPoll": {
        "type": "object",
        "description": "A poll in a Telegram channel or group. The post text is the question (up to 300 characters). Polls in a channel are anonymous. Stored as `telegram.poll`.",
        "required": [
          "options"
        ],
        "properties": {
          "options": {
            "type": "array",
            "minItems": 2,
            "maxItems": 12,
            "items": {
              "type": "string",
              "maxLength": 100,
              "example": "Yes"
            },
            "description": "2 to 12 answer options of up to 100 characters, all different."
          },
          "open_period": {
            "type": "integer",
            "minimum": 5,
            "maximum": 2628000,
            "description": "Seconds the poll stays open (5 seconds to about 30 days). Leave out to keep the poll open.",
            "example": 86400
          },
          "multiple": {
            "type": "boolean",
            "default": false,
            "description": "Allow several answers per person."
          }
        }
      },
      "TelegramButton": {
        "type": "object",
        "required": [
          "text",
          "url"
        ],
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 64,
            "description": "Button label.",
            "example": "See the menu"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "description": "Link the button opens: https://, http:// or tg://, at most 2,048 characters. Any other scheme (such as javascript:) or a longer link is refused with 400 `validation_error`, on a draft too.",
            "example": "https://example.com/menu"
          }
        }
      },
      "DiscordPoll": {
        "type": "object",
        "description": "A native Discord poll. The post text is the question (1 to 300 characters). No media and no buttons with a poll. Stored as `discord.poll`.",
        "required": [
          "options"
        ],
        "properties": {
          "options": {
            "type": "array",
            "minItems": 2,
            "maxItems": 10,
            "items": {
              "type": "string",
              "maxLength": 55,
              "example": "Yes"
            },
            "description": "2 to 10 answer options of up to 55 characters, all different."
          },
          "duration_hours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 768,
            "default": 24,
            "description": "Hours the poll stays open (1 hour to 32 days).",
            "example": 24
          },
          "multiple": {
            "type": "boolean",
            "default": false,
            "description": "Allow several answers per person."
          }
        }
      },
      "DiscordButton": {
        "type": "object",
        "required": [
          "text",
          "url"
        ],
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 80,
            "description": "Button label (1 to 80 characters).",
            "example": "See the menu"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "description": "Link the button opens: https:// or http://, at most 2,048 characters. Any other scheme (such as javascript:) or a longer link is refused with 400 `validation_error`, on a draft too.",
            "example": "https://example.com/menu"
          }
        }
      },
      "PostDryRun": {
        "type": "object",
        "description": "The answer of a post create with `dry_run: true`: what the real call would create. Nothing was stored, so there is no `id`.",
        "properties": {
          "dry_run": {
            "type": "boolean",
            "example": true
          },
          "valid": {
            "type": "boolean",
            "example": true,
            "description": "Always true in a 200 answer. An invalid request answers with the error of the real call instead."
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "scheduled",
              "posting",
              "in_approval"
            ],
            "description": "The status the post would get: `posting` = published right away.",
            "example": "scheduled"
          },
          "type": {
            "type": "string",
            "enum": [
              "post",
              "story",
              "reel"
            ],
            "example": "post"
          },
          "schedule_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "example": "2026-12-01T09:00:00.000Z"
          },
          "accounts": {
            "type": "array",
            "description": "One entry per selected account.",
            "items": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string",
                  "example": "instagram"
                },
                "type": {
                  "type": "string",
                  "example": "post"
                },
                "publish": {
                  "type": "string",
                  "enum": [
                    "now",
                    "scheduled",
                    "after_approval",
                    "draft"
                  ],
                  "description": "`now` = published right away, `scheduled` = at `schedule_at`, `after_approval` = at `schedule_at` once the workflow approves it, `draft` = never on its own.",
                  "example": "scheduled"
                },
                "schedule_at": {
                  "type": "string",
                  "format": "date-time",
                  "nullable": true
                },
                "content": {
                  "type": "string",
                  "description": "The text this account would get, after a hashtag set was applied.",
                  "example": "Our winter menu is here"
                },
                "media": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "nullable": true,
                        "description": "The media library id; null for a `media_urls` entry.",
                        "example": "501"
                      },
                      "url": {
                        "type": "string",
                        "example": "https://cdn.omnisocials.com/file/library-omnisocials/7/library/photo.jpg"
                      },
                      "alt": {
                        "type": "string"
                      },
                      "not_fetched": {
                        "type": "boolean",
                        "description": "A `media_urls` entry: the file was not downloaded or checked."
                      },
                      "crop": {
                        "type": "string",
                        "description": "The real call posts a crop of this image at this ratio (see the `image_fit` warning).",
                        "example": "4:5"
                      }
                    }
                  }
                },
                "thread_parts": {
                  "type": "integer",
                  "description": "The number of posts in a thread (X, Bluesky, Mastodon, Threads)."
                },
                "first_comment": {
                  "type": "string"
                }
              }
            }
          },
          "approval_workflow": {
            "type": "object",
            "description": "Present with `approval_workflow_id`: the workflow the post would enter. Nobody is notified in a dry run.",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "steps": {
                "type": "integer"
              }
            }
          },
          "tags": {
            "type": "object",
            "description": "Present with `tags`: the ids of the tags that exist, and the names the real call would create as new tags.",
            "properties": {
              "ids": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "new_names": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "comment_dm_automation": {
            "type": "object",
            "description": "Present with `comment_dm_automation`, the channels that would get an automation.",
            "properties": {
              "platforms": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "CreatePostRequest": {
        "type": "object",
        "description": "The account list is `accounts` (or its alias `channels`, which the SDKs send): one of the two is required.",
        "required": [
          "content"
        ],
        "anyOf": [
          {
            "required": [
              "accounts"
            ]
          },
          {
            "required": [
              "channels"
            ]
          }
        ],
        "properties": {
          "content": {
            "oneOf": [
              {
                "type": "string",
                "description": "Shorthand: one text for every platform, the same as `{ \"default\": \"<text>\" }`.",
                "example": "Hello world!"
              },
              {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Per-platform text. 'default' is used for every selected platform without its own key.",
                "example": {
                  "default": "Hello world!",
                  "instagram": "Hello from IG! #awesome"
                }
              }
            ],
            "description": "Post content: a string (the same text everywhere) or an object with 'default' and platform keys: instagram, facebook, linkedin, linkedin_page, youtube, tiktok, pinterest, x, threads, bluesky, mastodon, google_business, telegram, discord. Coming soon: reddit, snapchat.",
            "example": {
              "default": "Hello world!",
              "instagram": "Hello from IG! #awesome"
            }
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "instagram"
            },
            "description": "Social accounts to post to. Each entry is either:\n- A bare platform name (e.g. `\"youtube\"`, `\"linkedin_page\"`), or\n- The composite ID returned by `GET /v1/accounts` in the form `\"<workspace_id>_<platform>\"` (e.g. `\"844008_youtube\"`).\n\nThe composite form's workspace prefix must match the workspace your API key belongs to. Mismatched or unknown ids return 400 `validation_error` with an \"Unknown account/platform\" message. Always source ids from `GET /v1/accounts` for the API key in use.\n"
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "instagram"
            },
            "description": "Alias of `accounts` (the SDKs and the CLI send this name). When both are sent, `accounts` wins."
          },
          "scheduled_at": {
            "type": "string",
            "format": "date-time",
            "description": "Alias of `schedule_at` (the SDKs send this name). When both are sent, `schedule_at` wins.",
            "example": "2027-01-15T09:00:00Z"
          },
          "media_ids": {
            "$ref": "#/components/schemas/CreatePostRequest/properties/media"
          },
          "type": {
            "type": "string",
            "enum": [
              "post",
              "story",
              "reel"
            ],
            "default": "post",
            "description": "Post type: 'post' (feed), 'story' (Instagram/Facebook), 'reel' (Instagram/Facebook/YouTube/TikTok). Telegram and Discord have no reels: a reel that names them is still accepted, and they get the video as a normal post; send a video for them alone as a 'post'. A 'reel' must have video media (MP4/MOV); an image is rejected with 400 validation_error at schedule/publish. Use 'post' to share an image. A 'story' takes 1 to 10 media items: each item is one slide, published as its own story in the order given (Instagram and Facebook have no multi-slide story container). More than 10 returns 400 validation_error."
          },
          "media": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "string",
                      "example": "482913"
                    },
                    {
                      "type": "object",
                      "required": [
                        "id"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "482913"
                        },
                        "alt": {
                          "type": "string",
                          "maxLength": 1500,
                          "example": "A bowl of pumpkin soup on a wooden table",
                          "description": "Accessibility description (alt text) for this media item. Delivered to Mastodon (media description), Bluesky (embed alt), X (media metadata, photos/GIFs only), Pinterest (pin alt_text fallback), Instagram (images and carousel image slides, not Reels/Stories) and LinkedIn (images only, not video or documents)."
                        }
                      }
                    }
                  ]
                },
                "description": "Flat array of media IDs, the same for all platforms. Entries are bare IDs or { id, alt } objects. A media item of type `document` (a PDF kept as one item) expands into its page images, in order, so one id attaches the whole deck."
              },
              {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "type": "string",
                        "example": "482913"
                      },
                      {
                        "type": "object",
                        "required": [
                          "id"
                        ],
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "482913"
                          },
                          "alt": {
                            "type": "string",
                            "maxLength": 1500,
                            "example": "A bowl of pumpkin soup on a wooden table"
                          }
                        }
                      }
                    ]
                  }
                },
                "description": "Per-platform object with the keys 'default', 'instagram', 'pinterest', etc. Entries are bare IDs or { id, alt } objects."
              }
            ],
            "description": "Media IDs from POST /media/upload. Flat array or per-platform object. Any entry may be an { id, alt } object to carry a per-media accessibility description (alt text, max 1500 chars). For type 'story', each item is one slide (max 10, published in order)."
          },
          "media_urls": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "oneOf": [
                    {
                      "type": "string",
                      "format": "uri",
                      "example": "https://example.com/photo.jpg"
                    },
                    {
                      "type": "object",
                      "required": [
                        "url"
                      ],
                      "properties": {
                        "url": {
                          "type": "string",
                          "format": "uri",
                          "example": "https://example.com/photo.jpg"
                        },
                        "alt": {
                          "type": "string",
                          "maxLength": 1500,
                          "example": "A bowl of pumpkin soup on a wooden table",
                          "description": "Accessibility description (alt text) for this media item. Delivered to Mastodon (media description), Bluesky (embed alt), X (media metadata, photos/GIFs only), Pinterest (pin alt_text fallback), Instagram (images and carousel image slides, not Reels/Stories) and LinkedIn (images only, not video or documents)."
                        }
                      }
                    }
                  ]
                },
                "description": "Flat array, the same media for all platforms. Entries are URL strings or { url, alt } objects."
              },
              {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "type": "string",
                        "format": "uri",
                        "example": "https://example.com/photo.jpg"
                      },
                      {
                        "type": "object",
                        "required": [
                          "url"
                        ],
                        "properties": {
                          "url": {
                            "type": "string",
                            "format": "uri",
                            "example": "https://example.com/photo.jpg"
                          },
                          "alt": {
                            "type": "string",
                            "maxLength": 1500,
                            "example": "A bowl of pumpkin soup on a wooden table"
                          }
                        }
                      }
                    ]
                  }
                },
                "description": "Per-platform object with the keys 'default' (fallback for all platforms), 'instagram', 'pinterest', etc. Selected platforms without an explicit key inherit from 'default'. Pass an empty array (e.g. 'facebook': []) to explicitly opt a platform out of media. Entries are URL strings or { url, alt } objects.",
                "example": {
                  "default": [
                    {
                      "url": "https://example.com/photo.jpg",
                      "alt": "A red bicycle leaning against a brick wall"
                    }
                  ],
                  "instagram": [
                    "https://example.com/square.jpg"
                  ]
                }
              }
            ],
            "description": "External image/video/PDF URLs to download and attach (max 10 total, each file ≤ 100 MB). Flat array or per-platform object. Any entry may be a { url, alt } object to carry a per-media accessibility description (alt text, max 1500 chars), delivered to Mastodon, Bluesky, X, Pinterest, Instagram (images) and LinkedIn (images). When using per-platform format, 'default' acts as fallback for selected platforms without their own key. A PDF URL is rasterized into one image slide per page (max 20, in order). On LinkedIn it publishes as a swipeable document, elsewhere as an image carousel; slides inherit the entry's alt. For files over 100 MB (up to 1 GB), upload first via POST /v1/media/upload-from-url and attach the returned media id via the `media` field; oversized media_urls fail with code `file_too_large`."
          },
          "schedule_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO 8601 datetime to schedule. Omit for a draft without a date. With `draft: true` the time is kept but the post stays a draft (a planned draft on the calendar, see `draft`).",
            "example": "2026-10-21T09:00:00Z"
          },
          "draft": {
            "type": "boolean",
            "description": "Planned draft. With `schedule_at`, the post is stored as `draft` and keeps that time: it shows on the dashboard calendar at that slot with a dashed outline, the scheduler never publishes it, and a person schedules it from the composer (or you do with `PATCH /posts/{id}` and `draft: false`). Use it when an agent proposes a slot that a human should confirm. Not allowed with `publish_now` or `approval_workflow_id` (400 `validation_error`). Without `schedule_at` it changes nothing: that post is a draft already.",
            "example": true
          },
          "dry_run": {
            "type": "boolean",
            "description": "Test the request without creating anything. With `true` the call runs the same checks as a real call, in the same order, and stops before the first write: no post or draft, no media file, no tag, no approval, no comment-to-DM automation, no job, no webhook, no call to a social network. It answers `200` with `data.dry_run: true`, `data.valid: true` and what the real call would create (`PostDryRun`); an invalid request answers the same status and error as the real call. Not checked: the files behind `media_urls` (they are not downloaded; warning `media_urls_not_fetched`), the byte size of an image crop (the crop is not rendered; warning `image_fit` with `action: would_crop`), and the database write itself. A draft skips the platform checks in a dry run too (warning `draft_not_checked`). Also accepted as the query parameter `?dry_run=true`. A value that is not a boolean answers 400 `validation_error`. Default `false`. The other post endpoints (`PATCH /posts/{id}`, `DELETE /posts/{id}`, publish, retry, approve, reject) have no dry run: they refuse `dry_run` with 400 `validation_error` and change nothing.",
            "example": true
          },
          "media_fit": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "enum": [
                "auto",
                "crop",
                "keep"
              ]
            },
            "description": "Image fit per channel, for feed images (type `post`) whose ratio is outside what a channel shows uncropped. `auto` (the default when omitted) takes the channel's rule: Instagram crops a tall or wide image to 4:5 / 1.91:1 around the subject (Instagram cuts it to that window anyway, and Meta cannot boost a feed post outside it); Pinterest keeps a Pin taller than 2:3 and only reports it. `crop` crops for that channel, `keep` sends the original. Every decision is reported in the response `warnings` with `code: \"image_fit\"`. The crop is a file of its own for that channel only; `default` and the other channels keep the original. On `PATCH`, `media_fit` alone (no media) re-decides the stored images: `keep` gives the original back, `crop` crops an image that was kept.",
            "example": {
              "instagram": "keep"
            }
          },
          "publish_now": {
            "type": "boolean",
            "description": "Set true to publish immediately",
            "example": false
          },
          "link_url": {
            "type": "string",
            "format": "uri",
            "description": "URL to share as a rich preview card on platforms that support link-share posts (currently LinkedIn and Facebook). When set on a text post, the URL renders as a preview tile with thumbnail / title / description instead of plain text. Ignored on platforms that don't support link shares (Instagram, TikTok, etc.) and on posts that already have media attached (media takes precedence).",
            "example": "https://goodlightai.com/blog/new-feature"
          },
          "link_title": {
            "type": "string",
            "description": "Optional title for the link-share preview. LinkedIn uses this directly when set. Facebook ignores this: it fetches OG metadata server-side. Omit to let LinkedIn auto-fetch the page title.",
            "example": "Our autumn menu"
          },
          "link_description": {
            "type": "string",
            "description": "Optional description for the link-share preview. LinkedIn uses this when set; Facebook auto-fetches the OG description. Omit to defer to OG metadata.",
            "example": "Six new dishes, available from today."
          },
          "link_thumbnail_url": {
            "type": "string",
            "format": "uri",
            "example": "https://example.com/preview.jpg",
            "description": "Optional thumbnail image URL for the preview card. LinkedIn uploads this image as the card thumbnail; without it, LinkedIn uses the page's Open Graph image, and when the upload fails the card has no image. Facebook ignores it and uses the page's Open Graph image."
          },
          "video_cover": {
            "$ref": "#/components/schemas/VideoCover"
          },
          "source": {
            "type": "string",
            "description": "Self-reported origin of the integration creating this post. Defaults to 'api' if omitted. Use 'zapier', 'make', 'n8n', etc. to identify your integration.",
            "example": "zapier"
          },
          "location_id": {
            "type": "string",
            "description": "Instagram only. Facebook Place/Page ID to tag the post's location with (e.g. a dealership or storefront). Applied to single-image and carousel feed posts via Instagram's content-publishing `location_id`. Find a Place's Page ID via Facebook's Pages Search API. Ignored by other platforms. Send an empty string on PATCH to clear it.",
            "example": "1234567890"
          },
          "collaborators": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "partnerbrand"
            },
            "maxItems": 3,
            "description": "Instagram only. Up to 3 public Instagram usernames to invite as co-authors (the 'Collab' feature). Applied to image, carousel, and reel posts, not Stories. Invited users get an invitation in the Instagram app; once accepted, the post also appears on their profile and feed. Usernames are case-insensitive and a leading '@' is stripped. Private accounts and non-existent usernames are rejected by Instagram at publish time. Ignored by other platforms. Send an empty array on PATCH to clear collaborators.",
            "example": [
              "therock",
              "kevinhart4real"
            ]
          },
          "user_tags": {
            "type": "array",
            "description": "Instagram only. Tag public Instagram accounts at specific positions on a photo of a post, carousel or Story. Not on videos or reels. On a Story, Instagram tags the account without a visible sticker. For a single image omit `image_index` (or set 0); for a carousel or a multi-slide Story, set `image_index` to the 0-based slide the tag belongs to (videos counted; tags attach to that slide's image). Public accounts only; private/non-existent usernames are rejected by Instagram at publish time. Ignored by other platforms. Send an empty array on PATCH to clear tags.",
            "items": {
              "type": "object",
              "required": [
                "username",
                "x",
                "y"
              ],
              "properties": {
                "username": {
                  "type": "string",
                  "description": "Public Instagram username to tag. A leading '@' is stripped.",
                  "example": "partnerbrand"
                },
                "x": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1,
                  "description": "Horizontal position of the tag, 0.0–1.0 from the photo's left edge.",
                  "example": 0.5
                },
                "y": {
                  "type": "number",
                  "minimum": 0,
                  "maximum": 1,
                  "description": "Vertical position of the tag, 0.0–1.0 from the photo's top edge.",
                  "example": 0.8
                },
                "image_index": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "0-based slide of a carousel or Story the tag applies to (videos counted). Defaults to 0 (the only image for a single-image post).",
                  "example": 0
                }
              }
            },
            "example": [
              {
                "username": "therock",
                "x": 0.5,
                "y": 0.8
              }
            ]
          },
          "hashtag_set": {
            "type": "string",
            "description": "Name of a saved hashtag set (see GET /hashtag-sets) to apply to this post, matched case-insensitively. The set's tags are merged in ONCE at create time: the post stores plain text, so later edits to the set never change this post. Tags already present in a caption are skipped (case-insensitive), and hard platform caps (Instagram 30) are enforced with a 400 `hashtag_limit_exceeded` before the platform can reject the post. Mutually interchangeable with `hashtag_set_id`.",
            "example": "Fitness Brand"
          },
          "hashtag_set_id": {
            "type": "string",
            "description": "Id of a saved hashtag set to apply. Same behavior as `hashtag_set`; pass one or the other.",
            "example": "57"
          },
          "hashtag_placement": {
            "type": "string",
            "enum": [
              "caption_append",
              "first_comment"
            ],
            "default": "caption_append",
            "description": "Where the set's tags land. `caption_append` (default) appends them to each target platform's caption after a blank line. `first_comment` puts them in the auto first comment on comment-capable platforms (Instagram, Facebook, LinkedIn Profile/Page, YouTube, TikTok with comments enabled, Telegram), appended after any `first_comment` you passed explicitly, and falls back to caption_append on platforms without a comment API. Stories always use captions (first comments are never posted on Stories)."
          },
          "hashtag_platforms": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "instagram"
            },
            "description": "Optional subset of the post's selected platforms to apply the set to (e.g. only [\"instagram\", \"tiktok\"]). Defaults to all selected platforms."
          },
          "approval_workflow_id": {
            "type": "string",
            "description": "Id of an approval workflow (see GET /approval-workflows) to route this post through. The post is created with status `in_approval` and `approval_status: pending` instead of `scheduled`: the workflow's first-step approvers are notified (dashboard badge, email, Slack), they review it in the dashboard's Approvals page, and it publishes at `schedule_at` only once the last step approves it (dashboard, or POST /posts/{id}/approve). A rejection leaves it `rejected`. Requires `schedule_at`; cannot be combined with `publish_now`. Errors: 404 `workflow_not_found` (not a workflow of this company/workspace), 400 `validation_error` (missing `schedule_at`, `publish_now` set, or a step of the workflow has no approver who is a member of this workspace, or the workflow has no steps; the message names the step).",
            "example": "57823504"
          },
          "tags": {
            "type": "array",
            "description": "Tags for this post: tag ids or names. A name matches case-insensitively; a name that does not exist yet becomes a new tag of the workspace. Tags are the workspace's own labels (a hook style, a format, a campaign) to filter and compare posts in Analytics; nothing goes to a platform. At most 20 per post. Errors: 404 `tag_not_found` (an unknown id).",
            "items": {
              "oneOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "example": [
              "Question hook",
              "Talking head"
            ]
          },
          "comment_dm_automation": {
            "type": "object",
            "nullable": true,
            "description": "A comment-to-DM automation bound to this post (Instagram or Facebook must be in `accounts`). When somebody comments one of `trigger.keywords` on the post once it is live, the account DMs them `actions.dm.text`, once per person, and optionally posts one of `actions.public_reply.variations` under the comment. On a Facebook Page the DM lands in Messenger. The shape is the `AutomationInput` of POST /automations without `post_id`, `scope` or `kinds` (always this post, comment trigger), plus `platforms`. The created automations come back as `comment_dm_automation` on the post. Follow first (`actions.follow_gate`) works on Instagram only: with `platforms: [\"instagram\", \"facebook\"]` the Instagram automation sends the link once the person follows, and the Facebook one sends it at once (no error). A follow-up (`actions.follow_up`: one more DM 1 to 23 hours after the answer, inside Meta's 24-hour window) applies to every listed channel: on Instagram the first DM becomes a tap step with one button whose tap sends the link (unless Follow first is on, whose tap does that), on Facebook only people who answer the DM get it. Needs the opt-in `automations:write` scope on the API key (403 `insufficient_scope` without it).",
            "properties": {
              "platforms": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": [
                    "instagram",
                    "facebook"
                  ]
                },
                "description": "The channels that get the automation: one automation per channel, each with the same keywords, DM, public reply and limits. Each channel must be in the post's `accounts` (400 `validation_error` otherwise); an empty list answers 400. Omit it for one automation: Instagram when the post goes there, else Facebook.",
                "example": [
                  "instagram",
                  "facebook"
                ]
              },
              "trigger": {
                "type": "object",
                "properties": {
                  "keywords": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "example": "guide"
                    }
                  },
                  "match": {
                    "type": "string",
                    "enum": [
                      "word",
                      "contains",
                      "any"
                    ]
                  }
                }
              },
              "actions": {
                "$ref": "#/components/schemas/AutomationActions"
              },
              "limits": {
                "$ref": "#/components/schemas/AutomationLimits"
              }
            },
            "example": {
              "trigger": {
                "keywords": [
                  "guide"
                ]
              },
              "actions": {
                "dm": {
                  "text": "Here is the guide: https://example.com/guide"
                },
                "public_reply": {
                  "enabled": true,
                  "variations": [
                    "Sent you a DM!"
                  ]
                }
              },
              "limits": {
                "max_sends": 500
              }
            }
          },
          "pinterest": {
            "type": "object",
            "description": "Pinterest-specific options. Attach 2–5 images via `media_urls.pinterest` (or the flat `media_urls`) to publish a single carousel pin; the title, description, link, and alt_text apply to the whole pin. A single image or a single video still publishes as a normal image / video pin. **Carousel constraints:** carousels hard-cap at 5 images: attaching more responds 400 `validation_error` at create/schedule time. Pinterest's v5 API also requires every slide in a carousel pin to share the same aspect ratio (width divided by height within 0.001 of slide 1's; Pinterest refuses even 0.8017 next to 0.8000). If you attach mixed-ratio images and try to schedule or publish, the API responds 400 `validation_error` with `mismatched_slides: [n, ...]` listing the 1-indexed slide numbers that need to be re-cropped or removed. Both checks run when `publish_now: true`, when `schedule_at` is set, and when `PATCH` flips a draft to a scheduled status. Drafts are exempt so you can iterate on media.",
            "properties": {
              "board_id": {
                "type": "string",
                "description": "Required. Pinterest board ID",
                "example": "1234567890123456789"
              },
              "title": {
                "type": "string",
                "description": "Pin title (max 100 characters). For carousel pins, applies to the whole pin, not individual slides.",
                "example": "Autumn menu"
              },
              "link": {
                "type": "string",
                "description": "Destination URL for the pin",
                "example": "https://example.com/menu"
              },
              "video_cover": {
                "type": "string",
                "description": "Cover image URL for video pins (a JPEG or PNG image URL)",
                "example": "https://example.com/cover.jpg"
              },
              "alt_text": {
                "type": "string",
                "description": "Accessibility alt text for the pin image (max 500 characters)",
                "example": "A bowl of pumpkin soup on a wooden table"
              },
              "product_tags": {
                "type": "array",
                "maxItems": 24,
                "items": {
                  "type": "string"
                },
                "description": "Products to tag on the Pin, so people can shop the items in the image. Up to 24 product Pins of the connected Pinterest account, each as a Pin ID string or a Pin link (`https://www.pinterest.com/pin/<id>/`); stored and returned as Pin IDs. Get the IDs from `GET /pinterest/products`, or check one with `GET /pinterest/products/validate`. Pinterest accepts a product only when its Pin is public, belongs to the same account and links to a website that account claimed; products of other merchants cannot be tagged. The tags are added right after the Pin is published. A product Pinterest refuses never fails the post: the other products are still tagged and the outcome is returned as `product_tags_result` on the post. An invalid entry or more than 24 products responds 400 `validation_error`. On `PATCH`, the `pinterest` object replaces the stored one, so leave `product_tags` out (or send `[]`) to remove the tags.",
                "example": [
                  "813744226420795884",
                  "813744226420795885"
                ]
              },
              "product_tags_result": {
                "type": "object",
                "readOnly": true,
                "description": "Read-only. Present on a published post that had `product_tags`: what Pinterest did with them.",
                "properties": {
                  "requested": {
                    "type": "integer",
                    "description": "Number of products that were sent.",
                    "example": 2
                  },
                  "tagged": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "example": "813744226420795884"
                    },
                    "description": "Pin IDs that are tagged on the Pin."
                  },
                  "skipped": {
                    "type": "array",
                    "description": "Products that were not tagged, each with a reason.",
                    "items": {
                      "type": "object",
                      "properties": {
                        "pin_id": {
                          "type": "string",
                          "example": "813744226420795885"
                        },
                        "reason": {
                          "type": "string",
                          "description": "Pinterest's reason code: `PIN_MISSING` (Pin not found), `PIN_IS_PRIVATE`, `PRODUCT_METADATA_MISSING` (not a product Pin), `PIN_NOT_FROM_VERIFIED_DOMAIN` (the product link is not on a claimed website), `PIN_NOT_FROM_SAME_USER_AS_HERO_PIN` (Pin of another account).",
                          "example": "PIN_IS_PRIVATE"
                        }
                      }
                    }
                  },
                  "error": {
                    "type": "string",
                    "nullable": true,
                    "description": "Set when the tag request itself failed (for example Pinterest was down); `tagged` is then empty."
                  }
                }
              }
            }
          },
          "youtube": {
            "type": "object",
            "description": "YouTube Shorts options. Only applies when `type` is `reel` and `youtube` is among the selected accounts.",
            "properties": {
              "title": {
                "type": "string",
                "description": "Short title shown on YouTube (max 100 characters). When omitted, the first line of the caption is used, cut at a word to 100 characters; \"YouTube Short\" only when there is no caption either.",
                "example": "How we plan a week of posts"
              },
              "tags": {
                "type": "array",
                "items": {
                  "type": "string",
                  "example": "social media"
                },
                "description": "Video tags"
              },
              "privacy_status": {
                "type": "string",
                "enum": [
                  "public",
                  "private",
                  "unlisted"
                ],
                "default": "public"
              },
              "category_id": {
                "type": "string",
                "description": "YouTube category ID (default \"22\" People & Blogs)",
                "example": "22"
              },
              "made_for_kids": {
                "type": "boolean",
                "default": false
              },
              "notify_subscribers": {
                "type": "boolean",
                "default": false
              },
              "contains_synthetic_media": {
                "type": "boolean",
                "default": false,
                "description": "Mark as AI-generated content"
              },
              "first_comment": {
                "type": "string",
                "maxLength": 10000,
                "description": "Text auto-posted as the first comment on the video right after it publishes (commentThreads.insert). The video must have comments enabled. Empty/omitted = no first comment.",
                "example": "Full menu at the link in our bio."
              }
            }
          },
          "instagram": {
            "type": "object",
            "description": "Instagram Reel options",
            "properties": {
              "share_to_feed": {
                "type": "boolean",
                "default": false,
                "description": "Also share reel to feed"
              },
              "thumbnail_type": {
                "type": "string",
                "enum": [
                  "from-video",
                  "from-library"
                ],
                "description": "How to select thumbnail"
              },
              "thumb_offset": {
                "type": "integer",
                "description": "Video timestamp in milliseconds (when thumbnail_type is from-video)",
                "example": 3000
              },
              "cover_url": {
                "type": "string",
                "description": "Custom thumbnail URL (when thumbnail_type is from-library)",
                "example": "https://example.com/cover.jpg"
              },
              "audio_id": {
                "type": "string",
                "description": "Licensed music for the Reel: an audio ID from `GET /audio/search`. Replaces/mixes with the video's own audio at publish time. Requires a Facebook account connected to the workspace whose Page is linked to this Instagram account. Reels only.",
                "example": "587784541076604"
              },
              "audio_volume": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "default": 100,
                "description": "Volume of the attached music track (0 = muted). Only used with audio_id."
              },
              "video_volume": {
                "type": "integer",
                "minimum": 0,
                "maximum": 100,
                "default": 100,
                "description": "Volume of the video's original audio (0 = muted, e.g. music-only Reel). Only used with audio_id."
              },
              "first_comment": {
                "type": "string",
                "maxLength": 2200,
                "description": "Text auto-posted as the first comment on the post/reel right after it publishes. Common for keeping hashtags out of the caption. Not posted for Stories. Empty/omitted = no first comment.",
                "example": "Full menu at the link in our bio."
              },
              "is_trial_reel": {
                "type": "boolean",
                "default": false,
                "description": "Publish the reel as an Instagram Trial Reel: shown to non-followers first to test performance before (optionally) graduating to everyone. Reels only. Not available on every account: Instagram requires roughly 1,000+ followers and enables the feature per account (the account sees a 'Trial' toggle when creating a reel in the Instagram app). Ineligible accounts fail at publish time with a clear per-platform error."
              },
              "trial_graduation_strategy": {
                "type": "string",
                "enum": [
                  "MANUAL",
                  "SS_PERFORMANCE"
                ],
                "default": "MANUAL",
                "description": "How a Trial Reel graduates to all followers. MANUAL: you decide in the Instagram app. SS_PERFORMANCE: Instagram automatically shares it with followers if it performs well. Only used with is_trial_reel."
              },
              "is_ai_generated": {
                "type": "boolean",
                "default": false,
                "description": "Self-disclosure that this post's media is AI-generated. Adds Instagram's 'AI info' label. Applies to single images, videos, and Reels; for a carousel the label applies to the whole post, not individual slides. Cannot be added or removed after publish, so set it at post time. Not available for Stories."
              }
            }
          },
          "facebook": {
            "type": "object",
            "description": "Facebook options",
            "properties": {
              "first_comment": {
                "type": "string",
                "maxLength": 8000,
                "description": "Text auto-posted as the first comment on the post/reel right after it publishes. Only works on Page posts (the API cannot comment on personal-profile posts). Not posted for Stories. Empty/omitted = no first comment.",
                "example": "Full menu at the link in our bio."
              },
              "thumbnail_type": {
                "type": "string",
                "enum": [
                  "from-video",
                  "from-library"
                ],
                "description": "Video thumbnail for feed videos and reels: 'from-video' uses the frame at `thumb_offset`, 'from-library' uploads the image at `cover_url`. Same shape as the Instagram reel fields; stored as `video_cover.overrides.facebook` and applied after the video is live (a thumbnail failure never fails the post). On PATCH, `null` removes the Facebook override."
              },
              "thumb_offset": {
                "type": "integer",
                "description": "Frame timestamp in milliseconds (when thumbnail_type is from-video)",
                "example": 3000
              },
              "cover_url": {
                "type": "string",
                "format": "uri",
                "description": "Custom thumbnail image URL, JPEG or PNG up to 10 MB (when thumbnail_type is from-library)",
                "example": "https://example.com/cover.jpg"
              }
            }
          },
          "linkedin": {
            "type": "object",
            "description": "LinkedIn Profile options",
            "properties": {
              "first_comment": {
                "type": "string",
                "maxLength": 1250,
                "description": "Text auto-posted as the first comment on the profile post right after it publishes. Common for 'link in first comment' to avoid the in-caption link reach penalty. Empty/omitted = no first comment.",
                "example": "Full menu: https://example.com/menu"
              },
              "carousel_as_images": {
                "type": "boolean",
                "default": false,
                "description": "Multi-image style for the profile post. By default a post with 2+ images publishes as LinkedIn's swipeable PDF document carousel. Set true to publish the images as a plain multi-image gallery instead. Ignored for 0-1 images, video posts, and polls."
              },
              "document_source": {
                "type": "string",
                "enum": [
                  "original_pdf",
                  "slides"
                ],
                "default": "original_pdf",
                "description": "Where the profile post's document carousel comes from when its images are exactly the rendered pages of one uploaded PDF, in order and unchanged. `original_pdf` (default): LinkedIn receives the kept original file, so text stays sharp, in-document links work, viewers download the real file, and every page is included even past the 20-slide cap. `slides`: the document is rebuilt from the slide images instead (a flattened copy). Ignored when the images are not a PDF's pages, when `carousel_as_images` is true, for 0-1 images, video posts, and polls."
              }
            }
          },
          "linkedin_page": {
            "type": "object",
            "description": "LinkedIn Company Page options",
            "properties": {
              "first_comment": {
                "type": "string",
                "maxLength": 1250,
                "description": "Text auto-posted as the first comment on the company-page post right after it publishes. Empty/omitted = no first comment.",
                "example": "Full menu: https://example.com/menu"
              },
              "carousel_as_images": {
                "type": "boolean",
                "default": false,
                "description": "Multi-image style for the company-page post. By default a post with 2+ images publishes as LinkedIn's swipeable PDF document carousel. Set true to publish the images as a plain multi-image gallery instead. Ignored for 0-1 images, video posts, and polls."
              },
              "document_source": {
                "type": "string",
                "enum": [
                  "original_pdf",
                  "slides"
                ],
                "default": "original_pdf",
                "description": "Same as `linkedin.document_source`, for the company-page post: `original_pdf` (default) sends the kept original PDF when the images are its unchanged pages; `slides` rebuilds the document from the slide images."
              }
            }
          },
          "linkedin_poll": {
            "type": "object",
            "nullable": true,
            "description": "Non-sponsored LinkedIn poll(s), independent per channel, keyed by `linkedin` (personal profile) / `linkedin_page` (company page). A poll is mutually exclusive with media and a link share on that channel's post: a poll takes priority over both at publish time. Requires `content.linkedin` (or `content.default`) as that channel's caption/commentary; the poll itself only carries the question/options/duration.",
            "properties": {
              "linkedin": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/LinkedInPollFields"
                  }
                ],
                "nullable": true,
                "description": "Poll for the personal profile post. Omit or null = not a poll."
              },
              "linkedin_page": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/LinkedInPollFields"
                  }
                ],
                "nullable": true,
                "description": "Poll for the company page post. Omit or null = not a poll."
              }
            }
          },
          "tiktok": {
            "type": "object",
            "description": "TikTok options",
            "properties": {
              "title": {
                "type": "string",
                "maxLength": 90,
                "description": "Photo carousels only. The title TikTok shows above the caption on Photo Mode posts (max 90 characters). TikTok's photo endpoint takes the title and the caption as two separate fields; the caption comes from `content`. Ignored on video posts, which have a single caption field. Longer than 90 characters returns 400 validation_error. Read back as `tiktok.title` on GET /posts/{id}.",
                "example": "Autumn menu"
              },
              "privacy_level": {
                "type": "string",
                "enum": [
                  "PUBLIC_TO_EVERYONE",
                  "MUTUAL_FOLLOW_FRIENDS",
                  "FOLLOWER_OF_CREATOR",
                  "SELF_ONLY"
                ],
                "default": "PUBLIC_TO_EVERYONE"
              },
              "disable_comment": {
                "type": "boolean",
                "default": false
              },
              "disable_duet": {
                "type": "boolean",
                "default": false
              },
              "disable_stitch": {
                "type": "boolean",
                "default": false
              },
              "video_cover_timestamp_ms": {
                "type": "integer",
                "default": 0,
                "description": "Reels only. Timestamp (ms) of the video frame to use as the cover."
              },
              "is_aigc": {
                "type": "boolean",
                "default": false,
                "description": "Mark as AI-generated content"
              },
              "brand_content_toggle": {
                "type": "boolean",
                "default": false,
                "description": "Paid partnership disclosure (promotes a third-party brand)"
              },
              "brand_organic_toggle": {
                "type": "boolean",
                "default": false,
                "description": "Your own brand disclosure (promotes your own business)"
              },
              "auto_add_music": {
                "type": "boolean",
                "default": false,
                "description": "Photo carousels only. When true, TikTok auto-selects a soundtrack. Defaults to false to avoid unsuitable tracks."
              },
              "first_comment": {
                "type": "string",
                "maxLength": 150,
                "example": "Full menu at the link in our bio.",
                "description": "Text auto-posted as the first comment on the TikTok video right after it publishes (max 150 characters). Requires the workspace's TikTok comments authorization (the \"Enable comments\" button on the TikTok channel card, a second TikTok consent); without it `first_comment_result.status` is `failed` with an explanatory error. The video must be public with comments allowed. TikTok sometimes returns the final video id a few minutes after publish. In that case the comment is posted automatically as soon as the id resolves (`first_comment_result.pending` is true meanwhile). Empty/omitted = no first comment."
              }
            }
          },
          "x": {
            "type": "object",
            "description": "X (Twitter) options",
            "properties": {
              "reply_settings": {
                "type": "string",
                "enum": [
                  "",
                  "following",
                  "mentionedUsers"
                ],
                "description": "Who can reply (empty = everyone)"
              },
              "paid_partnership": {
                "type": "boolean",
                "default": false,
                "description": "Mark as a paid partnership disclosure"
              },
              "made_with_ai": {
                "type": "boolean",
                "default": false,
                "description": "Mark as AI-generated content"
              },
              "poll": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/XPoll"
                  }
                ],
                "nullable": true,
                "description": "Attach a poll to the tweet (the tweet text is the question). 2 to 4 options of up to 25 characters, open for `duration_minutes` (5 to 10080, 7 days; default 1440). A poll and media do not go together on X: the request is refused when the X channel also has media. On a thread the poll goes on the first tweet. On PATCH, `null` removes it."
              },
              "thread_parts": {
                "type": "array",
                "minItems": 2,
                "maxItems": 25,
                "description": "Publish as a chained thread instead of a single tweet. When omitted (or length < 2), `content.x` (or `content.default`) is used as a single tweet. Each part is posted in order via `in_reply_to_tweet_id`. Attach media to any part (first tweet or any reply) with either `media_ids` (numeric Library IDs from POST /v1/media, the same IDs single posts use) or `media_urls` (external links). Combined max is 4 media items per part. If the post also has top-level `media_urls.x` / media and the first part has no media of its own, the top-level media is attached to the first tweet.",
                "items": {
                  "type": "object",
                  "required": [
                    "text"
                  ],
                  "properties": {
                    "text": {
                      "type": "string",
                      "maxLength": 25000,
                      "description": "Tweet text. Limit depends on the connected account's tier: 280 chars standard, 25,000 for X Premium/Premium+. Counted the way X counts: every link weighs 23 characters (its t.co length) regardless of the real URL length, and emoji/CJK/most symbols weigh 2."
                    },
                    "media_ids": {
                      "type": "array",
                      "maxItems": 4,
                      "items": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "required": [
                              "id"
                            ],
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "alt": {
                                "type": "string",
                                "maxLength": 1500,
                                "description": "Accessibility description (alt text) for this media item."
                              }
                            }
                          }
                        ]
                      },
                      "description": "Optional per-part media as numeric Library IDs returned by POST /v1/media (bare IDs or { id, alt } objects). Resolved to hosted URLs at create time. Combined with media_urls, max 4 per tweet."
                    },
                    "media_urls": {
                      "type": "array",
                      "maxItems": 4,
                      "items": {
                        "oneOf": [
                          {
                            "type": "string",
                            "format": "uri"
                          },
                          {
                            "type": "object",
                            "required": [
                              "url"
                            ],
                            "properties": {
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "alt": {
                                "type": "string",
                                "maxLength": 1500,
                                "description": "Accessibility description (alt text) for this media item."
                              }
                            }
                          }
                        ]
                      },
                      "description": "Optional per-part media as external URLs (downloaded + hosted), as URL strings or { url, alt } objects. Combined with media_ids, max 4 per tweet."
                    }
                  }
                },
                "example": [
                  {
                    "text": "1/3: our results are in",
                    "media_ids": [
                      "12345"
                    ]
                  },
                  {
                    "text": "2/3: grab your free pick at https://example.com/signup"
                  },
                  {
                    "text": "3/3: and here's the slip",
                    "media_ids": [
                      "12346"
                    ]
                  }
                ]
              }
            }
          },
          "bluesky": {
            "type": "object",
            "description": "Bluesky options",
            "properties": {
              "thread_parts": {
                "type": "array",
                "minItems": 2,
                "maxItems": 25,
                "description": "Publish as a chained Bluesky thread instead of a single post. When omitted (or length < 2), `content.bluesky` (or `content.default`) is used as a single post. Each part is posted in order via AT Protocol reply refs (root + parent) so it renders as a thread. Attach media to any part with either `media_ids` (numeric Library IDs from POST /v1/media, the same IDs single posts use) or `media_urls` (external links). A part is a single video OR up to 4 images. If the post also has top-level `media_urls.bluesky` / media and the first part has no media of its own, the top-level media is attached to the first post. Links, mentions and hashtags are made clickable automatically (rich-text facets).",
                "items": {
                  "type": "object",
                  "required": [
                    "text"
                  ],
                  "properties": {
                    "text": {
                      "type": "string",
                      "maxLength": 300,
                      "description": "Post text (≤ 300 characters, counted as graphemes, so one emoji counts as 1)."
                    },
                    "media_ids": {
                      "type": "array",
                      "maxItems": 4,
                      "items": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "required": [
                              "id"
                            ],
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "alt": {
                                "type": "string",
                                "maxLength": 1500,
                                "description": "Accessibility description (alt text) for this media item."
                              }
                            }
                          }
                        ]
                      },
                      "description": "Optional per-part media as numeric Library IDs returned by POST /v1/media (bare IDs or { id, alt } objects). Resolved to hosted URLs at create time. A part is one video OR up to 4 images."
                    },
                    "media_urls": {
                      "type": "array",
                      "maxItems": 4,
                      "items": {
                        "oneOf": [
                          {
                            "type": "string",
                            "format": "uri"
                          },
                          {
                            "type": "object",
                            "required": [
                              "url"
                            ],
                            "properties": {
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "alt": {
                                "type": "string",
                                "maxLength": 1500,
                                "description": "Accessibility description (alt text) for this media item."
                              }
                            }
                          }
                        ]
                      },
                      "description": "Optional per-part media as external URLs (downloaded + hosted), as URL strings or { url, alt } objects. A part is one video OR up to 4 images."
                    }
                  }
                },
                "example": [
                  {
                    "text": "1/3: our results are in"
                  },
                  {
                    "text": "2/3: read the full writeup at https://example.com/post"
                  },
                  {
                    "text": "3/3: thanks for reading! #buildinpublic"
                  }
                ]
              }
            }
          },
          "mastodon": {
            "type": "object",
            "description": "Mastodon options",
            "properties": {
              "poll": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MastodonPoll"
                  }
                ],
                "nullable": true,
                "description": "Attach a poll to the status (the status text is the question). Options and `expires_in` (seconds) within the instance's limits: Mastodon's defaults are 2 to 4 options of up to 50 characters and 5 minutes to 1 month; `multiple` allows several answers, `hide_totals` hides the counts until the poll ends. A poll and media do not go together on Mastodon: the request is refused when the Mastodon channel also has media. On a thread the poll goes on the first status. On PATCH, `null` removes it."
              },
              "thread_parts": {
                "type": "array",
                "minItems": 2,
                "maxItems": 25,
                "description": "Publish as a chained Mastodon thread instead of a single status. When omitted (or length < 2), `content.mastodon` (or `content.default`) is used as a single status. Each part is posted in order as a native reply to the previous status (in_reply_to_id) so it renders as a thread. Attach media to any part with either `media_ids` (numeric Library IDs from POST /v1/media, the same IDs single posts use) or `media_urls` (external links). Max 4 media items per part. If the post also has top-level `media_urls.mastodon` / media and the first part has no media of its own, the top-level media is attached to the first status.",
                "items": {
                  "type": "object",
                  "required": [
                    "text"
                  ],
                  "properties": {
                    "text": {
                      "type": "string",
                      "maxLength": 500,
                      "description": "Status text (≤ 500 characters by default; some instances allow more)."
                    },
                    "media_ids": {
                      "type": "array",
                      "maxItems": 4,
                      "items": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "required": [
                              "id"
                            ],
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "alt": {
                                "type": "string",
                                "maxLength": 1500,
                                "description": "Accessibility description (alt text) shown to screen-reader users. The Mastodon community strongly values alt text on images."
                              }
                            }
                          }
                        ]
                      },
                      "description": "Optional per-part media as numeric Library IDs returned by POST /v1/media (bare IDs or { id, alt } objects). Resolved to hosted URLs at create time. Max 4 media items per part."
                    },
                    "media_urls": {
                      "type": "array",
                      "maxItems": 4,
                      "items": {
                        "oneOf": [
                          {
                            "type": "string",
                            "format": "uri"
                          },
                          {
                            "type": "object",
                            "required": [
                              "url"
                            ],
                            "properties": {
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "alt": {
                                "type": "string",
                                "maxLength": 1500,
                                "description": "Accessibility description (alt text) shown to screen-reader users. The Mastodon community strongly values alt text on images."
                              }
                            }
                          }
                        ]
                      },
                      "description": "Optional per-part media as external URLs (downloaded + hosted), as URL strings or { url, alt } objects. Max 4 media items per part."
                    }
                  }
                },
                "example": [
                  {
                    "text": "1/3: our picks are in"
                  },
                  {
                    "text": "2/3: read the full writeup at https://example.com/post"
                  },
                  {
                    "text": "3/3: thanks for reading! #fediverse"
                  }
                ]
              }
            }
          },
          "telegram": {
            "type": "object",
            "description": "Telegram options (2026-10-17). Telegram posts go to the connected channel or group through the OmniSocials bot. Text up to 4,096 characters; with media, text over 1,024 characters is sent as a reply under the media (Telegram's caption limit). Media: up to 10 photos and videos (an album), one GIF, one video up to 50 MB, or files. No Stories. Views are not available to bots: analytics report reactions and subscribers.",
            "properties": {
              "silent": {
                "type": "boolean",
                "description": "Send without a notification sound.",
                "example": false
              },
              "link_preview": {
                "type": "boolean",
                "default": true,
                "description": "Show a preview of the first link of a text-only post. Set false to hide it."
              },
              "pin": {
                "type": "boolean",
                "example": true,
                "description": "Pin the post in the chat after it is sent. Needs the bot's Edit messages right in a channel (Pin messages in a group); without it the post is sent unpinned and `telegram.result.pin_error` says why."
              },
              "protect_content": {
                "type": "boolean",
                "description": "Stop forwarding and saving of the post in Telegram apps.",
                "example": false
              },
              "spoiler": {
                "type": "boolean",
                "description": "Blur the photos and videos until someone taps them.",
                "example": false
              },
              "caption_above_media": {
                "type": "boolean",
                "description": "Show the text above the media instead of below.",
                "example": false
              },
              "buttons": {
                "type": "array",
                "maxItems": 3,
                "items": {
                  "$ref": "#/components/schemas/TelegramButton"
                },
                "description": "Up to 3 link buttons under the post, one per row. Not on an album (2+ media) or a poll: the request is refused."
              },
              "poll": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/TelegramPoll"
                  }
                ],
                "nullable": true,
                "description": "Send a native Telegram poll; the post text is the question (up to 300 characters). No media with a poll. On PATCH, `null` removes it."
              },
              "first_comment": {
                "type": "string",
                "maxLength": 4096,
                "description": "A reply the bot sends under the post right after it is published.",
                "example": "Full menu at the link in our bio."
              }
            }
          },
          "discord": {
            "type": "object",
            "description": "Discord options (2026-10-22). Discord posts go to the channel the workspace connected, through that channel's webhook; the message shows the webhook's name and picture. Text up to 2,000 characters. Media: up to 10 images, GIFs and videos in one message (they may mix). A file over Discord's 20 MB attachment limit is sent differently: an image is re-encoded to fit, a video or GIF goes as a link in the text (listed in `discord.result.video_links`). No Stories; a reel is sent as one video message. Statistics: reactions and poll votes only (Discord gives webhooks no views). A sent message can be deleted at any time.",
            "properties": {
              "silent": {
                "type": "boolean",
                "description": "Send without a push or desktop notification (Discord's @silent).",
                "example": false
              },
              "link_preview": {
                "type": "boolean",
                "default": true,
                "description": "Show the preview of the links in the text. Set false to hide it."
              },
              "allow_mentions": {
                "type": "boolean",
                "default": false,
                "description": "Let @everyone, @here, role and user mentions in the text notify people. Off by default: a mention shows as text and pings nobody."
              },
              "spoiler": {
                "type": "boolean",
                "description": "Blur every image and video until someone clicks it.",
                "example": false
              },
              "thread_name": {
                "type": "string",
                "maxLength": 100,
                "description": "The post title in a forum or media channel, where Discord requires one (1 to 100 characters). Only for those channels: a text channel takes none, so the post goes out there without it (warning `thread_name_ignored`). On PATCH, `null` removes it.",
                "example": "October menu"
              },
              "buttons": {
                "type": "array",
                "maxItems": 5,
                "items": {
                  "$ref": "#/components/schemas/DiscordButton"
                },
                "description": "Up to 5 link buttons in one row under the message. Not with a poll: the request is refused. On PATCH, `null` removes them."
              },
              "poll": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/DiscordPoll"
                  }
                ],
                "nullable": true,
                "description": "Send a native Discord poll; the post text is the question (1 to 300 characters). No media and no buttons with a poll. `duration_hours` defaults to 24. On PATCH, `null` removes it."
              }
            },
            "example": {
              "silent": true,
              "link_preview": false,
              "buttons": [
                {
                  "text": "Book a table",
                  "url": "https://example.com/book"
                }
              ]
            }
          },
          "threads": {
            "type": "object",
            "description": "Threads options: thread mode via `thread_parts`, location tag via `location_id`, poll via `poll`, topic via `topic_tag`.",
            "properties": {
              "topic_tag": {
                "type": "string",
                "nullable": true,
                "minLength": 1,
                "maxLength": 50,
                "description": "The topic of the post on Threads (one per post). Sent to Threads as `topic_tag` on the container create call; on a multi-post thread (`thread_parts`) it goes on the first post. Unlike a #tag in the text it can hold spaces, so a multi-word topic like \"Build in public\" works. 1 to 50 characters, no period (.) and no ampersand (&); a leading `#` is dropped and the text is trimmed. Sent with every Threads post type (text, image, video, carousel, poll). On PATCH, `null` removes the topic.",
                "example": "Build in public"
              },
              "poll": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ThreadsPoll"
                  }
                ],
                "nullable": true,
                "description": "Attach a poll to the post (the post text is the question). 2 to 4 options of 1 to 25 characters; Threads closes the poll 24 hours after it is published (no duration parameter). Polls go on text-only posts: the request is refused when the Threads channel also has media. On a thread the poll goes on the first post. On PATCH, `null` removes it."
              },
              "location_id": {
                "type": "string",
                "nullable": true,
                "description": "Tag a location on the Threads post. Use an `id` returned by `GET /locations/search?platform=threads&q=...` (Threads location ids are NOT Facebook Place IDs, so do not reuse the Instagram `location_id` here). Sent to Threads as `location_id` on the container create call; on a multi-post thread (`thread_parts`) the tag goes on the first post. Requires the workspace's Threads connection to have the `threads_location_tagging` permission: create/update/publish return 400 `validation_error` naming the reconnect when it is missing, and 400 when location tagging is not enabled in this environment yet. On PATCH, `null` clears the tag. Alternative: pass `location` as an object `{ id, name, address, city, country }` to store display fields along with the id; `location_id` wins when both are given.",
                "example": "17841400000000000"
              },
              "location": {
                "type": "object",
                "nullable": true,
                "description": "Alternative to `location_id`: the full search result so the dashboard can show the place name without another Threads call. Only `id` is required; the other fields are stored as given (not resolved against Threads). `null` clears the tag on PATCH.",
                "properties": {
                  "id": {
                    "type": "string",
                    "example": "17841400000000000"
                  },
                  "name": {
                    "type": "string",
                    "example": "Griffith Observatory"
                  },
                  "address": {
                    "type": "string",
                    "example": "2800 E Observatory Rd"
                  },
                  "city": {
                    "type": "string",
                    "example": "Los Angeles"
                  },
                  "country": {
                    "type": "string",
                    "example": "United States"
                  }
                }
              },
              "thread_parts": {
                "type": "array",
                "minItems": 2,
                "maxItems": 25,
                "description": "Publish as a chained Threads thread instead of a single post. When omitted (or length < 2), `content.threads` (or `content.default`) is used as a single post. Each part is posted in order as a native reply to the previous post (reply_to_id) so it renders as a thread under the first post. Attach media to any part with either `media_ids` (numeric Library IDs from POST /v1/media, the same IDs single posts use) or `media_urls` (external links), max 10 media items per part (images and videos can be mixed; 2+ items publish as a carousel). If the post also has top-level `media_urls.threads` / media and the first part has no media of its own, the top-level media is attached to the first post.",
                "items": {
                  "type": "object",
                  "required": [
                    "text"
                  ],
                  "properties": {
                    "text": {
                      "type": "string",
                      "maxLength": 500,
                      "description": "Post text (up to 500 characters)."
                    },
                    "media_ids": {
                      "type": "array",
                      "maxItems": 10,
                      "items": {
                        "oneOf": [
                          {
                            "type": "string"
                          },
                          {
                            "type": "object",
                            "required": [
                              "id"
                            ],
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "alt": {
                                "type": "string",
                                "maxLength": 1500,
                                "description": "Accessibility description (alt text) sent to Threads as alt_text."
                              }
                            }
                          }
                        ]
                      },
                      "description": "Optional per-part media as numeric Library IDs returned by POST /v1/media (bare IDs or { id, alt } objects). Resolved to hosted URLs at create time. Max 10 media items per part."
                    },
                    "media_urls": {
                      "type": "array",
                      "maxItems": 10,
                      "items": {
                        "oneOf": [
                          {
                            "type": "string",
                            "format": "uri"
                          },
                          {
                            "type": "object",
                            "required": [
                              "url"
                            ],
                            "properties": {
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "alt": {
                                "type": "string",
                                "maxLength": 1500,
                                "description": "Accessibility description (alt text) sent to Threads as alt_text."
                              }
                            }
                          }
                        ]
                      },
                      "description": "Optional per-part media as external URLs (downloaded + hosted), as URL strings or { url, alt } objects. Max 10 media items per part."
                    }
                  }
                },
                "example": [
                  {
                    "text": "1/3: our results are in"
                  },
                  {
                    "text": "2/3: read the full writeup: https://example.com/post"
                  },
                  {
                    "text": "3/3: thanks for reading! #buildinpublic"
                  }
                ]
              }
            }
          },
          "google_business": {
            "type": "object",
            "description": "Google Business Profile options. Use to publish EVENT or OFFER posts in addition to STANDARD, attach a call-to-action button, or both. STANDARD posts can also use this object purely to add a CTA. The shape mirrors Google's LocalPost JSONB exactly; see https://developers.google.com/my-business/reference/rest/v4/accounts.locations.localPosts#LocalPost.\n\nCaption rules, enforced at scheduling (text that violates these returns `validation_error` 400 before the post is saved):\n  • No phone numbers in the caption (use a CALL button instead).\n  • No inline URLs / bare domains / email addresses (use a LEARN_MORE, BOOK, SHOP, SIGN_UP, or ORDER button instead).\n  • Caption max 1500 characters.\n  • Media optional (text-only posts allowed). If attached: exactly one JPEG/PNG/WebP image (no video, no carousels).\n  • The workspace must have a Google Business location selected (Settings → Organisation → Workspaces → Google Business) before scheduling.\n",
            "properties": {
              "topic_type": {
                "type": "string",
                "enum": [
                  "STANDARD",
                  "EVENT",
                  "OFFER"
                ],
                "default": "STANDARD",
                "description": "Local post topic type. ALERT is reserved by Google and not exposed."
              },
              "cta": {
                "type": "object",
                "description": "Optional call-to-action button rendered under the caption on the Google Business Profile.",
                "properties": {
                  "actionType": {
                    "type": "string",
                    "enum": [
                      "LEARN_MORE",
                      "BOOK",
                      "ORDER",
                      "SHOP",
                      "SIGN_UP",
                      "CALL"
                    ]
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "Required for every actionType except CALL. CALL uses the location's phone number from the business profile.",
                    "example": "https://example.com/book"
                  }
                }
              },
              "event": {
                "type": "object",
                "description": "Required when topic_type is EVENT or OFFER (Google requires the title and dates for offers too: the offer's name and validity period).",
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 58,
                    "example": "Autumn tasting night"
                  },
                  "schedule": {
                    "type": "object",
                    "description": "Google's split date+time shape. startDate is required; startTime/endDate/endTime are optional. End (if present) must be ≥ start.",
                    "properties": {
                      "startDate": {
                        "type": "object",
                        "properties": {
                          "year": {
                            "type": "integer",
                            "example": 2026
                          },
                          "month": {
                            "type": "integer",
                            "example": 10
                          },
                          "day": {
                            "type": "integer",
                            "example": 24
                          }
                        }
                      },
                      "startTime": {
                        "type": "object",
                        "properties": {
                          "hours": {
                            "type": "integer",
                            "example": 18
                          },
                          "minutes": {
                            "type": "integer",
                            "example": 0
                          }
                        }
                      },
                      "endDate": {
                        "type": "object",
                        "properties": {
                          "year": {
                            "type": "integer",
                            "example": 2026
                          },
                          "month": {
                            "type": "integer",
                            "example": 10
                          },
                          "day": {
                            "type": "integer",
                            "example": 24
                          }
                        }
                      },
                      "endTime": {
                        "type": "object",
                        "properties": {
                          "hours": {
                            "type": "integer",
                            "example": 22
                          },
                          "minutes": {
                            "type": "integer",
                            "example": 0
                          }
                        }
                      }
                    }
                  }
                }
              },
              "offer": {
                "type": "object",
                "description": "Required when topic_type is OFFER. Must include at least one of couponCode or redeemOnlineUrl.",
                "properties": {
                  "couponCode": {
                    "type": "string",
                    "maxLength": 58,
                    "example": "AUTUMN20"
                  },
                  "redeemOnlineUrl": {
                    "type": "string",
                    "format": "uri",
                    "description": "Must be https://. http URLs are rejected.",
                    "example": "https://example.com/offer"
                  },
                  "termsConditions": {
                    "type": "string",
                    "maxLength": 4000,
                    "example": "Valid until 31 October 2026."
                  }
                }
              }
            }
          }
        }
      },
      "Media": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Media ID (use this in post creation)",
            "example": "482913"
          },
          "url": {
            "type": "string",
            "description": "Permanent CDN URL for the media",
            "example": "https://cdn.omnisocials.com/file/library-omnisocials/312a658f-2b45-4289-b240-890807221a74/library/1792573200000-k3j9xq_0c9e6b1a-2f4d-4b8e-a7c3-9d1e5f6a2b70.jpg"
          },
          "thumbnail_url": {
            "type": "string",
            "nullable": true,
            "description": "CDN URL of the generated preview thumbnail (videos only; null for images, which use `url` directly)",
            "example": "https://cdn.omnisocials.com/file/library-omnisocials/312a658f-2b45-4289-b240-890807221a74/library/thumbnails/1792573200000-k3j9xq_0c9e6b1a-2f4d-4b8e-a7c3-9d1e5f6a2b70_thumbnail.webp"
          },
          "type": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "document"
            ],
            "description": "`document` is a PDF kept as one item (see `pdf`): its id in `media_ids` expands into every page image, in order."
          },
          "name": {
            "type": "string",
            "nullable": true,
            "description": "Human-readable label set on upload or via PATCH (e.g. \"pp-play5get50\"). Falls back to the storage filename when unset. Search this with the `search` query param.",
            "example": "autumn-menu-hero"
          },
          "folder_id": {
            "type": "string",
            "nullable": true,
            "description": "Id of the folder this file lives in, or null for the root (\"All media\")",
            "example": "12"
          },
          "filename": {
            "type": "string",
            "description": "Generated storage filename (stable, used internally)",
            "example": "0c9e6b1a-2f4d-4b8e-a7c3-9d1e5f6a2b70.jpg"
          },
          "size": {
            "type": "string",
            "description": "Human-formatted file size (e.g. \"2.50 MB\")",
            "example": "2.50 MB"
          },
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "processing",
              "failed"
            ],
            "description": "Processing state. 'ready' for normal uploads (usable immediately). Large videos uploaded via URL ingestion (over 100 MB) start as 'processing': poll get media / list media until 'ready' before using them in a post. 'failed' means the source couldn't be fetched or validated.\n"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-20T14:32:10.000Z"
          },
          "pdf": {
            "type": "object",
            "description": "Present on a PDF document item (type `document`): the kept file and its rendered `pages` in order. Also present on a slide rendered from a PDF (type `image`): which original file and `page` it came from. The original PDF is kept in storage. When a LinkedIn post's images are exactly the rendered pages of one PDF, in order and unchanged, LinkedIn receives that original file (sharp text, working in-document links, the real download) instead of a document rebuilt from the page images. Opt out per channel with `document_source: \"slides\"` on the post's `linkedin` / `linkedin_page` options.\n",
            "properties": {
              "id": {
                "type": "string",
                "description": "Shared by the document item and every slide split from it.",
                "example": "9a7e3c1f-5b2d-4e8a-b6c4-1f3d5e7a9b20"
              },
              "name": {
                "type": "string",
                "description": "Original file name, e.g. \"deck.pdf\".",
                "example": "deck.pdf"
              },
              "url": {
                "type": "string",
                "description": "CDN URL of the original PDF.",
                "example": "https://cdn.omnisocials.com/file/library-omnisocials/312a658f-2b45-4289-b240-890807221a74/library/1792573200000-p7m2wd_9a7e3c1f-5b2d-4e8a-b6c4-1f3d5e7a9b20.pdf"
              },
              "page": {
                "type": "integer",
                "description": "Slides only. 1-based page this slide renders.",
                "example": 1
              },
              "total_pages": {
                "type": "integer",
                "example": 8
              },
              "rendered_pages": {
                "type": "integer",
                "description": "Pages turned into page images (max 20).",
                "example": 8
              },
              "truncated": {
                "type": "boolean",
                "description": "Document items only. True when the file has more pages than were rendered.",
                "example": false
              },
              "pages": {
                "type": "array",
                "description": "Document items only. The rendered page images, in page order; these are what a post carries.",
                "items": {
                  "type": "object",
                  "properties": {
                    "url": {
                      "type": "string",
                      "example": "https://cdn.omnisocials.com/file/library-omnisocials/312a658f-2b45-4289-b240-890807221a74/library/1792573200000-p7m2wd_4c2e8a6f-1d3b-4f5a-9e7c-0b2d4f6a8c13.png"
                    },
                    "width": {
                      "type": "integer",
                      "nullable": true,
                      "example": 1080
                    },
                    "height": {
                      "type": "integer",
                      "nullable": true,
                      "example": 1350
                    }
                  }
                }
              }
            }
          }
        }
      },
      "MediaCompatibility": {
        "type": "object",
        "description": "Whether the file fits the platforms connected to your workspace. `compatible` is true when no connected platform would reject it.\n",
        "properties": {
          "compatible": {
            "type": "boolean",
            "example": false
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string",
                  "example": "instagram"
                },
                "display_name": {
                  "type": "string",
                  "example": "Instagram"
                },
                "reasons": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "example": "max 300 MB"
                  },
                  "description": "e.g. [\"max 300 MB\"], [\"format not supported\"]"
                }
              }
            }
          },
          "summary": {
            "type": "string",
            "nullable": true,
            "description": "One-line human summary, or null when fully compatible.",
            "example": "This file (450 MB) won't post to: Instagram (max 300 MB)."
          }
        }
      },
      "PdfUploadResult": {
        "type": "object",
        "description": "Returned when the uploaded file is a PDF. With `pdf_mode: slides` (the default) the server rasterizes each page into an image slide and stores each as its own media item, and keeps the original PDF too. `data` mirrors the FIRST slide (so callers that read a single Media still work); `slides` and `media_ids` carry the whole carousel in page order. Pass ALL of `media_ids` to POST /posts as a carousel. With `pdf_mode: document` the response has no `slides`: `data` is the single document item (type `document`, pages in `data.pdf.pages`) and `media_ids` holds its one id, which expands into every page at post time. On LinkedIn it posts as a swipeable document made from the original PDF file (text stays sharp, links keep working, viewers download the real file); on Instagram, TikTok, Threads and Pinterest as an image carousel. Slides are capped at 20 pages; the original sent to LinkedIn is the whole file.\n",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Media"
          },
          "slides": {
            "type": "array",
            "description": "Every page as a Media item, in page order.",
            "items": {
              "$ref": "#/components/schemas/Media"
            }
          },
          "media_ids": {
            "type": "array",
            "description": "Slide ids in page order. Pass all of them to POST /posts.",
            "items": {
              "type": "string",
              "example": "482913"
            }
          },
          "pdf": {
            "type": "object",
            "properties": {
              "total_pages": {
                "type": "integer",
                "example": 8
              },
              "rendered_pages": {
                "type": "integer",
                "example": 8
              },
              "truncated": {
                "type": "boolean",
                "example": false,
                "description": "True when the PDF had more than 20 pages and only the first 20 became slides. LinkedIn still receives the full original."
              },
              "id": {
                "type": "string",
                "description": "Id of the kept original PDF (shared by every slide's `pdf.id`).",
                "example": "9a7e3c1f-5b2d-4e8a-b6c4-1f3d5e7a9b20"
              },
              "name": {
                "type": "string",
                "description": "Original file name, e.g. \"deck.pdf\".",
                "example": "deck.pdf"
              },
              "url": {
                "type": "string",
                "description": "CDN URL of the kept original PDF.",
                "example": "https://cdn.omnisocials.com/file/library-omnisocials/312a658f-2b45-4289-b240-890807221a74/library/1792573200000-p7m2wd_9a7e3c1f-5b2d-4e8a-b6c4-1f3d5e7a9b20.pdf"
              },
              "size_bytes": {
                "type": "integer",
                "example": 2483017
              }
            }
          },
          "compatibility": {
            "$ref": "#/components/schemas/MediaCompatibility"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "Folder": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "parent_id": {
            "type": "string",
            "nullable": true,
            "description": "Parent folder id, or null for a top-level folder"
          },
          "item_count": {
            "type": "integer",
            "description": "Number of media items directly in this folder"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Tag": {
        "type": "object",
        "description": "A workspace's own label for its posts (for example a hook style or a format), to filter and compare posts in Analytics. Never sent to a platform.",
        "properties": {
          "id": {
            "type": "integer",
            "example": 12
          },
          "name": {
            "type": "string",
            "example": "Question hook"
          },
          "color": {
            "type": "string",
            "enum": [
              "blue",
              "green",
              "orange",
              "red",
              "purple",
              "pink",
              "teal",
              "yellow",
              "brown",
              "gray"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TagInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 40,
            "description": "Unique in the workspace (case-insensitive)."
          },
          "color": {
            "type": "string",
            "enum": [
              "blue",
              "green",
              "orange",
              "red",
              "purple",
              "pink",
              "teal",
              "yellow",
              "brown",
              "gray"
            ],
            "description": "Omit on create to get the next colour of the palette."
          }
        }
      },
      "HashtagSet": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "Set name, unique per workspace (case-insensitive)"
          },
          "hashtags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Ordered tags WITHOUT the leading '#'"
          },
          "hashtag_count": {
            "type": "integer"
          },
          "preview": {
            "type": "string",
            "description": "The tags rendered as caption text, e.g. \"#fitness"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApprovalWorkflowApprover": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "User id of the approver"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          }
        }
      },
      "ApprovalWorkflowStep": {
        "type": "object",
        "properties": {
          "order": {
            "type": "integer",
            "description": "1-based step order; steps are approved in order"
          },
          "name": {
            "type": "string"
          },
          "require_mode": {
            "type": "string",
            "enum": [
              "any",
              "all"
            ],
            "description": "`any` = one approver of this step is enough; `all` = every approver must approve"
          },
          "approvers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalWorkflowApprover"
            }
          }
        }
      },
      "ApprovalWorkflow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "57823504",
            "description": "Pass this as `approval_workflow_id` on POST /posts/create"
          },
          "name": {
            "type": "string",
            "example": "Client review"
          },
          "workspace_id": {
            "type": "integer",
            "nullable": true,
            "description": "Workspace the workflow is bound to, or null when it is available to every workspace of the company"
          },
          "steps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApprovalWorkflowStep"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Account ID (use this when creating posts)",
            "example": "1234_instagram"
          },
          "platform": {
            "type": "string",
            "enum": [
              "instagram",
              "facebook",
              "linkedin",
              "linkedin_page",
              "youtube",
              "tiktok",
              "pinterest",
              "bluesky",
              "threads",
              "mastodon",
              "x",
              "google_business",
              "reddit",
              "snapchat",
              "telegram",
              "discord"
            ]
          },
          "username": {
            "type": "string",
            "nullable": true,
            "description": "Social media username/handle. Null where the account has none, such as a Discord channel (a server has no handle; the webhook name posts show is in platform_details.webhook_name).",
            "example": "yourbrand"
          },
          "display_name": {
            "type": "string",
            "description": "Display name on the platform. Discord: the server name for a connection made with Continue with Discord, the webhook name for a pasted webhook URL.",
            "example": "Your Brand"
          },
          "profile_picture": {
            "type": "string",
            "description": "Profile picture URL",
            "example": "https://example.com/avatar.jpg"
          },
          "content_types": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "post",
                "story",
                "reel"
              ]
            },
            "description": "Supported content types for this platform"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "needs_reconnect",
              "pick_pending"
            ],
            "description": "Connection status. `needs_reconnect` means the account is still wired up to the workspace but its OAuth token has been revoked or expired; posts to this account will fail until the user reconnects in the OmniSocials UI. Most often caused by the user changing their password, deauthorizing OmniSocials on the platform, or the token expiring without a successful refresh. `pick_pending` (Facebook, OmniSocials Connect customers only): the Facebook login manages several Pages and none is chosen yet; posts to this account fail until the Page is chosen (connect Facebook again and pick the Page)."
          },
          "needs_reconnect": {
            "type": "boolean",
            "description": "Convenience boolean: `true` when `status` is `needs_reconnect`.",
            "example": false
          },
          "pick_pending": {
            "type": "boolean",
            "description": "Convenience boolean: `true` when `status` is `pick_pending`. Such an account cannot be posted to; `username`, `display_name` and `profile_picture` then name the person who signed in, not a Page.",
            "example": false
          },
          "reauth_reason": {
            "type": "string",
            "nullable": true,
            "example": "OAuthException: Session has expired",
            "description": "Short reason from the platform (e.g. \"OAuthException: Session has expired\"). Present only when `needs_reconnect` is true. Token-health tracking exists for Instagram, Facebook, Threads, X, Pinterest, LinkedIn (profile + page), TikTok (TikTok refused the refresh token, or it passed its end date), Bluesky (the sign-in could not be renewed), Telegram (the bot was removed or lost the right to post) and Discord (the webhook was deleted in Discord); other platforms always report `needs_reconnect: false`."
          },
          "boards": {
            "type": "array",
            "description": "Pinterest boards (only present for Pinterest accounts). Use board `id` as `board_id` when creating Pinterest posts.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Board ID (use as board_id when creating posts)",
                  "example": "1234567890123456789"
                },
                "name": {
                  "type": "string",
                  "description": "Board name",
                  "example": "Recipes"
                }
              }
            }
          },
          "platform_details": {
            "type": "object",
            "description": "Platform-specific details. Present for X accounts with a Premium subscription, and for every Telegram and Discord account.",
            "properties": {
              "subscription_type": {
                "type": "string",
                "description": "X subscription tier (e.g. \"Premium\", \"PremiumPlus\")",
                "example": "Premium"
              },
              "chat_type": {
                "type": "string",
                "enum": [
                  "channel",
                  "group",
                  "supergroup"
                ],
                "description": "Telegram: what kind of chat OmniSocials posts to. In a group, posts show the OmniSocials bot as the sender."
              },
              "chat_id": {
                "type": "string",
                "description": "Telegram: the chat id (e.g. -1001234567890).",
                "example": "-1001234567890"
              },
              "subscribers": {
                "type": "integer",
                "nullable": true,
                "description": "Telegram: subscribers (channel) or members (group) at the last daily check.",
                "example": 1250
              },
              "url": {
                "type": "string",
                "nullable": true,
                "description": "Telegram: t.me link to the chat (public chats), or the t.me/c link members can open. Discord: discord.com/channels link to the channel, which members of the server can open.",
                "example": "https://t.me/brand"
              },
              "guild_id": {
                "type": "string",
                "nullable": true,
                "description": "Discord: the id of the server the channel is in.",
                "example": "1180000000000000000"
              },
              "guild_name": {
                "type": "string",
                "nullable": true,
                "description": "Discord: the server name. Known for a connection made with Continue with Discord, and for a pasted webhook URL in a server the OmniSocials bot is in.",
                "example": "Brand Community"
              },
              "channel_id": {
                "type": "string",
                "nullable": true,
                "description": "Discord: the id of the channel OmniSocials posts to.",
                "example": "1180000000000000001"
              },
              "channel_name": {
                "type": "string",
                "nullable": true,
                "description": "Discord: the channel name, without the #. Discord gives a webhook no channel name: the OmniSocials bot reads it (Continue with Discord adds the bot, with no permissions), or the person typed it when connecting. null when neither is known.",
                "example": "announcements"
              },
              "channel_type": {
                "type": "string",
                "nullable": true,
                "enum": [
                  "text",
                  "voice",
                  "announcement",
                  "stage",
                  "forum",
                  "media"
                ],
                "description": "Discord: the kind of channel, as the bot read it. A forum or media channel needs discord.thread_name on every post; a voice or stage channel shows posts in its chat. null when the bot cannot see the channel."
              },
              "webhook_name": {
                "type": "string",
                "nullable": true,
                "description": "Discord: the name of the webhook. Posts show this name and the webhook's picture as the sender; change them in Discord (Server Settings > Integrations > Webhooks).",
                "example": "OmniSocials"
              },
              "connect_method": {
                "type": "string",
                "enum": [
                  "oauth",
                  "url"
                ],
                "description": "Discord: `oauth` = connected with Continue with Discord, `url` = a pasted webhook URL."
              }
            }
          },
          "connected_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-03-02T10:15:00.000Z"
          }
        }
      },
      "PostAnalytics": {
        "type": "object",
        "properties": {
          "post_id": {
            "type": "string",
            "example": "1024"
          },
          "platforms": {
            "type": "object",
            "description": "One entry per platform the post was published to. For thread platforms (X, Bluesky, Mastodon, Threads) a post can publish as a chain of several parts; the entry sums each part's metrics so you get the thread's total (matching the in-app analytics), and reports the thread's root as `platform_post_id`.\n",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "platform": {
                  "type": "string",
                  "example": "instagram"
                },
                "platform_post_id": {
                  "type": "string",
                  "description": "The post's id on the platform. For a thread this is the root part (tweet/post/toot).",
                  "example": "17912345678901234"
                },
                "metrics": {
                  "type": "object",
                  "description": "Platform-specific metrics, as the platform reports them. A missing key means the platform does not report it; a 0 is a measured zero. For a thread, counts are summed across all parts and rates/averages are averaged. Common keys: `views`, `impressions`, `reach`, `likes`, `comments`, `replies`, `shares`, `reposts`, `quotes`, `saves`, `bookmarks`, `clicks`, `link_clicks`, `profile_visits`, `follows` (follows gained from the post), `engagement`, `reactions` (object by type). `link_clicks` is clicks on links in the post (X `url_link_clicks` for posts under 30 days, LinkedIn profile LINK_CLICKS, Facebook link clicks from `clicks_breakdown`, Pinterest outbound clicks, Instagram story link sticker taps); `clicks` is the platform's broadest click count (Facebook `post_clicks`, LinkedIn Page `clickCount`, which cannot be split into link clicks). `reach` is absent, never 0, on platforms with no reach metric (X, Pinterest, YouTube, Threads, Bluesky, Mastodon) and on Facebook: Meta retired Facebook post reach in June 2026 and its replacement metric returns no data. Video keys: `video_views`, `duration` (s), `avg_watch_time` (s), `total_watch_time` (s), `watch_time_percentage`, `completion_rate`, `skip_rate`, `replays`, `engaged_views`, `traffic_sources` (YouTube, object), `impression_sources` and `audience_types` (TikTok Business, objects with percentages). Retention: `hold_rate_3s` is the percent of viewers still watching at second 3 (TikTok videos with TikTok comments enabled, Facebook Reels, and Instagram Reels, where it is 100 minus `skip_rate`, Meta's share of views that skipped in the first 3 seconds). `retention_curve` (TikTok videos, Facebook Reels and feed videos) is the percent of viewers still watching along the video: `{ x, base, duration, points }`, where `points` is a list of `[position, percent]`, `x` says whether a position is in `seconds` (TikTok, one point per second, thinned to 120 points on long videos) or in `percent` of the video's length (Facebook), `duration` is the length in seconds when known, and `base` says what 100% is: `views` (TikTok), `plays` (Facebook Reels) or `views_3s` (Facebook feed videos count against 3-second views, so values can pass 100 and no `hold_rate_3s` is derived). Instagram and YouTube give no curve through their APIs. Pinterest: `pin_clicks`, `outbound_clicks`, `save_rate`, `pin_click_rate`, `outbound_click_rate`, `video_starts`. Instagram stories: `navigation`, `navigation_breakdown`, `profile_activity_breakdown`, `completion_analysis`. Telegram and Discord report no views: their entries carry the reaction total as `likes`, the count per emoji in `reactions`, and the votes of a poll in `poll`. Items a platform cannot measure (Google Business posts, deleted videos) carry `metrics_unavailable: true` and a `note` instead of zeros. A Facebook entry whose connection lacks Facebook's insights permission carries `insights_permission_missing: true` and a `note` with the fix (reconnect Facebook and leave every box on): `views`, `video_views` and `clicks` are then missing, not 0, while likes and comments are complete.\n",
                  "example": {
                    "views": 1520,
                    "reach": 1210,
                    "likes": 84,
                    "comments": 6,
                    "shares": 3,
                    "saves": 11
                  }
                },
                "thread_parts": {
                  "type": "integer",
                  "description": "Number of parts summed into this entry. 1 for a single (non-thread, single-slide) post. For a multi-slide story this is the number of slides with stats.",
                  "example": 1
                },
                "story_slides": {
                  "type": "array",
                  "description": "Multi-slide stories only. One entry per slide in publish order, each with that slide's own metrics (the parent `metrics` is the sum across slides). Absent on single-slide stories and on every other post type.\n",
                  "items": {
                    "type": "object",
                    "properties": {
                      "index": {
                        "type": "integer",
                        "description": "Zero-based slide position."
                      },
                      "platform_post_id": {
                        "type": "string",
                        "description": "The slide's own story id on the platform."
                      },
                      "metrics": {
                        "type": "object"
                      },
                      "collected_at": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                },
                "collected_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Most recent collection time across the summed parts.",
                  "example": "2026-10-21T15:00:12.000Z"
                }
              }
            }
          }
        }
      },
      "AnalyticsOverview": {
        "type": "object",
        "properties": {
          "total_posts": {
            "type": "integer",
            "example": 42
          },
          "total_platforms": {
            "type": "integer",
            "example": 4
          },
          "total_engagement": {
            "type": "number",
            "example": 3180
          },
          "total_impressions": {
            "type": "number",
            "example": 96400
          },
          "average_engagement_rate": {
            "type": "number",
            "description": "Engagement rate as a percentage (0-100)",
            "example": 3.3
          },
          "top_performing_platform": {
            "type": "string",
            "nullable": true,
            "example": "instagram"
          },
          "platform_breakdown": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "posts": {
                  "type": "integer",
                  "example": 12
                },
                "total_engagement": {
                  "type": "number",
                  "example": 1420
                },
                "total_impressions": {
                  "type": "number",
                  "example": 38200
                },
                "average_engagement": {
                  "type": "number",
                  "example": 118.3
                },
                "engagement_rate": {
                  "type": "number",
                  "example": 3.72
                }
              }
            }
          }
        }
      },
      "AccountAnalytics": {
        "type": "object",
        "properties": {
          "platform": {
            "type": "string",
            "example": "instagram"
          },
          "platform_account_id": {
            "type": "string"
          },
          "date": {
            "type": "string",
            "format": "date",
            "example": "2026-10-20"
          },
          "metrics": {
            "type": "object",
            "description": "Account-level metrics for the snapshot date, as the platform reports them. Stock values: `followers`, `following`, `posts`, and platform extras (`monthly_views`, `pin_count`, `listed`, `media_count`, `average_rating`, `review_count`, `total_views`, `total_videos`). Day values (`period: \"daily\"`): `impressions` (views), `reach`, `engagement`, `likes`, `comments`, `shares`, `saves`, `profile_views`, `link_clicks`, `follows_gained`, `follows_lost`, `accounts_engaged`, `video_views`, `watch_time_minutes`, and Google Business `calls`, `direction_requests`, `website_clicks`, `bookings`, `impressions_breakdown`, `search_keywords`. Audience objects when available: `demographics` (age, gender, country, city, or LinkedIn function, seniority, industry) with `demographics_unit`, `online_followers` (UTC hour -> followers online), `link_clicks_breakdown` (Threads, per URL). LinkedIn profile rows keep `impressions_lifetime` and carry `period: \"lifetime\"` when the daily breakdown is not available. Read the `note` field where present.\n",
            "example": {
              "followers": 12840,
              "following": 310,
              "posts": 412
            }
          },
          "collected_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-20T23:10:04.000Z"
          }
        }
      },
      "TagSummary": {
        "type": "object",
        "properties": {
          "posts": {
            "type": "integer"
          },
          "measured": {
            "type": "integer",
            "description": "Posts with numbers"
          },
          "median_impressions": {
            "type": "number",
            "nullable": true
          },
          "engagement_rate": {
            "type": "number",
            "nullable": true,
            "description": "Percent (5.4 = 5.4%)"
          },
          "vs_normal": {
            "type": "number",
            "nullable": true,
            "description": "Fraction against your normal (0.38 = 38% above, -0.2 = 20% below)"
          },
          "best_channel": {
            "type": "string",
            "nullable": true,
            "description": "Channel where the tag beats your normal by the most (3 posts there at least)"
          },
          "enough_posts": {
            "type": "boolean"
          }
        }
      },
      "TagComparison": {
        "allOf": [
          {
            "$ref": "#/components/schemas/TagSummary"
          },
          {
            "type": "object",
            "properties": {
              "tag": {
                "$ref": "#/components/schemas/Tag"
              }
            }
          }
        ]
      },
      "Webhook": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "example": "74327072-ec54-473c-837f-63b29187ac16"
          },
          "workspace_id": {
            "type": "integer",
            "nullable": true,
            "description": "The workspace whose events the webhook receives. Null for an organisation-wide webhook (made in the OmniSocials dashboard), which receives the events of every workspace in the organisation. Webhooks created through the API belong to the key's workspace, and a new url set through the API moves an organisation-wide webhook to the key's workspace.",
            "example": 1234
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "URL to receive webhook events",
            "example": "https://example.com/webhooks/omnisocials"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "post.scheduled",
                "post.published",
                "post.failed",
                "post.approved",
                "post.rejected",
                "x_statistics.paused",
                "x_statistics.resumed"
              ]
            },
            "description": "Events to subscribe to"
          },
          "is_active": {
            "type": "boolean",
            "description": "False when switched off, by a PATCH or automatically when the person who set the webhook up no longer has access to its organisation or workspace (or, for Ads events, to Ads; for an organisation-wide webhook, to Manage API keys), or when the API key or the OAuth app that set it up (or last changed its url or events, or switched it on) was revoked, deleted, expired or disconnected. An automatic switch-off says why in last_failure.error; a PATCH with is_active true from an active key or app switches it on again and binds it to that key or app. Failed deliveries never switch a webhook off.",
            "example": true
          },
          "last_triggered_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-21T09:00:07.000Z"
          },
          "failure_count": {
            "type": "integer",
            "description": "Consecutive delivery failures since the last success. Resets to 0 on any successful delivery, so 0 means currently healthy.",
            "example": 0
          },
          "last_failure": {
            "type": "object",
            "nullable": true,
            "description": "Details of the most recent failed delivery, or of an automatic switch-off (status null, attempts 0, error says why). Not cleared on success, so it persists as the last known problem even when failure_count is 0. Null if no delivery has ever failed.",
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time",
                "description": "When the failure was recorded",
                "example": "2026-10-18T07:42:31.000Z"
              },
              "status": {
                "type": "integer",
                "nullable": true,
                "description": "HTTP status your endpoint returned, or null for a network error/timeout",
                "example": 404
              },
              "error": {
                "type": "string",
                "description": "Human-readable reason (e.g. \"Endpoint responded with HTTP 404\", \"No response within 10s (timeout)\", \"No complete answer within 15s (timeout)\", \"Endpoint answer is larger than 1 MB\"). The whole answer must arrive within 15 seconds and be at most 1 MB.",
                "example": "Endpoint responded with HTTP 404"
              },
              "attempts": {
                "type": "integer",
                "description": "Number of delivery attempts made before giving up",
                "example": 4
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-09-30T12:00:00.000Z"
          }
        }
      },
      "WebhookPayload": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique delivery event ID (also sent as the X-OmniSocials-Delivery header)",
            "example": "80fbb5db-f0fa-4555-8c8d-8fc4fde94468"
          },
          "type": {
            "type": "string",
            "enum": [
              "post.scheduled",
              "post.published",
              "post.failed",
              "post.approved",
              "post.rejected",
              "x_statistics.paused",
              "x_statistics.resumed"
            ],
            "description": "Event type",
            "example": "post.published"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-21T09:00:07.000Z"
          },
          "data": {
            "type": "object",
            "description": "Event payload. Post fields (below) for post.* events.",
            "properties": {
              "post_id": {
                "type": "string",
                "description": "The post's ID (numeric string)",
                "example": "1024"
              },
              "workspace_id": {
                "type": "integer",
                "example": 1234
              },
              "status": {
                "type": "string",
                "description": "Post status at the time of the event (scheduled, posted, warning, failed, posting, rejected)",
                "example": "posted"
              },
              "post_type": {
                "type": "string",
                "example": "Post"
              },
              "approval": {
                "type": "object",
                "description": "Only on `post.approved` and `post.rejected`: how the review of the post ended. Read the full review (steps, approvers, comments) with GET /posts/{id}/approval.",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "approved",
                      "rejected"
                    ],
                    "example": "rejected"
                  },
                  "decided_by": {
                    "type": "string",
                    "description": "User ID of the approver who gave the last approval, or who rejected the post",
                    "example": "312a658f-2b45-4289-b240-890807221a74"
                  },
                  "reason": {
                    "type": "string",
                    "nullable": true,
                    "description": "The reason the approver gave with a rejection. Null on post.approved and when no reason was given.",
                    "example": "Wrong product photo"
                  }
                }
              },
              "scheduled_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "example": "2026-10-21T09:00:00.000Z"
              },
              "published_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "example": "2026-10-21T09:00:07.000Z"
              },
              "targets": {
                "type": "array",
                "description": "Per-platform results. Empty for post.scheduled, post.approved and post.rejected.",
                "items": {
                  "type": "object",
                  "properties": {
                    "platform": {
                      "type": "string",
                      "example": "instagram"
                    },
                    "status": {
                      "type": "string",
                      "description": "success or failed",
                      "example": "success"
                    },
                    "native_post_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "The post's ID on the platform itself (e.g. Instagram media ID, tweet ID). Null if the platform returned none.",
                      "example": "17912345678901234"
                    },
                    "error": {
                      "type": "string",
                      "description": "Present only on failed targets"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "PinterestProduct": {
        "type": "object",
        "properties": {
          "pin_id": {
            "type": "string",
            "description": "Use this in `pinterest.product_tags`.",
            "example": "813744226420795884"
          },
          "title": {
            "type": "string",
            "nullable": true,
            "example": "Blue ribbed top"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "link": {
            "type": "string",
            "nullable": true,
            "description": "The product page the Pin links to.",
            "example": "https://shop.example.com/products/blue-ribbed-top"
          },
          "image_url": {
            "type": "string",
            "nullable": true,
            "description": "A small image of the product Pin."
          },
          "price": {
            "type": "number",
            "nullable": true,
            "description": "Catalog source only.",
            "example": 24.99
          },
          "currency": {
            "type": "string",
            "nullable": true,
            "description": "Catalog source only. ISO 4217 code.",
            "example": "EUR"
          },
          "availability": {
            "type": "string",
            "nullable": true,
            "description": "Catalog source only, as Pinterest reports it (for example `IN_STOCK`, `OUT_OF_STOCK`, `PREORDER`)."
          },
          "item_id": {
            "type": "string",
            "nullable": true,
            "description": "Catalog source only. The merchant's own product id.",
            "example": "TOP-BLUE-M"
          }
        }
      },
      "InboxReplyMention": {
        "type": "object",
        "description": "The result of `mention_author` on a Facebook comment reply.",
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "tagged",
              "plain_name",
              "failed",
              "unverified"
            ],
            "example": "tagged",
            "description": "`tagged`: Facebook shows the name as a clickable tag at the start of the reply and notifies the person. `plain_name`: Facebook did not accept the tag, so OmniSocials edited the reply to start with \"@Name\" as plain text (no link, no notification). `failed`: Facebook did not accept the tag and the edit failed; the reply can show the raw `@[id]` text (delete it with DELETE /inbox/messages/{id} and send it again without `mention_author`). `unverified`: the reply was posted, but OmniSocials could not read it back from Facebook to check the tag."
          },
          "name": {
            "type": "string",
            "nullable": true,
            "example": "Jamie Rivera",
            "description": "The name of the person who wrote the comment."
          },
          "message": {
            "type": "string",
            "example": "Facebook shows Jamie Rivera as a tag at the start of the reply and notifies them.",
            "description": "One sentence that explains the status."
          }
        }
      },
      "InboxParticipant": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Platform-scoped id of the other party"
          },
          "name": {
            "type": "string",
            "example": "Jamie Rivera"
          },
          "username": {
            "type": "string",
            "example": "jamierivera"
          },
          "profile_picture": {
            "type": "string",
            "nullable": true,
            "example": "https://example.com/avatar.jpg"
          }
        }
      },
      "InboxConversation": {
        "type": "object",
        "properties": {
          "conversation_id": {
            "type": "string",
            "example": "instagram_comment_17912345678901234"
          },
          "platform": {
            "type": "string",
            "enum": [
              "instagram",
              "facebook",
              "linkedin",
              "tiktok",
              "youtube",
              "x",
              "threads"
            ]
          },
          "type": {
            "type": "string",
            "enum": [
              "dm",
              "comment",
              "mention"
            ],
            "example": "comment",
            "description": "dm = direct message; comment/mention = public interaction. LinkedIn is comment/mention only; TikTok and YouTube are comment only; X is dm only; Threads is comment (replies on your posts) and mention only."
          },
          "participant": {
            "$ref": "#/components/schemas/InboxParticipant"
          },
          "unread_count": {
            "type": "integer",
            "description": "Unread incoming messages in this conversation",
            "example": 1
          },
          "last_message": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "example": "88231"
              },
              "direction": {
                "type": "string",
                "enum": [
                  "incoming",
                  "outgoing"
                ]
              },
              "text": {
                "type": "string",
                "example": "What size is this?"
              },
              "timestamp": {
                "type": "string",
                "format": "date-time",
                "example": "2026-10-21T09:00:00.000Z"
              },
              "is_read": {
                "type": "boolean",
                "example": false
              }
            }
          },
          "post": {
            "$ref": "#/components/schemas/InboxPostContext"
          }
        }
      },
      "InboxPostContext": {
        "type": "object",
        "nullable": true,
        "description": "The post a comment/mention conversation belongs to, so a reply can be drafted with the post in view (\"what size is this?\" needs the caption and the picture). Null for DMs. `url` is the public link to the post when the platform provides one (Instagram, Facebook, YouTube, TikTok, LinkedIn, Threads); `media_type` is the platform's label (e.g. IMAGE, VIDEO, CAROUSEL_ALBUM on Instagram) when known.\n",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true,
            "example": "17912345678901234"
          },
          "caption": {
            "type": "string",
            "nullable": true,
            "example": "Our autumn menu is here. #autumnmenu"
          },
          "thumbnail": {
            "type": "string",
            "nullable": true,
            "description": "Image URL of the post (or the video's cover)",
            "example": "https://example.com/photo.jpg"
          },
          "url": {
            "type": "string",
            "nullable": true,
            "example": "https://www.instagram.com/p/Cxyz123ABC/"
          },
          "media_type": {
            "type": "string",
            "nullable": true,
            "example": "IMAGE"
          }
        }
      },
      "InboxMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "88231"
          },
          "conversation_id": {
            "type": "string",
            "example": "instagram_comment_17912345678901234"
          },
          "platform": {
            "type": "string",
            "example": "instagram"
          },
          "type": {
            "type": "string",
            "enum": [
              "dm",
              "comment",
              "mention"
            ],
            "example": "comment"
          },
          "direction": {
            "type": "string",
            "enum": [
              "incoming",
              "outgoing"
            ]
          },
          "text": {
            "type": "string",
            "example": "What size is this?"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-21T09:00:00.000Z"
          },
          "is_read": {
            "type": "boolean",
            "example": false
          },
          "is_replied": {
            "type": "boolean",
            "example": false
          },
          "reaction": {
            "type": "string",
            "nullable": true
          },
          "parent_comment_id": {
            "type": "string",
            "nullable": true
          },
          "hidden": {
            "type": "boolean",
            "nullable": true,
            "example": false,
            "description": "Comments only: true when the comment is hidden on the platform (see POST /inbox/messages/{id}/hide). Null for DMs."
          },
          "liked": {
            "type": "boolean",
            "nullable": true,
            "example": false,
            "description": "Incoming Facebook, LinkedIn Page and TikTok comments: true when the connected account liked the comment (see POST /inbox/messages/{id}/like). Facebook and LinkedIn report likes made through OmniSocials; TikTok also reports likes made in the TikTok app. Null for DMs, outgoing messages and the other platforms."
          },
          "permalink": {
            "type": "string",
            "nullable": true,
            "description": "Link to the reply or mentioning post on the platform. Set on Threads replies and mentions; null on the other platforms."
          },
          "attachment": {
            "type": "object",
            "nullable": true,
            "description": "Media sent with this message, when present: the first item of `attachments`. Incoming Instagram/Facebook DM images, videos, voice messages and story mentions, and the photos, videos and GIFs of Threads replies and mentions, are re-hosted on our CDN so the URL stays valid indefinitely (the platform's own URL is short-lived). `type` reflects the fetched bytes, not the platform's label: a photo the platform sent under an unlabelled attachment type is `image`, a story mention that is really an MP4 is `video`. `type: file` covers media we could fetch but could not classify. `type: link` means the platform's URL did not point at media (for example a shared post that resolves to an instagram.com page); `url` is then the platform's own link, not re-hosted, and may require login or expire.\n",
            "properties": {
              "url": {
                "type": "string",
                "example": "https://example.com/photo.jpg"
              },
              "type": {
                "type": "string",
                "enum": [
                  "image",
                  "video",
                  "audio",
                  "file",
                  "link"
                ]
              }
            }
          },
          "attachments": {
            "type": "array",
            "description": "Every file of this message, in order; empty when it has none. A Threads carousel reply or mention lists each item (up to 20); a Threads photo, video or GIF reply and a DM attachment have one. A Threads reply that has only media carries `text` such as \"Sent an image\", \"Sent a GIF\" or \"Sent 3 images\" (the words of the DM attachments). The files of a Threads reply arrive with the reply, at the latest with the next 15-minute sync.\n",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "example": "https://cdn.omnisocials.com/file/library-omnisocials/social-inbox/1000/inbound/photo.jpg"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "image",
                    "video",
                    "audio",
                    "file",
                    "link"
                  ],
                  "description": "From the fetched bytes; a GIF is `image`."
                },
                "thumbnail_url": {
                  "type": "string",
                  "nullable": true,
                  "description": "A still of a Threads video, on our CDN; null otherwise."
                }
              }
            }
          },
          "sender": {
            "$ref": "#/components/schemas/InboxParticipant"
          },
          "post": {
            "$ref": "#/components/schemas/InboxPostContext"
          }
        }
      },
      "InboxNextUnanswered": {
        "type": "object",
        "nullable": true,
        "description": "The next conversation that needs an answer, with everything needed to draft the reply. Null when the queue is empty.",
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/InboxConversation"
          },
          "message": {
            "allOf": [
              {
                "$ref": "#/components/schemas/InboxMessage"
              }
            ],
            "description": "The unanswered incoming message itself: the customer's latest DM, or the specific comment. Its `conversation_id` is what the reply endpoint takes, and its `id` is the `message_id` to pass along with the reply for comment threads (so the reply lands under this comment and not under the newest one on the post); the same `id` is what POST /inbox/messages/{id}/hide and DELETE /inbox/messages/{id} take."
          },
          "messages": {
            "type": "array",
            "description": "The conversation so far, oldest first (the most recent 50 messages for long DM threads).",
            "items": {
              "$ref": "#/components/schemas/InboxMessage"
            }
          },
          "reply_window": {
            "type": "object",
            "description": "Whether a reply can still be sent through the API. Only Instagram and Facebook DMs have a window (Meta: 24 hours after the customer's last message); every other item has `open: true` and `closes_at: null`. When `open` is false the item is still served (the customer is still waiting) but the reply endpoint answers 422 `outside_messaging_window`: answer it from the native app (that reply is mirrored into the inbox and clears the item) or mark the conversation read to skip it.",
            "properties": {
              "open": {
                "type": "boolean",
                "example": true
              },
              "closes_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "example": "2026-10-22T09:00:00.000Z",
                "description": "When the window closes or closed (customer's last message + 24 h); null when there is no window."
              }
            }
          }
        }
      },
      "InboxCursorPagination": {
        "type": "object",
        "properties": {
          "next_cursor": {
            "type": "string",
            "nullable": true,
            "description": "Pass as ?cursor= to fetch the next page; null when there are no more results",
            "example": "MjAyNi0xMC0yMVQwOTowMDowMC4wMDBafDg4MjMx"
          },
          "has_more": {
            "type": "boolean",
            "example": true
          },
          "limit": {
            "type": "integer",
            "example": 25
          }
        }
      },
      "AutomationTrigger": {
        "type": "object",
        "properties": {
          "kinds": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "comment",
                "dm",
                "story_reply"
              ]
            },
            "description": "What starts the automation. `comment` = a comment on an Instagram post or reel, or on a Facebook Page post (needs `scope`). `dm` = a keyword in a DM to the Instagram account, in a Messenger message to the Facebook Page, or in a DM to the X account. `story_reply` = a keyword in a reply to an Instagram story (Instagram only: Facebook has no story replies, and a Facebook automation with `story_reply` answers 400 `validation_error`). On X only `dm` exists. One automation can listen to several. Default `[\"comment\"]` (pass `[\"dm\"]` on X)."
          },
          "scope": {
            "type": "string",
            "enum": [
              "post",
              "next_post",
              "any"
            ],
            "description": "For the `comment` kind: `post` = one post (pass `post_id`, `instagram_media_id` or `facebook_post_id` on the request), `next_post` = the next post the workspace publishes on the automation's platform, `any` = every post of the account or Page. Default `post`."
          },
          "keywords": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "guide"
            },
            "description": "Up to 20 keywords (60 characters each), matched case-insensitively. Required unless `match` is `any`."
          },
          "match": {
            "type": "string",
            "enum": [
              "word",
              "contains",
              "any"
            ],
            "description": "`word` (default) = the keyword as a whole word, in the forms people write it: capitals, accents and fancy letters (\"Guide!\", \"GUIDE\", \"𝐆𝐔𝐈𝐃𝐄\"), longer letter runs (\"guideee\"), one common ending (\"guides\"; also -es, -ies, -ie, -y, -ey, -je, -jes, -tje, -tjes when 4 or more letters stay), and a plural keyword also takes the singular when 4 or more letters stay (\"links\" catches \"link\", \"news\" does not catch \"new\"). Never part of another word (\"linkedin\", \"blink\" and \"unlink\" do not match \"link\") and no typos. An event matched as another form carries `match` with the word the person wrote. `contains` = the keyword appears anywhere, `any` = every comment, also one without text (a photo, GIF or sticker comment), and every message with text."
          }
        }
      },
      "AutomationActions": {
        "type": "object",
        "description": "On create `dm` is required. On PATCH each key merges into the stored actions, so `{ \"follow_gate\": { \"enabled\": true } }` or `{ \"follow_up\": { \"delay_hours\": 12 } }` alone keeps the DM and the public reply.",
        "properties": {
          "dm": {
            "type": "object",
            "required": [
              "text"
            ],
            "properties": {
              "text": {
                "type": "string",
                "description": "The DM sent to the person (max 1000 characters, 640 with a `button`). Sent once per person per automation. On Facebook it lands in Messenger. With Follow first (`follow_gate`) this is the link message, sent once the person follows. With a follow-up on an Instagram comment (and Follow first off) it goes out after the person taps the button of the tap step (see `follow_up`). A link written in the text goes out as written and is not counted; use `button` to count taps. Required on create.",
                "example": "Here is the guide 👇"
              },
              "button": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AutomationDmButton"
                  }
                ],
                "nullable": true,
                "description": "An optional link button under the DM. Instagram sends it on every answer (the private reply to a comment, a DM answer, the link after Follow first or the tap step). Facebook sends it on a DM answer in Messenger; a Facebook comment answer (private reply) has no buttons, so the address goes on its own line under the text and is not counted. The button opens a short link on OmniSocials' host (`https://backend.omnisocials.com/l/...`) that counts the tap and forwards the person to `url`; `stats.clicked` and the event's `clicked_at` count the first tap per answer (a link checker or a HEAD request never counts). The short link works for 60 days after the DM and only while the organisation has a plan; after that it answers 404. With a button the DM text holds 640 characters (Meta's button message), else 400 `validation_error`. X has no buttons in DMs: a button on an X automation answers 400 `dm_button_not_supported` (put the link in the text). Input: optional; on PATCH a body without `button` keeps the stored one, `null` removes it and a new object replaces it (send `title` and `url` together). A post's `comment_dm_automation` does not take a button: set it on the automation with PATCH /automations/{id} (a later update of the post keeps it). Output: the button, or `null` (always `null` on X)."
              }
            }
          },
          "public_reply": {
            "type": "object",
            "description": "A public reply under the comment, only for the `comment` kind. One of `variations` is picked at random per comment.",
            "properties": {
              "enabled": {
                "type": "boolean",
                "example": true
              },
              "variations": {
                "type": "array",
                "items": {
                  "type": "string",
                  "example": "Sent you a DM!"
                },
                "description": "Up to 10 replies of 300 characters."
              }
            }
          },
          "follow_gate": {
            "type": "object",
            "nullable": true,
            "description": "Follow first, Instagram only: the link in `dm.text` goes out once the person follows the account. Instagram tells an app whether somebody follows only after that person messaged the account or tapped a button, so on a comment the private reply is `first_message` with one button (the public reply under the comment still goes out at once). A tap makes OmniSocials ask Instagram: a follower gets `dm.text`, anybody else gets `not_following` with its button, and every later tap checks again (10 taps that say \"not yet\" at most). A `dm` or `story_reply` trigger checks at once, because the person wrote first. When Instagram gives no answer the link goes out anyway, marked not checked. The first message counts as one DM under the send cap; the follow ask and the link go out inside the 24-hour window the tap opens. Input: optional; `first_message`, `not_following` and their `text` / `button` are optional (empty or missing = the defaults); `null` or `{ \"enabled\": false }` switches it off and keeps the stored texts. `enabled: true` on a Facebook or X automation answers 400 `follow_gate_instagram_only` (they have no follow status). Output: the texts with the defaults filled in, or `null` on a Facebook or X automation.",
            "properties": {
              "enabled": {
                "type": "boolean",
                "example": true
              },
              "first_message": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AutomationFollowGateMessage"
                  }
                ],
                "description": "The first message, with one button. Default: \"Tap the button and I'll send you the link 👇\" with the button \"Send me the link\"."
              },
              "not_following": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AutomationFollowGateMessage"
                  }
                ],
                "description": "The answer to a tap from somebody who does not follow yet, with its button. Default: \"Almost there! Follow us first, then tap the button again.\" with the button \"I follow now\"."
              }
            }
          },
          "follow_up": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AutomationFollowUp"
              }
            ],
            "nullable": true,
            "description": "Follow-up, Instagram and Facebook: one more automatic DM, `delay_hours` (1 to 23, default 23) after the answer (`dm.text`) went out. Meta allows an automatic message only within 24 hours after the person's last DM, button tap or quick reply; the comment and the private reply do not open that window. So on an Instagram comment with Follow first off, the first DM becomes a tap step: a short text with one button (`tap`), the tap sends `dm.text` and opens the window, and until the tap the event is `waiting`. With Follow first on, its own tap is that tap. People who never tap get no link and no follow-up. A `dm` or `story_reply` trigger needs no tap step: the person's own message opened the window. A Facebook comment answer has no button, so only people who answer the DM in Messenger get the follow-up. When it is due, OmniSocials checks again and skips it (`follow_up.reason` on the event) when the automation was paused or deleted (`automation_off`), the follow-up was switched off (`follow_up_off`), the plan is not active (`plan_inactive`), the person's latest message is \"stop\" (`opted_out`), a team member wrote to the person by hand after the answer (`team_answered`), or the person's last tap or message is older than 24 hours minus 15 minutes (`window_closed`); Meta's refusal on the person's side is `cannot_message`. An automation finished by its DM limit or stop date still sends its follow-ups. Input: optional; `null`, `false` or `{ \"enabled\": false }` switches it off and keeps the stored texts. On PATCH it merges into the stored follow-up: keys you leave out keep their value, `tap` merges key by key and `button: null` removes the button. `enabled: true` on an X automation answers 400 `follow_up_not_supported` (X allows an automatic DM only as the answer to a DM). Output: the follow-up with the tap step texts filled in (`tap` is `null` on Facebook), or `null` on an X automation."
          }
        }
      },
      "AutomationFollowUp": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "example": true
          },
          "text": {
            "type": "string",
            "maxLength": 1000,
            "description": "The follow-up message (max 1000 characters, 640 with a `button`). Required when `enabled` is true (in the body or stored); without it the API answers 400 `validation_error` (\"Write the follow-up\").",
            "example": "Did the guide help? Book a free call here 👇"
          },
          "delay_hours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 23,
            "default": 23,
            "description": "Hours after the answer went out. A whole number from 1 to 23 (else 400 `validation_error`): Meta allows an automatic message only within 24 hours after the person's last tap or message.",
            "example": 23
          },
          "button": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AutomationFollowUpButton"
              }
            ],
            "nullable": true,
            "description": "An optional link button under the follow-up. `null` on PATCH removes it. Like the DM's `button`, an https `url` opens a short link on OmniSocials' host that counts the first tap (`stats.follow_up_clicks`, the event's `follow_up.clicked_at`) and forwards to it (for 60 days after the follow-up, while the organisation has a plan); an http:// address goes out as is and is not counted."
          },
          "tap": {
            "allOf": [
              {
                "$ref": "#/components/schemas/AutomationFollowUpTap"
              }
            ],
            "nullable": true,
            "description": "Instagram only: the texts of the tap step, the first DM of a comment answer when Follow first is off. Ignored on Facebook (`null` in responses there)."
          }
        }
      },
      "AutomationDmButton": {
        "type": "object",
        "required": [
          "title",
          "url"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "description": "The button label, 1 to 20 characters (else 400 `validation_error`: \"dm.button.title needs 1 to 20 characters\").",
            "example": "Get the guide"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 900,
            "description": "The address the button opens: https:// only, max 900 characters (an http:// address or a longer one answers 400 `validation_error`: \"dm.button.url must be a web address that starts with https:// (at most 900 characters)\"). Stored and returned as the parsed address (a space becomes %20). People see the button, not the address; the tap goes through OmniSocials' short link, which counts it and forwards to this address.",
            "example": "https://example.com/guide"
          }
        }
      },
      "AutomationFollowUpButton": {
        "type": "object",
        "required": [
          "title",
          "url"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "description": "The button label, 1 to 20 characters (else 400 `validation_error`: \"follow_up.button.title needs 1 to 20 characters\").",
            "example": "Book a call"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2000,
            "description": "A web address that starts with https:// or http:// (max 2000 characters). On PATCH a `button` replaces the stored one, so send `title` and `url` together.",
            "example": "https://example.com/call"
          }
        }
      },
      "AutomationFollowUpTap": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 640,
            "description": "The tap step's message (max 640 characters). Default: \"Tap the button and I'll send you the link 👇\".",
            "example": "Tap the button and I'll send you the link 👇"
          },
          "button": {
            "type": "string",
            "maxLength": 20,
            "description": "The tap step's button label (max 20 characters). Default: \"Send me the link\".",
            "example": "Send me the link"
          }
        }
      },
      "AutomationFollowGateMessage": {
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 640,
            "description": "The message text (max 640 characters; more answers 400 `validation_error`).",
            "example": "Tap the button and I'll send you the link 👇"
          },
          "button": {
            "type": "string",
            "maxLength": 20,
            "description": "The button label (max 20 characters; more answers 400 `validation_error`, for example \"follow_gate.first_message.button can hold 20 characters\").",
            "example": "Send me the link"
          }
        }
      },
      "AutomationLimits": {
        "type": "object",
        "properties": {
          "max_sends": {
            "type": "integer",
            "nullable": true,
            "description": "Stop after this many DMs (the automation becomes `completed`). Omit for no limit.",
            "example": 500
          },
          "stop_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Stop at this time. Omit for no end.",
            "example": "2026-11-30T23:00:00.000Z"
          }
        }
      },
      "AutomationStats": {
        "type": "object",
        "properties": {
          "matched": {
            "type": "integer",
            "example": 120
          },
          "sent": {
            "type": "integer",
            "example": 112
          },
          "skipped": {
            "type": "integer",
            "example": 6
          },
          "failed": {
            "type": "integer",
            "example": 2
          },
          "followed": {
            "type": "integer",
            "description": "Follow first: people who followed after the follow ask, then got the link.",
            "example": 41
          },
          "follow_ups_sent": {
            "type": "integer",
            "description": "Follow-ups that went out.",
            "example": 37
          },
          "follow_ups_skipped": {
            "type": "integer",
            "description": "Follow-ups that were kept back: no tap or message from the person inside Meta's 24-hour window, a stop, a team member's own reply, or the automation or the follow-up switched off (the reason is on each event).",
            "example": 9
          },
          "linked": {
            "type": "integer",
            "description": "Answers that went out with a link button that counts taps (`actions.dm.button`).",
            "example": 80
          },
          "clicked": {
            "type": "integer",
            "description": "Of those, the answers whose link button was tapped (the first tap per answer counts).",
            "example": 31
          },
          "follow_up_clicks": {
            "type": "integer",
            "description": "Follow-ups whose link button was tapped (the first tap per follow-up counts).",
            "example": 6
          },
          "answered": {
            "type": "integer",
            "description": "People who wrote back to the account within 7 days of the answer (their first message counts once).",
            "example": 14
          },
          "last_event_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "example": "2026-10-21T15:00:12.000Z"
          }
        }
      },
      "Automation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "example": "318"
          },
          "type": {
            "type": "string",
            "enum": [
              "comment_to_dm"
            ]
          },
          "platform": {
            "type": "string",
            "enum": [
              "instagram",
              "facebook",
              "x"
            ],
            "description": "The channel the automation runs on: the connected Instagram account, the connected Facebook Page, or the connected X account. Set at create; it never changes."
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused",
              "completed"
            ],
            "description": "`completed` = `max_sends` or `stop_at` was reached. A new limit or trigger starts it again."
          },
          "name": {
            "type": "string",
            "nullable": true,
            "example": "Guide DM"
          },
          "post_id": {
            "type": "string",
            "nullable": true,
            "description": "The OmniSocials post the automation listens on, for the `post` scope. `null` for a post published outside OmniSocials and for the other scopes.",
            "example": "1024"
          },
          "instagram_media_id": {
            "type": "string",
            "nullable": true,
            "description": "The Instagram media id the automation listens on. Set once the post is live on Instagram. Always `null` for a Facebook automation.",
            "example": "17912345678901234"
          },
          "facebook_post_id": {
            "type": "string",
            "nullable": true,
            "description": "The Facebook Page post id (`{page-id}_{post-id}`) the automation listens on. Set once the post is live on the Page. Always `null` for an Instagram automation.",
            "example": "104857600123456_987654321098765"
          },
          "post": {
            "type": "object",
            "nullable": true,
            "description": "A snapshot of the post: `source` (`omnisocials`, `instagram` or `facebook`: a post picked by id is read from that platform), `id`, `caption`, `thumbnail_url`, `permalink`, `media_type` and, for an OmniSocials post, `status` and `live`."
          },
          "trigger": {
            "$ref": "#/components/schemas/AutomationTrigger"
          },
          "actions": {
            "$ref": "#/components/schemas/AutomationActions"
          },
          "limits": {
            "$ref": "#/components/schemas/AutomationLimits"
          },
          "stats": {
            "$ref": "#/components/schemas/AutomationStats"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-20T14:32:10.000Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "example": "2026-10-20T14:35:42.000Z"
          }
        }
      },
      "AutomationInput": {
        "type": "object",
        "description": "The fields of an automation. POST /automations requires `actions`; PATCH /automations/{id} takes any subset.",
        "properties": {
          "name": {
            "type": "string",
            "description": "A label for the automations list (max 120 characters).",
            "example": "Guide DM"
          },
          "platform": {
            "type": "string",
            "enum": [
              "instagram",
              "facebook",
              "x"
            ],
            "description": "The channel the automation runs on. Default `instagram`. `instagram_media_id` implies `instagram` and `facebook_post_id` implies `facebook`; a body that names another platform answers 400 `validation_error`. On PATCH it cannot change: another platform answers 400 `platform_immutable`. `x` answers DMs to the connected X account: only the `dm` kind (X allows an automated DM only after the person DMed you), the workspace needs X DMs turned on in the dashboard (else 409 `x_dms_off` for an active automation; `status: paused` saves it), every answer ends with the line \"Reply STOP to stop automatic messages.\", and a person who replies STOP gets no automatic DM from the account again. X does not give apps the messages of an encrypted X Chat conversation, so those get no answer.",
            "example": "instagram"
          },
          "trigger": {
            "$ref": "#/components/schemas/AutomationTrigger"
          },
          "post_id": {
            "type": "string",
            "description": "For `scope` `post`: an OmniSocials post (scheduled or live) that goes to the automation's platform. A post that does not go there answers 400 `post_not_instagram` or `post_not_facebook`. One automation per post and platform: a post that goes to Instagram and Facebook can have one of each.",
            "example": "1024"
          },
          "instagram_media_id": {
            "type": "string",
            "description": "For `scope` `post` on Instagram: the numeric id of a post or reel that was published outside OmniSocials (from the Instagram API, `GET /me/media`). The post is read from Instagram to check it belongs to the connected account.",
            "example": "17912345678901234"
          },
          "facebook_post_id": {
            "type": "string",
            "description": "For `scope` `post` on Facebook: the id of a post that was published on the connected Facebook Page outside OmniSocials. Pass `{page-id}_{post-id}` or the post id alone (the Page id is put in front). The post is read from Facebook with the Page token; a post of another Page answers 404 `facebook_post_not_found`. Implies `platform: facebook`. Pass one of `post_id`, `instagram_media_id` or `facebook_post_id`.",
            "example": "104857600123456_987654321098765"
          },
          "actions": {
            "$ref": "#/components/schemas/AutomationActions"
          },
          "limits": {
            "$ref": "#/components/schemas/AutomationLimits"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "paused"
            ],
            "description": "`paused` creates the automation without turning it on. Default `active`."
          }
        }
      },
      "AutomationEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "automation_id": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "comment",
              "dm",
              "story_reply"
            ],
            "description": "What the person did."
          },
          "outcome": {
            "type": "string",
            "enum": [
              "sent",
              "skipped",
              "failed",
              "pending",
              "queued",
              "opted_out",
              "waiting"
            ],
            "description": "`queued` = the answer waits for a free slot under the channel's send cap (X 15 per 15 minutes and 450 a day, Instagram and Facebook 700 an hour), or for the platform's own rate limit to end, and goes out as soon as there is room. One that found no room in time (on Instagram and Facebook 24 hours for a comment and 23 hours for a DM or story reply, on X an hour) becomes `skipped` with `rate_limited`. `opted_out` = the person replied STOP on X (no automatic DMs to them from the account again). `waiting` = Follow first (Instagram): the person got the first message or the follow ask, and the link goes out after their tap shows a follow; or the tap step of a follow-up (Instagram): the person got the message with the button, and the link goes out after the tap (see `follow_gate`, `mode`)."
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "description": "For `skipped`: `already_sent`, `limit_reached`, `stopped`, `window_passed` (comment older than 7 days), `rate_limited` (the send cap stayed full: for a day on Instagram and Facebook, for an hour on X), `cannot_message` (Meta refused the message: a Page made the comment, or the person's settings block messages), `already_replied` (the comment already has a private reply), `dm_window_passed` (their message is older than 24 hours), `dms_closed` (X refused: the person does not accept DMs from the account), `no_credits` (X DMs had no credits for the answer), `opted_out` (the person replied STOP before), `automation_off` (the automation was paused or finished while the answer waited, or before a Follow first tap), `plan_inactive` (the organisation had no active plan or trial, so nothing was sent; automations send only while the plan runs), `already_waiting` (Follow first: the person commented again while asked to follow; the link goes out after the follow). For `failed`: the platform's error text."
          },
          "reason_label": {
            "type": "string",
            "nullable": true,
            "description": "The reason in plain words."
          },
          "person": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "The id of the person as the account sees it: Instagram-scoped on Instagram, Page-scoped on Facebook."
              },
              "username": {
                "type": "string",
                "nullable": true,
                "description": "The Instagram @handle, or on Facebook the person's name (Facebook has no handle)."
              }
            }
          },
          "trigger_id": {
            "type": "string",
            "nullable": true,
            "description": "The comment id or message id that started the event."
          },
          "trigger_text": {
            "type": "string",
            "nullable": true,
            "description": "The comment or message text (300 characters); `null` for a comment without text (a photo, GIF or sticker comment). For `dm` and `story_reply` events it is returned only to a key with the `inbox:read` scope (OAuth: the social inbox permission); otherwise `null`."
          },
          "message": {
            "type": "string",
            "nullable": true,
            "description": "The DM that was sent."
          },
          "public_reply": {
            "type": "string",
            "nullable": true,
            "description": "The public reply posted under the comment, when one was."
          },
          "platform_message_id": {
            "type": "string",
            "nullable": true
          },
          "follow_gate": {
            "type": "object",
            "nullable": true,
            "description": "Follow first or the tap step of a follow-up (Instagram): where this person is. `null` on an event without a button step.",
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "follow",
                  "tap"
                ],
                "description": "`follow` = Follow first (the tap checks the follow); `tap` = the tap step of a follow-up (the tap sends the link with no follow check, so `checked` stays `false` and `followed` is `null`)."
              },
              "state": {
                "type": "string",
                "nullable": true,
                "enum": [
                  "waiting",
                  "done"
                ],
                "description": "`waiting` = asked, no link yet; `done` = the link went out; `null` on a skipped or failed row."
              },
              "asked_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "description": "When the first message or the follow ask went out."
              },
              "taps": {
                "type": "integer",
                "description": "How often the person tapped the button. 0 = has not tapped yet.",
                "example": 1
              },
              "followed": {
                "type": "boolean",
                "nullable": true,
                "description": "`true` = Instagram confirmed the follow and the link went out; `null` = the link went out without a check (Instagram gave no answer); `false` while the event waits."
              },
              "checked": {
                "type": "boolean",
                "description": "Whether Instagram answered the follow check."
              },
              "after_ask": {
                "type": "boolean",
                "description": "`true` = the person followed after the follow ask (counted in `stats.followed`); `false` with `followed: true` = they followed already."
              }
            }
          },
          "follow_up": {
            "type": "object",
            "nullable": true,
            "description": "The follow-up of this answer. `null` when none was planned (no follow-up on the automation, or the answer did not go out).",
            "properties": {
              "state": {
                "type": "string",
                "enum": [
                  "scheduled",
                  "sending",
                  "sent",
                  "skipped",
                  "failed"
                ],
                "description": "`scheduled` = waits for `due_at`; `sending` = going out now; `sent` = it went out; `skipped` = kept back (see `reason`); `failed` = the platform refused it with an error, or the send was cut off (`interrupted`, never sent again)."
              },
              "due_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "description": "When the follow-up is due (the answer's time plus `delay_hours`)."
              },
              "sent_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true
              },
              "reason": {
                "type": "string",
                "nullable": true,
                "description": "For `skipped`: `window_closed` (no tap or message from the person in the 24 hours before; Meta allows no automatic message then), `team_answered` (a team member wrote to the person by hand after the answer), `opted_out` (the person's latest message is \"stop\"), `follow_up_off` (the follow-up was switched off), `automation_off` (the automation was paused or deleted), `plan_inactive` (the organisation had no active plan or trial), `cannot_message` (Meta refused: the person's settings block messages). For `failed`: the platform's error text, or `interrupted`. `null` otherwise."
              },
              "reason_label": {
                "type": "string",
                "nullable": true,
                "description": "The reason in plain words."
              },
              "platform_message_id": {
                "type": "string",
                "nullable": true,
                "description": "The id of the follow-up message, once sent."
              },
              "clicked_at": {
                "type": "string",
                "format": "date-time",
                "nullable": true,
                "description": "The first tap on the follow-up's link button; `null` when it has no button or nobody tapped it."
              }
            }
          },
          "linked": {
            "type": "boolean",
            "description": "`true` = the answer went out with a link button that counts taps (`actions.dm.button`)."
          },
          "clicked_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "The first tap on the answer's link button; `null` when it had none or nobody tapped it. Filter with `filter=clicked`."
          },
          "replied_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When the person wrote back to the account, within 7 days of the answer (the first message counts; a STOP on X does not). Filter with `filter=answered`."
          },
          "match": {
            "type": "object",
            "nullable": true,
            "description": "With `match: word`: the comment or message matched `keyword` as another form of it (`null` when it matched as written, and for `contains` and `any`).",
            "properties": {
              "keyword": {
                "type": "string",
                "description": "The keyword of the automation that matched.",
                "example": "link"
              },
              "word": {
                "type": "string",
                "nullable": true,
                "description": "The word as the person wrote it (80 characters). Like `trigger_text`, `null` on a `dm` or `story_reply` event unless the key has the `inbox:read` scope.",
                "example": "LINKS"
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "sent_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "AutomationResults": {
        "type": "object",
        "description": "The results of one automation in a period. Every number comes from the automation's events (one per matched comment or message) created in the period, so the rates of the dashboard's Results tab are plain divisions: `got_dm / commented`, `clicked / linked`, `answered / got_dm`, `follow_up_clicked / follow_ups`, and `got_dm / comments` for the share of all comments on the post.",
        "properties": {
          "period": {
            "type": "string",
            "enum": [
              "7d",
              "30d",
              "all"
            ]
          },
          "from": {
            "type": "string",
            "format": "date-time",
            "description": "Start of the period: now minus 7 or 30 days, or the automation's creation for `all`."
          },
          "to": {
            "type": "string",
            "format": "date-time",
            "description": "End of the period (now)."
          },
          "unit": {
            "type": "string",
            "enum": [
              "day",
              "week"
            ],
            "description": "The bucket of `series`: `day`, or `week` (from Monday) for `all`."
          },
          "time_zone": {
            "type": "string",
            "description": "The time zone the days of `series` are counted in (UTC when `time_zone` was missing or unknown).",
            "example": "Europe/Amsterdam"
          },
          "steps": {
            "type": "object",
            "description": "Counts over the events created in the period.",
            "properties": {
              "commented": {
                "type": "integer",
                "description": "Every matched comment or message (not a STOP message).",
                "example": 412
              },
              "got_dm": {
                "type": "integer",
                "description": "The first answer went out (sent, or waiting for a tap).",
                "example": 398
              },
              "tapped": {
                "type": "integer",
                "description": "The person tapped the button of Follow first or of the follow-up's tap step (Instagram).",
                "example": 0
              },
              "got_link": {
                "type": "integer",
                "description": "The link went out after that tap.",
                "example": 0
              },
              "followed": {
                "type": "integer",
                "description": "Followed the account after the follow ask (Follow first).",
                "example": 0
              },
              "linked": {
                "type": "integer",
                "description": "Answers with a link button that counts taps.",
                "example": 390
              },
              "clicked": {
                "type": "integer",
                "description": "Of those, the answers whose button was tapped (first tap per answer).",
                "example": 151
              },
              "follow_ups": {
                "type": "integer",
                "description": "Follow-ups that went out.",
                "example": 0
              },
              "follow_up_clicked": {
                "type": "integer",
                "description": "Follow-ups whose link button was tapped.",
                "example": 0
              },
              "answered": {
                "type": "integer",
                "description": "People who wrote back within 7 days of the answer.",
                "example": 37
              },
              "variants": {
                "type": "integer",
                "description": "Matched as another form of a keyword (see `match: word`), e.g. \"guides\" for GUIDE.",
                "example": 58
              },
              "public_replies": {
                "type": "integer",
                "description": "Public replies posted under the comments.",
                "example": 395
              }
            }
          },
          "comments": {
            "type": "integer",
            "nullable": true,
            "description": "All comments on the automation's post in the period, as the inbox stored them (with scope `any`: every comment on the account or Page). `null` for an automation without the `comment` trigger. A post that is not live yet counts 0.",
            "example": 3120
          },
          "not_sent": {
            "type": "array",
            "description": "Why people got no DM in the period, most first.",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string",
                  "description": "The reason in plain words (the `reason_label` of the events).",
                  "example": "Already got this DM"
                },
                "outcome": {
                  "type": "string",
                  "enum": [
                    "skipped",
                    "failed"
                  ]
                },
                "count": {
                  "type": "integer",
                  "example": 12
                }
              }
            }
          },
          "series": {
            "type": "array",
            "description": "Per day (per week for `all`), every bucket of the period, one count per step: the answers that went out (`sent`, by their send time), the first link taps (`clicked`, by the tap's time), the people who wrote back (`answered`, by the time of their first message back), and by the time of the comment or message: matched (`commented`), no DM (`not_sent`), taps of Follow first or the tap step (`tapped`), links sent after that tap (`got_link`) and follow-ups sent (`follow_ups`). The dashboard's chart draws one of them per step.",
            "items": {
              "type": "object",
              "properties": {
                "day": {
                  "type": "string",
                  "format": "date",
                  "description": "The day (or the Monday of the week) in `time_zone`, YYYY-MM-DD.",
                  "example": "2026-11-24"
                },
                "sent": {
                  "type": "integer",
                  "example": 61
                },
                "clicked": {
                  "type": "integer",
                  "example": 23
                },
                "commented": {
                  "type": "integer",
                  "example": 64
                },
                "answered": {
                  "type": "integer",
                  "example": 5
                },
                "not_sent": {
                  "type": "integer",
                  "example": 3
                },
                "tapped": {
                  "type": "integer",
                  "example": 0
                },
                "got_link": {
                  "type": "integer",
                  "example": 0
                },
                "follow_ups": {
                  "type": "integer",
                  "example": 0
                }
              }
            }
          },
          "posts": {
            "type": "array",
            "description": "The posts that went live through OmniSocials on the automation's channel in the period (the numbered pins on the dashboard's chart), oldest first, at most 9: an automation on one post lists that post only. Empty on X and for an automation without the `comment` trigger. Compare a post's `day` with `series` to see which post brought the comments.",
            "items": {
              "type": "object",
              "properties": {
                "post_id": {
                  "type": "string",
                  "description": "The OmniSocials post id.",
                  "example": "88123"
                },
                "day": {
                  "type": "string",
                  "format": "date",
                  "description": "The day it went live, in `time_zone`.",
                  "example": "2026-11-21"
                },
                "platform": {
                  "type": "string",
                  "enum": [
                    "instagram",
                    "facebook"
                  ]
                },
                "kind": {
                  "type": "string",
                  "description": "The post type (`post`, `reel`, `story`, `carousel` and so on).",
                  "example": "reel"
                },
                "title": {
                  "type": "string",
                  "description": "The first line of the caption (80 characters); empty when there is none.",
                  "example": "Comment GUIDE and I'll send you the guide"
                },
                "thumbnail": {
                  "type": "string",
                  "nullable": true,
                  "description": "The first picture of the post, or the still of its first video; `null` when there is none."
                }
              }
            }
          }
        }
      },
      "AutomationStory": {
        "type": "object",
        "description": "One person's story with an automation: the event (its outcome and the times of the tap, the link, the follow-up and the answer), what they wrote, the post they commented on, the DM the automation sends, and the DM conversation with them from the comment to 8 days later (the 7-day answer window and a day for the follow-up).",
        "properties": {
          "event_id": {
            "type": "string",
            "example": "5521"
          },
          "event": {
            "$ref": "#/components/schemas/AutomationEvent"
          },
          "kind": {
            "type": "string",
            "enum": [
              "comment",
              "dm",
              "story_reply"
            ]
          },
          "said": {
            "type": "string",
            "nullable": true,
            "description": "The comment or message (1000 characters). For `dm` and `story_reply` only with the `inbox:read` scope (OAuth: the social inbox permission); otherwise `null`.",
            "example": "GUIDE please"
          },
          "post": {
            "type": "object",
            "nullable": true,
            "description": "The post the comment is on, as the inbox stored it; `null` for a DM or story reply, or when the inbox has no copy.",
            "properties": {
              "caption": {
                "type": "string",
                "nullable": true,
                "description": "The first line of the caption (120 characters)."
              },
              "thumbnail": {
                "type": "string",
                "nullable": true
              }
            }
          },
          "dm": {
            "type": "object",
            "description": "What the automation sends now (its current DM text and button label). What was really sent is in `messages`.",
            "properties": {
              "text": {
                "type": "string",
                "nullable": true
              },
              "button": {
                "type": "string",
                "nullable": true,
                "description": "The label of the link button, or `null`."
              }
            }
          },
          "messages": {
            "type": "array",
            "nullable": true,
            "description": "The DM conversation with the person from 5 minutes before the comment to 8 days after it, oldest first, at most 60 messages, as the social inbox stored it. `null` without the `inbox:read` scope (OAuth: the social inbox permission): DMs are private.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The inbox message id."
                },
                "direction": {
                  "type": "string",
                  "enum": [
                    "incoming",
                    "outgoing"
                  ],
                  "description": "`incoming` = the person wrote it; `outgoing` = the account sent it."
                },
                "text": {
                  "type": "string",
                  "nullable": true,
                  "description": "The message (1000 characters)."
                },
                "at": {
                  "type": "string",
                  "format": "date-time"
                },
                "automation": {
                  "type": "boolean",
                  "description": "`true` when an automation sent it (the answer, the link or the follow-up), `false` for a reply a person typed."
                }
              }
            }
          }
        }
      },
      "Limit": {
        "type": "object",
        "description": "Something OmniSocials cannot do, why, and what to do instead. An agent reads these before it tells a person that something is not possible.",
        "properties": {
          "id": {
            "type": "string",
            "example": "tiktok.delete"
          },
          "kind": {
            "type": "string",
            "enum": [
              "platform",
              "by_design",
              "not_built",
              "beta",
              "dashboard_only",
              "needs_setup"
            ],
            "description": "`platform` = the platform does not allow it, `by_design` = OmniSocials does not do it on purpose (neither can change through a request); `not_built` = not built yet, `beta` = open to some accounts, `dashboard_only` = works in the OmniSocials app only, `needs_setup` = works after a setup step."
          },
          "kind_label": {
            "type": "string",
            "example": "The platform does not allow it"
          },
          "area": {
            "type": "string",
            "enum": [
              "posts",
              "media",
              "inbox",
              "analytics",
              "automations",
              "accounts",
              "ads",
              "team",
              "other"
            ]
          },
          "platforms": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The platforms it is about; empty = every channel.",
            "example": [
              "tiktok"
            ]
          },
          "title": {
            "type": "string",
            "example": "Delete a TikTok video"
          },
          "says": {
            "type": "string",
            "description": "The reason, to tell the person.",
            "example": "TikTok's API cannot delete a video. delete_post removes it from OmniSocials only."
          },
          "instead": {
            "type": "string",
            "nullable": true,
            "example": "Delete the video in the TikTok app."
          },
          "requestable": {
            "type": "boolean",
            "description": "Whether a feature request can name it (`limit_id`). False for `platform` and `by_design`."
          }
        }
      },
      "FeatureRequest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 412
          },
          "title": {
            "type": "string",
            "example": "Post to a topic of a Telegram group"
          },
          "summary": {
            "type": "string",
            "example": "Post our daily update to the Announcements topic of our Telegram group."
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "in_progress",
              "completed",
              "declined"
            ]
          },
          "team_answer": {
            "type": "string",
            "nullable": true,
            "description": "The OmniSocials team's answer, when there is one."
          },
          "team_replies": {
            "type": "array",
            "description": "Replies of the OmniSocials team, oldest first.",
            "items": {
              "type": "object",
              "properties": {
                "message": {
                  "type": "string"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "votes_count": {
            "type": "integer",
            "description": "People of the organisation who asked for the same thing."
          },
          "limit_id": {
            "type": "string",
            "nullable": true,
            "example": "telegram.forum_topics"
          },
          "platform": {
            "type": "string",
            "nullable": true
          },
          "area": {
            "type": "string",
            "nullable": true
          },
          "source": {
            "type": "string",
            "enum": [
              "app",
              "mcp",
              "api",
              "cli"
            ],
            "description": "Where the request was sent from."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "AdNetworkSettings": {
        "type": "object",
        "description": "The settings of one network of a campaign or draft (platforms[].settings of a draft).",
        "properties": {
          "optimization": {
            "type": "object",
            "properties": {
              "conversion": {
                "type": "object",
                "properties": {
                  "destination_id": {
                    "type": "string"
                  },
                  "event": {
                    "type": "string"
                  },
                  "custom_conversion_id": {
                    "type": "string"
                  }
                }
              },
              "bidding": {
                "type": "object",
                "properties": {
                  "strategy": {
                    "type": "string",
                    "enum": [
                      "lowest_cost",
                      "cost_cap",
                      "bid_cap",
                      "min_roas",
                      "target_cost"
                    ]
                  },
                  "amount": {
                    "type": "number"
                  },
                  "roas_floor": {
                    "type": "number"
                  }
                }
              },
              "attribution": {
                "type": "object",
                "properties": {
                  "click_days": {
                    "type": "integer",
                    "enum": [
                      1,
                      7,
                      28
                    ]
                  },
                  "view_days": {
                    "type": "integer",
                    "enum": [
                      0,
                      1
                    ]
                  }
                }
              }
            }
          },
          "messaging": {
            "type": "object",
            "description": "Meta, goal messages",
            "properties": {
              "destination": {
                "type": "string",
                "enum": [
                  "messenger",
                  "instagram_direct",
                  "whatsapp"
                ]
              },
              "whatsapp_phone_number": {
                "type": "string"
              },
              "welcome_message": {
                "type": "object",
                "properties": {
                  "text": {
                    "type": "string"
                  },
                  "quick_replies": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "automation_id": {
                "type": "integer",
                "description": "A DM automation that answers the first message from the ad"
              }
            }
          },
          "calls": {
            "type": "object",
            "properties": {
              "phone_number": {
                "type": "string",
                "description": "E.164"
              }
            }
          },
          "lead_form_id": {
            "type": "string",
            "description": "The network's lead form id (GET /ads/lead-forms), goal lead_generation"
          },
          "google": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "demand_gen",
                  "search",
                  "performance_max"
                ]
              },
              "search": {
                "type": "object"
              },
              "performance_max": {
                "type": "object"
              }
            }
          },
          "microsoft": {
            "type": "object",
            "description": "Microsoft: audience (default, picture ads on MSN, Outlook and Edge) or search (keywords and responsive search ads on Bing search results; goal traffic, bidding lowest_cost only, places as the only targeting; API and drafts only). A Search setup that does not fit answers 400 search_setup_invalid with the issues.",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "audience",
                  "search"
                ],
                "default": "audience"
              },
              "search": {
                "type": "object",
                "properties": {
                  "keywords": {
                    "type": "array",
                    "description": "1 to 200, each at most 100 characters",
                    "items": {
                      "type": "object",
                      "required": [
                        "text"
                      ],
                      "properties": {
                        "text": {
                          "type": "string"
                        },
                        "match": {
                          "type": "string",
                          "enum": [
                            "broad",
                            "phrase",
                            "exact"
                          ],
                          "default": "broad"
                        }
                      }
                    }
                  },
                  "negative_keywords": {
                    "type": "array",
                    "description": "At most 200, on the campaign. Microsoft has no broad negative keywords",
                    "items": {
                      "type": "object",
                      "required": [
                        "text"
                      ],
                      "properties": {
                        "text": {
                          "type": "string"
                        },
                        "match": {
                          "type": "string",
                          "enum": [
                            "phrase",
                            "exact"
                          ],
                          "default": "phrase"
                        }
                      }
                    }
                  },
                  "search_partners": {
                    "type": "boolean",
                    "default": false,
                    "description": "Also show the ads on Microsoft's search partner sites"
                  }
                }
              }
            }
          },
          "meta": {
            "type": "object",
            "properties": {
              "budget_level": {
                "type": "string",
                "enum": [
                  "ad_set",
                  "campaign"
                ]
              }
            }
          }
        }
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "in": "header",
        "name": "Idempotency-Key",
        "required": false,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "example": "5f7c1d1e-8a0b-4b7e-9f1a-2c3d4e5f6a7b"
        },
        "description": "Makes a retry safe. Send a new unique value (a UUID v4) with each new request and the SAME value when you retry it (after a time-out or a lost connection). The first request with a key runs; its 2xx answer is kept for 24 hours and sent again for every request with the same key, path and body, with the header `Idempotent-Replayed: true`, so nothing is created or published twice. The same key with another path or body answers 409 `idempotency_key_reused`; while the first request still runs, 409 `idempotency_in_progress` with `Retry-After`. A 4xx or 5xx answer is not kept: a retry with the same key runs again. Keys belong to the API key (or OAuth grant) that sent them. A dry run ignores the key. Longer than 255 characters or empty: 400 `invalid_idempotency_key`."
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "No credential, or one that is not valid. `unauthorized`: no `Authorization: Bearer` header (or no key in it). `invalid_api_key`: the key is unknown, revoked or expired; create a new one at https://app.omnisocials.com/settings/api (Settings, API). The answer carries a `WWW-Authenticate: Bearer` challenge (RFC 6750) whose `resource_metadata` points to this API's RFC 9728 metadata, with `error=\"invalid_token\"` when a credential was sent.",
        "headers": {
          "WWW-Authenticate": {
            "description": "Bearer challenge with realm, resource_metadata and, for a refused credential, error=\"invalid_token\".",
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "unauthorized",
                        "invalid_api_key"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              },
              "example": {
                "error": {
                  "code": "invalid_api_key",
                  "message": "Invalid or expired API key."
                }
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "The credential is valid but may not do this. `insufficient_scope`: the key or token lacks the scope in this operation's `x-required-scopes` (the message and the `WWW-Authenticate` challenge name it); create a key with that scope. `insufficient_permission`: the person who owns the key lacks the role in this workspace. `forbidden`: the account lost access to the workspace.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "insufficient_scope",
                        "insufficient_permission",
                        "forbidden"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              },
              "example": {
                "error": {
                  "code": "insufficient_scope",
                  "message": "This API key needs the posts:write scope."
                }
              }
            }
          }
        }
      },
      "RateLimited": {
        "description": "Too many requests: 100 a minute per key over a sliding 60 second window. Wait the seconds in `Retry-After` (also `retry_after` in the body), then send the same request again.",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before the next request.",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "error"
              ],
              "properties": {
                "error": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "rate_limit_exceeded"
                      ]
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                },
                "retry_after": {
                  "type": "integer",
                  "description": "Seconds to wait."
                }
              },
              "example": {
                "error": {
                  "code": "rate_limit_exceeded",
                  "message": "Rate limit exceeded. Try again in 12 seconds."
                },
                "retry_after": 12
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/posts": {
      "get": {
        "operationId": "listPosts",
        "x-required-scopes": [
          "posts:read"
        ],
        "description": "Lists the posts of the key's workspace, 20 per page by default and at most 100, with `pagination`. Without a date range the newest created post comes first; with `start_date` or `end_date` the posts come in calendar order (`schedule_at`, earliest first). Filter by `status` and `tag`.",
        "summary": "List posts",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "in_approval",
                "scheduled",
                "posting",
                "published",
                "failed",
                "warning",
                "rejected"
              ]
            },
            "description": "Filter by status. `published` and the legacy alias `posted` are equivalent. `in_approval` matches posts waiting for a reviewer in an approval workflow. `rejected` matches posts an approver declined via POST /posts/{id}/reject. `warning` matches partially failed posts (some platforms published, some failed). These do NOT match `failed`, which only matches posts where every platform failed."
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 100
            },
            "description": "Number of posts to return"
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "description": "Number of posts to skip"
          },
          {
            "in": "query",
            "name": "start_date",
            "schema": {
              "type": "string",
              "example": "2026-11-01"
            },
            "description": "Only posts whose `schedule_at` is on or after this moment: the time a post is planned for, or for a post sent at once the moment it was sent. Accepts YYYY-MM-DD (that UTC day from 00:00), YYYY-MM (the first of that month) or a full ISO 8601 datetime. A post without a date (a draft without `schedule_at`) never matches a range. Same formats as GET /analytics/overview. Use it with `end_date` to read a calendar period; page with `limit` and `offset` as usual. With a range the posts come in calendar order (`schedule_at`, earliest first); without one, newest created first."
          },
          {
            "in": "query",
            "name": "end_date",
            "schema": {
              "type": "string",
              "example": "2026-11-30"
            },
            "description": "Only posts whose `schedule_at` is on or before this moment (inclusive). YYYY-MM-DD runs to 23:59:59.999 UTC of that day, YYYY-MM to the last day of that month; a full ISO 8601 datetime is used as given. Must not be before `start_date` (400 `validation_error`)."
          },
          {
            "in": "query",
            "name": "tag",
            "schema": {
              "type": "string",
              "example": "Question hook"
            },
            "description": "Only posts with this tag: a tag id or name. Comma separate several to match posts with any of them. An unknown tag answers 404 `tag_not_found`."
          }
        ],
        "responses": {
          "200": {
            "description": "List of posts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Post"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/posts?status=scheduled&limit=20\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst posts = await client.posts.list({ status: \"scheduled\", limit: 20 });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nposts = client.posts.list(status=\"scheduled\", limit=20)"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials posts:list --status scheduled --limit 20"
          }
        ]
      }
    },
    "/posts/recent-platform": {
      "get": {
        "operationId": "getRecentPlatformPosts",
        "x-required-scopes": [
          "analytics:read"
        ],
        "summary": "List live platform posts",
        "description": "Returns the most recent posts pulled directly from each connected platform's API (Instagram, TikTok, X, YouTube, Facebook, LinkedIn, and more), including content that was published outside OmniSocials. This is the fallback for brand-new workspaces that have not published anything through OmniSocials yet, so GET /posts (which only lists OmniSocials posts) comes back empty. Each post is enriched with normalized `engagement` / `impressions` / `engagement_rate` so you can rank across platforms without re-deriving per-platform rules. Metrics are only present where the platform exposes them for historical posts: X, TikTok (views/likes/comments/shares, plus `average_time_watched`, `full_video_watched_rate`, `total_time_watched`, `favorites`, `reach` when the workspace enabled TikTok comments, the Business API authorization), Bluesky, Mastodon, Instagram (likes/comments/reach/views/saves/shares, via one insights call per post), Facebook, and YouTube return counts, while Threads, Pinterest, and Google Business return captions only (`metrics: {}`). LinkedIn personal profiles cannot be listed live (LinkedIn grants no such permission to apps), so their results contain posts published through OmniSocials with their latest collected stats; TikTok results are backfilled the same way for photo posts the video list omits. Fetched live on every call for most platforms, so expect a few seconds of latency across many platforms. X is the exception: because X's API bills every returned post, X results may be served from a snapshot up to 24 hours old. The snapshot refreshes immediately after you publish to X through OmniSocials, so your own new posts always appear. Requires the `analytics:read` scope and View analytics (`access_analytics`) for the key's creator (or the person behind the OAuth token): it carries the numbers of posts made outside OmniSocials, which the app shows on its Analytics pages only.\n",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 25,
              "maximum": 50
            },
            "description": "Max posts to fetch per connected platform (1-50, default 25). When omitted, X returns up to 10 (its API bills per returned post); pass an explicit limit to get more from X.\n"
          },
          {
            "in": "query",
            "name": "platforms",
            "schema": {
              "type": "string",
              "example": "instagram,tiktok"
            },
            "description": "Optional comma-separated platform filter (e.g. \"instagram,tiktok\"). Defaults to every connected platform. Unsupported values return 400.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Recent posts across connected platforms, newest first",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "platform": {
                            "type": "string",
                            "example": "instagram"
                          },
                          "id": {
                            "type": "string",
                            "nullable": true,
                            "example": "17912345678901234",
                            "description": "The platform's own native post/media id (NOT the OmniSocials Post id). Use this as the stable key to store and de-duplicate each post when ingesting native content."
                          },
                          "permalink": {
                            "type": "string",
                            "nullable": true,
                            "description": "Public URL of the post on the platform. Present for Instagram, Facebook, Threads, TikTok, YouTube, X, Pinterest, Mastodon, Bluesky, and LinkedIn; null where the platform's listing API exposes no URL (e.g. Google Business) or one can't be built.",
                            "example": "https://www.instagram.com/p/Cxyz123ABC/"
                          },
                          "text": {
                            "type": "string",
                            "description": "Full, untruncated caption / post text (empty string if the post has none).",
                            "example": "Our autumn menu is here. #autumnmenu"
                          },
                          "format": {
                            "type": "string",
                            "description": "post, carousel, reel, video, image, text, or pin",
                            "example": "carousel"
                          },
                          "media_count": {
                            "type": "integer",
                            "example": 3
                          },
                          "timestamp": {
                            "type": "string",
                            "format": "date-time",
                            "nullable": true,
                            "example": "2026-10-21T09:00:07.000Z"
                          },
                          "image_url": {
                            "type": "string",
                            "nullable": true,
                            "description": "Display image for the post where the platform exposes one (currently Instagram: photo, video poster, or first carousel frame). Null otherwise."
                          },
                          "duration_seconds": {
                            "type": "integer",
                            "nullable": true,
                            "description": "Video length in whole seconds where the platform's listing API reports it (currently TikTok and YouTube). Null for images and for platforms that don't expose it (Instagram's media API has no duration field)."
                          },
                          "metrics": {
                            "type": "object",
                            "description": "Raw per-platform metrics as exact integers (never rounded/abbreviated); only keys the platform returned are present."
                          },
                          "engagement": {
                            "type": "number",
                            "example": 104
                          },
                          "impressions": {
                            "type": "number",
                            "example": 1520
                          },
                          "engagement_rate": {
                            "type": "number",
                            "description": "Percentage (0-100), suppressed below a minimum impression floor.",
                            "example": 6.84
                          }
                        }
                      }
                    },
                    "count": {
                      "type": "integer",
                      "example": 25
                    },
                    "connected_platforms": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "instagram"
                      }
                    },
                    "errors": {
                      "type": "object",
                      "description": "Per-platform error messages for any platform that failed to fetch."
                    },
                    "note": {
                      "type": "string"
                    },
                    "current_date": {
                      "type": "string",
                      "format": "date",
                      "example": "2026-10-21"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "One or more requested platforms are not supported",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` (no `analytics:read`), or `insufficient_permission`: the role of the key's creator (or the person behind the OAuth token) does not have View analytics (`access_analytics`) in this workspace's organisation, the permission the dashboard's Analytics pages need"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/posts/recent-platform?limit=10&platforms=instagram,x\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst recent = await client.posts.recentPlatform({ limit: 10, platforms: [\"instagram\", \"x\"] });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nrecent = client.posts.recent_platform(limit=10, platforms=[\"instagram\", \"x\"])"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials posts:recent-platform --limit 10 --platforms instagram,x"
          }
        ]
      }
    },
    "/posts/{id}": {
      "get": {
        "operationId": "getPost",
        "x-required-scopes": [
          "posts:read"
        ],
        "description": "Returns one post of the key's workspace: its content per channel, media, schedule, status, published links, errors and tags. A post on a channel with comment-to-DM also carries its `comment_dm_automation`. A post of another workspace answers 404.",
        "summary": "Get a post",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1024"
            },
            "description": "Post ID"
          }
        ],
        "responses": {
          "200": {
            "description": "Post details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Post not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/posts/12345\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst post = await client.posts.get(\"12345\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\npost = client.posts.get(\"12345\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials posts:get 12345"
          }
        ]
      },
      "patch": {
        "operationId": "updatePost",
        "x-required-scopes": [
          "posts:write"
        ],
        "description": "Changes a post of the key's workspace; fields you leave out keep their value. The channel options `instagram`, `telegram`, `discord`, `linkedin` and `linkedin_page` merge into the stored options, while `video_cover`, `linkedin_poll`, `comment_dm_automation` and `tags` replace what is stored. While the post is being published the answer is 409 `post_publishing`; a PATCH with only `tags` still works then.",
        "summary": "Update a post",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1024"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/content"
                  },
                  "accounts": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "example": "instagram"
                    }
                  },
                  "channels": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/channels"
                  },
                  "scheduled_at": {
                    "type": "string",
                    "format": "date-time",
                    "nullable": true,
                    "description": "Alias of `schedule_at` (the SDKs send this name). When both are sent, `schedule_at` wins."
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "post",
                      "story",
                      "reel"
                    ],
                    "description": "Change post type (draft only)"
                  },
                  "media": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/media"
                  },
                  "media_ids": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/media"
                  },
                  "media_urls": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/media_urls"
                  },
                  "schedule_at": {
                    "type": "string",
                    "format": "date-time",
                    "example": "2026-10-21T09:00:00Z",
                    "description": "New publish time (ISO 8601, must be in the future). A draft becomes `scheduled` (or stays a planned draft when `draft: true` is sent with it). A post that is waiting for approval keeps its `in_approval` status and only its time moves. Send `null` to unschedule back to a `draft` without a date; a post that was waiting for approval then leaves its approval workflow (`approval_status` becomes `none`)."
                  },
                  "draft": {
                    "type": "boolean",
                    "example": false,
                    "description": "Planned-draft switch. `false` without `schedule_at` schedules a draft at the `schedule_at` it already carries (400 `validation_error` when it has none or it is in the past). `true` without `schedule_at` unschedules a scheduled post: it keeps its time and stays on the calendar as a dashed draft, nothing publishes; a post waiting for approval leaves its workflow. `true` with `schedule_at` moves the time and keeps (or makes) the post a draft."
                  },
                  "media_fit": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/media_fit"
                  },
                  "location_id": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/location_id"
                  },
                  "collaborators": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/collaborators"
                  },
                  "user_tags": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/user_tags"
                  },
                  "video_cover": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/VideoCover"
                      }
                    ],
                    "nullable": true,
                    "description": "Replaced wholesale; send the full desired cover. Pass `null` to remove the cover. Omit to leave it untouched. Facebook's `facebook.thumbnail_type` / `thumb_offset` / `cover_url` merge into `overrides.facebook` on their own (`thumbnail_type: null` clears just that override)."
                  },
                  "pinterest": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/pinterest"
                  },
                  "youtube": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/youtube"
                  },
                  "instagram": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/CreatePostRequest/properties/instagram"
                      }
                    ],
                    "description": "Instagram Reel options. MERGED into the stored options: keys you omit keep their current value (so updating share_to_feed cannot silently clear a Trial Reel flag or reel music set elsewhere); pass a key explicitly as null to clear it."
                  },
                  "facebook": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/CreatePostRequest/properties/facebook"
                      }
                    ],
                    "description": "Facebook options. `first_comment`: a string sets it, `null`/empty clears it; leave it out to keep it. `thumbnail_type` / `thumb_offset` / `cover_url` set the video cover as on create; `thumbnail_type: null` clears it."
                  },
                  "tiktok": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/tiktok"
                  },
                  "x": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/x"
                  },
                  "bluesky": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/bluesky"
                  },
                  "mastodon": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/mastodon"
                  },
                  "threads": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/threads"
                  },
                  "telegram": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/CreatePostRequest/properties/telegram"
                      }
                    ],
                    "description": "Telegram options. MERGED into the stored options: keys you omit keep their value; a key set to null removes that option; `telegram: null` removes every option (the publish result stays)."
                  },
                  "discord": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/CreatePostRequest/properties/discord"
                      }
                    ],
                    "description": "Discord options. MERGED into the stored options: keys you omit keep their value; a key set to null removes that option; `discord: null` removes every option (the publish result stays)."
                  },
                  "google_business": {
                    "$ref": "#/components/schemas/CreatePostRequest/properties/google_business"
                  },
                  "linkedin": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/CreatePostRequest/properties/linkedin"
                      }
                    ],
                    "description": "LinkedIn Profile options. MERGED into the stored options: keys you omit keep their current value. `first_comment`: a string sets it, `null`/empty clears it. `carousel_as_images`: `true` publishes 2+ images as a plain image gallery, `false`/`null` reverts to the default PDF document carousel. `document_source`: `slides` rebuilds the document from the slide images, `original_pdf`/`null` reverts to sending the kept original PDF (the default)."
                  },
                  "linkedin_page": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/CreatePostRequest/properties/linkedin_page"
                      }
                    ],
                    "description": "LinkedIn Company Page options. Same merge semantics as `linkedin`."
                  },
                  "linkedin_poll": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/CreatePostRequest/properties/linkedin_poll"
                      }
                    ],
                    "description": "Replaced wholesale: send the full desired state for BOTH channels, not just the one you're changing. Pass `null` (or `{ \"linkedin\": null, \"linkedin_page\": null }`) to clear every poll and revert to normal posts; set just one channel's key to `null` to clear only that channel's poll while keeping the other."
                  },
                  "comment_dm_automation": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/CreatePostRequest/properties/comment_dm_automation"
                      }
                    ],
                    "nullable": true,
                    "description": "Replaces the post's comment-to-DM setup (keywords, DM, public reply, Follow first, follow-up, limits, `platforms`); each automation keeps listening on the same post. Leave out `actions.follow_gate` and Follow first is off after the update; leave out `actions.follow_up` and each automation keeps its stored follow-up (send `{ \"enabled\": false }` to switch it off). A channel no longer listed in `platforms` loses its automation. Pass `null` to remove them all. Omit to leave them untouched. Needs the `automations:write` scope."
                  },
                  "tags": {
                    "allOf": [
                      {
                        "$ref": "#/components/schemas/CreatePostRequest/properties/tags"
                      }
                    ],
                    "nullable": true,
                    "description": "Replaces the post's tags (ids or names, a new name becomes a tag); `null` or `[]` removes them all. A PATCH that sends only `tags` works on every post, published and failed ones included. To add or remove a few tags on many posts at once, use POST /tags/apply."
                  },
                  "link_url": {
                    "type": "string",
                    "format": "uri",
                    "nullable": true,
                    "description": "Sets the link card (LinkedIn and Facebook text posts; a post with media ignores it). The same URL as stored keeps the stored title, description and thumbnail; another URL starts a new card with only the link fields of this request. `null` or an empty string removes the card. Must be http or https (400 otherwise). Leave it out to keep the card.",
                    "example": "https://example.com/blog/new-feature"
                  },
                  "link_title": {
                    "type": "string",
                    "nullable": true,
                    "description": "Title of the link card, as on create. A string sets it, `null` or an empty string removes it. Without `link_url` it changes the stored card; a post without a card answers 400."
                  },
                  "link_description": {
                    "type": "string",
                    "nullable": true,
                    "description": "Description of the link card, as on create. A string sets it, `null` or an empty string removes it. Without `link_url` it changes the stored card; a post without a card answers 400."
                  },
                  "link_thumbnail_url": {
                    "type": "string",
                    "format": "uri",
                    "nullable": true,
                    "description": "Thumbnail of the link card (LinkedIn uploads it), as on create. A string sets it, `null` or an empty string removes it. Must be http or https: unlike create, which drops a bad thumbnail, PATCH answers 400. Without `link_url` it changes the stored card; a post without a card answers 400."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Post updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    },
                    "warnings": {
                      "type": "array",
                      "description": "Non-blocking notices. `ignored_fields` (first when present: top-level body fields PATCH does not read, listed in `fields`, for example `platforms`, `publish_now`, `link_url` or the read-only fields of a GET answer sent back; the post was updated without them) and `image_fit` (see `media_fit`).",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "example": "ignored_fields"
                          },
                          "message": {
                            "type": "string"
                          },
                          "fields": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "example": [
                              "platforms"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Common cases:\n- A text field of the body is longer than 100,000 characters, or all texts together are longer than 1,000,000 (`validation_error`, checked before anything else; the message names the field)\n- Cannot update posted/failed posts\n- Per-platform media cap exceeded after the update (Bluesky/X/Mastodon ≤4, Instagram/Threads ≤10, TikTok ≤35), or mixed image+video on a platform that doesn't support it (Facebook, LinkedIn, X, Bluesky, Mastodon, TikTok. Instagram/Threads mixed carousels are fine)\n- Pinterest carousel aspect ratios don't all match\n- Character-limit exceeded for one or more selected platforms\nSame `validation_error` code + message shape as `POST /v1/posts/create`.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Post not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`post_publishing`: the post is being published right now (status `posting`, also when the publish started while this request ran), so nothing was changed. Poll GET /posts/{id} until the status is `published`, `warning` or `failed`. A PATCH that sends only `tags` still works. `review_required`: changes were requested on this post in its approval workflow (`approval_status` `rejected`), so a `schedule_at` (or `draft: false`) that would schedule it is refused: it needs a new review (create it again with `approval_workflow_id`). Saving it as a draft works. `media_processing`: a file in `media`, `media_ids` or a thread part's `media_ids` is still being processed; nothing was changed. Wait until GET /v1/media/{id} says `ready`, then send the same request again (a file whose processing failed answers 400 `invalid_media`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "`storage_unavailable`: only with `media_urls`. Our storage provider is temporarily unavailable, the media was not stored and no post was changed. The URLs themselves are fine. Wait for the `Retry-After` header (seconds, also in the body as `retry_after`) and send the same request again. `video_busy`: only with `media_urls`. A video must be converted to H.264 and every conversion slot stayed busy for 60 seconds; nothing was stored. Wait for `Retry-After` and send the same request again. `downloads_busy`: only with `media_urls`. We read a limited number of URL files at a time and no slot came free within 20 seconds; nothing was stored. Wait for `Retry-After` and send the same request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.omnisocials.com/v1/posts/12345\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"schedule_at\": \"2026-11-02T09:00:00Z\"}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst post = await client.posts.update(\"12345\", { scheduled_at: \"2026-11-02T09:00:00Z\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\npost = client.posts.update(\"12345\", scheduled_at=\"2026-11-02T09:00:00Z\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials posts:update 12345 --schedule 2026-11-02T09:00:00Z"
          }
        ]
      },
      "delete": {
        "operationId": "deletePost",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Delete a post",
        "description": "Removes the post from OmniSocials only: it leaves the calendar, the posts list and the analytics. It never deletes the live post on a platform, so a published post stays live everywhere it went. To take a live post down as well, use \"Delete from [platform]\" on the post in the OmniSocials dashboard (all platforms except Instagram and TikTok, whose APIs have no delete) or delete it in the platform's own app. Cannot be undone.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1024"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Post deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Post not found"
          },
          "409": {
            "description": "`post_publishing`: the post is being published right now (status `posting`), or a retry publishes one of its channels right now (the automatic retry or a dashboard retry of a `failed` or `warning` post), so it is not deleted: a delete now would let the publish go live with no record in OmniSocials. Poll GET /posts/{id} until the status is `published`, `warning` or `failed` and no retry runs, then delete it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.omnisocials.com/v1/posts/12345\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nawait client.posts.delete(\"12345\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nclient.posts.delete(\"12345\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials posts:delete 12345"
          }
        ]
      }
    },
    "/posts/create": {
      "post": {
        "operationId": "createPost",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Create a post",
        "description": "Create a new post. You can attach media by uploading first (media/media_ids) or by passing external URLs (media_urls) which will be downloaded and processed automatically. Both can be combined.\n\n**Test without creating (`dry_run: true` or `?dry_run=true`):** the same checks as a real call, then `200` with `data.dry_run: true` and what would be created (`PostDryRun`). Nothing is stored or sent. An invalid request answers exactly as the real call does. See the guide \"Test without publishing\" (docs.omnisocials.com/testing).\n\n**Required media:** Instagram and TikTok posts need at least one image/video. Pinterest posts need an image and a board_id. Posts without required media will be rejected with a 400 error.\n\n**Stories (`type: \"story\"`):** 1 to 10 media items. Each item is one slide and publishes as its own story on Instagram and Facebook, in the order given. Per-platform objects can give each platform its own slide list. Videos max 60 s per slide. After publishing, `story_slides` lists every slide's native id and URL; `published_urls` keeps the first slide.\n\n**Per-platform media caps (enforced at submit, not at publish time):**\n- `bluesky`: max 4 images per post; cannot mix images and video\n- `mastodon`: max 4 media items per post; cannot mix images and video\n- `x`: max 4 images per post; cannot mix images and video\n- `instagram`: max 10 items in a carousel; images and videos **can** be mixed in one carousel\n- `threads`: max 10 items in a carousel; images and videos **can** be mixed in one carousel\n- `tiktok`: max 35 items per photo post; cannot mix photos and videos in one post\n- `pinterest`: max 5 **images** per carousel pin (videos are exempt: they publish as single video pins)\n- `facebook`, `linkedin`, `linkedin_page`: cannot mix images and video in one post (their APIs accept images only or a single video)\n\nExceeding any cap returns `400 { error: { code: \"validation_error\", message: \"<Platform> allows up to N media items per post. You attached M, please remove M-N.\" } }` (Pinterest wording: \"Pinterest carousel pins support a maximum of 5 images. Please remove some images and try again.\"). The Pinterest carousel aspect-ratio constraint (2–5 same-ratio images) is enforced the same way; see the Pinterest section for the `mismatched_slides` response shape.\n\n**Per-platform video file-size caps (validated via ffprobe; drafts exempt):**\nMastodon 99 MB · Bluesky 100 MB · Instagram 300 MB · X 512 MB free tier, 16 GB with Premium / Premium+ (in practice bounded by the 1 GB URL-ingest / 100 MB direct-upload limits) · Threads / Reddit 1 GB · Pinterest 2 GB · Facebook / TikTok 4 GB · LinkedIn 5 GB · YouTube 256 GB.\nUpload requests are capped at 100 MB on top of these: anything bigger is rejected before media processing with `code: file_too_large`.\n\n**Per-platform video duration caps (validated via ffprobe; drafts exempt):**\nFacebook 240 min (Post + Reel; the separate 90 s Reel cap was removed on 2026-09-30) · Instagram 15 min (Post + Reel) · TikTok 10 min (Post + Reel) · YouTube Short **3 min** · X 140 s free tier, 125 min when the connected X account has Premium or Premium+ (tier detected automatically; reconnect X after upgrading) · Bluesky 180 s · Threads 5 min · LinkedIn 10 min · Pinterest 15 min · Reddit 15 min · Mastodon (instance-dependent).\n\nCap violations return `400 { error: { code: \"validation_error\", message: \"<Platform> only allows videos up to <cap>; yours is <duration>. Trim the video or deselect <Platform>.\" } }` (duration) or `\"This video (<size>) is too large for <Platform>. ...\"` (size). When multiple platforms reject the same upload, each contributes one sentence to the message. See `API_DEVELOPER_GUIDE.md` → \"Per-Platform Media Limits\" and \"Per-Platform Video Duration Caps\" for the full table with source citations.\n\n**X link-post credits:** X's API bills posts whose text contains a URL at a premium ($0.20 vs $0.015), and OmniSocials passes that fee through as prepaid credits at X's rate card (20 credits per URL-containing tweet; threads are billed per part that contains a link). Only a link written with `http://` or `https://` counts; a bare domain (`brand.com`) or a `www.` link is free. Credits are purchased in euros: 1 credit = €0.01, top-ups of €5-500 in the dashboard. When a create/schedule targets X and the text contains a URL, the 201 response includes a `warnings` array entry (`code: \"x_url_post_credits\"`) with `credits_required`, the company's current `credits_balance`, and the enforcement state. At publish time the credits are debited; if the balance can't cover it, the **X target alone fails** with an `INSUFFICIENT_CREDITS` message in its `error_message` (other platforms in the post publish normally) and the post can be retried after topping up in Settings → Organisation → Billing → Credits. Posts without links and media uploads stay free. X statistics reads use credits too, as often as each X account's setting says (`x_statistics` on GET /accounts, PATCH /accounts/{id}; balance on GET /credits). Calls with an OmniSocials Connect organisation key never use credits (no warning, no 402): Connect posts go through the integrator's own X app, which X bills directly.\n\n**Schedule-time gate:** every scheduled X link post reserves its cost until it publishes. Scheduling (or publishing) a new X link post that would push the total reserved past the balance is refused with **402 `x_credits_insufficient`** (`details` carries `credits_required`, `credits_balance`, `credits_reserved`). Drafts are never gated; posts publishing before the enforcement date are never gated.\n",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "`true` (any case) = check the request and create nothing, like `dry_run` in the body (see `CreatePostRequest.dry_run`). `false` or no value = a real call."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dry run (`dry_run: true`): the request passed every check the dry run makes and nothing was created. `data` says what the real call would create; `warnings` carries the same notices as the real call plus `media_urls_not_fetched` and `draft_not_checked`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PostDryRun"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "example": "media_urls_not_fetched"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Post created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    },
                    "warnings": {
                      "type": "array",
                      "description": "Non-blocking notices about this post. `ignored_fields` (first when present: top-level body fields this endpoint does not read, listed in `fields`; the post was made without them. Channel options go at the top level, `linkedin: { first_comment }`, never under `platforms`), `x_url_post_credits` (X link-post fee pass-through) and `image_fit` (a feed image outside what a channel shows uncropped: `action` is `cropped`, `kept` or `crop_failed`, with `platform`, `media_url`, `ratio`, `target` and `crop_url`; see `media_fit`).",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "example": "x_url_post_credits"
                          },
                          "message": {
                            "type": "string"
                          },
                          "fields": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "`ignored_fields` only: the ignored top-level field names (at most 20, each cut to 64 characters).",
                            "example": [
                              "platforms"
                            ]
                          },
                          "credits_required": {
                            "type": "integer",
                            "example": 20
                          },
                          "credits_balance": {
                            "type": "integer",
                            "nullable": true,
                            "example": 480
                          },
                          "enforced": {
                            "type": "boolean",
                            "example": true
                          },
                          "enforce_from": {
                            "type": "string",
                            "example": "2026-08-14"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error. Common cases (the `error.code` field identifies which):\n- `validation_error`: missing required fields, unknown account/platform name (incl. composite ids with an unknown or mismatched workspace prefix, so always source ids from `GET /v1/accounts`), character-limit exceeded, per-platform media cap exceeded, mixed image+video on a platform that doesn't support it (Facebook, LinkedIn, X, Bluesky, Mastodon, TikTok. Instagram and Threads mixed carousels are allowed), Pinterest carousel aspect-ratio mismatch (`mismatched_slides` listed)\n- `validation_error`, checked before anything else: a text field of the body (the content, a thread part, a first comment, any other string) is longer than 100,000 characters, or all texts together are longer than 1,000,000. The message names the field, e.g. `content.default is 150000 characters. A text can be at most 100000 characters.` Every network's own limit is far below this (Facebook 63,206 is the largest).\n- `platform_not_connected`: a selected platform isn't connected to this workspace\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "`x_credits_insufficient`: this X link post plus the credits already reserved by the company's other scheduled X link posts exceed the balance. `error.details` carries `credits_required`, `credits_balance` and `credits_reserved`. Top up at https://app.omnisocials.com/credits (or remove the link from the X version) and retry the request. Only returned for non-draft creates targeting X with a URL while enforcement applies.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "`media_processing`: a file in `media`, `media_ids` or a thread part's `media_ids` is still being processed (a large video is checked and converted after upload). Nothing was created. Wait until GET /v1/media/{id} says `ready`, then send the same request again. A file whose processing failed answers 400 `invalid_media`: upload it again. With an `Idempotency-Key`: `idempotency_in_progress` (the first request with this key still runs; retry after `Retry-After` seconds) or `idempotency_key_reused` (the key was used with another body or path; use a new key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "`storage_unavailable`: only with `media_urls`. Our storage provider is temporarily unavailable, the media was not stored and no post was created. The URLs themselves are fine. Wait for the `Retry-After` header (seconds, also in the body as `retry_after`) and send the same request again. `video_busy`: only with `media_urls`. A video must be converted to H.264 and every conversion slot stayed busy for 60 seconds; nothing was stored. Wait for `Retry-After` and send the same request again. `downloads_busy`: only with `media_urls`. We read a limited number of URL files at a time and no slot came free within 20 seconds; nothing was stored. Wait for `Retry-After` and send the same request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/posts/create\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"content\": {\"default\": \"New drop this Friday\"},\n    \"accounts\": [\"linkedin\", \"x\"],\n    \"schedule_at\": \"2026-11-02T09:00:00Z\"\n  }'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst post = await client.posts.create({\n  content: \"New drop this Friday\",\n  channels: [\"linkedin\", \"x\"],\n  scheduled_at: \"2026-11-02T09:00:00Z\",\n});"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\npost = client.posts.create(\n    content=\"New drop this Friday\",\n    channels=[\"linkedin\", \"x\"],\n    scheduled_at=\"2026-11-02T09:00:00Z\",\n)"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials posts:create --text \"New drop this Friday\" --channels linkedin,x --schedule 2026-11-02T09:00:00Z"
          }
        ]
      }
    },
    "/posts/create-and-publish": {
      "post": {
        "operationId": "createAndPublishPost",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Create and publish post",
        "description": "Creates a new post and publishes it right away, with no scheduling needed. Equivalent to calling POST /posts/create with publish_now: true. The post will be queued for immediate publishing to all selected platforms. With `dry_run: true` (body) or `?dry_run=true` it publishes nothing: it runs the same checks and answers 200 with what would be published (`PostDryRun`, `status: posting`).",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "dry_run",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "`true` (any case) = check the request and create nothing, like `dry_run` in the body (see `CreatePostRequest.dry_run`). `false` or no value = a real call."
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePostRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dry run (`dry_run: true`): the request passed every check the dry run makes and nothing was created. `data` says what the real call would create; `warnings` carries the same notices as the real call plus `media_urls_not_fetched` and `draft_not_checked`.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PostDryRun"
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "example": "media_urls_not_fetched"
                          },
                          "message": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Post created and queued for immediate publishing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Post"
                    },
                    "warnings": {
                      "type": "array",
                      "description": "The same notices as POST /posts/create: `ignored_fields` (top-level fields this endpoint does not read, in `fields`), `x_url_post_credits`, `image_fit`.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "code": {
                            "type": "string",
                            "example": "ignored_fields"
                          },
                          "message": {
                            "type": "string"
                          },
                          "fields": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "example": [
                              "platforms"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "`media_processing`: a file in `media`, `media_ids` or a thread part's `media_ids` is still being processed (a large video is checked and converted after upload). Nothing was created or published. Wait until GET /v1/media/{id} says `ready`, then send the same request again. A file whose processing failed answers 400 `invalid_media`: upload it again. With an `Idempotency-Key`: `idempotency_in_progress` (the first request with this key still runs; retry after `Retry-After` seconds) or `idempotency_key_reused` (the key was used with another body or path; use a new key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "`storage_unavailable`: only with `media_urls`. Our storage provider is temporarily unavailable, the media was not stored and no post was created. The URLs themselves are fine. Wait for the `Retry-After` header (seconds, also in the body as `retry_after`) and send the same request again. `video_busy`: only with `media_urls`. A video must be converted to H.264 and every conversion slot stayed busy for 60 seconds; nothing was stored. Wait for `Retry-After` and send the same request again. `downloads_busy`: only with `media_urls`. We read a limited number of URL files at a time and no slot came free within 20 seconds; nothing was stored. Wait for `Retry-After` and send the same request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/posts/create-and-publish\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"content\": {\"default\": \"We are live\"},\n    \"accounts\": [\"linkedin\", \"x\"]\n  }'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst post = await client.posts.createAndPublish({\n  content: \"We are live\",\n  channels: [\"linkedin\", \"x\"],\n});"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\npost = client.posts.create_and_publish(\n    content=\"We are live\",\n    channels=[\"linkedin\", \"x\"],\n)"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials posts:create-and-publish --text \"We are live\" --channels linkedin,x"
          }
        ]
      }
    },
    "/posts/{id}/publish": {
      "post": {
        "operationId": "publishPost",
        "x-required-scopes": [
          "posts:write"
        ],
        "description": "Publishes a draft or scheduled post of the key's workspace now, on every channel it targets. The post is checked first (media and text per channel, X credits), so a problem answers 400 (402 for X credits) before anything goes out. On 200 the post is queued: GET /posts/{id} shows the result per channel. Failed or partly failed posts go through POST /posts/{id}/retry.",
        "summary": "Publish a post now",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1024"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Post queued for publishing",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "1024"
                        },
                        "status": {
                          "type": "string",
                          "example": "posting"
                        },
                        "message": {
                          "type": "string",
                          "example": "Post queued for immediate publishing."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Post cannot be published. Only draft or scheduled posts are publishable: an already published post returns `already_published`, a failed post returns `post_failed`, and any other status (`warning`, `posting`) returns `invalid_status`. Use POST /posts/{id}/retry for failed or partially failed posts. Also returned for validation problems (e.g., missing media for Instagram/TikTok, missing board_id for Pinterest, or Pinterest carousel slides at mismatched aspect ratios, listed in `mismatched_slides` on the error object)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Post not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`review_required`: changes were requested on this post in its approval workflow (`approval_status` `rejected`), so it publishes only after a new review: create it again with `approval_workflow_id`. With an `Idempotency-Key`: `idempotency_in_progress` (the first request with this key still runs; retry after `Retry-After` seconds) or `idempotency_key_reused` (the key was used for another post or body; use a new key).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/posts/12345/publish\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst post = await client.posts.publish(\"12345\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\npost = client.posts.publish(\"12345\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials posts:publish 12345"
          }
        ]
      }
    },
    "/posts/{id}/retry": {
      "post": {
        "operationId": "retryPost",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Retry failed post",
        "description": "Re-publishes ONLY the platforms that failed, on the same post. Platforms that already succeeded are never re-published. A platform whose error says publishing was interrupted on our side is first looked up on the platform: a post that went live is taken over as published instead of being sent again. Works on posts with status `failed` (every platform failed) or `warning` (some platforms failed). The retry is processed asynchronously by the publishing queue, usually within a minute; poll `GET /posts/{id}` to see the outcome (`status` becomes `published` and `published_urls` gains the platform URL on success, or the platform's entry reappears in `errors` on another failure). Each platform can be retried at most 3 times; after that, create a new post. Platforms dismissed with 'ignore' in the dashboard are not retried.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1024"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Retry queued",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "1024"
                        },
                        "status": {
                          "type": "string",
                          "example": "posting"
                        },
                        "platforms": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "instagram"
                          },
                          "description": "The failed platforms being retried"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Post is not retryable: `invalid_status` (post is not failed/warning), `nothing_to_retry` (no failed platforms recorded, e.g. legacy posts without per-platform tracking), or `max_retries_reached` (a failed platform has already been retried 3 times; the response lists the exhausted platforms)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Post not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`retry_in_progress`: another run is publishing a platform of this post right now (the automatic retry or a dashboard retry), or another retry (a second request, the dashboard, the automatic retry) claimed the failed platforms or the post first. Nothing was queued by this request. Poll GET /posts/{id} and retry once the post is `failed` or `warning` again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/posts/12345/retry\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst retry = await client.posts.retry(\"12345\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nretry = client.posts.retry(\"12345\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials posts:retry 12345"
          }
        ]
      }
    },
    "/posts/{id}/approve": {
      "post": {
        "operationId": "approvePost",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Approve a post",
        "description": "Approves the current step of the post's approval workflow, on behalf of the user who owns this API key. That user must be a listed approver for the workflow's CURRENT step. Steps are approved in order, and a key holder who is only an approver on a later step gets `forbidden` until earlier steps clear. If this is the last step, the post is finalized immediately: it moves to `scheduled` (future `schedule_at`) or `posting` (due now or in the past). If more steps remain, the post stays `in_approval` and the next step's approvers are notified. Check `approval_status` on GET /posts/{id} first: only a post with status `in_approval` can be approved. Send `step_order` (the step you reviewed, from GET /posts/{id}/approval) so a repeated call after a timeout never approves the next step too.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1024"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "step_order": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Optional. The workflow step this approval is for. When the review is on another step now (somebody decided since you read it), nothing is approved and the answer is 409 `step_changed`.",
                    "example": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Approval recorded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "1024"
                        },
                        "status": {
                          "type": "string",
                          "description": "The post's status after this call: `in_approval` (more steps remain), `scheduled`, or `posting`.",
                          "example": "scheduled"
                        },
                        "approval_status": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "approved"
                          ]
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_status`: the post is not waiting for approval. `already_finalized`: someone else already decided this step (race condition). `validation_error`: `step_order` is not a whole number from 1.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`forbidden`: the API key's owner is not a listed approver for the workflow's current step.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Post not found, or the post has no approval workflow attached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`step_changed`: `step_order` names another step than the one the review is on now; nothing was decided. `error.current_step_order` is the current step: read the post again before you decide.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/posts/12345/approve\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst result = await client.posts.approve(\"12345\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nresult = client.posts.approve(\"12345\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials posts:approve 12345"
          }
        ]
      }
    },
    "/posts/{id}/reject": {
      "post": {
        "operationId": "rejectPost",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Reject a post",
        "description": "Rejects the post's approval workflow on behalf of the user who owns this API key. That user must be a listed approver for the workflow's CURRENT step. Unlike approval, a rejection stops the whole workflow immediately (not just the current step), and the post's status becomes `rejected`. An optional `comment` explaining the rejection is stored on the decision and posted into the post's review thread.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1024"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "comment": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "Optional reason for the rejection, shown to the requester and other approvers.",
                    "example": "Wrong product photo"
                  },
                  "step_order": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "Optional. The workflow step this rejection is for. When the review is on another step now, nothing is rejected and the answer is 409 `step_changed`.",
                    "example": 1
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Rejection recorded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "1024"
                        },
                        "status": {
                          "type": "string",
                          "example": "rejected"
                        },
                        "approval_status": {
                          "type": "string",
                          "example": "rejected"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_status`: the post is not waiting for approval. `already_finalized`: someone else already decided this step (race condition). `validation_error`: `comment` was not a string, or `step_order` is not a whole number from 1.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`forbidden`: the API key's owner is not a listed approver for the workflow's current step.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Post not found, or the post has no approval workflow attached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "`step_changed`: `step_order` names another step than the one the review is on now; nothing was decided. `error.current_step_order` is the current step.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/posts/12345/reject\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"comment\": \"Wrong CTA link, please fix.\"}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst result = await client.posts.reject(\"12345\", \"Wrong CTA link, please fix.\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nresult = client.posts.reject(\"12345\", comment=\"Wrong CTA link, please fix.\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials posts:reject 12345 --comment \"Wrong CTA link, please fix.\""
          }
        ]
      }
    },
    "/posts/{id}/approval": {
      "get": {
        "operationId": "getPostApproval",
        "x-required-scopes": [
          "posts:read"
        ],
        "summary": "Get approval review",
        "description": "Returns the review of a post that went through an approval workflow: every step with its approvers and their decisions, the rejection with its reason, and the comment thread. Use it after `approval_status` is `rejected` to learn who rejected the post and why, or while it is `pending` to see who the post waits for and what the reviewers wrote. A post without an approval workflow returns `status: none` with empty `steps` and `comments`.",
        "tags": [
          "Posts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1024"
            },
            "description": "Post ID"
          }
        ],
        "responses": {
          "200": {
            "description": "The approval review",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "post_id": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "none",
                            "pending",
                            "approved",
                            "rejected"
                          ],
                          "description": "`none` = the post has no approval workflow."
                        },
                        "workflow": {
                          "type": "object",
                          "nullable": true,
                          "properties": {
                            "id": {
                              "type": "string",
                              "nullable": true,
                              "description": "Null for a one-off approval that was not made from a saved workflow"
                            },
                            "name": {
                              "type": "string"
                            }
                          }
                        },
                        "requested_by": {
                          "type": "object",
                          "nullable": true,
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string",
                              "nullable": true
                            }
                          }
                        },
                        "requested_at": {
                          "type": "string",
                          "format": "date-time",
                          "nullable": true
                        },
                        "current_step": {
                          "type": "integer",
                          "nullable": true,
                          "description": "Order of the step the post waits on. Null when the review is finished."
                        },
                        "steps": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "order": {
                                "type": "integer"
                              },
                              "name": {
                                "type": "string"
                              },
                              "require_mode": {
                                "type": "string",
                                "enum": [
                                  "all",
                                  "any"
                                ],
                                "description": "`all` = every approver of the step must approve. `any` = one approval is enough."
                              },
                              "status": {
                                "type": "string",
                                "enum": [
                                  "pending",
                                  "approved",
                                  "rejected"
                                ]
                              },
                              "approvers": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "id": {
                                      "type": "string"
                                    },
                                    "name": {
                                      "type": "string",
                                      "nullable": true
                                    },
                                    "email": {
                                      "type": "string",
                                      "nullable": true
                                    },
                                    "status": {
                                      "type": "string",
                                      "enum": [
                                        "pending",
                                        "approved",
                                        "rejected"
                                      ]
                                    },
                                    "decided_at": {
                                      "type": "string",
                                      "format": "date-time",
                                      "nullable": true
                                    },
                                    "comment": {
                                      "type": "string",
                                      "nullable": true,
                                      "description": "The reason this approver gave with a rejection"
                                    }
                                  }
                                }
                              }
                            }
                          }
                        },
                        "rejection": {
                          "type": "object",
                          "nullable": true,
                          "description": "Present when an approver rejected the post",
                          "properties": {
                            "by": {
                              "type": "object",
                              "properties": {
                                "id": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string",
                                  "nullable": true
                                }
                              }
                            },
                            "reason": {
                              "type": "string",
                              "nullable": true
                            },
                            "at": {
                              "type": "string",
                              "format": "date-time",
                              "nullable": true
                            },
                            "step": {
                              "type": "integer",
                              "nullable": true
                            }
                          }
                        },
                        "comments": {
                          "type": "array",
                          "description": "The review thread, oldest first. Includes the entries OmniSocials writes when a reviewer edits the post.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "author": {
                                "type": "object",
                                "nullable": true,
                                "properties": {
                                  "id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string",
                                    "nullable": true
                                  }
                                }
                              },
                              "message": {
                                "type": "string"
                              },
                              "account": {
                                "type": "string",
                                "nullable": true,
                                "description": "The channel the comment is about (`instagram`, `linkedin_page`, ...). Null = the whole post."
                              },
                              "created_at": {
                                "type": "string",
                                "format": "date-time"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                },
                "example": {
                  "data": {
                    "post_id": "123456",
                    "status": "rejected",
                    "workflow": {
                      "id": "42",
                      "name": "Content approval"
                    },
                    "requested_by": {
                      "id": "7d1f3c52-9a4e-4b6f-8c21-5e0a9d3b7f14",
                      "name": "Alex"
                    },
                    "requested_at": "2026-10-01T09:00:00.000Z",
                    "current_step": null,
                    "steps": [
                      {
                        "order": 1,
                        "name": "Team review",
                        "require_mode": "any",
                        "status": "approved",
                        "approvers": [
                          {
                            "id": "2b8e6f90-1c3d-4a57-9e84-6f2d0b1c3a75",
                            "name": "Sam",
                            "email": "sam@example.com",
                            "status": "approved",
                            "decided_at": "2026-10-01T10:15:00.000Z",
                            "comment": null
                          }
                        ]
                      },
                      {
                        "order": 2,
                        "name": "Client approval",
                        "require_mode": "all",
                        "status": "rejected",
                        "approvers": [
                          {
                            "id": "c4a09e1d-7b52-4f38-a6d1-3e9f8b2c5d60",
                            "name": "Jordan",
                            "email": "jordan@example.com",
                            "status": "rejected",
                            "decided_at": "2026-10-01T14:30:00.000Z",
                            "comment": "The image does not match the caption"
                          }
                        ]
                      }
                    ],
                    "rejection": {
                      "by": {
                        "id": "c4a09e1d-7b52-4f38-a6d1-3e9f8b2c5d60",
                        "name": "Jordan"
                      },
                      "reason": "The image does not match the caption",
                      "at": "2026-10-01T14:30:00.000Z",
                      "step": 2
                    },
                    "comments": [
                      {
                        "id": "5f3a2b1c-8d7e-4c69-b0a4-1e2d3c4b5a69",
                        "author": {
                          "id": "c4a09e1d-7b52-4f38-a6d1-3e9f8b2c5d60",
                          "name": "Jordan"
                        },
                        "message": "Please use the new logo",
                        "account": "instagram",
                        "created_at": "2026-10-01T14:28:00.000Z"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Post not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/posts/12345/approval\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst review = await client.posts.getApproval(\"12345\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nreview = client.posts.get_approval(\"12345\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials posts:approval 12345"
          }
        ]
      }
    },
    "/media": {
      "get": {
        "operationId": "listMedia",
        "x-required-scopes": [
          "media:read"
        ],
        "description": "Lists the media library of the key's workspace, newest upload first, 20 per page by default and at most 100, with `pagination`. `search` matches the name and the file name; `folder_id` lists one folder, or `root` the media outside any folder. A crop made from an image for one channel is not listed on its own.",
        "summary": "List media",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 100
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer",
              "default": 0
            }
          },
          {
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string",
              "example": "autumn"
            },
            "description": "Case-insensitive search across the media name and filename. Use this to find an existing asset by name instead of re-uploading it."
          },
          {
            "in": "query",
            "name": "folder_id",
            "schema": {
              "type": "string",
              "example": "12"
            },
            "description": "Return only media in this folder. Use \"root\" for unfiled items at the top level."
          }
        ],
        "responses": {
          "200": {
            "description": "List of media files",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Media"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/media?limit=20\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst media = await client.media.list({ limit: 20 });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nmedia = client.media.list(limit=20)"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials media:list --limit 20"
          }
        ]
      }
    },
    "/media/{id}": {
      "get": {
        "operationId": "getMedia",
        "x-required-scopes": [
          "media:read"
        ],
        "summary": "Get a media item",
        "description": "Fetch one media item by id. Use this to poll a large URL upload until its `status` becomes `ready` (or `failed`).\n",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "482913"
            },
            "description": "Media id returned by an upload endpoint."
          }
        ],
        "responses": {
          "200": {
            "description": "The media item",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Media"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Media item not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/media/67890\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst item = await client.media.get(\"67890\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nitem = client.media.get(\"67890\")"
          }
        ]
      },
      "delete": {
        "operationId": "deleteMedia",
        "x-required-scopes": [
          "media:write"
        ],
        "description": "Deletes a media item of the key's workspace, with the crops made from it. A media item that a scheduled post, or a post being published, still uses answers 409 `media_in_use`; drafts and finished posts do not block. Answers 204 without a body.",
        "summary": "Delete a media item",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "482913"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Media deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Media not found"
          },
          "409": {
            "description": "Media is attached to a scheduled or publishing post and cannot be deleted yet (error code `media_in_use`). Cancel or reschedule the post(s) first, otherwise deleting the file would make the post fail to publish."
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.omnisocials.com/v1/media/67890\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nawait client.media.delete(\"67890\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nclient.media.delete(\"67890\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials media:delete 67890"
          }
        ]
      },
      "patch": {
        "operationId": "updateMedia",
        "x-required-scopes": [
          "media:write"
        ],
        "summary": "Rename or move media",
        "description": "Update the human-readable name and/or move a media file into a folder. Lets you label assets so they can be found later by name instead of re-uploading. Only the fields you send are changed.",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "482913"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Human-readable label (e.g. \"pp-play5get50\"). Send an empty string to clear it.",
                    "example": "autumn-menu-hero"
                  },
                  "folder_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "Move the file into this folder. Send null to move it to the root (\"All media\").",
                    "example": "12"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Media updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Media"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "No updatable fields provided, or folder not found"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Media not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.omnisocials.com/v1/media/67890\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"hero-v2\"}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst item = await client.media.update(\"67890\", { name: \"hero-v2\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nitem = client.media.update(\"67890\", name=\"hero-v2\")"
          }
        ]
      }
    },
    "/media/upload": {
      "post": {
        "operationId": "uploadMedia",
        "x-required-scopes": [
          "media:write"
        ],
        "summary": "Upload a file",
        "description": "Upload an image or video, or a PDF. A PDF is rasterized into one image slide per page and returned as a carousel (see PdfUploadResult): pass all of `media_ids` to POST /posts. On LinkedIn the slides post as a native swipeable document; on Instagram, TikTok, Threads and Pinterest as an image carousel. PDFs are capped at 20 pages.\n",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "The file to upload: an image, video, or PDF (max 100MB). Per-platform caps apply at scheduling: Mastodon 99MB, Bluesky 100MB, X 512MB (free tier), Threads/Reddit 1GB, Pinterest 2GB, Facebook/Instagram/TikTok 4GB, LinkedIn 5GB, YouTube 256GB. A PDF is split into image slides (max 20 pages) and returned as a carousel."
                  },
                  "name": {
                    "type": "string",
                    "description": "Optional human-readable label (e.g. \"pp-play5get50\") so the asset is findable by name later. If the same bytes were already uploaded and that file still exists, the existing file is returned and labelled with this name.",
                    "example": "autumn-menu-hero"
                  },
                  "folder": {
                    "type": "string",
                    "description": "Optional folder name to file the asset under (created at the top level if it does not exist). Use `folder_id` instead to target an existing folder.",
                    "example": "Autumn campaign"
                  },
                  "folder_id": {
                    "type": "string",
                    "description": "Optional id of an existing folder to file the asset under.",
                    "example": "12"
                  },
                  "pdf_mode": {
                    "type": "string",
                    "enum": [
                      "slides",
                      "document"
                    ],
                    "default": "slides",
                    "description": "PDF uploads only. `slides` (default): one image media item per page, one id each; pass ALL of `media_ids` to POST /posts. `document`: ONE media item for the whole PDF (type `document`, its pages in `pdf.pages`); pass its single id in `media_ids` and the post gets every page, in order. Both modes keep the original file, which LinkedIn receives when the pages are posted unchanged."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "File uploaded successfully. For an image or video the body has a single `data` (Media). For a PDF the body is a PdfUploadResult with `slides` + `media_ids` for the whole carousel.\n",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Media"
                        },
                        "compatibility": {
                          "$ref": "#/components/schemas/MediaCompatibility"
                        },
                        "message": {
                          "type": "string",
                          "example": "File uploaded successfully. Use the 'id' in your post request."
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/PdfUploadResult"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid file or missing file (codes include `missing_file`, `invalid_file_type`, `corrupt_media`, `upload_error`, `validation_error`). `video_transcode_failed`: the video could not be converted during the upload. A video whose picture must be converted to H.264 (HEVC, AV1, VP9 and other codecs) is refused when it is longer than 10 minutes or larger than 4096x2304 per frame, and all video work of one upload stops after about 50 seconds (not counting the wait for a free conversion slot). The message says which; export the video as an H.264 MP4 and upload it again. A busy server is 503 `video_busy`, not this code. `pdf_too_large`: a PDF page or an image inside the PDF is too large to turn into slides, or the PDF takes longer than 80 seconds to render; export it at a normal page size. Other PDF codes: `pdf_invalid`, `pdf_encrypted`, `pdf_empty`, `pdf_unreadable`. `undecodable_image`: an image that cannot be read, or a HEIC photo larger than 67 megapixels or that took longer than 40 seconds to convert to JPEG (the message says which); export it as JPEG.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "413": {
            "description": "Payload too large. This endpoint is hard-capped at 100MB and bodies above that are rejected by our CDN (Cloudflare) BEFORE reaching the API, so the response is a NON-JSON HTML page, not the usual JSON error envelope. To upload files up to 1GB, use POST /media/upload-from-url instead (the server fetches the URL and bypasses the body cap)."
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "`storage_unavailable`: our storage provider is temporarily unavailable and the file was not stored. The request itself is correct. Wait for the `Retry-After` header (seconds, also in the body as `retry_after`) and send the same request again. `video_busy`: the video must be converted to H.264 and every conversion slot stayed busy for 60 seconds. Nothing was stored and the file is fine. Wait for `Retry-After` (also `retry_after` in the body) and send the same request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/media/upload\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -F \"file=@./photo.jpg\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst upload = await client.media.upload({ file: \"./photo.jpg\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nupload = client.media.upload(file=\"./photo.jpg\")"
          }
        ]
      }
    },
    "/media/upload-from-base64": {
      "post": {
        "operationId": "uploadMediaFromBase64",
        "x-required-scopes": [
          "media:write"
        ],
        "summary": "Upload from base64",
        "description": "Upload a file from base64-encoded data. Useful for MCP integrations where the AI has image data but no URL. Accepts images, video, and PDF (a PDF is split into image slides and returned as a carousel, see PdfUploadResult; pass all of media_ids to POST /posts). The JSON body can be 10 MB at most, so about 7.5 MB of file (base64 makes the data a third larger); for a bigger file use POST /media/upload (multipart, 100 MB), POST /media/create-upload-url or POST /media/upload-from-url (1 GB). Per-platform caps apply at scheduling (Mastodon 99MB, Bluesky 100MB, X 512MB free tier, Threads/Reddit 1GB, Pinterest 2GB, Facebook/Instagram/TikTok 4GB, LinkedIn 5GB, YouTube 256GB).",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "data",
                  "mime_type"
                ],
                "properties": {
                  "data": {
                    "type": "string",
                    "description": "Base64-encoded file data (without data URI prefix)"
                  },
                  "mime_type": {
                    "type": "string",
                    "description": "MIME type of the file (e.g. image/jpeg, image/png, application/pdf)",
                    "example": "image/jpeg"
                  },
                  "filename": {
                    "type": "string",
                    "description": "Optional filename",
                    "example": "autumn-menu.jpg"
                  },
                  "name": {
                    "type": "string",
                    "description": "Optional human-readable label so the asset is findable by name later (e.g. \"pp-play5get50\").",
                    "example": "autumn-menu-hero"
                  },
                  "folder": {
                    "type": "string",
                    "description": "Optional folder name to file the asset under (created at the top level if missing).",
                    "example": "Autumn campaign"
                  },
                  "folder_id": {
                    "type": "string",
                    "description": "Optional id of an existing folder to file the asset under.",
                    "example": "12"
                  },
                  "pdf_mode": {
                    "type": "string",
                    "enum": [
                      "slides",
                      "document"
                    ],
                    "default": "slides",
                    "description": "PDF uploads only. `slides` (default): one image media item per page, one id each; pass ALL of `media_ids` to POST /posts. `document`: ONE media item for the whole PDF (type `document`, its pages in `pdf.pages`); pass its single id in `media_ids` and the post gets every page, in order. Both modes keep the original file, which LinkedIn receives when the pages are posted unchanged."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "File uploaded successfully. A single `data` (Media) for image/video; a PdfUploadResult (`slides` + `media_ids`) for a PDF.\n",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Media"
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/PdfUploadResult"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid data or unsupported file type. The video and PDF codes are the same as on POST /media/upload: `video_transcode_failed` (a video that must be converted to H.264 is longer than 10 minutes or larger than 4096x2304 per frame, or the video work took longer than about 50 seconds; the message says which; a busy server is 503 `video_busy`) and `pdf_too_large` (a PDF page or image too large to turn into slides, or a render over 80 seconds). `undecodable_image`: an image that cannot be read, or a HEIC photo larger than 67 megapixels or that took longer than 40 seconds to convert to JPEG; export it as JPEG."
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "413": {
            "description": "`payload_too_large`: the JSON body is larger than 10 MB, so the file is larger than about 7.5 MB (base64 makes the data a third larger). Nothing was stored. Send a bigger file as multipart to POST /media/upload (100 MB), through POST /media/create-upload-url, or from a public URL with POST /media/upload-from-url (1 GB)."
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "`storage_unavailable`: our storage provider is temporarily unavailable and the file was not stored. The request itself is correct. Wait for the `Retry-After` header (seconds, also in the body as `retry_after`) and send the same request again. `video_busy`: the video must be converted to H.264 and every conversion slot stayed busy for 60 seconds. Nothing was stored and the file is fine. Wait for `Retry-After` (also `retry_after` in the body) and send the same request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "DATA=$(base64 < chart.png | tr -d '\\n')\n\ncurl -X POST \"https://api.omnisocials.com/v1/media/upload-from-base64\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d \"{\\\"data\\\": \\\"$DATA\\\", \\\"mime_type\\\": \\\"image/png\\\", \\\"filename\\\": \\\"chart.png\\\"}\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { readFileSync } from \"node:fs\";\nimport { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst upload = await client.media.uploadFromBase64({\n  data: readFileSync(\"./chart.png\").toString(\"base64\"),\n  mime_type: \"image/png\",\n  filename: \"chart.png\",\n});"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "import base64\nfrom omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nwith open(\"chart.png\", \"rb\") as f:\n    data = base64.b64encode(f.read()).decode()\n\nupload = client.media.upload_from_base64(\n    data=data,\n    mime_type=\"image/png\",\n    filename=\"chart.png\",\n)"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials media:upload-base64 --file ./chart.png"
          }
        ]
      }
    },
    "/media/upload-from-url": {
      "post": {
        "operationId": "uploadMediaFromUrl",
        "x-required-scopes": [
          "media:write"
        ],
        "summary": "Upload from a URL",
        "description": "Download a file from a URL and upload it to your media library. It is the recommended path for MCP/programmatic uploads. Supports videos up to **1 GB**: files over 100 MB are streamed to storage by a background worker and the response returns `202` with the item in `processing` state (poll `GET /media/{id}` until `status` is `ready`). Files at or under 100 MB upload inline and return `201` ready. A PDF URL is split into image slides and returned as a carousel (see PdfUploadResult; pass all of `media_ids` to POST /posts). Every response also includes a `compatibility` block listing any connected platforms that would reject the file by size or format.\n",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "HTTP or HTTPS URL of the file to download (max 1 GB for video; per-platform caps apply at scheduling).",
                    "example": "https://example.com/video.mp4"
                  },
                  "filename": {
                    "type": "string",
                    "description": "Optional filename override",
                    "example": "autumn-reel.mp4"
                  },
                  "name": {
                    "type": "string",
                    "description": "Optional human-readable label so the asset is findable by name later (e.g. \"pp-play5get50\").",
                    "example": "autumn-menu-hero"
                  },
                  "folder": {
                    "type": "string",
                    "description": "Optional folder name to file the asset under (created at the top level if missing).",
                    "example": "Autumn campaign"
                  },
                  "folder_id": {
                    "type": "string",
                    "description": "Optional id of an existing folder to file the asset under.",
                    "example": "12"
                  },
                  "pdf_mode": {
                    "type": "string",
                    "enum": [
                      "slides",
                      "document"
                    ],
                    "default": "slides",
                    "description": "PDF uploads only. `slides` (default): one image media item per page, one id each; pass ALL of `media_ids` to POST /posts. `document`: ONE media item for the whole PDF (type `document`, its pages in `pdf.pages`); pass its single id in `media_ids` and the post gets every page, in order. Both modes keep the original file, which LinkedIn receives when the pages are posted unchanged."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "File uploaded inline (<= 100 MB) and ready to use. A single `data` (Media) for image/video; a PdfUploadResult (`slides` + `media_ids`) for a PDF.\n",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "$ref": "#/components/schemas/Media"
                        },
                        "compatibility": {
                          "$ref": "#/components/schemas/MediaCompatibility"
                        },
                        "message": {
                          "type": "string",
                          "example": "File uploaded successfully. Use the 'id' in your post request."
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/PdfUploadResult"
                    }
                  ]
                }
              }
            }
          },
          "202": {
            "description": "Large file (over 100 MB) accepted and processing. `data.status` is 'processing': poll GET /media/{id} until 'ready' before using it.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Media"
                    },
                    "compatibility": {
                      "$ref": "#/components/schemas/MediaCompatibility"
                    },
                    "message": {
                      "type": "string",
                      "example": "Large file accepted and is being processed. Poll get media / list_media until its status is 'ready' before using it in a post."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid URL or unsupported file type. For a file of 100 MB or less the video and PDF codes are the same as on POST /media/upload: `video_transcode_failed` (a video that must be converted to H.264 is longer than 10 minutes or larger than 4096x2304 per frame, the video work took longer than about 50 seconds, or other videos are being converted; the message says which) and `pdf_too_large` (a PDF page or image too large to turn into slides, or a render over 80 seconds). `undecodable_image`: an image that cannot be read, or a HEIC photo larger than 67 megapixels or that took longer than 40 seconds to convert to JPEG; export it as JPEG. A larger file is converted in the background without these limits (202).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "413": {
            "description": "`file_too_large`: the file exceeds the 1 GB limit, or its server did not give its size (HEAD without Content-Length) and the file passed 100 MB while it was read.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "`storage_unavailable`: our storage provider is temporarily unavailable and the file was not stored. The request itself is correct. Wait for the `Retry-After` header (seconds, also in the body as `retry_after`) and send the same request again. `video_busy`: the video must be converted to H.264 and every conversion slot stayed busy for 60 seconds. Nothing was stored and the file is fine. Wait for `Retry-After` (also `retry_after` in the body) and send the same request again. `processing_unavailable` (a file over 100 MB): the file could not be queued for processing; its media item is marked failed. Send the same request again in a minute. `downloads_busy` (a file of 100 MB or less): we read a limited number of URL files at a time and no slot came free within 20 seconds. Nothing was stored. Wait for `Retry-After` (also `retry_after` in the body) and send the same request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/media/upload-from-url\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"url\": \"https://example.com/launch-video.mp4\"}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst upload = await client.media.uploadFromUrl({ url: \"https://example.com/launch-video.mp4\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nupload = client.media.upload_from_url(url=\"https://example.com/launch-video.mp4\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials media:upload --url https://example.com/launch-video.mp4"
          }
        ]
      }
    },
    "/media/create-upload-url": {
      "post": {
        "operationId": "createMediaUploadUrl",
        "x-required-scopes": [
          "media:write"
        ],
        "summary": "Create an upload URL",
        "description": "Create a one-time upload URL, for code that cannot send the API key with the upload, such as an AI assistant's code sandbox. POST the file as multipart `file` to `upload_url` (POST /media/upload-by-token) within 10 minutes; the URL works once. The MCP server's upload tool uses this flow. Requires the `media:write` scope.\n",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The one-time upload URL and how to use it.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "upload_url": {
                      "type": "string",
                      "description": "POST the file here (POST /media/upload-by-token with the token in the query).",
                      "example": "https://api.omnisocials.com/v1/media/upload-by-token?upload_token=9f2c4e1ab07d"
                    },
                    "upload_token": {
                      "type": "string",
                      "description": "The one-time token (64 hex characters), also part of `upload_url`.",
                      "example": "9f2c4e1ab07d"
                    },
                    "expires_in_seconds": {
                      "type": "integer",
                      "example": 600
                    },
                    "method": {
                      "type": "string",
                      "example": "POST"
                    },
                    "content_type": {
                      "type": "string",
                      "example": "multipart/form-data"
                    },
                    "instructions": {
                      "type": "string",
                      "description": "Upload commands (curl and Python) written for an AI assistant's code sandbox."
                    },
                    "hint": {
                      "type": "string",
                      "description": "What an AI assistant should tell the user when its sandbox blocks the upload host."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the `media:write` scope",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/media/create-upload-url\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst { upload_url } = await client.media.createUploadUrl();"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nupload = client.media.create_upload_url()\nupload_url = upload[\"upload_url\"]"
          }
        ]
      }
    },
    "/media/{id}/split": {
      "post": {
        "operationId": "splitMediaPdf",
        "x-required-scopes": [
          "media:write"
        ],
        "summary": "Split a PDF into pages",
        "description": "For a media item of type `document` (a PDF kept as one item): creates one image media item per rendered page, in page order, each a copy of the page image and each carrying `pdf` with its `page` number. The document item stays. Use it when a single page is needed as a normal image. A full, ordered set of the slides still publishes the original PDF on LinkedIn. Requires `media:write`.\n",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "482913"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The new slide items, in page order",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Media"
                      }
                    },
                    "media_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The item is not a PDF document"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Media not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/media/67890/split\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          }
        ]
      }
    },
    "/media/check": {
      "post": {
        "operationId": "checkMediaCompatibility",
        "x-required-scopes": [
          "media:read"
        ],
        "summary": "Check media limits",
        "description": "Preflight a file against the platforms connected to your workspace and find out which (if any) would reject it by size or format, before you upload or post. Provide ONE of: a public `url` (we read its size/type via a HEAD request), an existing `media_id`, or an explicit `size_bytes` + `mime`. Use this to warn the user (\"this 995 MB video won't post to Instagram\") and confirm before uploading.\n",
        "tags": [
          "Media"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "Public URL of the file to check (HEAD-probed for size + type).",
                    "example": "https://example.com/video.mp4"
                  },
                  "media_id": {
                    "type": "string",
                    "description": "Id of an already-uploaded library item to check.",
                    "example": "482913"
                  },
                  "size_bytes": {
                    "type": "integer",
                    "description": "File size in bytes (use with `mime` when you already know them).",
                    "example": 471859200
                  },
                  "mime": {
                    "type": "string",
                    "description": "MIME type, e.g. \"video/mp4\" (use with `size_bytes`).",
                    "example": "video/mp4"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Compatibility result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "file": {
                      "type": "object",
                      "properties": {
                        "size_bytes": {
                          "type": "integer",
                          "nullable": true,
                          "example": 471859200
                        },
                        "mime": {
                          "type": "string",
                          "nullable": true,
                          "example": "video/mp4"
                        },
                        "size_known": {
                          "type": "boolean",
                          "example": true
                        }
                      }
                    },
                    "connected_platforms": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "instagram"
                      }
                    },
                    "compatible": {
                      "type": "boolean",
                      "example": false,
                      "description": "true when no connected platform would reject the file."
                    },
                    "warnings": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "platform": {
                            "type": "string",
                            "example": "instagram"
                          },
                          "display_name": {
                            "type": "string",
                            "example": "Instagram"
                          },
                          "reasons": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "example": "max 300 MB"
                            }
                          }
                        }
                      }
                    },
                    "summary": {
                      "type": "string",
                      "nullable": true,
                      "description": "One-line human summary, or null when fully compatible.",
                      "example": "This file (450 MB) won't post to: Instagram (max 300 MB)."
                    },
                    "fit": {
                      "type": "array",
                      "description": "How each connected channel with a fit rule shows this IMAGE as a feed post (sizes known for library images). `fits: false` = the ratio is outside the window the channel shows uncropped; `default_action` is what a post create does (`crop` = Instagram crops it to `target` around the subject; `keep` = Pinterest sends it as it is and reports it) unless the post's `media_fit` says otherwise. Empty for videos and unknown sizes.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "platform": {
                            "type": "string",
                            "example": "instagram"
                          },
                          "display_name": {
                            "type": "string",
                            "example": "Instagram"
                          },
                          "fits": {
                            "type": "boolean",
                            "example": false
                          },
                          "ratio": {
                            "type": "string",
                            "example": "9:16"
                          },
                          "shown": {
                            "type": "string",
                            "enum": [
                              "whole",
                              "cut"
                            ]
                          },
                          "target": {
                            "type": "string",
                            "nullable": true,
                            "example": "4:5"
                          },
                          "default_action": {
                            "type": "string",
                            "nullable": true,
                            "enum": [
                              "crop",
                              "keep"
                            ]
                          },
                          "message": {
                            "type": "string",
                            "nullable": true
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing/invalid parameters"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/media/check\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"url\": \"https://example.com/launch-video.mp4\"}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst check = await client.media.check({ url: \"https://example.com/launch-video.mp4\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\ncheck = client.media.check(url=\"https://example.com/launch-video.mp4\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials media:check --url https://example.com/launch-video.mp4"
          }
        ]
      }
    },
    "/media/upload-by-token": {
      "post": {
        "operationId": "uploadMediaByToken",
        "summary": "Upload with a token",
        "description": "Upload a file to a one-time URL from POST /media/create-upload-url. No API key: the `upload_token` query parameter is the auth, valid once for 10 minutes. Takes the same files as POST /media/upload (images, video, PDF; up to 100 MB). If storage is briefly down (503), the token stays valid and the same request can be sent again.\n",
        "tags": [
          "Media"
        ],
        "security": [],
        "parameters": [
          {
            "in": "query",
            "name": "upload_token",
            "required": true,
            "description": "The token from POST /media/create-upload-url.",
            "schema": {
              "type": "string",
              "example": "9f2c4e1ab07d"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "file"
                ],
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary",
                    "description": "An image, video or PDF, up to 100 MB."
                  },
                  "name": {
                    "type": "string",
                    "description": "Optional label so the file is findable by name later.",
                    "example": "autumn-menu-hero"
                  },
                  "pdf_mode": {
                    "type": "string",
                    "enum": [
                      "slides",
                      "document"
                    ],
                    "default": "slides",
                    "description": "PDF uploads only, as on POST /media/upload."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The stored file. For an image or video, `data` is the media item. For a PDF the body is a PdfUploadResult.\n",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "123"
                        },
                        "data": {
                          "$ref": "#/components/schemas/Media"
                        },
                        "status": {
                          "type": "string",
                          "example": "ready"
                        }
                      }
                    },
                    {
                      "$ref": "#/components/schemas/PdfUploadResult"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "No file, an unsupported or damaged file, or a bad `pdf_mode` (codes `missing_file`, `invalid_file_type`, `corrupt_media`, `upload_error`, `validation_error`). Also, as on POST /media/upload: `video_transcode_failed` (a video that must be converted to H.264 is longer than 10 minutes or larger than 4096x2304 per frame, or the video work took longer than about 50 seconds; the message says which; a busy server is 503 `video_busy`) and `pdf_too_large` (a PDF page or image too large to turn into slides, or a render over 80 seconds). `undecodable_image`: an image that cannot be read, or a HEIC photo larger than 67 megapixels or that took longer than 40 seconds to convert to JPEG; export it as JPEG.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The token is unknown, already used (`invalid_token`) or expired (`token_expired`). Answered before the file is read, and the connection is closed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "`access_revoked`: the access the upload URL was made with has ended since: the API key was revoked or expired, the OAuth app was disconnected, or its person was removed from the workspace or lost the permission to create posts. Checked again at the upload, before the file is read; the token is used up and the connection is closed. Nothing was stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "`storage_unavailable`: nothing was stored and the token is still valid. Wait for `Retry-After` and send the same request again. `video_busy`: the video must be converted to H.264 and every conversion slot stayed busy for 60 seconds; nothing was stored, the token is still valid, wait for `Retry-After` and send the same request again. `service_unavailable`: the access check could not run; nothing was read or stored, the token is still valid, wait for `Retry-After` and send the same request again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/media/upload-by-token?upload_token=9f2c4e1ab07d\" \\\n  -F \"file=@./photo.jpg\""
          }
        ]
      }
    },
    "/folders": {
      "get": {
        "operationId": "listFolders",
        "x-required-scopes": [
          "media:read"
        ],
        "summary": "List folders",
        "description": "Returns all folders in the workspace as a flat list (build the tree client-side via parent_id). Use folder ids with the media endpoints to organize and find assets.",
        "tags": [
          "Folders"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List of folders",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Folder"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/folders\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst folders = await client.folders.list();"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nfolders = client.folders.list()"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials folders:list"
          }
        ]
      },
      "post": {
        "operationId": "createFolder",
        "x-required-scopes": [
          "media:write"
        ],
        "description": "Creates a media folder in the key's workspace, at the top level or inside `parent_id` (a folder of the same workspace, else 400 `parent_not_found`).",
        "summary": "Create a folder",
        "tags": [
          "Folders"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "parent_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "Parent folder id to nest under, or omit for a top-level folder"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Folder created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Folder"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid name or parent"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/folders\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Campaigns\"}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst folder = await client.folders.create({ name: \"Campaigns\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nfolder = client.folders.create(name=\"Campaigns\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials folders:create --name Campaigns"
          }
        ]
      }
    },
    "/folders/{id}": {
      "patch": {
        "operationId": "updateFolder",
        "x-required-scopes": [
          "media:write"
        ],
        "description": "Renames a media folder (`name`), moves it into another folder (`parent_id`) or to the top level (`parent_id: null`). Send at least one of the two (400 `no_fields`). A folder cannot move into itself or one of its own subfolders (400 `invalid_parent`).",
        "summary": "Rename or move a folder",
        "tags": [
          "Folders"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "parent_id": {
                    "type": "string",
                    "nullable": true,
                    "description": "New parent folder id, or null to move to the top level"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Folder updated"
          },
          "400": {
            "description": "Invalid update (e.g. would create a cycle)"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Folder not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.omnisocials.com/v1/folders/42\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Campaigns 2026\"}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst folder = await client.folders.update(\"42\", { name: \"Campaigns 2026\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nfolder = client.folders.update(\"42\", name=\"Campaigns 2026\")"
          }
        ]
      },
      "delete": {
        "operationId": "deleteFolder",
        "x-required-scopes": [
          "media:write"
        ],
        "summary": "Delete a folder",
        "description": "Deletes the folder. Its media is NOT deleted - files move to the root (\"All media\"), and any subfolders move up to this folder's parent.",
        "tags": [
          "Folders"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Folder deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Folder not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.omnisocials.com/v1/folders/42\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nawait client.folders.delete(\"42\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nclient.folders.delete(\"42\")"
          }
        ]
      }
    },
    "/tags": {
      "get": {
        "operationId": "listTags",
        "x-required-scopes": [
          "posts:read"
        ],
        "summary": "List tags",
        "description": "Every tag of the workspace, by name. Tags label posts to filter and compare them: `tag` on GET /posts and GET /analytics/overview, and GET /analytics/tags.",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The workspace's tags",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Tag"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/tags\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst tags = await client.tags.list();"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\ntags = client.tags.list()"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials tags:list"
          }
        ]
      },
      "post": {
        "operationId": "createTag",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Create a tag",
        "description": "At most 200 tags per workspace. A name is unique in the workspace (case-insensitive).",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/TagInput"
                  },
                  {
                    "required": [
                      "name"
                    ]
                  }
                ]
              },
              "example": {
                "name": "Question hook"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new tag",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Tag"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_tag_name` or `invalid_tag_color`"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "`tag_exists` (the existing tag is in `error.tag`) or `tag_limit_reached`"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/tags\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Question hook\"}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst tag = await client.tags.create({ name: \"Question hook\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\ntag = client.tags.create(name=\"Question hook\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials tags:create --name \"Question hook\""
          }
        ]
      }
    },
    "/tags/{id}": {
      "patch": {
        "operationId": "updateTag",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Update a tag",
        "description": "Rename or recolour. A key you leave out keeps its value. Posts keep the tag.",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TagInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated tag",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Tag"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`tag_not_found`"
          },
          "409": {
            "description": "`tag_exists`"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.omnisocials.com/v1/tags/12\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Question opener\"}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst tag = await client.tags.update(\"12\", { name: \"Question opener\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\ntag = client.tags.update(\"12\", name=\"Question opener\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials tags:update 12 --name \"Question opener\""
          }
        ]
      },
      "delete": {
        "operationId": "deleteTag",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Delete a tag",
        "description": "Deletes the tag and takes it off every post of the workspace. The posts themselves stay.",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "tag": {
                          "$ref": "#/components/schemas/Tag"
                        },
                        "posts_untagged": {
                          "type": "integer",
                          "description": "Posts that carried the tag"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`tag_not_found`"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.omnisocials.com/v1/tags/12\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nawait client.tags.delete(\"12\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nclient.tags.delete(\"12\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials tags:delete 12"
          }
        ]
      }
    },
    "/tags/apply": {
      "post": {
        "operationId": "tagPosts",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Tag posts in bulk",
        "description": "Add, remove or replace the tags of up to 500 posts at once, published ones included (tags never go to a platform). `add`, `remove` and `set` take tag ids or names; a new name in `add` or `set` becomes a tag. `set` replaces a post's tags, `add` and `remove` change only the tags you name. Post ids that are not posts of this workspace come back in `not_found`.",
        "tags": [
          "Tags"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "post_ids"
                ],
                "properties": {
                  "post_ids": {
                    "type": "array",
                    "maxItems": 500,
                    "items": {
                      "type": "string"
                    }
                  },
                  "add": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    }
                  },
                  "remove": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    }
                  },
                  "set": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "integer"
                        }
                      ]
                    }
                  }
                }
              },
              "example": {
                "post_ids": [
                  "1024",
                  "1025"
                ],
                "add": [
                  "Question hook"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The posts with their tags now",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "updated": {
                          "type": "integer",
                          "description": "Posts whose tags changed"
                        },
                        "posts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "tags": {
                                "type": "array",
                                "items": {
                                  "$ref": "#/components/schemas/Tag"
                                }
                              }
                            }
                          }
                        },
                        "not_found": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_post_ids`, `too_many_posts`, `too_many_tags`, `invalid_tags` or `invalid_tag_ids` (none of add, remove or set given)"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`tag_not_found`"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/tags/apply\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"post_ids\": [\"12345\", \"12346\"], \"add\": [\"Question hook\"]}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst result = await client.tags.apply({\n  post_ids: [\"12345\", \"12346\"],\n  add: [\"Question hook\"],\n});"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nresult = client.tags.apply(post_ids=[\"12345\", \"12346\"], add=[\"Question hook\"])"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials tags:apply --posts 12345,12346 --add \"Question hook\""
          }
        ]
      }
    },
    "/hashtag-sets": {
      "get": {
        "operationId": "listHashtagSets",
        "x-required-scopes": [
          "posts:read"
        ],
        "summary": "List hashtag sets",
        "description": "Returns all saved hashtag sets in the workspace. Apply one to a new post by passing its name (`hashtag_set`) or id (`hashtag_set_id`) to POST /posts/create.",
        "tags": [
          "Hashtag Sets"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List of hashtag sets",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/HashtagSet"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/hashtag-sets\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst sets = await client.hashtagSets.list();"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nsets = client.hashtag_sets.list()"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials hashtag-sets:list"
          }
        ]
      },
      "post": {
        "operationId": "createHashtagSet",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Create a hashtag set",
        "description": "Saves a reusable, named group of hashtags. Tags may be passed with or without the leading '#'; they are deduped case-insensitively and stored in order. Max 100 tags per set.",
        "tags": [
          "Hashtag Sets"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "hashtags"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "description": "Set name, e.g. \"Fitness Brand\". Unique per workspace."
                  },
                  "hashtags": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "description": "Array of tags ([\"fitness\", \"#gym\"]) or a single string (\"#fitness"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Hashtag set created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HashtagSet"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid name/hashtags or duplicate name"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/hashtag-sets\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\": \"Launch\", \"hashtags\": [\"saas\", \"buildinpublic\"]}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst set = await client.hashtagSets.create({ name: \"Launch\", hashtags: [\"saas\", \"buildinpublic\"] });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nhashtag_set = client.hashtag_sets.create(name=\"Launch\", hashtags=[\"saas\", \"buildinpublic\"])"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials hashtag-sets:create --name Launch --tags \"#saas #buildinpublic\""
          }
        ]
      }
    },
    "/hashtag-sets/{id}": {
      "get": {
        "operationId": "getHashtagSet",
        "x-required-scopes": [
          "posts:read"
        ],
        "description": "Returns one saved hashtag set of the key's workspace with its hashtags. A set of another workspace answers 404.",
        "summary": "Get a hashtag set",
        "tags": [
          "Hashtag Sets"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Hashtag set",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/HashtagSet"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Hashtag set not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/hashtag-sets/7\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst set = await client.hashtagSets.get(\"7\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nhashtag_set = client.hashtag_sets.get(\"7\")"
          }
        ]
      },
      "patch": {
        "operationId": "updateHashtagSet",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Update a hashtag set",
        "description": "Rename the set and/or replace its hashtags. `hashtags` replaces the full list (fetch, modify, resend to add/remove tags).",
        "tags": [
          "Hashtag Sets"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "hashtags": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Hashtag set updated"
          },
          "400": {
            "description": "Invalid update"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Hashtag set not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.omnisocials.com/v1/hashtag-sets/7\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"hashtags\": [\"saas\", \"founder\"]}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst set = await client.hashtagSets.update(\"7\", { hashtags: [\"saas\", \"founder\"] });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nhashtag_set = client.hashtag_sets.update(\"7\", hashtags=[\"saas\", \"founder\"])"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials hashtag-sets:update 7 --tags \"#saas #founder\""
          }
        ]
      },
      "delete": {
        "operationId": "deleteHashtagSet",
        "x-required-scopes": [
          "posts:write"
        ],
        "summary": "Delete a hashtag set",
        "description": "Deletes the set. Posts that already used it are unaffected. The tags were merged into their captions at create time.",
        "tags": [
          "Hashtag Sets"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Hashtag set deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Hashtag set not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.omnisocials.com/v1/hashtag-sets/7\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nawait client.hashtagSets.delete(\"7\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nclient.hashtag_sets.delete(\"7\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials hashtag-sets:delete 7"
          }
        ]
      }
    },
    "/approval-workflows": {
      "get": {
        "operationId": "listApprovalWorkflows",
        "x-required-scopes": [
          "posts:read"
        ],
        "summary": "List approval workflows",
        "description": "Saved approval workflows the current workspace can use: company-wide workflows plus the ones bound to this workspace. Workflows are created and edited in the dashboard (Approvals); the API only lists them. Pass a workflow's `id` as `approval_workflow_id` on POST /posts/create to route a new scheduled post through it. The post is then created as `in_approval` and publishes at its `schedule_at` once the last step approves (dashboard, or POST /posts/{id}/approve). Requires the `posts:read` scope.",
        "tags": [
          "Approvals"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "Workflows available to this workspace (may be empty)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ApprovalWorkflow"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing API key"
          },
          "403": {
            "description": "`insufficient_scope`: the key lacks posts:read"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/approval-workflows\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst workflows = await client.approvalWorkflows.list();"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nworkflows = client.approval_workflows.list()"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials approval-workflows:list"
          }
        ]
      }
    },
    "/accounts": {
      "get": {
        "operationId": "listAccounts",
        "x-required-scopes": [
          "accounts:read"
        ],
        "summary": "List accounts",
        "description": "Lists the social accounts connected to the workspace of this API key, one entry per channel. Requires the `accounts:read` scope.",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "platform",
            "schema": {
              "type": "string",
              "enum": [
                "instagram",
                "facebook",
                "linkedin",
                "linkedin_page",
                "youtube",
                "tiktok",
                "pinterest",
                "bluesky",
                "threads",
                "mastodon",
                "x",
                "google_business",
                "reddit",
                "snapchat",
                "telegram",
                "discord"
              ]
            },
            "description": "Filter by platform"
          }
        ],
        "responses": {
          "200": {
            "description": "List of connected accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Account"
                      }
                    },
                    "workspace_id": {
                      "type": "integer",
                      "description": "Stable id of the active workspace this key belongs to.",
                      "example": 1234
                    },
                    "workspace_name": {
                      "type": "string",
                      "nullable": true,
                      "description": "Human-readable name of the active workspace.",
                      "example": "Daily Edge Sports"
                    },
                    "workspace_icon": {
                      "type": "string",
                      "nullable": true
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/accounts\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst accounts = await client.accounts.list();"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\naccounts = client.accounts.list()"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials accounts:list"
          }
        ]
      }
    },
    "/accounts/{id}": {
      "get": {
        "operationId": "getAccount",
        "x-required-scopes": [
          "accounts:read"
        ],
        "description": "Returns one connected account of the key's workspace by its id (`<workspaceId>_<platform>`), with `needs_reconnect`. A Pinterest account also lists its boards, an X account its X statistics setting, and a Telegram or Discord account its channel in `platform_details`. An id of another workspace answers 404.",
        "summary": "Get an account",
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1234_instagram"
            },
            "description": "Account ID (format workspaceId_platform)"
          }
        ],
        "responses": {
          "200": {
            "description": "Account details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Account"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Account not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/accounts/844008_instagram\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst account = await client.accounts.get(\"844008_instagram\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\naccount = client.accounts.get(\"844008_instagram\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials accounts:get 844008_instagram"
          }
        ]
      },
      "patch": {
        "operationId": "setXStatistics",
        "x-required-scopes": [
          "accounts:write"
        ],
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Change how often X statistics are checked",
        "description": "X accounts only. X bills every statistics read, and OmniSocials passes X's\nprice on as credits: a post check is half a credit (plus half a credit for\na video or GIF), a follower count 1 credit. `posts` decides how often each\npost is checked: `full` (5 checks: about 5 hours, day 1, 3 and 7, and day 30\nfor posts with 100+ views), `light` (2 checks: about 5 hours and day 7) or\n`off`. `followers` decides how often the follower count is read: `daily`,\n`weekly` or `off`. Send one key or both; a missing key keeps its value.\n\nNeeds the opt-in scope `accounts:write` and billing rights (manage_billing)\nfor the key's creator.\n",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1234_x"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "x_statistics"
                ],
                "properties": {
                  "x_statistics": {
                    "type": "object",
                    "properties": {
                      "posts": {
                        "type": "string",
                        "enum": [
                          "full",
                          "light",
                          "off"
                        ]
                      },
                      "followers": {
                        "type": "string",
                        "enum": [
                          "daily",
                          "weekly",
                          "off"
                        ]
                      }
                    }
                  }
                }
              },
              "example": {
                "x_statistics": {
                  "posts": "light",
                  "followers": "daily"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The account with its new x_statistics"
          },
          "400": {
            "description": "validation_error, invalid_value or not_supported (not an X account)"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "insufficient_scope, or insufficient_permission (no billing rights for the key's creator)"
          },
          "404": {
            "description": "Account not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.omnisocials.com/v1/accounts/<id>\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"x_statistics\": {\"posts\": \"light\", \"followers\": \"daily\"}}'"
          }
        ]
      }
    },
    "/analytics/posts": {
      "get": {
        "operationId": "getPostsAnalytics",
        "x-required-scopes": [
          "analytics:read"
        ],
        "summary": "Get bulk post analytics",
        "description": "Batch version of GET /analytics/posts/{id}. Pass a comma-separated list of numeric OmniSocials post ids in `ids` and get each post's latest per-platform metrics back in a single request (thread posts are summed across their parts, same as the single-post endpoint). Built for sync clients that would otherwise call the single-post endpoint once per post and hit the 100 requests/minute rate limit. Up to 100 ids per call; page through larger sets in batches. Every requested id is returned (in request order); ids with no collected analytics come back with an empty `platforms` object rather than being omitted, so clients can map results 1:1 to the ids they sent. Reads stored snapshots from our database, the same data as the single-post endpoint, so it never calls the social platforms live.\n",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "ids",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1024,1025,1026"
            },
            "description": "Comma-separated numeric OmniSocials post ids (the `id` field from GET /posts), e.g. \"1024,1025,1026\". Max 100 per request.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "Per-post analytics, one entry per requested id",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "allOf": [
                          {
                            "$ref": "#/components/schemas/PostAnalytics"
                          },
                          {
                            "type": "object",
                            "properties": {
                              "trial_reel": {
                                "type": "object",
                                "nullable": true,
                                "description": "Set when the post went to Instagram as a Trial Reel: `{ strategy: MANUAL | SS_PERFORMANCE }`. Compare trial reels with normal reels on these numbers. Instagram does not say whether a trial reel was later shared with followers."
                              },
                              "tags": {
                                "type": "array",
                                "items": {
                                  "$ref": "#/components/schemas/Tag"
                                }
                              }
                            }
                          }
                        ]
                      }
                    },
                    "count": {
                      "type": "integer",
                      "description": "Number of entries returned (equals the number of valid ids requested)",
                      "example": 3
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing `ids`, more than 100 ids, or one or more ids that are not numeric OmniSocials post ids (e.g. a platform post id was supplied).\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/analytics/posts?ids=12345,12346\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst stats = await client.analytics.posts([\"12345\", \"12346\"]);"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nstats = client.analytics.posts([\"12345\", \"12346\"])"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials analytics:posts 12345,12346"
          }
        ]
      }
    },
    "/analytics/posts/{id}": {
      "get": {
        "operationId": "getPostAnalytics",
        "x-required-scopes": [
          "analytics:read"
        ],
        "description": "Returns the latest stored statistics of one post of the key's workspace, one entry per platform under `platforms`; a thread counts all its parts. A post without statistics yet answers 200 with an empty `platforms`. Use the OmniSocials post id: a non-numeric id answers 400 `invalid_post_id`.",
        "summary": "Get post analytics",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "1024"
            },
            "description": "The numeric OmniSocials post id (the `id` field from GET /posts). Not a platform post id such as a YouTube video id or tweet id."
          }
        ],
        "responses": {
          "200": {
            "description": "Post analytics data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PostAnalytics"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid post id (non-numeric, e.g. a platform post id was supplied instead of the OmniSocials post id)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/analytics/posts/12345\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst stats = await client.analytics.post(\"12345\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nstats = client.analytics.post(\"12345\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials analytics:post 12345"
          }
        ]
      }
    },
    "/analytics/tags": {
      "get": {
        "operationId": "getTagAnalytics",
        "x-required-scopes": [
          "analytics:read"
        ],
        "summary": "Compare tags",
        "description": "How each tag did against your normal, for the published posts in a period (the same table as the Tags tab in Analytics). `vs_normal` is fair across channels: each post is measured against the median impressions of its own channel in the same period, a post's index is the mean over its channels, and a tag's value is the median index of its posts minus 1 (0.38 = 38% above normal). `enough_posts` is false below `min_posts` measured posts: read `vs_normal` then as a hint only. Tags come comparable first, best first. `untagged` = the posts without a tag. Posts made outside OmniSocials are not included. Needs the `analytics:read` scope and View analytics (`access_analytics`) for the key's creator, as the Analytics pages in the app.\n",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "start_date",
            "schema": {
              "type": "string",
              "example": "2026-08-01"
            },
            "description": "YYYY-MM-DD, YYYY-MM or ISO 8601. Default: 90 days ago."
          },
          {
            "in": "query",
            "name": "end_date",
            "schema": {
              "type": "string",
              "example": "2026-10-31"
            },
            "description": "YYYY-MM-DD, YYYY-MM or ISO 8601 (inclusive). Default: today."
          },
          {
            "in": "query",
            "name": "platform",
            "schema": {
              "type": "string",
              "example": "tiktok"
            },
            "description": "Only this channel's numbers (instagram, tiktok, youtube, ...). Default: every connected channel."
          },
          {
            "in": "query",
            "name": "min_posts",
            "schema": {
              "type": "integer",
              "default": 5,
              "minimum": 1,
              "maximum": 50
            },
            "description": "Measured posts a tag needs before `enough_posts` is true."
          }
        ],
        "responses": {
          "200": {
            "description": "Tags compared",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "period": {
                          "type": "object",
                          "properties": {
                            "start_date": {
                              "type": "string"
                            },
                            "end_date": {
                              "type": "string"
                            }
                          }
                        },
                        "platform": {
                          "type": "string",
                          "nullable": true
                        },
                        "min_posts": {
                          "type": "integer"
                        },
                        "tags": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/TagComparison"
                          }
                        },
                        "untagged": {
                          "$ref": "#/components/schemas/TagSummary"
                        },
                        "normals": {
                          "type": "object",
                          "additionalProperties": {
                            "type": "number"
                          },
                          "description": "Median impressions per channel in the period"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_date`, `invalid_date_range` or `invalid_platform`"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` (no `analytics:read`), or `insufficient_permission`: the role of the key's creator (or the person behind the OAuth token) does not have View analytics (`access_analytics`) in this workspace's organisation, the permission the dashboard's Analytics pages need"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/analytics/tags?start_date=2026-08-01&end_date=2026-10-31\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst comparison = await client.analytics.tags({ start_date: \"2026-08-01\", end_date: \"2026-10-31\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\ncomparison = client.analytics.tags(start_date=\"2026-08-01\", end_date=\"2026-10-31\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials analytics:tags --start-date 2026-08-01 --end-date 2026-10-31"
          }
        ]
      }
    },
    "/analytics/overview": {
      "get": {
        "operationId": "getAnalyticsOverview",
        "x-required-scopes": [
          "analytics:read"
        ],
        "summary": "Get analytics overview",
        "description": "Totals for the workspace of this API key over a period (`period`, default 30 days, or `start_date` and `end_date`), with a breakdown per platform. Requires the `analytics:read` scope and View analytics (`access_analytics`) for the key's creator (or the person behind the OAuth token), as the Analytics pages in the app.",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "period",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "90d"
              ],
              "default": "30d"
            },
            "description": "Time period for analytics"
          },
          {
            "in": "query",
            "name": "start_date",
            "schema": {
              "type": "string",
              "example": "2026-09-01"
            },
            "description": "Custom start date. Accepts YYYY-MM-DD (e.g. \"2026-04-01\"), YYYY-MM month-shorthand (e.g. \"2026-04\" expands to the first of the month), or a full ISO 8601 datetime."
          },
          {
            "in": "query",
            "name": "end_date",
            "schema": {
              "type": "string",
              "example": "2026-09-30"
            },
            "description": "Custom end date. Same formats as start_date; \"YYYY-MM\" expands to the last day of the month."
          },
          {
            "in": "query",
            "name": "tag",
            "schema": {
              "type": "string",
              "example": "Question hook"
            },
            "description": "Post numbers of the posts with this tag only: a tag id or name, comma separated for any of several. Account numbers (followers, account reach) stay those of the whole account. An unknown tag answers 404 `tag_not_found`."
          }
        ],
        "responses": {
          "200": {
            "description": "Analytics overview",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AnalyticsOverview"
                    },
                    "period": {
                      "type": "string",
                      "description": "Human-readable range label (e.g. \"30d\" or \"2026-04-01 to 2026-04-30\")",
                      "example": "30d"
                    },
                    "start_date": {
                      "type": "string",
                      "format": "date",
                      "description": "Resolved range start (YYYY-MM-DD), useful for clients that want to confirm what was queried",
                      "example": "2026-09-21"
                    },
                    "end_date": {
                      "type": "string",
                      "format": "date",
                      "description": "Resolved range end (YYYY-MM-DD)",
                      "example": "2026-10-21"
                    },
                    "current_date": {
                      "type": "string",
                      "format": "date",
                      "description": "Server's current date (UTC), included so clients can self-correct relative phrases like \"last month\"",
                      "example": "2026-10-21"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid date input (e.g. unparseable, or start_date after end_date)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` (no `analytics:read`), or `insufficient_permission`: the role of the key's creator (or the person behind the OAuth token) does not have View analytics (`access_analytics`) in this workspace's organisation, the permission the dashboard's Analytics pages need"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/analytics/overview?period=30d\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst overview = await client.analytics.overview({ period: \"30d\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\noverview = client.analytics.overview(period=\"30d\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials analytics:overview --period 30d"
          }
        ]
      }
    },
    "/analytics/accounts": {
      "get": {
        "operationId": "getAccountAnalytics",
        "x-required-scopes": [
          "analytics:read"
        ],
        "summary": "Get account analytics",
        "description": "Latest stored account-level snapshot per connected platform, on or before the requested date. Snapshots are collected daily. Metric semantics vary by platform (see the AccountAnalytics schema). LinkedIn rows hold that day's impressions (`period: \"daily\"`). A LinkedIn profile row also keeps the all-time total of all of the member's posts in `impressions_lifetime`; when LinkedIn serves no daily breakdown, its `impressions` is that lifetime total and the row carries `period: \"lifetime\"`. Each metrics object carries a `note` explaining its scope where semantics are non-obvious. Needs View analytics (`access_analytics`) for the key's creator, as the Analytics pages in the app.\n",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "platform",
            "schema": {
              "type": "string",
              "example": "instagram"
            },
            "description": "Filter by platform"
          },
          {
            "in": "query",
            "name": "date",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2026-10-20"
            },
            "description": "Date to get analytics for (YYYY-MM-DD, defaults to today)"
          }
        ],
        "responses": {
          "200": {
            "description": "Account analytics data",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountAnalytics"
                      }
                    },
                    "date": {
                      "type": "string",
                      "format": "date",
                      "example": "2026-10-20"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` (no `analytics:read`), or `insufficient_permission`: the role of the key's creator (or the person behind the OAuth token) does not have View analytics (`access_analytics`) in this workspace's organisation, the permission the dashboard's Analytics pages need"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/analytics/accounts?platform=instagram\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst stats = await client.analytics.accounts({ platform: \"instagram\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nstats = client.analytics.accounts(platform=\"instagram\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials analytics:accounts --platform instagram"
          }
        ]
      }
    },
    "/analytics/best-times": {
      "get": {
        "operationId": "getBestTimes",
        "x-required-scopes": [
          "analytics:read"
        ],
        "summary": "Get best posting times",
        "description": "Recommended day/hour posting slots for one platform, computed from the workspace's own posting history (publish time × engagement of every post published on that platform, recency-weighted, outlier-damped). Times are bucketed in the requesting user's timezone (overridable via `timezone`). When the workspace has fewer than 15 analyzed posts on the platform, a static industry-average table is returned instead: `basis` flips from `own_data` to `defaults` and `posts_needed` says how many more published posts unlock personalized recommendations. Grid scores are relative within the platform (100 = the best slot). Requires the `analytics:read` scope.\n",
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "platform",
            "required": true,
            "schema": {
              "type": "string",
              "example": "instagram"
            },
            "description": "Platform identifier (e.g. instagram, tiktok, linkedin, linkedin_page, x, telegram, discord)."
          },
          {
            "in": "query",
            "name": "timezone",
            "schema": {
              "type": "string",
              "example": "Europe/Amsterdam"
            },
            "description": "IANA timezone for the buckets (e.g. Europe/Amsterdam). Defaults to the account's timezone, then UTC."
          }
        ],
        "responses": {
          "200": {
            "description": "Best-time grid and top recommendations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "platform": {
                      "type": "string",
                      "example": "instagram"
                    },
                    "timezone": {
                      "type": "string",
                      "description": "IANA timezone the day/hour buckets are expressed in",
                      "example": "Europe/Amsterdam"
                    },
                    "basis": {
                      "type": "string",
                      "enum": [
                        "own_data",
                        "own_data_and_audience",
                        "audience",
                        "defaults"
                      ],
                      "description": "`own_data` = computed from this workspace's posts; `own_data_and_audience` = own posts blended with when the audience is online (Instagram, TikTok Business); `audience` = not enough posts yet, based on the audience-online profile only; `defaults` = industry averages (not enough history yet)"
                    },
                    "sample_size": {
                      "type": "integer",
                      "description": "Number of analyzed posts (published >72h ago, last 365 days)",
                      "example": 48
                    },
                    "posts_needed": {
                      "type": "integer",
                      "description": "How many more published posts unlock personalized recommendations (0 when basis is own_data)",
                      "example": 0
                    },
                    "metric": {
                      "type": "string",
                      "description": "Always `engagement` in v1 (shared cross-platform engagement formula)",
                      "example": "engagement"
                    },
                    "window_days": {
                      "type": "integer",
                      "example": 365
                    },
                    "audience_online": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "number"
                      },
                      "description": "Hour (0-23, in the response timezone) -> number of followers online, from the platform's audience-activity data. Present for Instagram and TikTok Business accounts with 100+ followers once the daily account snapshot has collected it."
                    },
                    "audience_online_date": {
                      "type": "string",
                      "format": "date",
                      "description": "Snapshot date of `audience_online`.",
                      "example": "2026-10-20"
                    },
                    "grid": {
                      "type": "array",
                      "description": "One entry per day/hour cell that has data (missing cells = no posts there). Scores are relative 0-100.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "day": {
                            "type": "string",
                            "enum": [
                              "monday",
                              "tuesday",
                              "wednesday",
                              "thursday",
                              "friday",
                              "saturday",
                              "sunday"
                            ]
                          },
                          "hour": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 23,
                            "example": 15
                          },
                          "score": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 100,
                            "example": 100
                          },
                          "n": {
                            "type": "integer",
                            "description": "Sample count behind the cell (±1h smoothed). Absent on defaults.",
                            "example": 6
                          },
                          "typical_engagement": {
                            "type": "integer",
                            "description": "Back-transformed typical engagement for the slot. Absent on defaults.",
                            "example": 132
                          }
                        }
                      }
                    },
                    "recommendations": {
                      "type": "array",
                      "description": "Top 3 slots, diversity-enforced (never two on the same day within 3 hours)",
                      "items": {
                        "type": "object",
                        "properties": {
                          "day": {
                            "type": "string",
                            "example": "tuesday"
                          },
                          "hour": {
                            "type": "integer",
                            "example": 15
                          },
                          "time": {
                            "type": "string",
                            "example": "15:00"
                          },
                          "score": {
                            "type": "integer",
                            "example": 100
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing/unknown platform or invalid timezone"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/analytics/best-times?platform=instagram&timezone=Europe%2FAmsterdam\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst best = await client.analytics.bestTimes({ platform: \"instagram\", timezone: \"Europe/Amsterdam\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nbest = client.analytics.best_times(platform=\"instagram\", timezone=\"Europe/Amsterdam\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials analytics:best-times --platform instagram --timezone Europe/Amsterdam"
          }
        ]
      }
    },
    "/analytics/posts/{id}/refresh": {
      "post": {
        "operationId": "updatePostAnalytics",
        "x-required-scopes": [
          "analytics:read"
        ],
        "tags": [
          "Analytics"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Check the X numbers of a post now (\"Update now\")",
        "description": "Reads the X statistics of one published post now, outside its schedule.\nX bills every read, so it costs half a credit per tweet (each part of a\nthread counts, plus half a credit for a video or GIF), and nothing when\nthe post was already read today (UTC): X bills a post once a day. At most\n5 reads of a post a day, and 100 Update now checks an organisation a day.\nNeeds View analytics (`access_analytics`) for the key's creator, as\nUpdate now in the app.\n",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "example": 9123
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The new numbers per tweet",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "post_id": 9123,
                    "tweets": [
                      {
                        "id": "1859000000000000000",
                        "metrics": {
                          "views": 3412,
                          "likes": 41,
                          "comments": 9
                        },
                        "read_at": "2027-01-08T09:12:04Z"
                      }
                    ],
                    "credits_used": 0.5,
                    "read_at": "2027-01-08T09:12:04Z"
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "description": "insufficient_credits: the balance does not cover the read"
          },
          "403": {
            "description": "`insufficient_scope` (no `analytics:read`), or `insufficient_permission`: the role of the key's creator (or the person behind the OAuth token) does not have View analytics (`access_analytics`) in this workspace's organisation, the permission the dashboard's Analytics pages need"
          },
          "404": {
            "description": "Post not found"
          },
          "409": {
            "description": "refresh_not_available: the post has no published X tweet"
          },
          "429": {
            "description": "refresh_limit: 5 reads of this post today, or 100 Update now checks of the organisation today"
          },
          "502": {
            "description": "refresh_failed: X did not answer; nothing was charged"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/analytics/posts/<id>/refresh\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          }
        ]
      }
    },
    "/credits": {
      "get": {
        "operationId": "getCredits",
        "x-required-scopes": [
          "credits:read"
        ],
        "tags": [
          "Credits"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "summary": "Credit balance and X statistics",
        "description": "The organisation's credit balance (1 credit = €0.01), whether auto-refill\nis on, the credits used this month by type, and the X statistics overview:\nthe state (active or paused at 0 credits), the date charging starts, each\nX account with its setting and its estimate for a month, and this month's\nreads. Needs the opt-in scope `credits:read` and billing rights\n(manage_billing) for the key's creator.\n",
        "responses": {
          "200": {
            "description": "The balance and the X statistics overview",
            "content": {
              "application/json": {
                "example": {
                  "data": {
                    "balance": 412,
                    "auto_refill": {
                      "enabled": false
                    },
                    "this_month": {
                      "x_statistics": 31,
                      "x_url_post": 40,
                      "x_dm": 6
                    },
                    "x_statistics": {
                      "state": "active",
                      "charging": {
                        "active": true,
                        "from": "2027-01-01T00:00:00.000Z"
                      },
                      "total_credits_month": 38,
                      "accounts": [
                        {
                          "account_id": "1234_x",
                          "handle": "@omnisocials",
                          "posts": "full",
                          "followers": "daily",
                          "credits_month": 38
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "insufficient_scope, or no billing rights for the key's creator"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/credits\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          }
        ]
      }
    },
    "/webhooks": {
      "get": {
        "operationId": "listWebhooks",
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "summary": "List webhooks",
        "description": "Lists the webhooks of the key's workspace and the organisation-wide webhooks of its organisation (workspace_id null, made in the OmniSocials dashboard). The key's creator needs permission to manage the API in that organisation.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "List of webhooks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Webhook"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/webhooks\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst webhooks = await client.webhooks.list();"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nwebhooks = client.webhooks.list()"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials webhooks:list"
          }
        ]
      },
      "post": {
        "operationId": "createWebhook",
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "description": "Creates a webhook in the key's workspace that receives the chosen `events` at an HTTPS URL on a public host. The answer carries the signing secret once: save it to check the HMAC-SHA256 signature of each delivery. An organisation has at most 100 webhooks (409 `webhook_limit_reached`).",
        "summary": "Create a webhook",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "events"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "description": "HTTPS URL to receive events. Must resolve to a public host; private, loopback, link-local and unresolvable hosts are rejected with `validation_error`. Deliveries go to this exact URL and follow no redirect (a 3xx answer is a failed delivery).",
                    "example": "https://example.com/webhooks/omnisocials"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "post.scheduled",
                        "post.published",
                        "post.failed",
                        "post.approved",
                        "post.rejected",
                        "x_statistics.paused",
                        "x_statistics.resumed"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Webhook created. The secret is only returned once at creation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Webhook"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "secret": {
                              "type": "string",
                              "description": "Webhook signing secret (only shown once)",
                              "example": "159ba257854f3f71a9b363b04367862705c72e3ed4cd746ecc11274f5c88291e"
                            }
                          }
                        }
                      ]
                    },
                    "message": {
                      "type": "string",
                      "example": "Webhook created. Save the secret - it will only be shown once. Use it to verify webhook signatures."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "`webhook_limit_reached`: the organisation has 100 webhooks (every workspace and the organisation-wide ones, switched-off ones too), the most it can have. Delete one, or add the events to a webhook you have.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/webhooks\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"url\": \"https://example.com/omnisocials/webhook\",\n    \"events\": [\"post.published\", \"post.failed\"]\n  }'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst webhook = await client.webhooks.create({\n  url: \"https://example.com/omnisocials/webhook\",\n  events: [\"post.published\", \"post.failed\"],\n});"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nwebhook = client.webhooks.create(\n    url=\"https://example.com/omnisocials/webhook\",\n    events=[\"post.published\", \"post.failed\"],\n)"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials webhooks:create --url https://example.com/omnisocials/webhook --events post.published,post.failed"
          }
        ]
      }
    },
    "/webhooks/{id}": {
      "get": {
        "operationId": "getWebhook",
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "summary": "Get a webhook",
        "description": "A webhook of the key's workspace or an organisation-wide webhook of its organisation.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "74327072-ec54-473c-837f-63b29187ac16"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Webhook details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Webhook not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/webhooks/4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst webhook = await client.webhooks.get(\"4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nwebhook = client.webhooks.get(\"4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials webhooks:get 4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90"
          }
        ]
      },
      "patch": {
        "operationId": "updateWebhook",
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "summary": "Update a webhook",
        "description": "Works on a webhook of the key's workspace or an organisation-wide webhook of its organisation. Setting url or events, or switching the webhook on, makes the key's creator the person behind the webhook. Before each delivery OmniSocials checks that this person still has access to the organisation (and to Ads for Ads events), and switches the webhook off when not. A change of url, events or a switch-on of a webhook that has Ads events after the change needs the ads:read scope and access to Ads (403 insufficient_scope or insufficient_permission otherwise). A new url on an organisation-wide webhook (workspace_id null) makes it a webhook of the key's workspace, so it then receives only that workspace's events; the answer shows the new workspace_id. To keep a webhook organisation-wide, make it in the OmniSocials dashboard.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "74327072-ec54-473c-837f-63b29187ac16"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "example": "https://example.com/webhooks/omnisocials"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "post.scheduled",
                        "post.published",
                        "post.failed",
                        "post.approved",
                        "post.rejected",
                        "x_statistics.paused",
                        "x_statistics.resumed"
                      ]
                    }
                  },
                  "is_active": {
                    "type": "boolean",
                    "description": "true switches the webhook on again (also after an automatic switch-off) and resets failure_count.",
                    "example": true
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Webhook"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "validation_error: a bad url or events list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The webhook has Ads events after this change and the key has no ads:read scope (insufficient_scope), or its creator has no access to Ads (insufficient_permission). Nothing was changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Webhook not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.omnisocials.com/v1/webhooks/4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"is_active\": false}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst webhook = await client.webhooks.update(\"4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90\", { is_active: false });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nwebhook = client.webhooks.update(\"4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90\", is_active=False)"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials webhooks:update 4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90 --active false"
          }
        ]
      },
      "delete": {
        "operationId": "deleteWebhook",
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "summary": "Delete a webhook",
        "description": "Deletes a webhook of the key's workspace or an organisation-wide webhook of its organisation.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "74327072-ec54-473c-837f-63b29187ac16"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Webhook deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Webhook not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.omnisocials.com/v1/webhooks/4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nawait client.webhooks.delete(\"4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nclient.webhooks.delete(\"4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials webhooks:delete 4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90"
          }
        ]
      }
    },
    "/webhooks/{id}/rotate-secret": {
      "post": {
        "operationId": "rotateWebhookSecret",
        "x-required-scopes": [
          "webhooks:manage"
        ],
        "summary": "Rotate webhook secret",
        "description": "Returns a new signing secret, shown once. The old secret keeps signing for 24 hours: during that time every delivery carries X-OmniSocials-Signature (new secret) and X-OmniSocials-Signature-Previous (old secret, same format, same timestamp and body), so the receiver keeps accepting deliveries while it switches to the new secret. Accept a delivery when either signature matches a secret you hold. Rotating again within the 24 hours replaces the previous secret with the one just rotated out. Works on a webhook of the key's workspace or an organisation-wide webhook of its organisation.",
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "74327072-ec54-473c-837f-63b29187ac16"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "New secret generated. Save it now. It is shown only once.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "74327072-ec54-473c-837f-63b29187ac16"
                        },
                        "secret": {
                          "type": "string",
                          "description": "New webhook signing secret",
                          "example": "159ba257854f3f71a9b363b04367862705c72e3ed4cd746ecc11274f5c88291e"
                        }
                      }
                    },
                    "message": {
                      "type": "string",
                      "example": "Secret rotated. Save the new secret - it will only be shown once. For 24 hours deliveries also carry X-OmniSocials-Signature-Previous, signed with the old secret."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Webhook not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/webhooks/4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90/rotate-secret\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst rotated = await client.webhooks.rotateSecret(\"4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nrotated = client.webhooks.rotate_secret(\"4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials webhooks:rotate-secret 4f6c2b1e-8a3d-4c7e-9b2f-1d5e6a7c8b90"
          }
        ]
      }
    },
    "/locations/search": {
      "get": {
        "operationId": "searchLocations",
        "x-required-scopes": [
          "posts:read"
        ],
        "summary": "Search locations",
        "description": "Search physical places to get a valid `location_id` for tagging a post. The `platform` query parameter selects the source, and the two sources use DIFFERENT ids (a Facebook Place ID is not a Threads location id), so always search with the platform you will tag.\n\n**`platform=instagram` (default):** search by name (`q`). Returns only real venues with a precise address (the kind Instagram accepts); national brand pages, personal profiles, and Instagram location IDs are not returned because Instagram rejects them. Pass a returned `id` as the top-level `location_id` on `POST /posts/create`. Requires a Facebook account connected to the workspace (the lookup runs through Facebook's place data). Response shape: `{ data: [...], error, needsPermission }`.\n\n**`platform=threads`:** search by name (`q`) OR by coordinates (`latitude` + `longitude`). Pass a returned `id` as `threads.location_id` on `POST /posts/create` / `PATCH /posts/{id}`. Requires a Threads account connected with the `threads_location_tagging` permission (connections made before that permission was added must be reconnected; the response then carries `error.code = threads_reauth_required`). Threads allows 500 location searches per account per rolling 24 hours. Response shape: `{ locations: [...] }` or `{ error: { code, message } }`.\n",
        "tags": [
          "Locations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "platform",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "instagram",
                "threads"
              ],
              "default": "instagram"
            },
            "description": "Which platform the location will be tagged on. Determines the search source and the id type returned."
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Place name to search (min 2 chars), e.g. a dealership, café, or venue name. Use a specific name: generic brands return their individual store locations, not the brand. Required for `platform=instagram`; for `platform=threads` pass either `q` or `latitude` + `longitude`.",
            "example": "Griffith Observatory"
          },
          {
            "in": "query",
            "name": "latitude",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90
            },
            "description": "Threads only. Search places around this point; pass together with `longitude` instead of `q`.",
            "example": 34.1184
          },
          {
            "in": "query",
            "name": "longitude",
            "required": false,
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180
            },
            "description": "Threads only. Pass together with `latitude`.",
            "example": -118.3004
          }
        ],
        "responses": {
          "200": {
            "description": "Matching places. The shape depends on `platform`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "title": "Instagram results",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Use this as `location_id`",
                                "example": "313813441"
                              },
                              "name": {
                                "type": "string",
                                "example": "Griffith Observatory"
                              },
                              "address": {
                                "type": "string",
                                "nullable": true,
                                "example": "2800 E Observatory Rd, Los Angeles, CA, 90027, United States"
                              },
                              "city": {
                                "type": "string",
                                "nullable": true
                              },
                              "country": {
                                "type": "string",
                                "nullable": true
                              }
                            }
                          }
                        },
                        "error": {
                          "type": "string",
                          "nullable": true,
                          "description": "Set when search is unavailable (e.g. no Facebook account connected, or the app lacks place-search permission). data is then empty."
                        },
                        "needsPermission": {
                          "type": "boolean",
                          "description": "true when the Facebook app lacks 'Page Public Content Access'."
                        }
                      }
                    },
                    {
                      "type": "object",
                      "title": "Threads results",
                      "properties": {
                        "locations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "description": "Use this as `threads.location_id`",
                                "example": "17841400000000000"
                              },
                              "name": {
                                "type": "string",
                                "nullable": true,
                                "example": "Griffith Observatory"
                              },
                              "address": {
                                "type": "string",
                                "nullable": true,
                                "example": "2800 E Observatory Rd"
                              },
                              "city": {
                                "type": "string",
                                "nullable": true,
                                "example": "Los Angeles"
                              },
                              "country": {
                                "type": "string",
                                "nullable": true,
                                "example": "United States"
                              },
                              "latitude": {
                                "type": "number",
                                "nullable": true,
                                "example": 34.1184
                              },
                              "longitude": {
                                "type": "number",
                                "nullable": true,
                                "example": -118.3004
                              }
                            }
                          }
                        },
                        "error": {
                          "type": "object",
                          "nullable": true,
                          "description": "Present instead of `locations` when the search could not run.",
                          "properties": {
                            "code": {
                              "type": "string",
                              "enum": [
                                "not_available",
                                "threads_not_connected",
                                "threads_reauth_required",
                                "platform_error"
                              ],
                              "description": "`not_available` = Threads location tagging is not available yet (the Threads location permission is still under Meta review). `threads_not_connected` = no Threads account on the workspace. `threads_reauth_required` = the Threads connection lacks the `threads_location_tagging` permission; reconnect Threads. `platform_error` = Threads did not answer; retry."
                            },
                            "message": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request (Threads only): neither `q` nor `latitude`+`longitude` given, `q` under 2 characters, coordinates out of range, or Threads rejected the search text.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/locations/search?q=Griffith%20Observatory\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst places = await client.locations.search(\"Griffith Observatory\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nplaces = client.locations.search(\"Griffith Observatory\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials locations:search \"Griffith Observatory\""
          }
        ]
      }
    },
    "/locations/validate": {
      "get": {
        "operationId": "validateLocation",
        "x-required-scopes": [
          "posts:read"
        ],
        "summary": "Validate a location",
        "description": "Check whether a Facebook Place ID is a valid Instagram location (a single venue with a precise address) before using it as `location_id`. Returns `{ valid: true, name, address }` for taggable places; `{ valid: false, reason }` for personal profiles, brand pages, or non-places. If the workspace has no Facebook account (or the app can't read the page), returns `{ valid: false, unverified: true }`, and the post's publish step is then the final check.",
        "tags": [
          "Locations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Numeric Facebook Place ID to validate.",
            "example": "313813441"
          }
        ],
        "responses": {
          "200": {
            "description": "Validation result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "valid": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string",
                      "nullable": true
                    },
                    "name": {
                      "type": "string",
                      "nullable": true
                    },
                    "address": {
                      "type": "string",
                      "nullable": true
                    },
                    "unverified": {
                      "type": "boolean",
                      "description": "Couldn't be checked now; the publish step will validate."
                    },
                    "reason": {
                      "type": "string",
                      "nullable": true,
                      "description": "Why it isn't valid / couldn't be verified."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/locations/validate?id=313813441\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst check = await client.locations.validate(\"313813441\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\ncheck = client.locations.validate(\"313813441\")"
          }
        ]
      }
    },
    "/audio/search": {
      "get": {
        "operationId": "searchInstagramAudio",
        "x-required-scopes": [
          "posts:read"
        ],
        "summary": "Search Instagram audio",
        "description": "Search Meta's licensed audio catalog for tracks that can be attached to an Instagram Reel. Pass a returned `audio_id` as `instagram.audio_id` on `POST /posts/create` (type `reel`). Omit `q` to get currently trending audio. Only tracks Meta has authorized for third-party publishing are returned, so the selection can differ from the native app. Requires a Facebook account connected to the workspace whose Facebook Page is linked to the workspace's Instagram account (music publishing runs through Facebook's side of the Instagram API).",
        "tags": [
          "Audio"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Song title, artist, or keyword. Omit for trending audio.",
            "example": "birthday"
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "music",
                "original_sound"
              ],
              "default": "music"
            },
            "description": "Catalog to search: licensed music (default) or original sounds created on Instagram."
          }
        ],
        "responses": {
          "200": {
            "description": "Matching audio tracks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "audio_id": {
                            "type": "string",
                            "description": "Use this as `instagram.audio_id`",
                            "example": "587784541076604"
                          },
                          "title": {
                            "type": "string",
                            "nullable": true,
                            "example": "Birthday Wish"
                          },
                          "artist": {
                            "type": "string",
                            "nullable": true,
                            "example": "Shuba"
                          },
                          "duration_ms": {
                            "type": "integer",
                            "nullable": true,
                            "example": 153760
                          },
                          "audio_type": {
                            "type": "string",
                            "enum": [
                              "music",
                              "original_sound"
                            ]
                          },
                          "cover_url": {
                            "type": "string",
                            "nullable": true,
                            "description": "Cover artwork (music) or creator avatar (original sound)."
                          },
                          "preview_url": {
                            "type": "string",
                            "nullable": true,
                            "description": "Temporary audio preview URL. It expires after about 1.5 days, so do not store it."
                          },
                          "ig_username": {
                            "type": "string",
                            "nullable": true,
                            "description": "Creator handle (original sounds only)."
                          }
                        }
                      }
                    },
                    "error": {
                      "type": "string",
                      "nullable": true,
                      "description": "Set when search is unavailable (e.g. no linked Facebook account). data is then empty."
                    },
                    "needsFacebook": {
                      "type": "boolean",
                      "description": "true when the workspace needs a Facebook connection (with a Page linked to this Instagram account) before music is available."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/audio/search?q=summer\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst tracks = await client.audio.search(\"summer\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\ntracks = client.audio.search(\"summer\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials audio:search summer"
          }
        ]
      }
    },
    "/pinterest/products": {
      "get": {
        "operationId": "listPinterestProducts",
        "x-required-scopes": [
          "posts:read"
        ],
        "summary": "List product Pins",
        "description": "List the product Pins of the connected Pinterest account. Pass a returned `pin_id` in `pinterest.product_tags` on `POST /posts/create` / `PATCH /posts/{id}` to tag the product on a Pin (max 24 products per Pin).\n\nPinterest only accepts a product tag when the product Pin is public, belongs to the same Pinterest account, and links to a website that account claimed on Pinterest. Products of other merchants cannot be tagged through the API.\n\n**Sources.** `source=catalog` reads the Pinterest catalog (with `price`, `currency`, `availability`, `item_id`) through a product group; the response carries `product_groups` so you can pick another group with `product_group_id`. It needs catalog access on the Pinterest connection: in the OmniSocials composer open the Pinterest options, select Add products, then Connect catalog (one time per workspace). Without catalog access the response is `error.code = pinterest_catalog_access_required`. `source=pins` reads the account's own Pins and returns the ones Pinterest marks as product Pins; it works on every connection. One `pins` call scans up to 250 Pins, so `products` can be empty while `bookmark` is set: call again with the bookmark. When `source` is left out, `catalog` is used when the connection has catalog access, else `pins`.\n\nProblems that are not a bad request (no Pinterest account, no catalog access, Pinterest did not answer) come back as HTTP 200 with an `error` object instead of `products`.\n",
        "tags": [
          "Pinterest"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "source",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "catalog",
                "pins"
              ]
            },
            "description": "Where to read product Pins from. Default: `catalog` when the connection has catalog access, else `pins`."
          },
          {
            "in": "query",
            "name": "product_group_id",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Catalog source only. A product group `id` from `product_groups`. Default: the group named \"All Products\", else the first group.",
            "example": "443727193917"
          },
          {
            "in": "query",
            "name": "bookmark",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Cursor from the previous response, to get the next page."
          },
          {
            "in": "query",
            "name": "page_size",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            },
            "description": "Catalog source only. Products per page."
          }
        ],
        "responses": {
          "200": {
            "description": "Product Pins, or an `error` object when the list could not be read.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "products": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PinterestProduct"
                      }
                    },
                    "bookmark": {
                      "type": "string",
                      "nullable": true,
                      "description": "Pass as `bookmark` to get the next page. `null` on the last page."
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "catalog",
                        "pins"
                      ],
                      "description": "The source that was read."
                    },
                    "catalog_access": {
                      "type": "boolean",
                      "description": "`true` when the Pinterest connection can read the catalog."
                    },
                    "no_catalog": {
                      "type": "boolean",
                      "description": "`true` when the connection has catalog access but the Pinterest account has no catalog yet (Pinterest answers HTTP 409 to the product group request). `products` and `product_groups` are then empty. Products are added at https://www.pinterest.com/business/catalogs/."
                    },
                    "product_groups": {
                      "type": "array",
                      "description": "Catalog source only. The product groups of the account.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "example": "443727193917"
                          },
                          "name": {
                            "type": "string",
                            "nullable": true,
                            "example": "All Products"
                          }
                        }
                      }
                    },
                    "product_group_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "Catalog source only. The group these products come from."
                    },
                    "error": {
                      "type": "object",
                      "nullable": true,
                      "description": "Present instead of `products` when the list could not be read.",
                      "properties": {
                        "code": {
                          "type": "string",
                          "enum": [
                            "pinterest_not_connected",
                            "pinterest_catalog_access_required",
                            "platform_error"
                          ],
                          "description": "`pinterest_not_connected` = no Pinterest account on the workspace. `pinterest_catalog_access_required` = `source=catalog` was asked but the connection has no catalog access; connect the catalog in the composer or use `source=pins`. `platform_error` = Pinterest did not answer or refused; the message carries Pinterest's text."
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "example": {
                  "products": [
                    {
                      "pin_id": "813744226420795884",
                      "title": "Blue ribbed top",
                      "description": null,
                      "link": "https://shop.example.com/products/blue-ribbed-top",
                      "image_url": "https://i.pinimg.com/400x300/aa/bb/cc/example.jpg",
                      "price": 24.99,
                      "currency": "EUR",
                      "availability": "IN_STOCK",
                      "item_id": "TOP-BLUE-M"
                    }
                  ],
                  "bookmark": null,
                  "source": "catalog",
                  "catalog_access": true,
                  "product_groups": [
                    {
                      "id": "443727193917",
                      "name": "All Products"
                    }
                  ],
                  "product_group_id": "443727193917"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: `source` is not `catalog` or `pins`, or `product_group_id` is not a product group of the connected account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/pinterest/products\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst products = await client.pinterest.listProducts();"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nproducts = client.pinterest.list_products()"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials pinterest:products"
          }
        ]
      }
    },
    "/pinterest/products/validate": {
      "get": {
        "operationId": "validatePinterestProduct",
        "x-required-scopes": [
          "posts:read"
        ],
        "summary": "Check a product Pin",
        "description": "Check whether a Pin can be used in `pinterest.product_tags` before you create the post. Pass a Pin ID or a Pin link (`https://www.pinterest.com/pin/<id>/`; `pin.it` short links do not work). Returns `{ valid: true, pin_id, title, link, image_url }` for a product Pin of the connected account, and `{ valid: false, reason }` for a Pin that is not a product Pin, belongs to another account or does not exist. When the check cannot run (no Pinterest account, Pinterest did not answer, or Pinterest did not say if the Pin is a product Pin) it returns `{ valid: false, unverified: true }`: the publish step is then the final check. The check does not look at the claimed-website rule; Pinterest applies that one at publish.",
        "tags": [
          "Pinterest"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Pin ID or Pin link of the product Pin.",
            "example": "813744226420795884"
          }
        ],
        "responses": {
          "200": {
            "description": "Check result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "valid": {
                      "type": "boolean"
                    },
                    "pin_id": {
                      "type": "string",
                      "nullable": true,
                      "description": "The Pin ID read from `id` (`null` when `id` is not a Pin ID or link)."
                    },
                    "title": {
                      "type": "string",
                      "nullable": true
                    },
                    "link": {
                      "type": "string",
                      "nullable": true
                    },
                    "image_url": {
                      "type": "string",
                      "nullable": true
                    },
                    "unverified": {
                      "type": "boolean",
                      "description": "The check could not run; the publish step will check."
                    },
                    "reason": {
                      "type": "string",
                      "nullable": true,
                      "description": "Why the Pin is not valid or could not be checked."
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/pinterest/products/validate?id=813744226420795884\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst check = await client.pinterest.validateProduct(\"813744226420795884\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\ncheck = client.pinterest.validate_product(\"813744226420795884\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials pinterest:validate 813744226420795884"
          }
        ]
      }
    },
    "/inbox/conversations": {
      "get": {
        "operationId": "listInboxConversations",
        "x-required-scopes": [
          "inbox:read"
        ],
        "summary": "List conversations",
        "description": "Returns one entry per conversation (the latest message in each), across Instagram and Facebook DMs, comments, and mentions, LinkedIn company-page comments and mentions (LinkedIn has no DMs via API), TikTok video comments (comments only; requires the TikTok comments authorization on the channel), YouTube video comments (comments only; each channel is checked once per day, YouTube has no comment webhooks), X DMs for workspaces that opted in to X DMs in the dashboard (X is DM-only; no history from before opt-in), and Threads replies on your posts plus mentions (requires a Threads connection with the reply-reading permission). Sorted by newest activity first. Cursor-paginated: follow `pagination.next_cursor` until it is null. Requires the `inbox:read` scope (API keys) or the `access_social_inbox` permission (OAuth/MCP).\n",
        "tags": [
          "Inbox"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 25,
              "maximum": 100
            },
            "description": "Max conversations per page (1-100, default 25)."
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string",
              "example": "MjAyNi0xMC0yMVQwOTowMDowMC4wMDBafDg4MjMx"
            },
            "description": "Opaque pagination cursor from a previous response."
          },
          {
            "in": "query",
            "name": "platform",
            "schema": {
              "type": "string",
              "enum": [
                "instagram",
                "facebook",
                "linkedin",
                "tiktok",
                "youtube",
                "x",
                "threads"
              ]
            },
            "description": "Filter to a single platform."
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string",
              "enum": [
                "dm",
                "comment",
                "mention"
              ]
            },
            "description": "Filter to a single conversation type."
          },
          {
            "in": "query",
            "name": "unread",
            "schema": {
              "type": "boolean",
              "example": true
            },
            "description": "When true, only conversations with unread incoming messages."
          },
          {
            "in": "query",
            "name": "unanswered",
            "schema": {
              "type": "boolean",
              "example": true
            },
            "description": "When true, only conversations that still need an answer: the customer's latest DM has no reply after it (Instagram/Facebook DMs past the 24-hour messaging window included; they cannot be answered through the API but the customer is still waiting), or a comment/mention has not been replied to and is not hidden. Replies typed in the native apps count as answers (they are mirrored into the inbox). Read state is ignored here; use GET /inbox/next for a work queue.\n"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of conversations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InboxConversation"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/InboxCursorPagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/inbox/conversations?platform=instagram&unread=true&limit=25\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst conversations = await client.inbox.listConversations({ platform: \"instagram\", unread: true, limit: 25 });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nconversations = client.inbox.list_conversations(platform=\"instagram\", unread=True, limit=25)"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials inbox:list --platform instagram --unread --limit 25"
          }
        ]
      }
    },
    "/inbox/conversations/{conversationId}/messages": {
      "get": {
        "operationId": "getInboxConversation",
        "x-required-scopes": [
          "inbox:read"
        ],
        "summary": "List messages",
        "description": "Returns the full message history of a conversation, oldest first, cursor-paginated. Requires the `inbox:read` scope (API keys) or the `access_social_inbox` permission (OAuth/MCP).\n",
        "tags": [
          "Inbox"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "conversationId",
            "required": true,
            "schema": {
              "type": "string",
              "example": "instagram_comment_17912345678901234"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 100
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string",
              "example": "MjAyNi0xMC0yMVQwOTowMDowMC4wMDBafDg4MjMx"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of messages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InboxMessage"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/InboxCursorPagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Conversation not found in this workspace"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/inbox/conversations/instagram_1234567890_17841400000000000/messages\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst messages = await client.inbox.getMessages(\"instagram_1234567890_17841400000000000\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nmessages = client.inbox.get_messages(\"instagram_1234567890_17841400000000000\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials inbox:messages instagram_1234567890_17841400000000000"
          }
        ]
      }
    },
    "/inbox/conversations/{conversationId}/read": {
      "post": {
        "operationId": "markInboxRead",
        "x-required-scopes": [
          "inbox:write"
        ],
        "summary": "Mark conversation read",
        "description": "Marks every unread incoming message in the conversation as read and returns how many were updated. Requires the `inbox:write` scope (API keys) or the `access_social_inbox` permission (OAuth/MCP).\n",
        "tags": [
          "Inbox"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "conversationId",
            "required": true,
            "schema": {
              "type": "string",
              "example": "instagram_comment_17912345678901234"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Read state updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "conversation_id": {
                      "type": "string",
                      "example": "instagram_comment_17912345678901234"
                    },
                    "marked_read": {
                      "type": "integer",
                      "example": 3
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_permission`: the role has no social inbox access, or the caller is a client of the organisation; clients can read the inbox but not change it."
          },
          "404": {
            "description": "Conversation not found in this workspace"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/inbox/conversations/instagram_1234567890_17841400000000000/read\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst result = await client.inbox.markRead(\"instagram_1234567890_17841400000000000\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nresult = client.inbox.mark_read(\"instagram_1234567890_17841400000000000\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials inbox:read instagram_1234567890_17841400000000000"
          }
        ]
      }
    },
    "/inbox/conversations/{conversationId}/reply": {
      "post": {
        "operationId": "replyToInbox",
        "x-required-scopes": [
          "inbox:write"
        ],
        "summary": "Reply to a conversation",
        "description": "Sends a reply in an existing conversation (DM, comment, or mention) on Instagram, Facebook, LinkedIn, TikTok (comments only), YouTube (comments only), X (DM-only), or Threads (replies and mentions; needs a Threads connection with the reply permission, else 401 `reauth_required`). When Meta ended the session of the Instagram or Facebook connection (for example after a password change), the reply answers 401 `reauth_required` too and the app shows the Reconnect banner: reconnect the account, then send the reply again. You can only reply to conversations that already exist in your inbox. The API cannot start new conversations (Instagram requires the user to message first, and cold outreach violates Meta policy). Direct-message replies must be within the platform's messaging window (24 hours since the user's last message); replies outside the window are rejected. TikTok replies are text-only, capped at 150 characters (400 `validation_error` beyond that), and can take a few minutes to appear on TikTok while they pass spam review. Each workspace can send up to 1,000 replies per rolling 24 hours (429 `reply_limit_reached` beyond that). Contact robert@omnisocials.com if you need a higher limit. X DM replies debit 2 credits from the company balance before the send (auto-refunded if the send fails) and can return 402 `insufficient_credits` or 402 `x_inbox_suspended`. Facebook comment replies can tag the person who wrote the comment: set `mention_author` and OmniSocials puts their tag in front of `text`, so their name shows first as a clickable link and Facebook notifies them. The answer's `mention` says whether Facebook accepted the tag. Requires the `inbox:write` scope (API keys) or the `access_social_inbox` permission (OAuth/MCP).\n",
        "tags": [
          "Inbox"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "conversationId",
            "required": true,
            "schema": {
              "type": "string",
              "example": "instagram_comment_17912345678901234"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "description": "Either `text` or `attachment_url` must be set.",
                "properties": {
                  "text": {
                    "type": "string",
                    "example": "It comes in S, M and L. Which size do you need?",
                    "description": "Reply body (max 2000 characters; Instagram DMs max 1000; TikTok comments max 150). Optional when `attachment_url` is set: an attachment-only DM is allowed.",
                    "maxLength": 2000
                  },
                  "attachment_url": {
                    "type": "string",
                    "example": "https://example.com/size-chart.jpg",
                    "description": "Optional media URL to send (Facebook and Instagram DMs only)"
                  },
                  "attachment_type": {
                    "type": "string",
                    "enum": [
                      "image",
                      "video",
                      "audio",
                      "file"
                    ],
                    "description": "Required if attachment_url is set"
                  },
                  "message_id": {
                    "type": "string",
                    "example": "88231",
                    "description": "For comment and mention threads: the inbox id of the specific incoming comment being answered (`message.id` from GET /inbox/next, or a message id from GET /inbox/conversations/{id}/messages). Every comment on a post shares one conversation, so without it the reply is posted under the newest comment on the post, which may be a different person than the one you drafted for. Always pass it when replying to an item served by the queue. Ignored for DMs (a DM reply goes to the conversation). 404 `not_found` when it is not an incoming message of this conversation."
                  },
                  "include_next": {
                    "type": "boolean",
                    "default": false,
                    "description": "When true, the response also carries `next`: the next conversation that needs an answer (same shape as GET /inbox/next, with its default queue order and filters), and `remaining`. Saves the extra call when working through the inbox."
                  },
                  "mention_author": {
                    "type": "boolean",
                    "default": false,
                    "description": "Facebook comment replies only: tag the person who wrote the comment you answer. OmniSocials puts their tag (`@[id]`) in front of `text`, so their name shows first in the reply as a clickable link and Facebook notifies them; do not write the name or the tag in `text` yourself. Works for comments on the Page's own posts. After the send OmniSocials reads the reply back and reports the result in `mention`. Any other conversation (another platform, a Facebook DM, a post that mentions the Page, a comment Facebook sent without its writer) answers 400 `mention_not_supported` and nothing is sent."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reply sent",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InboxMessage"
                    },
                    "next": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/InboxNextUnanswered"
                        }
                      ],
                      "description": "Only when `include_next` was set. Null when nothing is waiting."
                    },
                    "remaining": {
                      "type": "integer",
                      "example": 4,
                      "description": "Only when `include_next` was set: unanswered items still waiting after `next` (capped at 500)."
                    },
                    "mention": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/InboxReplyMention"
                        }
                      ],
                      "description": "Only when `mention_author` was set: whether Facebook shows the commenter's name as a tag. `data.text` is the reply as Facebook shows it."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`mention_not_supported`: `mention_author` was set on a conversation that is not a comment on the Facebook Page's own post, or Facebook did not say who wrote the comment; nothing was sent. Validation error (including `text` over the platform cap: 2000 overall, 1000 on Instagram DMs, 150 on TikTok comments, and an attachment that Instagram or Facebook did not accept: the message names the formats and Meta's error code; nothing was sent), `unsupported_platform`, or `unsupported_reply_type` (the conversation's platform/type cannot be replied to, e.g. an Instagram story mention)"
          },
          "401": {
            "description": "`reauth_required`: the connection must be reconnected before a reply can go out: the Threads reply permission is missing, the LinkedIn Page or TikTok comments authorization expired, or Meta ended the Instagram or Facebook session (for example after a password change)"
          },
          "402": {
            "description": "X DMs only: `insufficient_credits` (balance cannot cover the 2-credit send) or `x_inbox_suspended` (X inbox paused at zero balance; a top-up turns it back on)"
          },
          "403": {
            "description": "Platform limitation (e.g. cannot comment on a personal-profile post). `insufficient_permission`: the caller is a client of the organisation; clients can read the inbox but not change it."
          },
          "404": {
            "description": "`not_found`: conversation not found in this workspace, `message_id` is not an incoming message of this conversation, or the comment/message being replied to no longer exists on the platform (deleted, hidden, or restricted by its author)"
          },
          "409": {
            "description": "`duplicate_reply`: this exact reply (same text and attachment, same comment or DM conversation) already went out in the last 10 minutes, or is being sent right now; nothing was sent again. `data` carries the earlier outgoing message when there is one. Treat it as done: do not resend."
          },
          "422": {
            "description": "`outside_messaging_window`: Instagram/Facebook DM replies are only allowed within 24 hours of the customer's last message (Meta policy); checked before the send, the message names when the window closed (GET /inbox/next reports the same in `reply_window`). Answer such a DM from the native app (mirrored into the inbox) or mark the conversation read. `reply_not_allowed`: the platform refuses replies to this item for good (Facebook #1705: the comment sits on a share or boosted copy of the post, or the commenter restricts replies; YouTube: the thread's canReply is false because comments are off on the video or the comment was removed or held for review; TikTok: the video was deleted or made private, or is no longer on the connected account, or TikTok refuses replies to this one comment with its error 40002 \"Something is wrong. Please try again later.\", which it gives for the same comment every time; Facebook or Instagram: Meta error 551, the person blocks messages from the account or deactivated or deleted their account). The item is dropped from GET /inbox/next; do not retry. `reply_not_accepted`: YouTube did not accept this reply and gave no reason, usually because many replies went out on one video in a short time or its spam filter stopped the reply (for example one with a link); nothing was posted and the item stays in GET /inbox/next. Wait a few minutes before you send it again, and send replies on one video more slowly. Also `reply_not_accepted`: Instagram or Facebook has blocked the account from sending for a while (Meta error 368, or Meta's words for a temporary block, in the account's language), usually after many messages or replies in a short time; nothing was sent and the item stays in GET /inbox/next. Wait some hours before the account sends again, then send fewer in a row: every send during the block fails the same way. `platform_rejected`: the platform answered and refused the reply (an HTTP 4xx, or TikTok's own error code such as 40002 \"No data from downstream.\"), and no rule above names the answer; the message quotes the platform's text and code. The item stays in GET /inbox/next. The same reply sent again usually gets the same answer: read the conversation before you send it again."
          },
          "429": {
            "description": "Daily reply limit reached for this workspace"
          },
          "502": {
            "description": "`platform_error`: the platform did not answer (network error or time-out) or answered with a server error (HTTP 5xx); the message carries the platform's own text when there is one. The reply may be posted: read the conversation before you send it again."
          },
          "503": {
            "description": "`platform_unavailable`: Facebook or Instagram did not answer in time (Meta error 1 or 2). A Facebook comment reply is checked first: when Facebook posted it anyway, the answer is 200 with that reply; when it is not there after a second try, the message says nothing was posted. Otherwise the message says the reply may be posted: read the conversation before you send it again. Wait for `Retry-After` (seconds)."
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/inbox/conversations/instagram_1234567890_17841400000000000/reply\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"text\": \"Yes, we ship worldwide!\"}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst reply = await client.inbox.reply(\"instagram_1234567890_17841400000000000\", { text: \"Yes, we ship worldwide!\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nreply = client.inbox.reply(\"instagram_1234567890_17841400000000000\", \"Yes, we ship worldwide!\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials inbox:reply instagram_1234567890_17841400000000000 --text \"Yes, we ship worldwide!\""
          }
        ]
      }
    },
    "/inbox/messages/{id}/hide": {
      "post": {
        "operationId": "hideInboxComment",
        "x-required-scopes": [
          "inbox:write"
        ],
        "summary": "Hide or unhide a comment",
        "description": "Hides (or unhides) a comment someone left on one of your posts, on the platform, as the post owner. Facebook, Instagram, TikTok, YouTube and Threads comments (Threads: incoming top-level replies only; Threads does not allow hiding nested replies). On YouTube \"hide\" sets the comment's moderation status to rejected, which removes it and its replies from public view; unhide publishes it again. The message keeps its place in the conversation and `hidden` flips on the returned message. A hidden comment no longer counts as unanswered. The account must have been connected with the moderation permission (Facebook `pages_manage_engagement`, Instagram `instagram_business_manage_comments`); 403 `reconnect_required` otherwise. Requires the `inbox:write` scope (API keys) or the `access_social_inbox` permission (OAuth/MCP).\n",
        "tags": [
          "Inbox"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "88231"
            },
            "description": "The inbox message id (from the conversation messages list)."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "hide": {
                    "type": "boolean",
                    "default": true,
                    "description": "true to hide, false to unhide"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Reply hidden or unhidden. On Facebook/Instagram, if the platform reports the comment no longer exists (its author deleted it, or it was already removed another way), this still returns 200 (there is nothing left to hide, and it stops counting as unanswered), but the response carries a `note` explaining that instead of silently implying the call hid something.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InboxMessage"
                    },
                    "note": {
                      "type": "string",
                      "nullable": true,
                      "description": "Present only when the comment was already gone on the platform; explains that nothing was left to hide/unhide."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`unsupported_platform` (not an incoming comment on a supported platform) or `not_hideable` (Threads nested reply, or Threads refused)"
          },
          "401": {
            "description": "`reauth_required`: the Threads reply permission or the TikTok comments authorization is missing or expired"
          },
          "403": {
            "description": "`reconnect_required`: the account was connected without the comment-moderation permission, or Meta ended the Instagram or Facebook session (for example after a password change); reconnect it in the dashboard. `insufficient_permission`: the caller is a client of the organisation; clients can read the inbox but not change it."
          },
          "404": {
            "description": "`not_found` (message not in this workspace) or `account_not_connected`"
          },
          "422": {
            "description": "`cannot_hide`: Facebook does not let the Page hide (or unhide) this comment (the commenter blocked the Page, their account is deactivated or restricted, or the comment sits on a shared copy of the post). Retrying does not change it; handle it in Facebook, or mark the conversation read to skip it. `platform_rejected`: the platform answered and refused the call (an HTTP 4xx, or TikTok's own error code), and no rule above names the answer; the message quotes the platform's text and code. Nothing changed. The same call gets the same answer until something changes on the platform, so do not retry it at once."
          },
          "429": {
            "description": "`quota_exceeded`: YouTube's daily API quota is used up; retry after midnight Pacific"
          },
          "502": {
            "description": "`platform_error`: the platform did not answer (network error or time-out) or answered with a server error (HTTP 5xx). `hide_not_applied` (Instagram): Instagram accepted the hide or unhide but still reports the comment in the old state when read back, so the inbox row was left unchanged. This happens with comments Instagram shows under 'Comments from Facebook' on a reel that is also shared to Facebook (they live on Facebook); hide it in the Instagram or Facebook app, do not retry."
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/inbox/messages/98765/hide\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"hide\": true}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst result = await client.inbox.hide(\"98765\", { hide: true });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nresult = client.inbox.hide(\"98765\", hide=True)"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials inbox:hide 98765"
          }
        ]
      }
    },
    "/inbox/messages/{id}/like": {
      "post": {
        "operationId": "likeInboxComment",
        "x-required-scopes": [
          "inbox:write"
        ],
        "summary": "Like or unlike a comment",
        "description": "Likes (or removes the like from) a comment someone left on one of your posts, as the connected account: the Facebook Page, the LinkedIn Page or the TikTok account. Incoming Facebook, LinkedIn Page and TikTok comments. Facebook allows a Like only: no app can add Love or another reaction. Liking a comment that is already liked (or unliking one that is not) succeeds and changes nothing. `liked` on the returned message shows the new state. A like does not mark the comment as read or answered. The account must have been connected with the comment permission (Facebook `pages_manage_engagement`); 403 `reconnect_required` otherwise. Requires the `inbox:write` scope (API keys) or the `access_social_inbox` permission (OAuth/MCP).\n",
        "tags": [
          "Inbox"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "88231"
            },
            "description": "The inbox message id (from the conversation messages list)."
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "like": {
                    "type": "boolean",
                    "default": true,
                    "description": "true to like, false to remove the like"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Comment liked or unliked",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InboxMessage"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`unsupported_platform`: not an incoming Facebook, LinkedIn Page or TikTok comment"
          },
          "401": {
            "description": "`reauth_required`: the LinkedIn Page connection or the TikTok comments authorization expired; reconnect it in the dashboard"
          },
          "403": {
            "description": "`reconnect_required`: the account was connected without the comment permission, or Meta ended the Facebook session (for example after a password change); reconnect it in the dashboard. `insufficient_permission`: the caller is a client of the organisation; clients can read the inbox but not change it."
          },
          "404": {
            "description": "`not_found` (message not in this workspace, or Facebook cannot find the comment any more) or `account_not_connected`"
          },
          "422": {
            "description": "`like_not_accepted`: TikTok refuses a like on this one comment (its error 40002 \"Server Internal Error.\"), and gives that answer for the same comment almost every time. OmniSocials sends it twice before it answers this. Nothing changed; skip the comment, do not retry. `platform_rejected`: the platform answered and refused the call (an HTTP 4xx, or TikTok's own error code), and no rule above names the answer; the message quotes the platform's text and code. Nothing changed. The same call gets the same answer until something changes on the platform, so do not retry it at once."
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "description": "`platform_error`: the platform did not answer (network error or time-out) or answered with a server error (HTTP 5xx)"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/inbox/messages/<id>/like\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{}'"
          }
        ]
      }
    },
    "/inbox/messages/{id}": {
      "delete": {
        "operationId": "deleteInboxComment",
        "x-required-scopes": [
          "inbox:write"
        ],
        "summary": "Delete a comment",
        "description": "Deletes a comment on one of your posts, on the platform and from the inbox: a comment someone left, or a reply your own account posted (`direction: outgoing`, sent from OmniSocials or from the app). Facebook, Instagram and TikTok comments only: YouTube's API does not let a channel delete other people's comments, hide those instead (POST /inbox/messages/{id}/hide). On TikTok only the account's own replies can be deleted: TikTok does not let an account delete comments other people left, so those answer 400 `unsupported_platform` (hide them instead). Replies under the deleted comment go with it (the platforms cascade the delete and the inbox mirrors that); their ids are returned. When you delete your account's last reply under a comment, that comment gets `is_replied: false` again, so GET /inbox/next serves it again. A comment that is already gone on the platform is still removed from the inbox. This cannot be undone. Requires the `inbox:write` scope (API keys) or the `access_social_inbox` permission (OAuth/MCP).\n",
        "tags": [
          "Inbox"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "example": "88231"
            },
            "description": "The inbox message id (from the conversation messages list or GET /inbox/next)."
          }
        ],
        "responses": {
          "200": {
            "description": "Comment deleted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "description": "The deleted message id",
                          "example": "88231"
                        },
                        "conversation_id": {
                          "type": "string",
                          "example": "instagram_comment_17912345678901234"
                        },
                        "removed_reply_ids": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "example": "88240"
                          },
                          "description": "Inbox ids of replies removed together with the comment"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`unsupported_platform`: not a Facebook, Instagram or TikTok comment (DMs and mentions cannot be deleted), or a TikTok comment someone else left (TikTok lets an account delete only what it posted itself; hide it instead)"
          },
          "401": {
            "description": "`reauth_required`: the TikTok comments authorization expired"
          },
          "403": {
            "description": "`reconnect_required`: the account was connected without the comment-moderation permission, or Meta ended the Instagram or Facebook session (for example after a password change); reconnect it in the dashboard. `insufficient_permission`: the caller is a client of the organisation; clients can read the inbox but not change it."
          },
          "404": {
            "description": "`not_found` (message not in this workspace) or `account_not_connected`"
          },
          "422": {
            "description": "`platform_rejected`: the platform answered and refused the call (an HTTP 4xx, or TikTok's own error code), and no rule above names the answer; the message quotes the platform's text and code. Nothing changed. The same call gets the same answer until something changes on the platform, so do not retry it at once."
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "description": "`platform_error`: the platform did not answer (network error or time-out) or answered with a server error (HTTP 5xx)"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.omnisocials.com/v1/inbox/messages/98765\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst result = await client.inbox.deleteMessage(\"98765\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nresult = client.inbox.delete_message(\"98765\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials inbox:delete 98765"
          }
        ]
      }
    },
    "/inbox/next": {
      "get": {
        "operationId": "getNextUnanswered",
        "x-required-scopes": [
          "inbox:read"
        ],
        "summary": "Get next conversation",
        "description": "A work queue for answering the inbox. Returns one item that still needs a reply, together with its conversation so far and the post it belongs to, so a reply can be drafted from one call. An item needs an answer when it is the customer's latest DM with no reply after it, or a comment/mention that has not been replied to and is not hidden. Order: DMs that can still be answered come first (Instagram/Facebook DMs inside Meta's 24-hour window, the one whose window closes soonest first, and X DMs), then Instagram/Facebook DMs whose window has closed (served with `reply_window.open = false`: answer them from the native app or mark them read), then comments and mentions, oldest first by default. Pass `message.id` as `message_id` to the reply endpoint so a comment reply lands under the served comment. Replies typed in the native apps count as answers (they are mirrored into the inbox), so a thread a colleague answered on their phone is not served again. Instagram mentions are skipped (no reply path). Only unread items are served by default: marking a conversation read (POST /inbox/conversations/{id}/read) is how to skip one for good; pass `include_read=true` to include read-but-unanswered items. Looks at the last 30 days of activity. To chain the queue, pass `include_next: true` to the reply endpoint and it returns the next item in the same response. Requires the `inbox:read` scope (API keys) or the `access_social_inbox` permission (OAuth/MCP).\n",
        "tags": [
          "Inbox"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "platform",
            "schema": {
              "type": "string",
              "enum": [
                "instagram",
                "facebook",
                "linkedin",
                "tiktok",
                "youtube",
                "x",
                "threads"
              ]
            },
            "description": "Only items from one platform."
          },
          {
            "in": "query",
            "name": "type",
            "schema": {
              "type": "string",
              "enum": [
                "dm",
                "comment",
                "mention"
              ]
            },
            "description": "Only items of one type."
          },
          {
            "in": "query",
            "name": "order",
            "schema": {
              "type": "string",
              "enum": [
                "oldest",
                "newest"
              ],
              "default": "oldest"
            },
            "description": "`oldest` serves the item that has waited longest first; `newest` the most recent."
          },
          {
            "in": "query",
            "name": "include_read",
            "schema": {
              "type": "boolean",
              "default": false
            },
            "description": "Also serve items that were marked read but never answered."
          },
          {
            "in": "query",
            "name": "exclude",
            "schema": {
              "type": "string",
              "example": "instagram_comment_17912345678901234,instagram_comment_17912345678905678"
            },
            "description": "Comma-separated conversation ids to leave out of this call (a session-local skip; up to 100)."
          }
        ],
        "responses": {
          "200": {
            "description": "The next item, or null when nothing is waiting",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/InboxNextUnanswered"
                    },
                    "remaining": {
                      "type": "integer",
                      "example": 4,
                      "description": "Unanswered items still waiting after this one (capped at 500). 0 when `data` is null."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`validation_error`: unknown platform, type or order"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/inbox/next?platform=instagram\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst next = await client.inbox.next({ platform: \"instagram\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nitem = client.inbox.next(platform=\"instagram\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials inbox:next --platform instagram"
          }
        ]
      }
    },
    "/automations": {
      "get": {
        "operationId": "listAutomations",
        "x-required-scopes": [
          "automations:read"
        ],
        "summary": "List automations",
        "description": "Returns the comment-to-DM automations of the workspace, newest first. An automation answers a keyword in a comment (or a DM, or an Instagram story reply) with a DM, once per person. It runs on the connected Instagram account, the connected Facebook Page or the connected X account (`platform`; on X it answers DMs only). Needs the opt-in `automations:read` scope.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "paused",
                "completed"
              ]
            }
          },
          {
            "in": "query",
            "name": "post_id",
            "schema": {
              "type": "string"
            },
            "description": "Only the automations bound to this OmniSocials post (one per platform at most)."
          },
          {
            "in": "query",
            "name": "platform",
            "schema": {
              "type": "string",
              "enum": [
                "instagram",
                "facebook",
                "x"
              ]
            },
            "description": "Only the automations of this platform."
          }
        ],
        "responses": {
          "200": {
            "description": "List of automations",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Automation"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/automations?status=active\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst automations = await client.automations.list({ status: \"active\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nautomations = client.automations.list(status=\"active\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials automations:list --status active"
          }
        ]
      },
      "post": {
        "operationId": "createAutomation",
        "x-required-scopes": [
          "automations:write"
        ],
        "summary": "Create an automation",
        "description": "Creates a comment-to-DM automation on the connected Instagram account (default) or on the connected Facebook Page (`platform: facebook`). When somebody comments a keyword on the post (or sends it in a DM, or in an Instagram story reply, see `trigger.kinds`), the account sends them `actions.dm.text` as a private message, once per person, and optionally posts one of `actions.public_reply.variations` under the comment. On Facebook the DM lands in Messenger. Meta's rules are the same on both: one private reply per comment, within 7 days of the comment, and an automatic message only within 24 hours after the person's last DM, button tap or quick reply (the comment does not open that window). OmniSocials caps sends at 700 DMs an hour per account and platform (Meta's own limit is 750 calls an hour); an answer over the cap waits in a queue and goes out as soon as there is room, for up to about a day (24 hours for a comment, 23 hours for a DM or story reply). On X (`platform: x`) only `trigger.kinds: [\"dm\"]` exists: the account answers a DM with the keyword (or any first message with `match: any`), once per person, after X DMs are turned on for the workspace in the dashboard; X allows 15 answers per 15 minutes per account, and each answer ends with \"Reply STOP to stop automatic messages.\". For `scope` `post`, pass one of `post_id` (an OmniSocials post that goes to the platform; a scheduled post starts listening once it is live), `instagram_media_id` (an Instagram post published outside OmniSocials) or `facebook_post_id` (a Page post published outside OmniSocials). Needs the opt-in `automations:write` scope and a connected Instagram account, Facebook Page or X account; an active X automation also needs X DMs on (else `409 x_dms_off`; `status: paused` always saves). Follow first (`actions.follow_gate`, Instagram only): the person first gets a short message with one button, and the link in `dm.text` goes out once a tap shows they follow the account; somebody who does not follow yet is asked to follow and tap again. Texts hold 640 characters and buttons 20; leave them out for the defaults. Facebook and X have no follow status, so `enabled: true` there answers `400 follow_gate_instagram_only`. Follow-up (`actions.follow_up`, Instagram and Facebook): one more DM 1 to 23 hours (default 23) after the answer went out, inside Meta's 24-hour window. On an Instagram comment with Follow first off, the first DM becomes a tap step with one button (`follow_up.tap`, defaults \"Tap the button and I'll send you the link 👇\" and \"Send me the link\"), and the tap sends `dm.text` and opens the window; with Follow first on, its own tap does that. A DM or story reply trigger needs no tap step. On Facebook only people who answer the DM get the follow-up. `text` holds 1000 characters (640 with a `button`), `button` is an optional link button (`title` 20 characters, an http(s) `url`). X has none: `enabled: true` there answers `400 follow_up_not_supported`. Link button (`actions.dm.button`, Instagram and Facebook): a button under the DM (`title` 20 characters, an https `url` of at most 900) whose taps OmniSocials counts through a short link for 60 days after the DM (`stats.clicked`, the event's `clicked_at`); the DM text then holds 640 characters. A Facebook comment answer has no buttons and gets the address under the text instead; X answers `400 dm_button_not_supported`. Keywords (`match: word`, the default) also catch the forms people write: capitals, accents, fancy letters, longer letter runs and a plural or common ending (\"guides\", \"guideee\" for GUIDE), never part of another word and no typos. Read the funnel with `GET /automations/{id}/results`.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/AutomationInput"
                  },
                  {
                    "type": "object",
                    "required": [
                      "actions"
                    ]
                  }
                ]
              },
              "examples": {
                "keywordOnOnePost": {
                  "summary": "Keyword on one post, with a public reply",
                  "value": {
                    "name": "Free guide",
                    "post_id": "12345",
                    "trigger": {
                      "keywords": [
                        "guide",
                        "link"
                      ],
                      "match": "word"
                    },
                    "actions": {
                      "dm": {
                        "text": "Here is the guide: https://example.com/guide"
                      },
                      "public_reply": {
                        "enabled": true,
                        "variations": [
                          "Sent you a DM!",
                          "Check your inbox 📩"
                        ]
                      }
                    },
                    "limits": {
                      "max_sends": 500
                    }
                  }
                },
                "nextPost": {
                  "summary": "The next post the workspace publishes",
                  "value": {
                    "trigger": {
                      "scope": "next_post",
                      "keywords": [
                        "price"
                      ]
                    },
                    "actions": {
                      "dm": {
                        "text": "The price list is here: https://example.com/prices"
                      }
                    }
                  }
                },
                "dmKeyword": {
                  "summary": "A keyword in any DM or story reply",
                  "value": {
                    "trigger": {
                      "kinds": [
                        "dm",
                        "story_reply"
                      ],
                      "keywords": [
                        "menu"
                      ]
                    },
                    "actions": {
                      "dm": {
                        "text": "Our menu: https://example.com/menu"
                      }
                    }
                  }
                },
                "xDm": {
                  "summary": "X, a keyword in a DM to the X account",
                  "value": {
                    "platform": "x",
                    "trigger": {
                      "kinds": [
                        "dm"
                      ],
                      "keywords": [
                        "pricing"
                      ]
                    },
                    "actions": {
                      "dm": {
                        "text": "Our plans: https://example.com/pricing"
                      }
                    }
                  }
                },
                "facebookPagePost": {
                  "summary": "A Facebook Page post published outside OmniSocials",
                  "value": {
                    "platform": "facebook",
                    "facebook_post_id": "104857600123456_987654321098765",
                    "trigger": {
                      "keywords": [
                        "guide"
                      ]
                    },
                    "actions": {
                      "dm": {
                        "text": "Here is the guide: https://example.com/guide"
                      },
                      "public_reply": {
                        "enabled": true,
                        "variations": [
                          "Sent you a message!"
                        ]
                      }
                    }
                  }
                },
                "followFirst": {
                  "summary": "Instagram, the link only for followers (Follow first)",
                  "value": {
                    "post_id": "12345",
                    "trigger": {
                      "keywords": [
                        "guide"
                      ]
                    },
                    "actions": {
                      "dm": {
                        "text": "Here's the guide 🙌 https://example.com/guide"
                      },
                      "public_reply": {
                        "enabled": true,
                        "variations": [
                          "Sent you a DM! 📩"
                        ]
                      },
                      "follow_gate": {
                        "enabled": true,
                        "first_message": {
                          "text": "Tap the button and I'll send you the link 👇",
                          "button": "Send me the link"
                        },
                        "not_following": {
                          "text": "Almost there! Follow @yourbrand first, then tap the button again.",
                          "button": "I follow now"
                        }
                      }
                    }
                  }
                },
                "followUp": {
                  "summary": "Instagram, a follow-up 23 hours after the link",
                  "value": {
                    "post_id": "12345",
                    "trigger": {
                      "keywords": [
                        "guide"
                      ]
                    },
                    "actions": {
                      "dm": {
                        "text": "Here's the guide 🙌 https://example.com/guide"
                      },
                      "follow_up": {
                        "enabled": true,
                        "text": "Did the guide help? Book a free call here 👇",
                        "delay_hours": 23,
                        "button": {
                          "title": "Book a call",
                          "url": "https://example.com/call"
                        },
                        "tap": {
                          "text": "Tap the button and I'll send you the guide 👇",
                          "button": "Send me the guide"
                        }
                      }
                    }
                  }
                },
                "linkButton": {
                  "summary": "A link button under the DM, taps counted",
                  "value": {
                    "post_id": "12345",
                    "trigger": {
                      "keywords": [
                        "guide"
                      ]
                    },
                    "actions": {
                      "dm": {
                        "text": "Here's the guide 🙌 Tap below to open it.",
                        "button": {
                          "title": "Get the guide",
                          "url": "https://example.com/guide"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Automation created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Automation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid input (`validation_error`: also `story_reply` on Facebook, `comment` or `story_reply` on X, two of `post_id` / `instagram_media_id` / `facebook_post_id`, or a Follow first text over 640 or a button over 20 characters, or a follow-up without `text`, with `delay_hours` outside 1 to 23, a text over 1000 (640 with a button), a button without a title of 1 to 20 characters or without an http(s) `url`, a tap text over 640 or a tap button over 20 characters, a `dm.button` without a title of 1 to 20 characters or without an https `url` of at most 900 characters, or a DM text over 640 characters with a `dm.button`), `follow_gate_instagram_only` (`actions.follow_gate.enabled: true` on a Facebook or X automation), `follow_up_not_supported` (`actions.follow_up.enabled: true` on an X automation), `dm_button_not_supported` (`actions.dm.button` on an X automation), or the post does not go to the platform (`post_not_instagram`, `post_not_facebook`), or no post was given for the `post` scope (`post_required`)"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`post_not_found`, `instagram_media_not_found` (Instagram has no such post on this account), or `facebook_post_not_found` (the id is not a post of the connected Page)"
          },
          "409": {
            "description": "`instagram_not_connected`, `instagram_needs_reauth`, `facebook_not_connected` (no Facebook Page connected), `facebook_needs_reauth` (the Page connection must be reconnected), `x_not_connected` (no X account connected), `x_dms_off` (X DMs are off for the workspace; turn them on in the dashboard, or create the automation with `status: paused`), or `automation_exists` (the post already has one on this platform; the response carries its `automation_id`)"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/automations\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"post_id\": \"12345\",\n    \"trigger\": {\"keywords\": [\"guide\"]},\n    \"actions\": {\n      \"dm\": {\"text\": \"Here is the guide: https://example.com/guide\"}\n    }\n  }'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst automation = await client.automations.create({\n  post_id: \"12345\",\n  trigger: { keywords: [\"guide\"] },\n  actions: { dm: { text: \"Here is the guide: https://example.com/guide\" } },\n});"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nautomation = client.automations.create(\n    post_id=\"12345\",\n    trigger={\"keywords\": [\"guide\"]},\n    actions={\"dm\": {\"text\": \"Here is the guide: https://example.com/guide\"}},\n)"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials automations:create --post-id 12345 --keywords guide --dm \"Here is the guide: https://example.com/guide\""
          }
        ]
      }
    },
    "/automations/{id}": {
      "get": {
        "operationId": "getAutomation",
        "x-required-scopes": [
          "automations:read"
        ],
        "description": "Returns one comment-to-DM automation of the key's workspace: its trigger, actions, limits, counts in `stats`, and the post it listens on.",
        "summary": "Get an automation",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Automation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Automation"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Automation not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/automations/100000004\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst automation = await client.automations.get(\"100000004\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nautomation = client.automations.get(\"100000004\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials automations:get 100000004"
          }
        ]
      },
      "patch": {
        "operationId": "updateAutomation",
        "x-required-scopes": [
          "automations:write"
        ],
        "summary": "Update an automation",
        "description": "Partial update. `status` pauses (`paused`) or resumes (`active`) the automation. `trigger`, `actions` and `limits` are merged into the stored sections: keys you omit keep their value (new `keywords` keep the kinds, the scope and the match; a new `dm.text` keeps the public reply). `public_reply.variations: []` or `enabled: false` turns the public reply off; `limits.max_sends: null` removes that limit. `actions.follow_gate` merges into the stored one too: `{ \"enabled\": false }` switches Follow first off and keeps its texts, new texts keep the switch as it is, `null` switches it off, and a body without `follow_gate` leaves it untouched. `actions.follow_up` merges the same way: `{ \"enabled\": false }` or `null` switches the follow-up off and keeps its texts, keys you leave out keep their value (`{ \"delay_hours\": 12 }` changes only the delay), `tap` merges key by key, `button: null` removes the link button and a new `button` replaces the stored one (send `title` and `url` together), and a body without `follow_up` leaves it untouched; `enabled: true` on an X automation answers 400 `follow_up_not_supported`. `actions.dm.button`: a body without it keeps the stored button (also with a new `dm.text`, which must then fit in 640 characters), `null` removes it, a new object replaces it (send `title` and `url` together); a button on an X automation answers 400 `dm_button_not_supported`. Another `post_id`, `instagram_media_id` or `facebook_post_id` moves the automation to that post. The platform never changes: a body that names another platform (or `instagram_media_id` on a Facebook automation, `facebook_post_id` on an Instagram one) answers 400 `platform_immutable`. A `completed` automation starts again when its limits or trigger change.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationInput"
              },
              "examples": {
                "pause": {
                  "summary": "Pause",
                  "value": {
                    "status": "paused"
                  }
                },
                "newKeywords": {
                  "summary": "New keywords",
                  "value": {
                    "trigger": {
                      "keywords": [
                        "guide",
                        "pdf"
                      ]
                    }
                  }
                },
                "followFirstOn": {
                  "summary": "Turn Follow first on with the default texts (Instagram)",
                  "value": {
                    "actions": {
                      "follow_gate": {
                        "enabled": true
                      }
                    }
                  }
                },
                "followFirstOff": {
                  "summary": "Turn Follow first off, keep its texts",
                  "value": {
                    "actions": {
                      "follow_gate": {
                        "enabled": false
                      }
                    }
                  }
                },
                "followUpOn": {
                  "summary": "Turn a follow-up on (Instagram or Facebook)",
                  "value": {
                    "actions": {
                      "follow_up": {
                        "enabled": true,
                        "text": "Did the guide help? Reply with any question.",
                        "delay_hours": 20
                      }
                    }
                  }
                },
                "followUpNoButton": {
                  "summary": "Remove the follow-up's link button, keep the rest",
                  "value": {
                    "actions": {
                      "follow_up": {
                        "button": null
                      }
                    }
                  }
                },
                "followUpOff": {
                  "summary": "Turn the follow-up off, keep its texts",
                  "value": {
                    "actions": {
                      "follow_up": {
                        "enabled": false
                      }
                    }
                  }
                },
                "dmButton": {
                  "summary": "Put a link button under the DM (Instagram or Facebook)",
                  "value": {
                    "actions": {
                      "dm": {
                        "button": {
                          "title": "Get the guide",
                          "url": "https://example.com/guide"
                        }
                      }
                    }
                  }
                },
                "dmButtonOff": {
                  "summary": "Remove the DM's link button, keep the text",
                  "value": {
                    "actions": {
                      "dm": {
                        "button": null
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Automation updated",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Automation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid update (`validation_error`, also a follow-up switched on without a text in the body or stored, a DM text over 640 characters next to a new or stored `dm.button`, or with the limits of the create call broken; `no_fields`), `follow_gate_instagram_only` (Follow first switched on for a Facebook or X automation), `follow_up_not_supported` (a follow-up switched on for an X automation), `dm_button_not_supported` (a `dm.button` on an X automation), or `platform_immutable` (the body names another platform)"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Automation not found, or the new post was not found (`post_not_found`, `instagram_media_not_found`, `facebook_post_not_found`)"
          },
          "409": {
            "description": "`automation_exists`: the new post already has an automation on this platform, or `x_dms_off`: an X automation cannot be set `active` while X DMs are off for the workspace"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X PATCH \"https://api.omnisocials.com/v1/automations/100000004\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"status\": \"paused\"}'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst automation = await client.automations.update(\"100000004\", { status: \"paused\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nautomation = client.automations.update(\"100000004\", status=\"paused\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials automations:update 100000004 --pause"
          }
        ]
      },
      "delete": {
        "operationId": "deleteAutomation",
        "x-required-scopes": [
          "automations:write"
        ],
        "summary": "Delete an automation",
        "description": "Deletes the automation and its activity log. DMs that were already sent stay sent.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Automation deleted"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "Automation not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X DELETE \"https://api.omnisocials.com/v1/automations/100000004\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nawait client.automations.delete(\"100000004\");"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nclient.automations.delete(\"100000004\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials automations:delete 100000004"
          }
        ]
      }
    },
    "/automations/{id}/events": {
      "get": {
        "operationId": "getAutomationActivity",
        "x-required-scopes": [
          "automations:read"
        ],
        "summary": "List automation events",
        "description": "One row per comment or message the automation acted on, newest first: the DM that was sent, an answer that waits in the queue, a skip with its reason, or a failure with the platform's error. `counts` gives the total per outcome. On Facebook `person.username` is the person's name and `kind` is `comment` or `dm`; on X `kind` is always `dm` and `opted_out` rows mark people who replied STOP. With Follow first (Instagram), `waiting` rows are people who were asked to follow and have no link yet, and the rows the gate handled carry `follow_gate` (taps, whether Instagram confirmed the follow, and whether the follow came after the ask). With a follow-up, a `waiting` row on Instagram can also be a person who got the tap step and has not tapped yet (`follow_gate.mode: tap`), and each answer that went out carries `follow_up`: scheduled with its `due_at`, sent, or skipped with the reason (no tap or message in Meta's 24-hour window, a stop, a team member's own reply). Each row also says whether the answer carried a counted link button (`linked`), when the person first tapped it (`clicked_at`), when they wrote back (`replied_at`), and, for a keyword matched as another form, which word they wrote (`match`). `filter=clicked` lists the people who tapped the link button, `filter=answered` the people who wrote back. For the totals per step over a period, use `GET /automations/{id}/results`.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "outcome",
            "description": "`queued` = waits for room under the channel's send cap (at most an hour on X, about a day on Instagram and Facebook); `opted_out` = the person wrote STOP (X); `waiting` = Follow first asked the person to follow, or the tap step of a follow-up waits for the tap; no link yet (Instagram); `not_sent` = `skipped` and `failed` together (the people who got no DM, the dashboard's Not sent tab).",
            "schema": {
              "type": "string",
              "enum": [
                "sent",
                "queued",
                "skipped",
                "opted_out",
                "failed",
                "pending",
                "waiting",
                "not_sent"
              ]
            }
          },
          {
            "in": "query",
            "name": "filter",
            "description": "`clicked` = only the people who tapped the DM's link button (`clicked_at` set); `answered` = only the people who wrote back within 7 days of the answer (`replied_at` set). Combines with `outcome`.",
            "schema": {
              "type": "string",
              "enum": [
                "clicked",
                "answered"
              ]
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 25,
              "maximum": 100
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activity",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AutomationEvent"
                      }
                    },
                    "counts": {
                      "type": "object",
                      "description": "Rows per outcome over the whole log (not narrowed by `outcome` or `filter`), e.g. `{ \"sent\": 12, \"skipped\": 3, \"waiting\": 4, \"clicked\": 5, \"answered\": 2 }` (`waiting` = rows that wait for a tap: Follow first, or the tap step of a follow-up). `clicked` and `answered` are the rows the two filters return; they overlap the outcomes, so do not add them to the rest."
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` (no `automations:read`), or `insufficient_permission`: the role of the key's creator (or the person behind the OAuth token) has neither the permission to create and schedule posts nor social inbox access, as in the dashboard"
          },
          "404": {
            "description": "Automation not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/automations/100000004/events?outcome=sent\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst events = await client.automations.listEvents(\"100000004\", { outcome: \"sent\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nevents = client.automations.list_events(\"100000004\", outcome=\"sent\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials automations:events 100000004 --outcome sent"
          }
        ]
      }
    },
    "/automations/{id}/results": {
      "get": {
        "operationId": "getAutomationResults",
        "x-required-scopes": [
          "automations:read"
        ],
        "summary": "Get automation results",
        "description": "The results of a comment-to-DM automation in a period, the numbers of the dashboard's Results tab: each step of the setup with its count (matched comments and messages, answers sent, button taps of Follow first or the tap step, links sent after the tap, follows after the ask, answers with a counted link button and the ones tapped, follow-ups sent and tapped, people who wrote back within 7 days, keywords matched as another form, public replies), all comments on the post in the period, why people got no DM, and the answers sent and link taps per day. Every number comes from the automation's events created in the period; the answer names no person (use `GET /automations/{id}/events` with `filter` for the people).",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "period",
            "description": "`7d`, `30d` (default) or `all` (since the automation was created, per week in `series`). Another value answers 400 `validation_error`.",
            "schema": {
              "type": "string",
              "enum": [
                "7d",
                "30d",
                "all"
              ],
              "default": "30d"
            }
          },
          {
            "in": "query",
            "name": "time_zone",
            "description": "The IANA time zone the days of `series` are counted in, e.g. `Europe/Amsterdam`. Default UTC; an unknown name counts in UTC (the answer's `time_zone` says which one was used).",
            "schema": {
              "type": "string",
              "example": "Europe/Amsterdam"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Results",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AutomationResults"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`validation_error`: `period` is not `7d`, `30d` or `all`"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` (no `automations:read`), or `insufficient_permission`: the role of the key's creator (or the person behind the OAuth token) has neither the permission to create and schedule posts nor social inbox access, as in the dashboard"
          },
          "404": {
            "description": "Automation not found"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/automations/100000004/results?period=7d&time_zone=Europe%2FAmsterdam\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst results = await client.automations.results(\"100000004\", { period: \"7d\", time_zone: \"Europe/Amsterdam\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nresults = client.automations.results(\"100000004\", period=\"7d\", time_zone=\"Europe/Amsterdam\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials automations:results 100000004 --period 7d --time-zone Europe/Amsterdam"
          }
        ]
      }
    },
    "/automations/{id}/events/{event_id}/story": {
      "get": {
        "operationId": "getAutomationStory",
        "x-required-scopes": [
          "automations:read"
        ],
        "summary": "Get one person's story",
        "description": "One person's whole story with the automation, the dashboard's person panel: what they commented or wrote, the post the comment is on, the DM the automation sends, and the DM conversation with them after it (the answer, the link, the follow-up, their replies and the team's). Take `event_id` from `GET /automations/{id}/events` (`filter=clicked` or `filter=answered` lists the people who tapped or wrote back). The DM texts (`messages`, and `said` for a DM or story reply) need the `inbox:read` scope (OAuth: the social inbox permission); without it they are `null` and the rest is returned.",
        "tags": [
          "Automations"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "event_id",
            "required": true,
            "description": "The event's `id` from `GET /automations/{id}/events`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The story",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/AutomationStory"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`validation_error`: `event_id` is not a number"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "`insufficient_scope` (no `automations:read`), or `insufficient_permission`: the role of the key's creator (or the person behind the OAuth token) has neither the permission to create and schedule posts nor social inbox access, as in the dashboard"
          },
          "404": {
            "description": "`not_found`: no such automation in the key's workspace, or the event is not one of its events"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/automations/<id>/events/<event_id>/story\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          }
        ]
      }
    },
    "/limits": {
      "get": {
        "operationId": "getLimits",
        "x-required-scopes": [],
        "summary": "List what OmniSocials cannot do",
        "description": "The things OmniSocials cannot do, why, and what to do instead: platform rules, features not built yet, features that work in the OmniSocials app only. Read it before you tell a person that something is not possible, so you can give the reason. When the person still wants a `requestable` entry, send a feature request with its `limit_id`. Works with every key; no scope needed.",
        "tags": [
          "Feature requests"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "platform",
            "schema": {
              "type": "string"
            },
            "description": "Only the entries for this platform (entries for every channel stay in)."
          },
          {
            "in": "query",
            "name": "area",
            "schema": {
              "type": "string",
              "enum": [
                "posts",
                "media",
                "inbox",
                "analytics",
                "automations",
                "accounts",
                "ads",
                "team",
                "other"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The entries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Limit"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_platform` or `invalid_area`"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/limits?platform=tiktok\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst { data } = await client.limits.list({ platform: \"tiktok\" });"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nlimits = client.limits.list(platform=\"tiktok\")"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials limits --platform tiktok"
          }
        ]
      }
    },
    "/feature-requests": {
      "post": {
        "operationId": "requestFeature",
        "x-required-scopes": [],
        "summary": "Send a feature request",
        "description": "Sends a feature request to the OmniSocials team for the person who owns the key (their name and email are stored with it so the team can answer). Send it only when the person asked for it. Write `summary` yourself: what the person wants to do and why, in one or two sentences; never a conversation. When the request matches an entry of GET /limits, pass its `limit_id`: a second person of the same organisation then adds a vote to the open request instead of a new one. The person sees the request in OmniSocials (Settings, Request a feature) and gets an email when its status changes. At most 10 requests an hour per person.",
        "tags": [
          "Feature requests"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "summary"
                ],
                "properties": {
                  "summary": {
                    "type": "string",
                    "minLength": 10,
                    "maxLength": 1000,
                    "description": "What the person wants to do and why, in one or two sentences."
                  },
                  "title": {
                    "type": "string",
                    "maxLength": 120,
                    "description": "A short name for the request. Made from the summary when left out."
                  },
                  "platform": {
                    "type": "string",
                    "description": "The platform it is about, when it is about one."
                  },
                  "area": {
                    "type": "string",
                    "enum": [
                      "posts",
                      "media",
                      "inbox",
                      "analytics",
                      "automations",
                      "accounts",
                      "ads",
                      "team",
                      "other"
                    ]
                  },
                  "limit_id": {
                    "type": "string",
                    "description": "The `id` of the GET /limits entry the request is about."
                  },
                  "source": {
                    "type": "string",
                    "enum": [
                      "mcp",
                      "api",
                      "cli"
                    ],
                    "description": "Where the request comes from. The MCP servers and the CLI set it; default `api`."
                  }
                }
              },
              "example": {
                "summary": "Post our daily update to the Announcements topic of our Telegram group, not to the whole group.",
                "platform": "telegram",
                "limit_id": "telegram.forum_topics"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "`outcome: already_requested`: this person already has an open request for it; `data` is that request."
          },
          "201": {
            "description": "Stored (`outcome: created`), or a vote added to the organisation's open request for the same gap (`outcome: voted`)",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "outcome": {
                      "type": "string",
                      "enum": [
                        "created",
                        "voted"
                      ]
                    },
                    "data": {
                      "$ref": "#/components/schemas/FeatureRequest"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_summary`, `invalid_title`, `invalid_platform`, `invalid_area` or `unknown_limit`"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "description": "`not_requestable`: the `limit_id` is a platform rule or a choice of OmniSocials, which a request cannot change. `error.limit` holds the entry; nothing was stored."
          },
          "429": {
            "description": "`too_many_requests`: 10 requests in the last hour"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl -X POST \"https://api.omnisocials.com/v1/feature-requests\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"summary\": \"Post our daily update to the Announcements topic of our Telegram group, not to the whole group.\",\n    \"limit_id\": \"telegram.forum_topics\"\n  }'"
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst { outcome, data } = await client.featureRequests.create({\n  summary: \"Post our daily update to the Announcements topic of our Telegram group, not to the whole group.\",\n  limit_id: \"telegram.forum_topics\",\n});"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nresult = client.feature_requests.create(\n    summary=\"Post our daily update to the Announcements topic of our Telegram group, not to the whole group.\",\n    limit_id=\"telegram.forum_topics\",\n)"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials feature:request --summary \"Post our daily update to the Announcements topic of our Telegram group.\" --limit-id telegram.forum_topics"
          }
        ]
      },
      "get": {
        "operationId": "listFeatureRequests",
        "x-required-scopes": [],
        "summary": "List your feature requests",
        "description": "The feature requests of the person who owns the key (sent from the app, the MCP server, the API or the CLI), newest first, at most 50, with their status and the team's replies.",
        "tags": [
          "Feature requests"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/FeatureRequest"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/feature-requests\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst { data } = await client.featureRequests.list();"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nrequests = client.feature_requests.list()"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials feature:list"
          }
        ]
      }
    },
    "/feature-requests/{id}": {
      "get": {
        "operationId": "getFeatureRequest",
        "x-required-scopes": [],
        "summary": "Get a feature request",
        "description": "One request of the person or their organisation, with its status and the team's replies.",
        "tags": [
          "Feature requests"
        ],
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/FeatureRequest"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`invalid_id`"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "description": "`not_found`"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "x-codeSamples": [
          {
            "lang": "shell",
            "label": "cURL",
            "source": "curl \"https://api.omnisocials.com/v1/feature-requests/412\" \\\n  -H \"Authorization: Bearer $OMNISOCIALS_API_KEY\""
          },
          {
            "lang": "js",
            "label": "Node.js",
            "source": "import { OmniSocials } from \"@omnisocials/sdk\";\n\nconst client = new OmniSocials(); // reads OMNISOCIALS_API_KEY\n\nconst { data } = await client.featureRequests.get(412);"
          },
          {
            "lang": "python",
            "label": "Python",
            "source": "from omnisocials import OmniSocials\n\nclient = OmniSocials()  # reads OMNISOCIALS_API_KEY\n\nrequest = client.feature_requests.get(412)"
          },
          {
            "lang": "bash",
            "label": "CLI",
            "source": "omnisocials feature:get 412"
          }
        ]
      }
    }
  }
}
