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

# Draft a reply with AI

> Have PostSyncer AI write a reply to an inbox item in the brand's voice, kept as a draft.

> [!NOTE]
>
> Needs `comments:update`. Your role in the item's workspace must also let you edit public comments and use the workspace's AI; a Client's doesn't. See [Permissions](/docs/essentials/authentication.md#permissions).

PostSyncer AI writes a reply to the item in the brand's voice, from the [brand](/docs/api-reference/brand/overview.md), what the item is about, the messages so far and the brand's past replies, as **Write with AI** does in the app. PostSyncer AI's draft reads what the message shares: the post it quotes, its link card and up to 3 pages its links lead to. Still 1 credit. It keeps it as the item's draft, with `draft.by` `ai`, in place of a draft already there. PostSyncer wrote it, so it is `ai` even when a key asks; to keep your own words instead, [update the item](/docs/api-reference/inbox/update.md) with `draft`. It also adds the tags it finds: `lead`, `complaint` or `praise`.

It never sends. A person sends it from the app, or you send it on purpose with [Create a comment](/docs/api-reference/comments/create.md), [Reply to a review](/docs/api-reference/reviews/reply.md) or [Reply to a mention](/docs/api-reference/mentions/reply.md).

An item nobody can answer from PostSyncer gets no draft: `422` with the reason, and nothing is charged. That is a comment hidden or deleted on its network (`The comment is hidden on Facebook. Unhide it to reply.`, `The comment was deleted on Facebook.`), or a mention the network takes no reply to from apps (the item's `cant_reply_reason`).

Each draft spends 1 of the workspace owner's AI credits, as the app's AI reply does. Without enough, it answers `402` (`insufficient_credits`) and nothing is written or charged. If the AI can't write it, the answer is `503` (`ai_unavailable`) or `422` (`ai_declined`), and the credit is back. Drafts are written only when asked: nothing is drafted as items come in.

It answers the whole item, as [Get an inbox item](/docs/api-reference/inbox/get.md) does, with its new draft.

On the Free plan, comments and mentions are drafted from the Free month's AI credits. A review's draft is refused with `403` (`plan_limit_reached`, `limit: ai`): `AI review replies are part of the paid plans. Upgrade to use them.`

When an item was joined into another one (a comment PostSyncer later found to be a reply, or a mention later saved as a comment), its old id answers `404` with `{"message": "This item is now part of item 123. Use that id.", "moved_to": 123}`. Read or change item `moved_to` instead; a change sent to the old id changes nothing. You get `moved_to` only for an item you can open; otherwise the answer is the usual `404 {"message": "Not found."}`.

## Errors

| Status | `error` | When | Retry? |
| - | - | - | - |
| 401 | | No API key, or not a valid one. | No: fix the key. |
| 402 | `insufficient_credits` | The workspace owner's AI credits don't cover a draft. | After credits are added, or they come back on Free. |
| 403 | | The key lacks `comments:update`, its user is inactive, or your role can't edit public comments or use the workspace's AI. | No: grant it in Settings → API. |
| 403 | `plan_limit_reached` | A review's draft on the Free plan (`limit: ai`). | After an upgrade. |
| 404 | | No item with that id in the workspaces the key can reach, or what it was about is gone. With `moved_to`, the item is now part of that one. | No: use item `moved_to`. |
| 422 | | Nobody can answer the item from PostSyncer: `message` says why. | No: answer it on the network. |
| 422 | `ai_declined` | The AI won't write this. The credit is back. | No. |
| 429 | | More than 60 requests a minute. | Yes, after `Retry-After` seconds. |
| 503 | `ai_unavailable` | The AI couldn't answer right now. The credit is back. | Yes, in a minute. |

## Related

* [Draft replies for many items](/docs/api-reference/inbox/draft-many.md): up to 50 at once.
* [Work through the Inbox](/docs/guides/inbox.md#drafts-never-send): drafts in the routine.


## OpenAPI

````yaml POST /inbox/{thread}/draft
openapi: 3.0.3
info:
  title: PostSyncer API
  description: >-
    Post to 14 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: Inbox
    description: >-
      Comments, mentions and Google reviews in one list: what needs a reply,
      drafts, who answers what, team notes, and replies to mentions.
  - 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:
  /inbox/{thread}/draft:
    post:
      tags:
        - Inbox
      summary: Draft a reply with AI
      description: >-
        Needs `comments:update`. Your role in the item's workspace must also let
        you edit public comments and use the workspace's AI; a Client's doesn't.
        PostSyncer AI writes a reply to the item in the brand's voice, from what
        it is about, the messages so far and the brand's past replies, and keeps
        it as the item's draft (`by: ai`, even when a key asks; to keep your own
        words, update the item with `draft`). It replaces a draft already there.
        It adds the tags it finds: `lead`, `complaint` or `praise`. It never
        sends: a person sends it from the app, or you send it on purpose. An
        item nobody can answer from PostSyncer (a comment hidden or deleted on
        its network, or a mention the network takes no reply to from apps)
        answers `422` with the reason, and nothing is written or charged. Each
        draft spends 1 of the workspace owner's AI credits, as the app's AI
        reply does; without enough it answers `402` and nothing changes. On the
        Free plan, comments and mentions are drafted from the Free month's AI
        credits, and a review's draft is refused (`403`, `plan_limit_reached`,
        `limit: ai`): AI replies to reviews are on paid plans. Answers the whole
        item, as Get an inbox item does, with its new draft.
      operationId: draftInboxItem
      parameters:
        - name: thread
          in: path
          required: true
          description: 'The item''s id: `id` in List the inbox.'
          schema:
            type: integer
      responses:
        '200':
          description: The item with its new draft.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InboxThread'
              examples:
                default:
                  summary: Drafted by PostSyncer AI
                  value:
                    id: 8812
                    kind: comment
                    status: open
                    done_how: null
                    done_at: null
                    done_by: null
                    account:
                      id: 301
                      platform: instagram
                      username: haldencoffee
                      name: Halden Coffee
                      avatar: https://cdn.postsyncer.com/examples/halden-coffee.jpg
                    person:
                      name: Rowan Example
                      handle: rowan.example
                      avatar: null
                      platform_user_id: '17841400000000002'
                      contact_id: 501
                      contact:
                        id: 501
                        tags:
                          - Customer
                        email: null
                        interactions: 4
                        first_seen: '2030-02-11T17:40:00.000000Z'
                        last_seen: '2030-03-15T10:12:00.000000Z'
                        lists:
                          - id: 5
                            name: Guide requests
                        notes: []
                      contact_locked: false
                    text: Is the oat milk extra?
                    media: []
                    quoted: null
                    link_preview: null
                    stars: null
                    created_at: '2030-03-15T10:12:00.000000Z'
                    last_activity_at: '2030-03-15T10:12:00.000000Z'
                    unread: true
                    about:
                      type: post
                      post_id: 92731
                      caption: The lavender oat latte is back.
                      url: https://www.instagram.com/p/DHk2mQ7sLtA/
                      thumbnail: https://cdn.postsyncer.com/examples/latte-art.jpg
                      stats: null
                      from: us
                      author_name: Halden Coffee
                    thread: []
                    notes: []
                    tags:
                      - question
                    assignee: null
                    draft:
                      text: No, oat milk costs the same as dairy here. See you soon!
                      by: ai
                      agent: null
                      at: '2030-03-15T10:21:00.000000Z'
                    can:
                      reply: true
                      hide: true
                      delete: true
                      assign: true
                      draft: true
                      note: true
                    cant_reply_reason: null
                    reply_limit: 2200
                    source:
                      comment_id: 70412
                      hidden: false
                    links:
                      open_on_network: https://www.instagram.com/p/DHk2mQ7sLtA/
        '401':
          $ref: '#/components/responses/Unauthorized401'
        '402':
          description: >-
            The workspace's AI credits don't cover a draft. Nothing was written
            or charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InsufficientCreditsError'
              examples:
                insufficient_credits:
                  summary: Not enough credits
                  value:
                    message: >-
                      Not enough AI credits: this needs 1 and you have 0. Top up
                      your credits or upgrade your plan to continue.
                    error: insufficient_credits
                    credits_required: 1
                    credits_available: 0
        '403':
          description: >-
            The key lacks `comments:update`, its user is inactive, your role in
            the workspace can't edit public comments or use its AI, or a
            review's draft on the Free plan (`plan_limit_reached`, `limit: ai`).
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PlanLimitError'
                  - $ref: '#/components/schemas/Error'
              examples:
                missing_permission:
                  summary: The key lacks comments:update
                  value:
                    message: >-
                      This API key does not have the "comments:update"
                      permission. Edit the key in PostSyncer under Settings →
                      API to grant it.
                inactive_account:
                  summary: The key's user is inactive
                  value:
                    message: Your account is inactive.
                role:
                  summary: Your role can't edit public comments
                  value:
                    message: >-
                      Your role in the workspace "Halden Coffee" does not allow
                      you to edit public comments. Ask the workspace owner or an
                      admin to do it, or to change your role.
                role_ai:
                  summary: Your role can't use the workspace's AI
                  value:
                    message: >-
                      Your role in the workspace "Halden Coffee" does not allow
                      you to use AI. Ask the workspace owner or an admin to do
                      it, or to change your role.
                ai_paid:
                  summary: 'Free: AI review replies are on paid plans'
                  value:
                    message: >-
                      AI review replies are part of the paid plans. Upgrade to
                      use them.
                    owner_plan: false
                    error: plan_limit_reached
                    limit: ai
                    used: 0
                    allowed: 0
                    plan: free
                    resets_at: null
                    upgrade_url: >-
                      https://app.postsyncer.com/dashboard?action=settings&section=billing
                    upgrade_plan:
                      plan: starter-v2
                      name: Starter
                      monthly_price: 29
                      yearly_price: 24
                      accounts: 10
                      accounts_per_workspace: false
        '404':
          description: >-
            No item with that id in the workspaces the key can reach. When an
            item was joined into another one (a comment PostSyncer later found
            to be a reply, or a mention later saved as a comment), its old id
            answers `404` with `{"message": "This item is now part of item 123.
            Use that id.", "moved_to": 123}`. Read or change item `moved_to`
            instead; a change sent to the old id changes nothing. You get
            `moved_to` only for an item you can open; otherwise the answer is
            the usual `404 {"message": "Not found."}`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - type: object
                    properties:
                      moved_to:
                        type: integer
                        description: 'The item this one is now part of: use its id.'
              examples:
                not_found:
                  summary: Not found
                  value:
                    message: Not found.
                moved:
                  summary: Joined into another item
                  value:
                    message: This item is now part of item 8815. Use that id.
                    moved_to: 8815
        '422':
          description: >-
            Nobody can answer the item from PostSyncer: the comment is hidden or
            deleted on its network, or the network takes no reply to the mention
            from apps (its `cant_reply_reason`). Nothing was written or charged.
            Or the AI won't write this (`ai_declined`), and the credit is back.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                hidden:
                  summary: A comment hidden on its network
                  value:
                    message: The comment is hidden on Facebook. Unhide it to reply.
                deleted:
                  summary: A comment deleted on its network
                  value:
                    message: The comment was deleted on Facebook.
                ai_declined:
                  summary: The AI declined
                  value:
                    error: ai_declined
                    message: >-
                      The AI won't write this. Try different wording. Your 1
                      credit is back.
        '429':
          $ref: '#/components/responses/RateLimited429'
        '503':
          description: >-
            The AI couldn't answer right now. Nothing was written, and the
            credit is back; try again in a minute.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Error'
                  - type: object
                    required:
                      - error
                    properties:
                      error:
                        type: string
                        enum:
                          - ai_unavailable
              examples:
                ai_unavailable:
                  summary: The AI is unavailable
                  value:
                    error: ai_unavailable
                    message: >-
                      The AI couldn't answer right now. Try again in a minute.
                      Your 1 credit is back.
components:
  schemas:
    InboxThread:
      type: object
      description: >-
        One item of the Inbox: a comment on one of your posts, a mention of one
        of your accounts, or a Google review, with everything needed to answer
        it.
      required:
        - id
        - kind
        - status
        - done_how
        - done_at
        - done_by
        - account
        - person
        - text
        - media
        - quoted
        - link_preview
        - stars
        - created_at
        - last_activity_at
        - unread
        - about
        - thread
        - notes
        - tags
        - assignee
        - draft
        - can
        - cant_reply_reason
        - reply_limit
        - source
        - links
      properties:
        id:
          type: integer
          description: The item's id, for Get, Update and Mark done.
        kind:
          type: string
          enum:
            - comment
            - mention
            - review
          description: >-
            `comment`: a top-level comment on one of your posts. `mention`:
            someone else’s post or comment that names one of your accounts.
            `review`: a Google review of a location.
        status:
          type: string
          enum:
            - open
            - done
          description: >-
            `open`: it needs a reply. `done`: answered, marked done, hidden or
            deleted. A new message from them opens it again, and so does your
            only reply being deleted on the network.
        done_how:
          type: string
          nullable: true
          enum:
            - replied
            - marked
            - hidden
            - deleted
            - null
          description: >-
            How it became done: `replied` (from PostSyncer or on the network),
            `marked` (Done with no words), `hidden` or `deleted`. Null while
            open.
        done_at:
          type: string
          nullable: true
          format: date-time
          description: When it became done. Null while open.
        done_by:
          type: object
          nullable: true
          description: >-
            The teammate who closed it. Null while open, and when the account
            answered on the network itself.
          required:
            - id
            - name
          properties:
            id:
              type: integer
            name:
              type: string
        account:
          type: object
          description: 'Your account it is for: the one a reply goes out from.'
          required:
            - id
            - platform
            - username
            - name
            - avatar
          properties:
            id:
              type: integer
            platform:
              type: string
              description: '`instagram`, `twitter` (X), `google_business` and so on.'
            username:
              type: string
              nullable: true
            name:
              type: string
              nullable: true
            avatar:
              type: string
              nullable: true
        person:
          type: object
          description: Who wrote it, and what PostSyncer holds about them.
          required:
            - name
            - handle
            - avatar
            - platform_user_id
            - contact_id
            - contact
            - contact_locked
          properties:
            name:
              type: string
              description: Their name. Empty for an anonymous review.
            handle:
              type: string
              nullable: true
              description: Their handle on the network, without the @. Null on a review.
            avatar:
              type: string
              nullable: true
              description: A link to their photo.
            platform_user_id:
              type: string
              nullable: true
              description: Their id on the network, when it gives one.
            contact_id:
              type: integer
              nullable: true
              description: >-
                Their contact, for [Get a contact](/api-reference/contacts/get).
                Null when they have none.
            contact:
              type: object
              nullable: true
              description: >-
                Their contact card: only what PostSyncer holds. Null when they
                have none, on a plan without contacts, or for a role that can’t
                see contacts.
              required:
                - id
                - tags
                - email
                - interactions
                - first_seen
                - last_seen
                - lists
                - notes
              properties:
                id:
                  type: integer
                tags:
                  type: array
                  items:
                    type: string
                  description: '`Lead` and `Customer` first, then the contact’s own tags.'
                email:
                  type: string
                  nullable: true
                  description: Their email, when they gave one.
                interactions:
                  type: integer
                  description: How many times they wrote.
                first_seen:
                  type: string
                  format: date-time
                  nullable: true
                last_seen:
                  type: string
                  format: date-time
                  nullable: true
                lists:
                  type: array
                  items:
                    type: object
                    required:
                      - id
                      - name
                    properties:
                      id:
                        type: integer
                      name:
                        type: string
                notes:
                  type: array
                  description: The team’s notes on the contact, newest first.
                  items:
                    type: object
                    required:
                      - id
                      - body
                      - created_at
                    properties:
                      id:
                        type: integer
                      body:
                        type: string
                      created_at:
                        type: string
                        format: date-time
                        nullable: true
            contact_locked:
              type: boolean
              description: >-
                `true` on a plan without contacts (Free), for a role that can
                see contacts: the card is a paid feature, so `contact` is null.
                `false` otherwise.
        text:
          type: string
          description: >-
            Their words. Each link is whole, as the person meant it. `""` for a
            comment that is only a picture, or a review with stars only.
        media:
          type: array
          description: >-
            The pictures in a comment, as [Get a
            comment](/api-reference/comments/get) gives them, or a review’s
            photos and videos. A mention’s picture is its post’s, in
            `about.thumbnail`.
          items:
            type: object
            additionalProperties: true
        quoted:
          type: object
          nullable: true
          description: >-
            The post their message quotes (a mention on Bluesky, X or Mastodon):
            who wrote it, its words, its link. Null when it quotes none.
          required:
            - author_name
            - author_handle
            - text
            - url
          properties:
            author_name:
              type: string
              nullable: true
              description: Who wrote the quoted post.
            author_handle:
              type: string
              nullable: true
              description: Their handle on the network, without the @.
            text:
              type: string
              description: Its words. Each link is whole.
            url:
              type: string
              nullable: true
              description: 'Its link on the network: http(s) only.'
        link_preview:
          type: object
          nullable: true
          description: >-
            The link card their message shows (a mention on Bluesky, Mastodon or
            LinkedIn): the page's link, title and description. Null when it
            shows none.
          required:
            - url
            - title
            - description
          properties:
            url:
              type: string
              description: 'The page''s link: http(s) only.'
            title:
              type: string
              nullable: true
            description:
              type: string
              nullable: true
        stars:
          type: integer
          nullable: true
          minimum: 1
          maximum: 5
          description: A review's stars. Null on comments and mentions.
        created_at:
          type: string
          nullable: true
          format: date-time
          description: When they wrote it.
        last_activity_at:
          type: string
          nullable: true
          format: date-time
          description: >-
            The newest message in it, theirs or yours, at the network's time.
            The list is ordered by it, and `cursor` pages on it; `since` goes by
            when PostSyncer read the message instead.
        unread:
          type: boolean
          description: >-
            `true` until someone on the team opens it in the app after their
            newest message.
        about:
          type: object
          description: What it is about.
          required:
            - type
            - post_id
            - caption
            - url
            - thumbnail
            - stats
            - from
            - author_name
          properties:
            type:
              type: string
              enum:
                - post
                - mention_source
                - place
              description: >-
                `post`: your post the comment is on. `mention_source`: the post
                that names you, or the post above the comment that does.
                `place`: the reviewed location.
            post_id:
              type: integer
              nullable: true
              description: Your post, for a comment. Null otherwise.
            caption:
              type: string
              nullable: true
              description: >-
                Your post's text; for a mention in a comment, the post above it;
                for a review, the location's name.
            url:
              type: string
              nullable: true
              description: Where it is on the network.
            thumbnail:
              type: string
              nullable: true
              description: A picture of the post, when it has one.
            stats:
              type: string
              nullable: true
              description: >-
                The mentioning post’s numbers as the network gives them, like
                `120 views · 8 likes`. Null elsewhere.
            from:
              type: string
              nullable: true
              enum:
                - us
                - them
                - null
              description: >-
                Who wrote that post: us (the account: our post, or our own reply
                a mention answers) or them; null for a review's place.
            author_name:
              type: string
              nullable: true
              description: >-
                Who wrote that post: the account's name for ours, else their
                name or @handle where the network gives it.
        thread:
          type: array
          description: >-
            The messages after the first one, oldest first: every reply under a
            comment, the replies sent from PostSyncer under a mention, and a
            review’s reply.
          items:
            type: object
            required:
              - id
              - from
              - author_name
              - avatar
              - text
              - created_at
              - sent_by
              - state
              - error
            properties:
              id:
                type: integer
                description: >-
                  The message's id. Your reply under a mention has none of its
                  own: its place under the mention, from 1.
              from:
                type: string
                enum:
                  - them
                  - us
                description: '`us`: your account wrote it.'
              author_name:
                type: string
              avatar:
                type: string
                nullable: true
              text:
                type: string
              created_at:
                type: string
                nullable: true
                format: date-time
                description: >-
                  When it was written. Your reply under a mention: when the
                  network took it, or, while it is `sending` or once `refused`,
                  when it was asked for.
              sent_by:
                type: object
                nullable: true
                description: >-
                  The teammate who sent it from PostSyncer. Null for theirs, and
                  for one written on the network.
                required:
                  - id
                  - name
                properties:
                  id:
                    type: integer
                  name:
                    type: string
              state:
                type: string
                enum:
                  - sending
                  - sent
                  - refused
                description: >-
                  Where it stands. `sent` for every message on the network. Your
                  reply under a mention is `sending` until the network answers,
                  then `sent`, or `refused` with the reason in `error`. A
                  refused reply leaves the item open.
              error:
                type: string
                nullable: true
                description: >-
                  Why the network refused your reply under a mention, in words
                  to show the user. Null otherwise.
        notes:
          type: array
          description: >-
            The team's notes on it, oldest first. They never reach the network.
            With client sign-off on, a Client member reads only the notes Client
            members wrote; the rest of the team reads them all.
          items:
            $ref: '#/components/schemas/InboxThreadNote'
        tags:
          type: array
          description: >-
            `question` (it has a question mark) and `spam` (moderation removed
            it as junk) come on their own. `lead`, `complaint` and `praise` come
            when PostSyncer AI writes a draft for it.
          items:
            type: string
            enum:
              - question
              - lead
              - complaint
              - praise
              - spam
        assignee:
          type: object
          required:
            - id
            - name
            - avatar
          properties:
            id:
              type: integer
            name:
              type: string
            avatar:
              type: string
              nullable: true
              description: A link to their photo.
          nullable: true
          description: The teammate it is given to. Null for nobody.
        draft:
          type: object
          nullable: true
          description: >-
            The reply waiting to be sent: Ready to send in the app. It never
            sends itself. A reply PostSyncer takes to send (a comment's, or a
            mention's) clears it, and a comment reply the network refuses comes
            back as the draft (`by: person`), unless someone wrote a newer one.
            Null when there is none.
          required:
            - text
            - by
            - agent
            - at
          properties:
            text:
              type: string
            by:
              type: string
              enum:
                - ai
                - agent
                - snippet
                - person
              description: >-
                `ai`: PostSyncer AI. `agent`: an AI agent or script, through the
                API or MCP. `snippet`: a saved snippet. `person`: a teammate
                typed it.
            agent:
              type: string
              nullable: true
              description: >-
                For `agent`, who wrote it: the AI app (such as `Claude`), or
                else the API key’s name. For `snippet`, the snippet’s name.
            at:
              type: string
              format: date-time
              nullable: true
        can:
          type: object
          description: >-
            What the key’s user may do with it, by their role and what the
            network allows.
          required:
            - reply
            - hide
            - delete
            - assign
            - draft
            - note
          properties:
            reply:
              type: boolean
              description: >-
                `false` when nobody can answer it from PostSyncer
                (`cant_reply_reason` says why: a mention the network takes no
                reply to from apps, or a comment hidden or deleted on its
                network), or the role can't answer. [Draft a reply with
                AI](/api-reference/inbox/draft) skips these items too.
            hide:
              type: boolean
              description: >-
                A comment on a network that hides comments: [Hide a
                comment](/api-reference/comments/hide).
            delete:
              type: boolean
              description: 'A comment: [Delete a comment](/api-reference/comments/delete).'
            assign:
              type: boolean
              description: >-
                Your role can edit public comments: give it to a teammate, mark
                it done or open it again.
            draft:
              type: boolean
              description: 'Your role can edit public comments: leave or clear its draft.'
            note:
              type: boolean
              description: >-
                Your role can write team notes: [Add a team
                note](/api-reference/inbox/notes). A Client's can.
        cant_reply_reason:
          type: string
          nullable: true
          description: >-
            Why nobody can answer it from PostSyncer, in words to show the user,
            with where to answer instead: a mention the network takes no reply
            to from apps, `The comment is hidden on {Network}. Unhide it to
            reply.` or `The comment was deleted on {Network}.` Null when a reply
            can go out, and always on a review.
        reply_limit:
          type: integer
          nullable: true
          description: The longest reply the network takes, in characters.
        source:
          type: object
          description: >-
            The id to answer it with: `comment_id` (a comment), `mention_id` (a
            mention) or `review_id` (a review). Only the one of its kind is
            there. A comment's also says whether it is `hidden` on its network.
          properties:
            comment_id:
              type: integer
              description: >-
                `parent_comment_id` for [Create a
                comment](/api-reference/comments/create).
            mention_id:
              type: integer
              description: For [Reply to a mention](/api-reference/mentions/reply).
            review_id:
              type: integer
              description: For [Reply to a review](/api-reference/reviews/reply).
            hidden:
              type: boolean
              description: >-
                A comment only: `true` while it is hidden on its network. Unhide
                it with [Hide a comment](/api-reference/comments/hide)
                (`"hidden": false`) to reply.
        links:
          type: object
          required:
            - open_on_network
          properties:
            open_on_network:
              type: string
              nullable: true
              description: >-
                Where it is on the network: the comment, the mentioning post,
                the location on Google Maps.
    InsufficientCreditsError:
      type: object
      description: '402: the AI credits left don''t cover this.'
      required:
        - message
        - error
        - credits_required
        - credits_available
      properties:
        message:
          type: string
          description: What it needs, what is left, and what to do.
        error:
          type: string
          enum:
            - insufficient_credits
        credits_required:
          type: integer
          description: The credits this needs.
        credits_available:
          type: integer
          description: The credits left.
        free_plan:
          type: boolean
          enum:
            - true
          description: Only on the Free plan, whose credits come back each month.
        resets_at:
          type: string
          format: date-time
          description: 'Only on the Free plan: when its credits come back.'
    PlanLimitError:
      type: object
      description: >-
        403: the workspace owner's plan doesn't include this, or its limit is
        used up. Nothing was saved. `limit` says which.
      required:
        - message
        - owner_plan
        - error
        - limit
        - used
        - allowed
        - plan
        - resets_at
        - upgrade_url
        - upgrade_plan
      properties:
        message:
          type: string
          description: What the plan doesn't allow, and what to do.
        owner_plan:
          type: boolean
          description: >-
            True when the plan is someone else's (the key's user isn't the
            workspace owner): only the owner can change it, and `message` says
            to ask them.
        error:
          type: string
          enum:
            - plan_limit_reached
        limit:
          type: string
          enum:
            - accounts
            - posts
            - workspaces
            - team
            - labels
            - campaigns
            - ai
            - moderation
            - contacts
            - crm
            - products
            - analytics
            - free_accounts
            - client_signoff
          description: >-
            What ran out: `accounts`, `posts` (this month's posts) and
            `workspaces` are counted; `free_accounts` is a post to an account
            other than the 2 a Free owner posts to outside a first week (the
            account's `plan_allows_posting` is `false`); `team`, `labels`,
            `campaigns`, `ai`, `moderation` (comment moderation), `contacts`
            (contact collection), `crm` (contacts and contact lists) and
            `products` and `client_signoff` (client sign-off and client
            reviewers) are on paid plans only. `analytics` (more than the last 7
            days) comes from the app only: API v1 and MCP don't refuse analytics
            on Free, they keep the numbers to the last 7 days, outside an
            owner's first week, and say so in `range_limited`.
        used:
          type: integer
          description: How much of the limit is used; 0 for a paid-plan feature.
        allowed:
          type: integer
          description: What the plan allows; 0 for a paid-plan feature.
        plan:
          type: string
          description: The owner's plan, like `free`.
        resets_at:
          type: string
          format: date-time
          nullable: true
          description: When a monthly limit starts again; null for the others.
        upgrade_url:
          type: string
          nullable: true
          description: Where the owner picks a plan; null when the plan is someone else's.
        upgrade_plan:
          type: object
          nullable: true
          description: >-
            The smallest plan that lifts the limit; null when the plan is
            someone else's or no plan lifts it.
          required:
            - plan
            - name
            - monthly_price
            - yearly_price
            - accounts
            - accounts_per_workspace
          properties:
            plan:
              type: string
              description: The plan's key.
            name:
              type: string
              description: The plan's name.
            monthly_price:
              type: integer
            yearly_price:
              type: integer
            accounts:
              type: integer
              description: The social accounts the plan includes.
            accounts_per_workspace:
              type: boolean
              description: True when `accounts` counts per workspace rather than in all.
    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).
    InboxThreadNote:
      type: object
      description: A team note on an inbox item. Only the team reads it.
      required:
        - id
        - author
        - body
        - created_at
      properties:
        id:
          type: integer
        author:
          type: object
          required:
            - id
            - name
            - avatar
          properties:
            id:
              type: integer
              nullable: true
              description: >-
                Null once the writer left the team (`name` is then `Former
                member`).
            name:
              type: string
            avatar:
              type: string
              nullable: true
        body:
          type: string
        created_at:
          type: string
          format: date-time
          nullable: true
  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.
    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.