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

# Create a campaign

> Make a campaign that groups posts between two dates.

> [!NOTE]
>
> Needs `campaigns:create`, and a role in the workspace that can create campaigns: owners, managers, content managers and content creators can. See [Permissions](https://docs.postsyncer.com/essentials/authentication.md#permissions).

Makes a campaign in a workspace. `name`, `start_date` and `end_date` are needed: the start must be in the future and the end after it. Send the answer's `id` as a post's `campaign_id` when you [create](https://docs.postsyncer.com/api-reference/posts/create.md) or [update](https://docs.postsyncer.com/api-reference/posts/update.md) it.

> [!WARNING]
>
> `start_date` and `end_date` are read as UTC, and an offset in them is ignored. The answer gives them in the workspace's timezone. In a workspace on `Europe/London`, `2030-03-15 09:00` comes back as `2030-03-15 09:00`, but `2030-06-01 09:00` comes back as `2030-06-01 10:00` (British Summer Time); in `America/New_York`, `2030-03-15 09:00` comes back as `2030-03-15 05:00`. Work out the UTC time before you send it.

Leave `status` out and it follows the dates: `SCHEDULED` until the start, `ACTIVE` until the end, then `COMPLETED`. Send `DRAFT` or `CANCELLED` to hold it at that status. Sending `SCHEDULED`, `ACTIVE` or `COMPLETED` changes nothing: the dates decide which of the three it shows. The status only describes the campaign: it doesn't hold back or send its posts.

Campaigns are on paid plans. When the workspace owner is on Free, nothing is saved and the answer is `403` with `error: plan_limit_reached` and `limit: campaigns`. The owner's key gets `upgrade_url` and `upgrade_plan`; anyone else's is told to ask the owner (`owner_plan: true`, no `upgrade_url`).

## Errors

| Status | `error` | When | Retry? |
| - | - | - | - |
| 401 | | No API key, or not a valid one. | No: fix the key. |
| 403 | | The key lacks `campaigns:create`, or its user is inactive. | No: grant it in Settings → API. |
| 403 | | Your role in the workspace can't create campaigns. | No. |
| 403 | `plan_limit_reached` | The workspace owner is on Free (`limit: campaigns`). | After the owner upgrades. |
| 422 | | No `name`, `start_date` or `end_date`, a start in the past, an end that isn't after the start, a `status` that isn't one of the five, a `description` over 255 characters, or a workspace the key can't reach. | No: fix the request. |
| 429 | | More than 60 requests a minute. | Yes, after `Retry-After` seconds. |

## Related

* [List campaigns](https://docs.postsyncer.com/api-reference/campaigns/list.md): the campaigns there are.
* [Update a campaign](https://docs.postsyncer.com/api-reference/campaigns/update.md): change its dates, or hold it.


## OpenAPI

````yaml POST /campaigns
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.
paths:
  /campaigns:
    post:
      tags:
        - Campaigns
      summary: Create a campaign
      description: >-
        Needs `campaigns:create`. Your role in the workspace must also let you
        create campaigns. Campaigns are on paid plans: when the workspace owner
        is on Free, the answer is `403` with `error: plan_limit_reached` and
        `limit: campaigns`, and nothing is saved. Makes a campaign in a
        workspace. Send its `id` as a post's `campaign_id` to put the post in
        it. Dates are read as UTC, and an offset in them is ignored; the answer
        gives them in the workspace's timezone.
      operationId: createCampaign
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - workspace_id
                - name
                - start_date
                - end_date
              properties:
                workspace_id:
                  type: integer
                  description: The workspace. It must be one the key can reach.
                name:
                  type: string
                  maxLength: 255
                status:
                  type: string
                  enum:
                    - DRAFT
                    - SCHEDULED
                    - ACTIVE
                    - COMPLETED
                    - CANCELLED
                    - null
                  description: >-
                    `DRAFT` or `CANCELLED` holds the campaign at that status.
                    `SCHEDULED`, `ACTIVE` and `COMPLETED` follow the dates
                    whatever you send, so sending one of them only lifts a hold.
                    Left out or null: it follows the dates.
                  nullable: true
                start_date:
                  type: string
                  description: >-
                    When it starts, like `2030-03-15 09:00`, read as UTC. It
                    must be in the future.
                end_date:
                  type: string
                  description: >-
                    When it ends, like `2030-03-22 18:00`, read as UTC. It must
                    be after `start_date`.
                description:
                  type: string
                  nullable: true
                  maxLength: 255
            examples:
              default:
                summary: A week-long campaign
                value:
                  workspace_id: 12
                  name: Spring menu launch
                  start_date: 2030-03-15 09:00
                  end_date: 2030-03-22 18:00
                  description: Three new spring drinks, a week of posts.
              draft:
                summary: Held as a draft
                value:
                  workspace_id: 12
                  name: Roastery open day
                  status: DRAFT
                  start_date: 2030-03-23 10:00
                  end_date: 2030-03-23 16:00
      responses:
        '201':
          description: The campaign.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Campaign'
              examples:
                default:
                  summary: A week-long campaign
                  value:
                    id: 3
                    name: Spring menu launch
                    status: SCHEDULED
                    start_date: 2030-03-15 09:00
                    end_date: 2030-03-22 18:00
                    description: Three new spring drinks, a week of posts.
                    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
                draft:
                  summary: Held as a draft
                  value:
                    id: 4
                    name: Roastery open day
                    status: DRAFT
                    start_date: 2030-03-23 10:00
                    end_date: 2030-03-23 16:00
                    description: null
                    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
        '401':
          $ref: '#/components/responses/Unauthorized401'
        '403':
          description: >-
            The key lacks `campaigns:create`, its user is inactive, your role in
            the workspace can't create campaigns, or the workspace owner is on
            Free (`plan_limit_reached`, `limit: campaigns`).
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/PlanLimitError'
                  - $ref: '#/components/schemas/Error'
              examples:
                missing_permission:
                  summary: The key lacks campaigns:create
                  value:
                    message: >-
                      This API key does not have the "campaigns:create"
                      permission. Edit the key in PostSyncer under Settings →
                      API to grant it.
                role:
                  summary: The role can't create campaigns
                  value:
                    message: >-
                      Your role in the workspace "Halden Coffee" does not allow
                      you to create campaigns. Ask the workspace owner or a
                      manager to do it, or to change your role.
                campaigns_paid:
                  summary: 'Free: campaigns are paid'
                  value:
                    message: Campaigns are on paid plans. Upgrade to use campaigns.
                    owner_plan: false
                    error: plan_limit_reached
                    limit: campaigns
                    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
                campaigns_paid_member:
                  summary: 'Free, asked by a member: the owner must upgrade'
                  value:
                    message: >-
                      Campaigns are on paid plans, and this workspace's owner is
                      on the free plan. Only the workspace owner can upgrade, so
                      ask them to.
                    owner_plan: true
                    error: plan_limit_reached
                    limit: campaigns
                    used: 0
                    allowed: 0
                    plan: free
                    resets_at: null
                    upgrade_url: null
                    upgrade_plan: null
                inactive_account:
                  summary: The key's user is inactive
                  value:
                    message: Your account is inactive.
        '422':
          description: >-
            A field is missing or wrong, a date is in the past or out of order,
            or the workspace isn't one the key can reach.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                name:
                  summary: No name
                  value:
                    message: The name field is required.
                    errors:
                      name:
                        - The name field is required.
                end_date:
                  summary: No end date
                  value:
                    message: The end date field is required.
                    errors:
                      end_date:
                        - The end date field is required.
                start_date:
                  summary: A start in the past
                  value:
                    message: The start date field must be a date after now.
                    errors:
                      start_date:
                        - The start date field must be a date after now.
                end_before_start:
                  summary: An end before the start
                  value:
                    message: The end date field must be a date after start date.
                    errors:
                      end_date:
                        - The end date field must be a date after start date.
                status:
                  summary: Not a status
                  value:
                    message: The selected status is invalid.
                    errors:
                      status:
                        - The selected status is invalid.
                description:
                  summary: A description over 255 characters
                  value:
                    message: >-
                      The description field must not be greater than 255
                      characters.
                    errors:
                      description:
                        - >-
                          The description field must not be greater than 255
                          characters.
                workspace_id:
                  summary: Not a workspace the key can reach
                  value:
                    message: Invalid workspace ID.
                    errors:
                      workspace_id:
                        - Invalid workspace ID.
        '429':
          $ref: '#/components/responses/RateLimited429'
components:
  schemas:
    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`.
    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
            - analytics
          description: >-
            What ran out: `accounts`, `posts` (this month's posts) and
            `workspaces` are counted; `team`, `labels`, `campaigns`, `ai`,
            `moderation` (comment moderation) and `contacts` (contact
            collection) 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 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.
    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
    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.
    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
        - 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).
        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
        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.
    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.
    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.