> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update a post's auto-plug

> Reply on a post automatically once it reaches a number of likes, reposts, replies or views.

> [!NOTE]
>
> Needs `posts:update`. See [Permissions](/docs/essentials/authentication.md#permissions).

An auto-plug is a reply PostSyncer posts on your post once it reaches a number you set, like a link to the menu after 50 likes. With `enabled: true`, send `name`, `reply_text` and at least one threshold (`likes`, `reposts`, `replies` or `views`) that is on with a `count` of 1 or more. Thresholds you leave out are off, and the first one reached sends the reply, once. `enabled: false` turns it off, and the post's `auto_plug` becomes `null`.

PostSyncer checks the numbers on X, Instagram, Facebook, LinkedIn, Threads, Bluesky and Mastodon, on the same schedule as post analytics, for up to 90 days after the post goes out. Auto-plug works on every plan. On Free, a post's numbers are read and kept once a day while it is 1 to 7 days old, if the owner used PostSyncer (the app, the API or MCP) in the last 14 days; its other reads are only for its plug, and their numbers aren't kept.

The answer is [the post object](/docs/api-reference/posts/object.md), with `auto_plug` as saved. You can also set it when you [create](/docs/api-reference/posts/create.md) or [update](/docs/api-reference/posts/update.md) the post.

## Errors

| Status | `error` | When | Retry? |
| - | - | - | - |
| 401 | | No API key, or not a valid one. | No: fix the key. |
| 403 | | The key lacks `posts:update`, or its user is inactive. | No: grant it in Settings → API. |
| 403 | | Your role in the post's workspace can't edit posts. | No. |
| 404 | | No post with that id in the workspaces the key can reach. | No. |
| 422 | | `name` or `reply_text` is missing, or no threshold is on with a count of 1 or more. | No: fix the request. |
| 429 | | More than 60 requests a minute. | Yes, after `Retry-After` seconds. |

## Related

* [The post object](/docs/api-reference/posts/object.md): `auto_plug` on a post.
* [Get a post](/docs/api-reference/posts/get.md): see a row's numbers.


## OpenAPI

````yaml PATCH /posts/{post}/auto-plug
openapi: 3.0.3
info:
  title: PostSyncer API
  description: >-
    Post to 12 social networks from your code: posts, media, comments,
    analytics, webhooks and more.
  version: 1.0.0
servers:
  - url: https://postsyncer.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: The workspaces the key can reach.
  - name: Accounts
    description: Connected social accounts, links to connect more, and disconnecting them.
  - name: Posts
    description: Drafts, scheduled and published posts, approvals and a post's history.
  - name: Post settings
    description: A post's auto-plug, comment moderation and contact collection.
  - name: Media
    description: >-
      The media library: file uploads, URL imports, and reading videos and
      social posts' files.
  - name: Folders
    description: Folders that organise the media library.
  - name: Comments
    description: >-
      Comments on your posts: reading, replying, editing, hiding, deleting and
      syncing them.
  - name: Reviews
    description: Google Business Profile reviews and your replies to them.
  - name: Analytics
    description: Workspace, account and post performance.
  - name: Brand
    description: >-
      A workspace's brand: identity, voice, look, accounts, competitors,
      learnings and rules.
  - name: Labels
    description: Labels used to tag posts.
  - name: Campaigns
    description: Campaigns used to group posts.
  - name: Snippets
    description: Saved snippets and hashtag groups to drop into posts.
  - name: Webhooks
    description: Signed webhook endpoints that get your notification events.
  - name: Billing
    description: >-
      The owner's plan, invoices and the links that pay for, change or cancel
      it.
  - name: Team
    description: A workspace's teammates and invitations, and their roles.
  - name: Notifications
    description: >-
      Your bell and notification settings, and the workspace's Slack, Discord
      and Telegram channels.
  - name: Blog-to-social
    description: Blog feeds that turn a workspace's new articles into posts.
  - name: Products
    description: Products the workspace's posts can promote.
  - name: Contacts
    description: People who commented on the workspace's posts, and the lists they are on.
  - name: Profile
    description: 'The key''s user: their name and sign-in email.'
  - name: API keys
    description: 'Your API keys: listing and deleting them.'
  - name: Agent sign-up
    description: >-
      An AI agent signs a person up with a code emailed to them, and gets their
      first key. No key needed.
paths:
  /posts/{post}/auto-plug:
    patch:
      tags:
        - Post settings
      summary: Update a post's auto-plug
      description: >-
        Needs `posts:update`. Turns the post's auto-plug on or off: a reply
        PostSyncer posts once the post reaches a number of likes, reposts,
        replies or views. It checks the numbers on X, Instagram, Facebook,
        LinkedIn, Threads, Bluesky and Mastodon for up to 90 days after
        publishing. On every plan.
      operationId: updatePostAutoPlug
      parameters:
        - name: post
          in: path
          required: true
          description: The post's id.
          schema:
            type: integer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              description: >-
                With `enabled: true` it needs `name`, `reply_text` and at least
                one threshold that is on with a count of 1 or more. `enabled:
                false` turns it off; nothing else is needed.
              required:
                - enabled
              properties:
                enabled:
                  type: boolean
                  description: >-
                    True to turn the plug on; false turns it off and takes
                    nothing else.
                id:
                  type: string
                  description: Your id for the plug. One is made when left out.
                name:
                  type: string
                  description: A name for the plug. Needed when `enabled` is true.
                is_default:
                  type: boolean
                  default: false
                reply_text:
                  type: string
                  description: The reply to post. Needed when `enabled` is true.
                likes:
                  $ref: '#/components/schemas/PostAutoPlugThresholdInput'
                reposts:
                  $ref: '#/components/schemas/PostAutoPlugThresholdInput'
                replies:
                  $ref: '#/components/schemas/PostAutoPlugThresholdInput'
                views:
                  $ref: '#/components/schemas/PostAutoPlugThresholdInput'
            examples:
              default:
                summary: Reply at 50 likes
                value:
                  enabled: true
                  id: spring-menu
                  name: Menu link
                  reply_text: 'The full spring menu: https://haldencoffee.example/menu'
                  likes:
                    enabled: true
                    count: 50
              'off':
                summary: Turn it off
                value:
                  enabled: false
      responses:
        '200':
          description: The post, with the setting saved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Post'
              examples:
                default:
                  summary: Auto-plug on
                  value:
                    id: 4182
                    content:
                      - text: >-
                          Our spring menu starts today. The lavender oat latte
                          is back, and so is the rhubarb bun.
                        media:
                          - id: 9051
                            workspace_id: 12
                            folder_id: null
                            name: latte-art.jpg
                            url: https://cdn.postsyncer.com/examples/latte-art.jpg
                            thumb_url: >-
                              https://cdn.postsyncer.com/examples/latte-art-thumb.jpg
                            medium_url: >-
                              https://cdn.postsyncer.com/examples/latte-art-medium.jpg
                            mime_type: image/jpeg
                            size: 482113
                            is_processing: false
                            type: image
                            ai_generated_id: null
                            is_reference: false
                            progress: 100
                            alt: Latte art in a blue cup
                            duration_seconds: null
                        cover_image: null
                        is_first_comment: false
                        first_comment_delay: null
                      - text: Find us at 14 Mill Lane, open 7 to 4 every day.
                        media: []
                        cover_image: null
                        is_first_comment: true
                        first_comment_delay: 1
                    status: SCHEDULED
                    content_version: 1
                    posted_on: []
                    scheduled_at: 2030-03-15 09:00
                    repeatable: false
                    repeatable_times: null
                    repeatable_gap: null
                    repeatable_gap_unit: null
                    repeatable_accounts: null
                    remaining_posts: null
                    comments_settings: null
                    contact_collection_settings: null
                    created_at: 2030-03-01 10:24
                    updated_at: 2030-03-02 11:10
                    workspace:
                      id: 12
                      owner_id: 7
                      name: Halden Coffee
                      type: BRAND
                      logo: >-
                        https://cdn.postsyncer.com/examples/halden-coffee-logo.png
                      timezone: Europe/London
                      queue_slot:
                        '09:00':
                          time_24: '09:00'
                          time_12: 9:00 am
                          days:
                            - true
                            - true
                            - true
                            - true
                            - true
                            - false
                            - false
                      is_auto_repost_enabled_by_default: false
                      auto_repost_settings:
                        repeatable_gap: 6
                        repeatable_gap_unit: hours
                        repeatable_times: 2
                      is_auto_plug_enabled_by_default: false
                      auto_plug_settings: []
                      comments_settings:
                        remove_profanity: false
                        remove_negativity: false
                        remove_all_comments: false
                        remove_custom_topics: false
                        custom_topics_list: []
                        remove_urls: false
                        remove_emails: false
                        remove_phones: false
                        remove_mentions: false
                        mentions_list: []
                        remove_hashtags: false
                        hashtags_list: []
                        remove_keywords: false
                        keywords_list: []
                        ai_reply: false
                      is_comment_moderation_enabled: false
                      credits: 240
                    labels: []
                    campaign: null
                    platforms:
                      - platform: instagram
                        account_id: 301
                        posted_on: []
                        status: PENDING
                        settings:
                          post_type: POST
                          caption: null
                          reel_trial_enabled: false
                          graduation_strategy: MANUAL
                          collaborators: []
                        notes: []
                      - platform: linkedin
                        account_id: 302
                        posted_on: []
                        status: PENDING
                        settings:
                          visibility: PUBLIC
                          link: null
                          title: null
                        notes: []
                    auto_plug:
                      id: spring-menu
                      name: Menu link
                      is_default: false
                      reply_text: 'The full spring menu: https://haldencoffee.example/menu'
                      likes:
                        enabled: true
                        count: 50
                      reposts:
                        enabled: false
                        count: 0
                      replies:
                        enabled: false
                        count: 0
                      views:
                        enabled: false
                        count: 0
        '401':
          $ref: '#/components/responses/Unauthorized401'
        '403':
          description: >-
            The key lacks `posts:update`, its user is inactive, or your role in
            the post's workspace can't edit posts.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_permission:
                  summary: The key lacks posts:update
                  value:
                    message: >-
                      This API key does not have the "posts:update" permission.
                      Edit the key in PostSyncer under Settings → API to grant
                      it.
                role:
                  summary: The role can't edit posts
                  value:
                    message: >-
                      Your role in the workspace "Halden Coffee" does not allow
                      you to edit posts. Ask the workspace owner or a manager to
                      do it, or to change your role.
                inactive_account:
                  summary: The key's user is inactive
                  value:
                    message: Your account is inactive.
        '404':
          $ref: '#/components/responses/NotFound404'
        '422':
          description: The request didn't pass validation, and nothing changed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                no_threshold:
                  summary: No threshold is on
                  value:
                    message: >-
                      Turn on at least one threshold (likes, reposts, replies or
                      views) with a count of 1 or more: with none, the plug
                      never replies.
                    errors:
                      thresholds:
                        - >-
                          Turn on at least one threshold (likes, reposts,
                          replies or views) with a count of 1 or more: with
                          none, the plug never replies.
                reply_text_missing:
                  summary: reply_text is missing
                  value:
                    message: The reply text field is required when enabled is true.
                    errors:
                      reply_text:
                        - The reply text field is required when enabled is true.
        '429':
          $ref: '#/components/responses/RateLimited429'
components:
  schemas:
    PostAutoPlugThresholdInput:
      type: object
      description: One threshold. Left out, it's off.
      properties:
        enabled:
          type: boolean
          default: false
        count:
          type: integer
          minimum: 0
          description: The number that fires the reply. Needed when `enabled` is true.
    Post:
      type: object
      description: >-
        A post: its text and media, when it goes out, and one row per account it
        goes to (`platforms`). Times are in the workspace's timezone, as `Y-m-d
        H:i`.
      required:
        - id
        - content
        - status
        - content_version
        - posted_on
        - scheduled_at
        - repeatable
        - repeatable_times
        - repeatable_gap
        - repeatable_gap_unit
        - repeatable_accounts
        - remaining_posts
        - comments_settings
        - contact_collection_settings
        - created_at
        - updated_at
        - workspace
        - labels
        - campaign
        - platforms
        - auto_plug
      properties:
        id:
          type: integer
          description: The post's id.
        content:
          type: array
          description: >-
            The post's parts, in order. One part is a single post; more parts
            make a thread on X, Threads, Bluesky and Mastodon (the other
            networks get the parts joined into one text, with two blank lines
            between them, the first comment left out). A part with
            `is_first_comment` is the first comment.
          items:
            $ref: '#/components/schemas/PostContent'
        status:
          type: string
          enum:
            - DRAFT
            - SCHEDULED
            - PENDING_APPROVAL
            - IN_QUEUE
            - IN_PROGRESS
            - PUBLISHED
            - PARTIALLY_FAILED
            - FAILED
            - REJECTED
          description: >-
            Where the post stands. `DRAFT`: saved, not going out. `SCHEDULED`:
            goes out at `scheduled_at`. `PENDING_APPROVAL`: waiting for someone
            to approve it. `IN_QUEUE`: published now and waiting its turn.
            `IN_PROGRESS`: being sent. `PUBLISHED`: out on every account.
            `PARTIALLY_FAILED`: out on some accounts, failed on others.
            `FAILED`: failed on every account. `REJECTED`: its approval was
            turned down.
        content_version:
          type: integer
          description: >-
            Goes up by one each time the post's content is saved. Send it back
            on [Update a post](/api-reference/posts/update) to be refused
            (`409`) instead of overwriting a change made elsewhere since you
            read it.
        posted_on:
          type: array
          items:
            type: string
          description: >-
            When it went out, one entry a time (a repeating post has several).
            `[]` until it is published.
        scheduled_at:
          type: string
          nullable: true
          description: >-
            When it goes out (or went out), in the workspace's timezone. Null
            when the post has no time yet: a draft with none, or a post sent for
            approval with none, where the approver picks when it goes out. API
            v1 and MCP never save a `SCHEDULED` post without one.
        repeatable:
          type: boolean
          nullable: true
          description: True when the post repeats. `false` or `null` when it doesn't.
        repeatable_times:
          type: integer
          nullable: true
          description: How many times it repeats after the first time.
        repeatable_gap:
          type: integer
          nullable: true
          description: Time between repeats, in `repeatable_gap_unit`.
        repeatable_gap_unit:
          type: string
          nullable: true
          enum:
            - minutes
            - hours
            - days
            - weeks
            - months
            - null
          description: The unit of `repeatable_gap`.
        repeatable_accounts:
          type: array
          nullable: true
          items:
            type: integer
          description: >-
            The accounts the repeats go to; null or `[]` for every account of
            the post.
        remaining_posts:
          type: integer
          nullable: true
          description: Sends still to go, the first one included until it goes out.
        comments_settings:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/PostCommentModeration'
          description: >-
            The post's comment moderation; null when it was never set. Change it
            with [Update comment
            moderation](/api-reference/posts/comment-moderation).
        contact_collection_settings:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/PostContactCollection'
          description: >-
            The post's contact collection; null when it was never set. Change it
            with [Update contact
            collection](/api-reference/posts/contact-collection).
        created_at:
          type: string
          description: When the post was made, in the workspace's timezone.
        updated_at:
          type: string
          description: When the post last changed, in the workspace's timezone.
        workspace:
          allOf:
            - $ref: '#/components/schemas/Workspace'
          description: >-
            The post's workspace. It has no `accounts` or `brand_voice` here:
            [List workspaces](/api-reference/workspaces/list) has those.
        labels:
          type: array
          items:
            $ref: '#/components/schemas/PostLabel'
          description: The post's labels; `[]` when it has none.
        campaign:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Campaign'
          description: The post's campaign, or null.
        platforms:
          type: array
          items:
            $ref: '#/components/schemas/PlatformPost'
          description: >-
            One row per account the post goes to, in the order the accounts were
            added. A draft with no accounts has `[]`.
        auto_plug:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/PostAutoPlug'
          description: >-
            The reply posted when the post reaches a number of likes, reposts,
            replies or views; null when it's off. Change it with [Update
            auto-plug](/api-reference/posts/auto-plug).
        comments:
          type: array
          items:
            $ref: '#/components/schemas/APIComment'
          description: >-
            Only with `include_comments=true`: the post's comments, with their
            contact.
      example:
        id: 4182
        content:
          - text: >-
              Our spring menu starts today. The lavender oat latte is back, and
              so is the rhubarb bun.
            media:
              - id: 9051
                workspace_id: 12
                folder_id: null
                name: latte-art.jpg
                url: https://cdn.postsyncer.com/examples/latte-art.jpg
                thumb_url: https://cdn.postsyncer.com/examples/latte-art-thumb.jpg
                medium_url: https://cdn.postsyncer.com/examples/latte-art-medium.jpg
                mime_type: image/jpeg
                size: 482113
                is_processing: false
                type: image
                ai_generated_id: null
                is_reference: false
                progress: 100
                alt: Latte art in a blue cup
                duration_seconds: null
            cover_image: null
            is_first_comment: false
            first_comment_delay: null
          - text: Find us at 14 Mill Lane, open 7 to 4 every day.
            media: []
            cover_image: null
            is_first_comment: true
            first_comment_delay: 1
        status: PUBLISHED
        content_version: 1
        posted_on:
          - 2030-03-15 09:00
        scheduled_at: 2030-03-15 09:00
        repeatable: false
        repeatable_times: null
        repeatable_gap: null
        repeatable_gap_unit: null
        repeatable_accounts: null
        remaining_posts: null
        comments_settings: null
        contact_collection_settings: null
        created_at: 2030-03-01 10:24
        updated_at: 2030-03-15 09:01
        workspace:
          id: 12
          owner_id: 7
          name: Halden Coffee
          type: BRAND
          logo: https://cdn.postsyncer.com/examples/halden-coffee-logo.png
          timezone: Europe/London
          queue_slot:
            '09:00':
              time_24: '09:00'
              time_12: 9:00 am
              days:
                - true
                - true
                - true
                - true
                - true
                - false
                - false
          is_auto_repost_enabled_by_default: false
          auto_repost_settings:
            repeatable_gap: 6
            repeatable_gap_unit: hours
            repeatable_times: 2
          is_auto_plug_enabled_by_default: false
          auto_plug_settings: []
          comments_settings:
            remove_profanity: false
            remove_negativity: false
            remove_all_comments: false
            remove_custom_topics: false
            custom_topics_list: []
            remove_urls: false
            remove_emails: false
            remove_phones: false
            remove_mentions: false
            mentions_list: []
            remove_hashtags: false
            hashtags_list: []
            remove_keywords: false
            keywords_list: []
            ai_reply: false
          is_comment_moderation_enabled: false
          credits: 240
        labels: []
        campaign: null
        platforms:
          - platform: instagram
            account_id: 301
            posted_on:
              - 2030-03-15 09:00
            status: PUBLISHED
            settings:
              post_type: POST
              caption: null
              reel_trial_enabled: false
              graduation_strategy: MANUAL
              collaborators: []
            notes: []
            analytics:
              comments: 12
              likes: 248
              shares: 9
              impressions: 3120
              quotes: null
              saves: 31
              views: null
              reach: 2870
              clicks: null
              profile_visits: 44
              engagement_rate: 9.62
              pending: false
              synced_at: '2030-03-16T09:00:00+00:00'
            post_url: https://www.instagram.com/p/DHk2mQ7sLtA/
          - platform: linkedin
            account_id: 302
            posted_on:
              - 2030-03-15 09:00
            status: PUBLISHED
            settings:
              visibility: PUBLIC
              link: null
              title: null
            notes: []
            analytics:
              comments: 7
              likes: 64
              shares: 5
              impressions: 1850
              quotes: null
              saves: 3
              views: 0
              reach: 1400
              clicks: 41
              profile_visits: 12
              engagement_rate: 6.49
              pending: false
              synced_at: '2030-03-16T09:00:00+00:00'
            post_url: >-
              https://www.linkedin.com/feed/update/urn:li:share:7306000000000000001/
        auto_plug: null
    Error:
      type: object
      description: >-
        An error answer. Every one has `message`, in plain words; some add an
        `error` code and fields of their own.
      required:
        - message
      properties:
        message:
          type: string
          description: What went wrong and what to do about it.
        error:
          type: string
          description: >-
            A code a few errors add, such as `rate_limited`. See [Handle
            errors](/essentials/error-handling#answers-with-an-error-code).
    ValidationError:
      type: object
      description: '422: the request didn''t pass validation, and nothing changed.'
      required:
        - message
        - errors
      properties:
        message:
          type: string
          description: >-
            The first error and, when there are more, how many: `(and 1 more
            error)`, `(and 2 more errors)`.
        errors:
          type: object
          description: >-
            The messages, by field. A field inside a list is named with dots:
            `accounts.0.id`.
          additionalProperties:
            type: array
            items:
              type: string
    PostContent:
      type: object
      description: One part of a post.
      required:
        - text
        - media
        - cover_image
        - is_first_comment
        - first_comment_delay
      properties:
        text:
          type: string
          nullable: true
          description: The text, as saved (LinkedIn tags included).
        media:
          type: array
          items:
            $ref: '#/components/schemas/APIMedia'
          description: The part's files, in order. `[]` when it has none.
        cover_image:
          type: object
          nullable: true
          description: The video cover, or null. Only the first part's is used.
          required:
            - thumbnail
            - video_cover_timestamp_ms
          properties:
            thumbnail:
              type: object
              nullable: true
              allOf:
                - $ref: '#/components/schemas/APIMedia'
              description: >-
                The cover picture (YouTube, Facebook, and Instagram Reels), or
                null.
            video_cover_timestamp_ms:
              type: integer
              nullable: true
              description: >-
                The video frame used as the cover, in milliseconds (TikTok,
                Instagram), or null.
        is_first_comment:
          type: boolean
          description: True for the part posted as the first comment.
        first_comment_delay:
          type: integer
          nullable: true
          description: >-
            Minutes after publishing that the first comment goes out; null on
            other parts.
    PostCommentModeration:
      type: object
      description: >-
        Comment moderation on the post: the rules that remove comments as they
        come in.
      required:
        - enabled
        - settings
      properties:
        enabled:
          type: boolean
        settings:
          type: object
          properties:
            remove_profanity:
              type: boolean
              description: Remove comments with swearing.
            remove_negativity:
              type: boolean
              description: Remove negative comments.
            remove_all_comments:
              type: boolean
              description: Remove every comment.
            remove_custom_topics:
              type: boolean
              description: Remove comments about the topics in `custom_topics_list`.
            custom_topics_list:
              type: array
              items:
                type: string
              description: The topics for `remove_custom_topics`. Needed when it's on.
            remove_urls:
              type: boolean
              description: Remove comments with links.
            remove_emails:
              type: boolean
              description: Remove comments with email addresses.
            remove_phones:
              type: boolean
              description: Remove comments with phone numbers.
            remove_mentions:
              type: boolean
              description: Remove comments that mention someone.
            mentions_list:
              type: array
              items:
                type: string
              description: The handles `remove_mentions` looks for; empty for any mention.
            remove_hashtags:
              type: boolean
              description: Remove comments with hashtags.
            hashtags_list:
              type: array
              items:
                type: string
              description: The hashtags `remove_hashtags` looks for; empty for any hashtag.
            remove_keywords:
              type: boolean
              description: Remove comments with the words in `keywords_list`.
            keywords_list:
              type: array
              items:
                type: string
              description: The words for `remove_keywords`. Needed when it's on.
            ai_reply:
              type: boolean
              description: Reply to comments with AI.
          required:
            - remove_profanity
            - remove_negativity
            - remove_all_comments
            - remove_custom_topics
            - custom_topics_list
            - remove_urls
            - remove_emails
            - remove_phones
            - remove_mentions
            - mentions_list
            - remove_hashtags
            - hashtags_list
            - remove_keywords
            - keywords_list
            - ai_reply
    PostContactCollection:
      type: object
      description: >-
        Contact collection on the post: people who comment are added to CRM
        lists.
      required:
        - enabled
        - settings
      properties:
        enabled:
          type: boolean
        settings:
          type: object
          required:
            - mode
            - list_id
            - keyword_rules
            - keyword_case_sensitive
          properties:
            mode:
              type: string
              nullable: true
              enum:
                - keyword_rules
                - add_all
                - null
              description: >-
                `add_all`: everyone who comments goes to `list_id`.
                `keyword_rules`: a comment with a rule's keyword goes to that
                rule's list.
            list_id:
              type: integer
              nullable: true
              description: The list for `add_all`.
            keyword_rules:
              type: array
              items:
                $ref: '#/components/schemas/PostContactKeywordRule'
            keyword_case_sensitive:
              type: boolean
              description: >-
                True: a keyword matches only with the same upper and lower case,
                so `Coffee` doesn't match `coffee`. False: case is ignored.
    Workspace:
      type: object
      description: A workspace the key can reach.
      required:
        - id
        - owner_id
        - name
        - type
        - logo
        - timezone
        - queue_slot
        - is_auto_repost_enabled_by_default
        - auto_repost_settings
        - is_auto_plug_enabled_by_default
        - auto_plug_settings
        - comments_settings
        - is_comment_moderation_enabled
        - credits
      properties:
        id:
          type: integer
          description: The workspace's id. Other routes take it as `workspace_id`.
        owner_id:
          type: integer
          description: >-
            The id of the user who owns the workspace. Their plan sets the
            workspace's limits.
        name:
          type: string
        type:
          type: string
          enum:
            - PERSONAL
            - TEAM
            - ORGANIZATION
            - CLIENT
            - PROJECT
            - DEPARTMENT
            - EVENT
            - TEMPORARY
            - COMMUNITY
            - BRAND
            - AGENCY
          description: What the workspace is for, as picked when it was made.
        logo:
          type: string
          description: The logo, or an avatar made from the name when there is none.
        timezone:
          type: string
          description: >-
            The workspace's time zone, an IANA name like `Europe/London`. Post
            times are in it.
        queue_slot:
          description: >-
            The posting queue's times, keyed by the 24-hour time. `days` has 7
            entries, Monday first: true when the time is used that day. A
            workspace with no queue times has `[]`, an empty list, not an
            object.
          oneOf:
            - type: object
              title: Queue times
              additionalProperties:
                type: object
                required:
                  - time_24
                  - time_12
                  - days
                properties:
                  time_24:
                    type: string
                    description: The time, like `08:30`.
                  time_12:
                    type: string
                    description: The same time on a 12-hour clock, like `8:30 am`.
                  days:
                    type: array
                    minItems: 7
                    maxItems: 7
                    items:
                      type: boolean
            - type: array
              title: No queue times
              maxItems: 0
              items: {}
        is_auto_repost_enabled_by_default:
          type: boolean
          description: >-
            Whether posts made in the PostSyncer app repeat by default, with
            `auto_repost_settings`. Posts made through the API or MCP don't take
            this default: send `repeatable` and its fields yourself.
        auto_repost_settings:
          type: object
          description: >-
            How auto-repost repeats a post. Without settings of its own a
            workspace has 6 hours and 2 times.
          properties:
            repeatable_gap:
              type: integer
              description: The wait between reposts, in `repeatable_gap_unit`.
            repeatable_gap_unit:
              type: string
              description: The unit of `repeatable_gap`, like `hours`.
            repeatable_times:
              type: integer
              description: How many times the post goes out again.
        is_auto_plug_enabled_by_default:
          type: boolean
          description: >-
            Whether posts made in the PostSyncer app get the default auto-plug
            from `auto_plug_settings`. Posts made through the API or MCP don't
            take this default: send `auto_plug` yourself.
        auto_plug_settings:
          type: array
          description: >-
            The workspace's auto-plugs: a reply posted when a post reaches a
            number of likes, reposts, replies or views. `[]` when there are
            none.
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              is_default:
                type: boolean
                description: >-
                  True for the auto-plug new posts get when
                  `is_auto_plug_enabled_by_default` is on.
              reply_text:
                type: string
                description: The reply posted.
              likes:
                $ref: '#/components/schemas/WorkspaceAutoPlugTrigger'
              reposts:
                $ref: '#/components/schemas/WorkspaceAutoPlugTrigger'
              replies:
                $ref: '#/components/schemas/WorkspaceAutoPlugTrigger'
              views:
                $ref: '#/components/schemas/WorkspaceAutoPlugTrigger'
        comments_settings:
          type: object
          description: >-
            The comment moderation rules: what to remove, and whether AI replies
            are on. Each `remove_…` is true when that kind of comment is
            removed; the `…_list` fields hold the topics, mentions, hashtags and
            keywords to look for.
          properties:
            remove_profanity:
              type: boolean
            remove_negativity:
              type: boolean
            remove_all_comments:
              type: boolean
            remove_custom_topics:
              type: boolean
            custom_topics_list:
              type: array
              items:
                type: string
            remove_urls:
              type: boolean
            remove_emails:
              type: boolean
            remove_phones:
              type: boolean
            remove_mentions:
              type: boolean
            mentions_list:
              type: array
              items:
                type: string
            remove_hashtags:
              type: boolean
            hashtags_list:
              type: array
              items:
                type: string
            remove_keywords:
              type: boolean
            keywords_list:
              type: array
              items:
                type: string
            ai_reply:
              type: boolean
              description: Whether AI replies to comments.
        is_comment_moderation_enabled:
          type: boolean
          description: Whether comment moderation is on.
        accounts:
          type: array
          description: >-
            Only in List workspaces: the workspace's connected accounts, as
            [List accounts](/api-reference/accounts/list) gives them but without
            `boards`.
          items:
            $ref: '#/components/schemas/Account'
        brand_voice:
          type: string
          nullable: true
          description: >-
            Only in List workspaces: how the workspace sounds, in one line of up
            to 200 characters, from its brand. Null when the brand has no voice
            yet. [Get brand](/api-reference/brand/get) has the whole brand.
        credits:
          type: integer
          description: >-
            The AI credits the workspace owner has left. Every member's key sees
            the owner's credits: AI work in the workspace spends them.
    PostLabel:
      type: object
      description: >-
        A label as a post carries it: no `workspace`. [Get a
        label](/api-reference/labels/get) has the whole label.
      required:
        - id
        - name
        - color
      properties:
        id:
          type: integer
        name:
          type: string
        color:
          type: string
          description: A hex color, like `#0EA5E9`.
    Campaign:
      type: object
      description: A campaign that groups posts.
      required:
        - id
        - name
        - status
        - start_date
        - end_date
        - description
        - workspace
      properties:
        id:
          type: integer
          description: The campaign's id. Send it as a post's `campaign_id`.
        name:
          type: string
          maxLength: 255
        status:
          type: string
          enum:
            - DRAFT
            - SCHEDULED
            - ACTIVE
            - COMPLETED
            - CANCELLED
          description: >-
            `SCHEDULED` until `start_date`, `ACTIVE` until `end_date`, then
            `COMPLETED`: these follow the dates when the campaign is read.
            `DRAFT` and `CANCELLED` are holds set on the campaign, which stay
            until it is changed. The status only describes the campaign: it
            doesn't hold back or send its posts.
        start_date:
          type: string
          description: When it starts, in the workspace's timezone, as `Y-m-d H:i`.
        end_date:
          type: string
          description: When it ends, in the workspace's timezone, as `Y-m-d H:i`.
        description:
          type: string
          nullable: true
          maxLength: 255
        workspace:
          allOf:
            - $ref: '#/components/schemas/Workspace'
          description: >-
            The campaign's workspace, as [List
            workspaces](/api-reference/workspaces/list) gives it, with no
            `accounts` or `brand_voice`.
    PlatformPost:
      type: object
      description: >-
        The post on one account. `progress`, `error_message`, `analytics` and
        `post_url` appear only in the statuses named.
      required:
        - platform
        - posted_on
        - status
        - settings
        - notes
      properties:
        platform:
          type: string
          enum:
            - twitter
            - instagram
            - facebook
            - linkedin
            - youtube
            - tiktok
            - pinterest
            - threads
            - telegram
            - bluesky
            - mastodon
            - google_business
          description: The network.
        account_id:
          type: integer
          nullable: true
          description: >-
            The account this row posts to. Null only for an old row whose
            account was removed.
        posted_on:
          type: array
          items:
            type: string
          description: When it went out on this account, in the workspace's timezone.
        status:
          type: string
          enum:
            - PENDING
            - IN_PROGRESS
            - PUBLISHED
            - FAILED
          description: >-
            `PENDING`: not sent yet. `IN_PROGRESS`: being sent now. `PUBLISHED`:
            live on the network. `FAILED`: the last try failed (`error_message`
            says why).
        settings:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            This account's options, as sent in `accounts[].settings`, with the
            platform's defaults filled in. When the account posts its own media,
            `settings.media` lists those files as media objects. You can send
            them back unchanged.
        notes:
          type: array
          items:
            $ref: '#/components/schemas/PublishNote'
          description: What went partly wrong in a published result. `[]` when nothing did.
        progress:
          type: object
          nullable: true
          description: >-
            Only while `IN_PROGRESS`: what the account is doing, or null while
            it is simply posting. Read the post again to follow it.
          required:
            - stage
            - message
          properties:
            stage:
              type: string
              enum:
                - preparing_video
            message:
              type: string
              description: Like "Preparing video for TikTok".
        error_message:
          type: string
          nullable: true
          description: 'Only when `FAILED`: the network''s reason for the last try, in words.'
        analytics:
          $ref: '#/components/schemas/PlatformPostAnalytics'
        post_url:
          type: string
          description: >-
            Only when `PUBLISHED`: the post on the network, when the network
            gives a link.
    PostAutoPlug:
      type: object
      description: >-
        A reply posted on the post once it reaches any one of the thresholds
        that are on.
      required:
        - id
        - name
        - is_default
        - reply_text
        - likes
        - reposts
        - replies
        - views
      properties:
        id:
          type: string
        name:
          type: string
        is_default:
          type: boolean
        reply_text:
          type: string
        likes:
          $ref: '#/components/schemas/PostAutoPlugThreshold'
        reposts:
          $ref: '#/components/schemas/PostAutoPlugThreshold'
        replies:
          $ref: '#/components/schemas/PostAutoPlugThreshold'
        views:
          $ref: '#/components/schemas/PostAutoPlugThreshold'
    APIComment:
      type: object
      description: >-
        A comment on a post: from a network (`source: SOCIAL`), or written in
        PostSyncer (team, approval and share-link comments). `mentions`,
        `media`, `replies` and `user` are left out of a reply's
        `parent_comment`.
      required:
        - id
        - user_id
        - crm_contact_id
        - post_id
        - platform_post_id
        - parent_comment_id
        - source
        - comment_url
        - platform
        - platform_post_comment_id
        - author_name
        - author_avatar_url
        - content
        - moderation_message
        - moderation_reason
        - is_resolved
        - is_approved
        - is_deleted_on_platform
        - is_hidden_on_platform
        - media_hidden_by_platform
        - needs_reply
        - quote
        - anchor
        - account_id
        - account
        - likes_count
        - created_at
        - updated_at
      properties:
        id:
          type: integer
        user_id:
          type: integer
          nullable: true
          description: >-
            The PostSyncer member behind it: who wrote a team comment or a reply
            sent from PostSyncer (an auto-reply has the post's author, or the
            workspace owner). On a comment read from a network, the member who
            connected the account when the connected account itself wrote it.
            Null on other people's comments from a network and on a client's
            share-link comment.
        crm_contact_id:
          type: integer
          nullable: true
          description: >-
            The CRM contact saved for the commenter of a comment read from a
            network, whatever contact collection is set to. Null on team,
            approval and share-link comments, on replies sent from PostSyncer,
            and when the network withheld the author.
        post_id:
          type: integer
        platform_post_id:
          type: integer
          nullable: true
          description: >-
            The post's copy on one account (a `platforms[].id` of the post) that
            the comment is on. Null on team, approval and share-link comments.
        parent_comment_id:
          type: integer
          nullable: true
          description: The comment this one answers; null on a top-level comment.
        source:
          type: string
          enum:
            - SOCIAL
            - INTERNAL
            - APPROVAL
            - PUBLIC_SHARE
          description: >-
            `SOCIAL`: from a network, or a reply to one sent from PostSyncer.
            `INTERNAL`: a team comment, which stays in PostSyncer. `APPROVAL`: a
            note left when approving or asking for changes. `PUBLIC_SHARE`: a
            client's comment on the post's share link.
        comment_url:
          type: string
          nullable: true
          description: >-
            A link to the comment, or to the post it is on, on the network. Null
            when the network gives none.
        platform:
          type: string
          nullable: true
          description: >-
            The network, like `instagram`. Null on team, approval and share-link
            comments.
        platform_post_comment_id:
          type: string
          nullable: true
          description: >-
            The comment's id on the network. Null on a reply that hasn't gone
            out yet, and on comments that stay in PostSyncer.
        author_name:
          type: string
          nullable: true
          description: >-
            The member's name when a member wrote it; else the name or handle
            the network gives.
        author_avatar_url:
          type: string
          nullable: true
        content:
          type: string
          nullable: true
          description: >-
            The text. Null on a comment with only media. An Instagram comment
            with a picture Instagram doesn't share has `""`: see
            `media_hidden_by_platform`.
        moderation_message:
          type: string
          nullable: true
          description: What moderation did, in words.
        moderation_reason:
          type: string
          nullable: true
          description: >-
            Why moderation acted on the comment. On a comment moderation removed
            (is_deleted_on_platform true), the rule it broke:
            remove_all_comments, urls_detected, emails_detected,
            phone_numbers_detected, mentions_detected, hashtags_detected,
            keywords_detected, profanity_detected, negativity_detected or
            custom_topics_detected. On a reply the auto-reply sent:
            ai_reply_generated. Null when moderation did nothing, as on a
            comment its author deleted.
        is_resolved:
          type: boolean
          nullable: true
          description: >-
            The thread is marked resolved. Null only in the answer to [Create a
            comment](/api-reference/comments/create) when the request left it
            out; it is stored as `false`.
        is_approved:
          type: boolean
          nullable: true
          description: >-
            A flag of your own, set when the comment was created. Null when it
            wasn't set.
        is_deleted_on_platform:
          type: boolean
          nullable: true
          description: >-
            Removed on the network: deleted from PostSyncer (on YouTube, someone
            else's comment is rejected, which can't be undone), by moderation,
            or by its author. On Bluesky, a delete or moderation also marks
            someone else's reply `true`, though it stays up there. Null only in
            the answer to Create a comment.
        is_hidden_on_platform:
          type: boolean
          nullable: true
          description: >-
            Hidden on the network: by Hide, by moderation, or by a delete on X
            or Threads, which hide instead of deleting someone else's comment.
            Null only in the answer to Create a comment.
        media_hidden_by_platform:
          type: boolean
          description: >-
            Instagram: the comment holds a GIF, sticker or photo Instagram
            doesn't share. Instagram sends such a comment with no text, so its
            content is "" (an empty string) and its media is []. False on every
            other comment.
        needs_reply:
          type: boolean
          description: >-
            A top-level social comment that asks something (?, ؟ or ？), is not
            hidden or deleted, and has no reply from the workspace yet. A reply
            counts as the workspace's when it was sent from PostSyncer or
            written by the connected account in the network's own app.
        quote:
          type: string
          nullable: true
          description: 'Team comments: the words of the post this comment is about.'
        anchor:
          type: object
          nullable: true
          description: 'Team comments: where the quoted words are.'
          required:
            - thread
            - network
          properties:
            thread:
              type: integer
              description: 'The content item: 0 is the post.'
            network:
              type: string
              nullable: true
              description: >-
                The network whose own text holds the words; null for the post's
                text.
        mentions:
          type: array
          description: >-
            Team comments: the people it tags. Picture and name only, never an
            email.
          items:
            type: object
            required:
              - id
              - name
              - avatar
            properties:
              id:
                type: integer
              name:
                type: string
              avatar:
                type: string
                nullable: true
                description: A link to their picture; null when they have none.
        account_id:
          type: integer
          nullable: true
          description: >-
            A social comment: which of the post's connected accounts it is on,
            the one a reply to it is sent as. Null on team, client and approval
            comments.
        account:
          type: object
          nullable: true
          description: The account `account_id` names. Null with it.
          required:
            - id
            - name
            - username
            - avatar
          properties:
            id:
              type: integer
            name:
              type: string
              nullable: true
            username:
              type: string
              nullable: true
            avatar:
              type: string
              nullable: true
        likes_count:
          type: integer
          nullable: true
          description: >-
            The likes the network counted when PostSyncer last read the comment.
            Null when not known: team and client comments, replies sent from
            PostSyncer, Instagram and Threads.
        created_at:
          type: string
          format: date-time
          description: UTC, ISO 8601.
        updated_at:
          type: string
          format: date-time
          description: UTC, ISO 8601.
        parent_comment:
          type: object
          nullable: true
          allOf:
            - $ref: '#/components/schemas/APIComment'
          description: >-
            Get, create and update only: the comment this one answers, without
            its `mentions`, `media`, `replies` or `user`. Null on a top-level
            comment.
        replies:
          type: array
          description: >-
            The answers to it, nested up to five levels. On a list with
            `include_replies=false` it is left out.
          items:
            $ref: '#/components/schemas/APIComment'
        media:
          type: array
          description: >-
            A social comment: the photos, GIFs, videos and audio clips in it, in
            the order the comment shows them. A team comment: its attachments.
            Instagram doesn't share the pictures in comments, so an Instagram
            comment has none. On Threads, a GIF in a reply with text isn't kept.
          items:
            $ref: '#/components/schemas/APICommentMedia'
        user:
          type: object
          description: The member who wrote it. Left out when `user_id` is null.
          required:
            - id
            - name
            - avatar
          properties:
            id:
              type: integer
            name:
              type: string
            avatar:
              type: string
              nullable: true
              description: A link to their picture; null when they have none.
    APIMedia:
      type: object
      description: >-
        A file in the media library: what list, get and the uploads give, and
        what posts and comments hold.
      required:
        - id
        - workspace_id
        - folder_id
        - name
        - url
        - mime_type
        - size
        - is_processing
        - type
        - ai_generated_id
        - is_reference
        - progress
        - alt
        - duration_seconds
      properties:
        id:
          type: integer
          description: The file's id. Posts take it in `content[].media`.
        workspace_id:
          type: integer
        folder_id:
          type: integer
          nullable: true
          description: The folder it is in; null at the top of the library.
        name:
          type: string
          description: The file name.
        url:
          type: string
          format: uri
          description: The file itself, at a public link.
        thumb_url:
          type: string
          format: uri
          description: >-
            A picture's small copy (about 400 px on its long edge) for cards and
            lists, or a video's still. Left out until one is made: use `url`
            then. See [Picture
            copies](/api-reference/media/overview#picture-copies).
        medium_url:
          type: string
          format: uri
          description: >-
            A picture's medium copy (about 800 px on its long edge) for large
            tiles and previews. Left out until one is made, and for a picture no
            bigger than 800 px on its long edge, which needs none: use `url`
            then. Videos, GIFs and documents have none.
        mime_type:
          type: string
          nullable: true
          description: The file's type, like `image/jpeg`.
        size:
          type: integer
          nullable: true
          description: The size in bytes.
        is_processing:
          type: boolean
          description: >-
            True while the file is still being made (an AI video, for example).
            It can't go on a post or be deleted until it is ready.
        type:
          type: string
          nullable: true
          enum:
            - image
            - video
            - audio
            - document
            - null
          description: >-
            The kind of file, from `mime_type`: `document` is a PDF, Word or
            PowerPoint file. Null for any other type.
        ai_generated_id:
          type: integer
          nullable: true
          description: Set when PostSyncer's AI made the file; null for uploads.
        is_reference:
          type: boolean
          description: True for a reference picture kept for AI video, not for posting.
        progress:
          type: integer
          description: Always 100.
        alt:
          type: string
          nullable: true
          description: The alt text, when set.
        duration_seconds:
          type: number
          nullable: true
          description: >-
            A video's or sound's length in seconds, read when it was uploaded.
            Null for pictures and documents, and for files stored before lengths
            were read.
    PostContactKeywordRule:
      type: object
      required:
        - keyword
        - list_id
      properties:
        keyword:
          type: string
          description: The word to look for in a comment.
        list_id:
          type: integer
          description: The CRM list a matching commenter goes to.
    WorkspaceAutoPlugTrigger:
      type: object
      description: 'One trigger of an auto-plug: on, and the count that fires it.'
      properties:
        enabled:
          type: boolean
        count:
          type: integer
          minimum: 0
    Account:
      type: object
      description: A connected social account.
      required:
        - id
        - workspace_id
        - platform
        - username
        - name
        - avatar
        - has_expired
        - needs_reconnect
        - reconnect_reason
        - platform_hold
        - renewal_failing
        - sign_in_ends_at
        - profile_url
        - is_default
        - support_threads
        - is_verified
        - plan_allows_posting
        - analytics_unavailable
      properties:
        id:
          type: integer
          description: The account's id. Posts take it in `accounts[].id`.
        workspace_id:
          type: integer
        platform:
          type: string
          enum:
            - twitter
            - linkedin
            - instagram
            - facebook
            - tiktok
            - youtube
            - threads
            - pinterest
            - bluesky
            - telegram
            - mastodon
            - google_business
          description: >-
            The network. `twitter` is X; `google_business` is Google Business
            Profile.
        username:
          type: string
          nullable: true
          description: >-
            The handle on the network, without `@` (a Mastodon handle includes
            its server).
        name:
          type: string
          nullable: true
          description: The display name on the network.
        avatar:
          type: string
          description: >-
            The profile picture, or an avatar made from the name when there is
            none.
        has_expired:
          type: boolean
          description: The same as `needs_reconnect`, kept for older integrations.
        needs_reconnect:
          type: boolean
          description: >-
            True when the sign-in no longer works, so the account can't post
            until someone reconnects it in PostSyncer. A new post leaves it out
            and lists it in `skipped_accounts`.
        reconnect_reason:
          type: string
          nullable: true
          description: >-
            The network's reason the account needs reconnecting, when it gave
            one. Null when `needs_reconnect` is false.
        platform_hold:
          type: object
          nullable: true
          description: >-
            Set when the network holds the account until its owner acts there
            (an identity check, a lock, a suspension, a restriction, the bot
            removed from a channel). The sign-in still works, so no reconnect is
            needed: posts to it fail with the network's reason until the hold is
            resolved there, and trying a failed post again asks the network
            again. Null when not held.
          required:
            - reason
            - scope
            - since
            - next_check_at
          properties:
            reason:
              type: string
              nullable: true
              description: The network's own words.
            scope:
              type: string
              nullable: true
              enum:
                - publish
                - all
                - null
              description: >-
                `publish`: only posting is held. `all`: everything the account
                does is.
            since:
              type: string
              format: date-time
              nullable: true
              description: When the network first refused.
            next_check_at:
              type: string
              format: date-time
              nullable: true
              description: >-
                When PostSyncer asks the network again (every 3 hours). Null
                while a retry is letting posts through.
        renewal_failing:
          type: object
          nullable: true
          description: >-
            Set when the network refused to renew a sign-in that still works.
            The account keeps posting until `works_until`; if the renewal is
            still refused then, it needs a reconnect. Null when renewals are
            fine.
          required:
            - reason
            - since
            - works_until
          properties:
            reason:
              type: string
              nullable: true
              description: The network's reason for refusing.
            since:
              type: string
              format: date-time
              nullable: true
              description: When the renewal was first refused.
            works_until:
              type: string
              format: date-time
              nullable: true
              description: >-
                When the sign-in stops working. Reconnect the account before
                then.
        sign_in_ends_at:
          type: string
          format: date-time
          nullable: true
          description: >-
            When the network ends this sign-in whatever PostSyncer does
            (LinkedIn: a year after it was connected). Reconnect the account
            before then. Null when the network doesn't say.
        profile_url:
          type: string
          nullable: true
          description: >-
            The account's own page on its network. Null when PostSyncer can't
            make one, for example a Mastodon account without its server, or a
            Telegram channel with no public name.
        is_default:
          type: boolean
          description: Whether the account is picked by default for new posts.
        support_threads:
          type: boolean
          nullable: true
          description: >-
            Whether a post can be a thread of several parts on this network (X,
            Threads, Bluesky and Mastodon).
        is_verified:
          type: boolean
          nullable: true
          description: >-
            Whether the network marks the account verified (X only; false
            elsewhere).
        plan_allows_posting:
          type: boolean
          description: >-
            False when the owner's plan doesn't let new posts go to this account
            (Free outside a first week: 2 picked accounts). Drafts, replies and
            analytics still work.
        can_publish_articles:
          type: boolean
          description: >-
            X accounts only: true when X lets the account publish Articles (X
            Premium or Premium+). Absent for other networks.
        analytics_unavailable:
          type: object
          nullable: true
          description: >-
            Why this account's post numbers can't be read, or null when they
            can. Its posts' numbers are not read meanwhile.
          required:
            - reason
            - message
          properties:
            reason:
              type: string
              enum:
                - x_private
                - linkedin_reconnect
                - pinterest_not_business
                - google_business_no_post_stats
                - telegram_private
              description: >-
                `x_private`: a private X account. `linkedin_reconnect`: a
                LinkedIn profile on the older connection; reconnect it.
                `pinterest_not_business`: not a Pinterest business account.
                `google_business_no_post_stats`: Google gives numbers for a
                location, never for one post. `telegram_private`: a private
                Telegram channel shows no views (subscribers are still counted).
            message:
              type: string
              description: The same, in words to show a person.
        is_page:
          type: boolean
          description: >-
            LinkedIn accounts only: true for a Company Page, false for a person.
            Absent for other networks.
        location:
          type: object
          description: >-
            Google Business Profile accounts only: the location this account is.
            Absent for other networks.
          required:
            - address
            - verified
            - can_post
            - maps_uri
            - new_review_uri
          properties:
            address:
              type: string
              nullable: true
            verified:
              type: boolean
              description: Whether Google verified the location.
            can_post:
              type: boolean
              description: Whether Google lets the location publish posts.
            maps_uri:
              type: string
              nullable: true
              description: The location on Google Maps.
            new_review_uri:
              type: string
              nullable: true
              description: The link that opens Google's form for a new review.
        boards:
          type: array
          description: >-
            List accounts and Get account only. A Pinterest account's boards,
            read from Pinterest; `[]` for other networks, and when Pinterest
            can't be read. Pass a board's `id` as `accounts[].settings.board_id`
            on a post.
          items:
            type: object
            required:
              - id
              - name
              - image_cover_url
            properties:
              id:
                type: string
                nullable: true
              name:
                type: string
              image_cover_url:
                type: string
                nullable: true
        playlists:
          type: array
          nullable: true
          description: >-
            Get account only. A YouTube channel's own playlists, read from
            YouTube, up to 500. `[]` for other networks and when
            `playlists_reconnect` is `true`. `null` when YouTube didn't answer:
            the channel may still have playlists, so try again later. Pass a
            playlist's `id` as `accounts[].settings.playlist_id` on a post to
            add the video to it.
          items:
            type: object
            required:
              - id
              - title
              - privacy_status
              - video_count
            properties:
              id:
                type: string
              title:
                type: string
              privacy_status:
                type: string
                nullable: true
                enum:
                  - public
                  - unlisted
                  - private
                  - null
                description: Who can see the playlist.
              video_count:
                type: integer
                nullable: true
                description: How many videos it holds.
        playlists_reconnect:
          type: boolean
          description: >-
            Get account only. `true` for a YouTube channel that must be
            reconnected to list its playlists and add videos to them: it was
            connected before PostSyncer asked YouTube for that permission, or
            its sign-in no longer works. `false` for every other account.
        scheduled_posts:
          type: object
          description: >-
            Get account only. Scheduled posts still to go out to this account.
            Deleting the account moves the ones that go only to it to drafts
            (they keep their time); the others still go to their other accounts.
          required:
            - total
            - only_this_account
          properties:
            total:
              type: integer
            only_this_account:
              type: integer
              description: The ones with no other account.
        posts_to_put_back:
          type: object
          nullable: true
          description: >-
            Get account only. Set when this profile was disconnected and
            connected again to the same workspace, and posts it was on can get
            it back with [Put back account
            posts](/api-reference/accounts/put-back-posts). Null otherwise.
          required:
            - posts
            - counts
            - relinked
            - disconnected_at
          properties:
            posts:
              type: integer
              description: Posts that would get the account back.
            counts:
              $ref: '#/components/schemas/PutBackCounts'
            relinked:
              type: integer
              description: >-
                Published posts already linked to the account again, with their
                link, numbers and comments. That happens on its own at the
                reconnect and sends nothing.
            disconnected_at:
              type: string
              format: date-time
              nullable: true
              description: When the profile was disconnected.
    PublishNote:
      type: object
      required:
        - type
        - message
      properties:
        type:
          type: string
          enum:
            - thread_unposted
            - unconfirmed
            - thumbnail_error
            - text_shortened
            - mentions_untagged
            - repeat_failed
            - setting_not_applied
          description: >-
            `thread_unposted`: some parts of the thread didn't go out.
            `unconfirmed`: the network never said the video was ready.
            `thumbnail_error`: the custom cover wasn't applied.
            `text_shortened`: X text was cut to fit the account, or a YouTube
            description to 5,000 bytes. `mentions_untagged`: LinkedIn people who
            couldn't be tagged went out as plain names. `repeat_failed`: a
            repeat didn't go out; the earlier post is still live.
            `setting_not_applied`: a network setting that is applied after the
            post is made didn't take, such as a YouTube playlist, a Telegram pin
            or a Bluesky reply rule; `setting` names it. The post itself is
            live.
        message:
          type: string
          description: What happened, in words.
        items:
          type: array
          nullable: true
          items:
            type: integer
          description: 'For `thread_unposted` and `text_shortened`: the parts it is about.'
        setting:
          type: string
          description: >-
            For `setting_not_applied`: the `accounts[].settings` key that didn't
            take, such as `playlist_id`.
    PlatformPostAnalytics:
      type: object
      description: >-
        Only when `PUBLISHED`: the post's numbers on this network. A number the
        network doesn't report is null, never 0.
      required:
        - comments
        - likes
        - shares
        - impressions
        - quotes
        - saves
        - views
        - reach
        - clicks
        - profile_visits
        - engagement_rate
        - pending
        - synced_at
      properties:
        comments:
          type: integer
          nullable: true
        likes:
          type: integer
          nullable: true
        shares:
          type: integer
          nullable: true
          description: Shares and reposts together.
        impressions:
          type: integer
          nullable: true
        quotes:
          type: integer
          nullable: true
        saves:
          type: integer
          nullable: true
        views:
          type: integer
          nullable: true
        reach:
          type: integer
          nullable: true
        clicks:
          type: integer
          nullable: true
        profile_visits:
          type: integer
          nullable: true
        engagement_rate:
          type: number
          nullable: true
          description: >-
            Interactions over impressions, in percent with 2 decimals (9.62 is
            9.62%). Null without impressions.
        pending:
          type: boolean
          description: True until the numbers were read once.
        synced_at:
          type: string
          format: date-time
          nullable: true
          description: When the numbers were last read.
    PostAutoPlugThreshold:
      type: object
      required:
        - enabled
        - count
      properties:
        enabled:
          type: boolean
        count:
          type: integer
          nullable: true
          description: The number that fires the reply.
    APICommentMedia:
      description: >-
        A picture, GIF, video or audio clip in a social comment, or a file
        attached to a team comment: a media library item, plus its kind and
        whether the network marked it sensitive.
      allOf:
        - $ref: '#/components/schemas/APIMedia'
        - type: object
          required:
            - kind
            - sensitive
          properties:
            kind:
              type: string
              enum:
                - photo
                - gif
                - video
                - audio
                - file
              description: >-
                On a social comment, what the network sent: photo, gif, video or
                audio. type is the saved file's type, so the two can differ: a
                video kept as its still has type image and kind video; a saved
                video file's still is at thumb_url once it is made. On a team
                comment, kind follows the file's type: photo, gif, video, audio,
                or file for anything else (a PDF, for example).
            sensitive:
              type: boolean
              description: >-
                True when the network marked the picture sensitive, for example
                a Mastodon post marked sensitive or a Bluesky post with an adult
                or graphic label.
    PutBackCounts:
      type: object
      description: >-
        Posts by what putting back does with them (all 11 are always there):
        `scheduled_again` (a draft the disconnect took off the schedule,
        unchanged since, scheduled again at its time), `added_to_scheduled`
        (scheduled or waiting for approval: the account is added, the time
        stays), `added_to_draft` (a draft stays a draft),
        `added_to_draft_time_passed` and `added_to_draft_changed` (taken off the
        schedule by the disconnect, but its time passed or it was edited since,
        so it stays a draft), `added_to_draft_refused` (kept a draft because the
        plan's post limit refused scheduling it), `skipped_deleted`,
        `skipped_already_there`, `skipped_went_out` (published, failed or
        sending), `skipped_time_passed` (due within 5 minutes), and `not_done`
        (an error stopped it; calling again tries it again).
      required:
        - scheduled_again
        - added_to_scheduled
        - added_to_draft
        - added_to_draft_time_passed
        - added_to_draft_changed
        - added_to_draft_refused
        - skipped_deleted
        - skipped_already_there
        - skipped_went_out
        - skipped_time_passed
        - not_done
      properties:
        scheduled_again:
          type: integer
        added_to_scheduled:
          type: integer
        added_to_draft:
          type: integer
        added_to_draft_time_passed:
          type: integer
        added_to_draft_changed:
          type: integer
        added_to_draft_refused:
          type: integer
        skipped_deleted:
          type: integer
        skipped_already_there:
          type: integer
        skipped_went_out:
          type: integer
        skipped_time_passed:
          type: integer
        not_done:
          type: integer
  responses:
    Unauthorized401:
      description: No API key, or not a valid one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthenticated:
              summary: No valid API key
              value:
                message: Unauthenticated.
    NotFound404:
      description: Nothing with that id in the workspaces the key can reach.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            not_found:
              summary: Not found
              value:
                message: Not found.
    RateLimited429:
      description: >-
        More than 60 requests in a minute from this key's user (the API and the
        MCP server share the count). Wait `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds until requests are allowed again.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests allowed a minute.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left this minute.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: When requests are allowed again, as a Unix timestamp.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            too_many_attempts:
              summary: Too many requests
              value:
                message: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.