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

# Refresh now instead of waiting for the next cycle (at most once every 2 minutes per account)

> Within 2 minutes of the previous manual refresh of the same account, nothing is fetched: the answer carries `reason: "recently_synced"` and `retryAfterSeconds`. Answers 429 while the shared Meta API quota is nearly exhausted.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/analytics/sync
openapi: 3.0.0
info:
  title: PlugKit API
  description: >-
    One API to publish, schedule and message across Instagram, Facebook,
    Threads, WhatsApp, TikTok, Telegram, YouTube, X, LinkedIn and Bluesky — and
    to run Meta and Google ads.
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.plugkit.co
security: []
tags: []
paths:
  /v1/analytics/sync:
    post:
      tags:
        - analytics
      summary: >-
        Refresh now instead of waiting for the next cycle (at most once every 2
        minutes per account)
      description: >-
        Within 2 minutes of the previous manual refresh of the same account,
        nothing is fetched: the answer carries `reason: "recently_synced"` and
        `retryAfterSeconds`. Answers 429 while the shared Meta API quota is
        nearly exhausted.
      operationId: AnalyticsController_sync
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SyncAnalyticsDto'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    description: 'With `accountId`: synced now.'
                    properties:
                      accountId:
                        type: string
                      synced:
                        type: boolean
                      lastSyncAt:
                        type: string
                        format: date-time
                        example: '2026-11-10T09:30:00.000Z'
                        nullable: true
                      refreshed:
                        type: integer
                      reason:
                        type: string
                        nullable: true
                        enum:
                          - recently_synced
                          - listing_debounced
                          - null
                      retryAfterSeconds:
                        type: integer
                        description: Only when `reason` is `recently_synced`.
                    required:
                      - accountId
                      - synced
                      - lastSyncAt
                      - refreshed
                      - reason
                  - type: object
                    description: 'Without `accountId`: every account is queued.'
                    properties:
                      queued:
                        type: integer
                        description: Accounts queued for the next sync tick.
                    required:
                      - queued
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          $ref: '#/components/responses/PlatformError'
      security:
        - api-key: []
components:
  schemas:
    SyncAnalyticsDto:
      type: object
      properties:
        accountId:
          type: string
          description: >-
            Account to refresh now. Omitted, every account of the caller is
            queued for the next cycle.
    Error:
      type: object
      description: >-
        Every error response has this shape. The request id is returned in the
        `x-request-id` header, not in the body.
      properties:
        error:
          type: string
          description: >-
            Human-readable message (English). Informative only: branch on `type`
            and `code`.
          example: scheduledFor must be a future date.
        type:
          type: string
          description: Error class, for programmatic branching.
          example: invalid_request_error
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - not_found
            - rate_limit_error
            - platform_error
            - billing_error
            - api_error
        code:
          type: string
          description: >-
            Stable machine code for the precise case (e.g. `validation_failed`,
            `post_not_found`, `rate_limited`, `subscription_required`).
          example: scheduled_in_past
        param:
          type: string
          description: Request field at fault, when there is one.
          example: scheduledFor
        platform:
          type: string
          description: >-
            Upstream platform (meta, tiktok, x…) when `type` is
            `platform_error`.
          example: meta
        platformError:
          type: object
          additionalProperties: true
          description: Raw error payload from the platform, passed through verbatim.
        details:
          type: object
          additionalProperties: true
          description: >-
            Extra structured context. Validation errors carry `details.fields`
            (one message per invalid field); billing errors carry
            `details.action_url`; rate limits carry `details.retryAfter`.
      required:
        - error
        - type
        - code
  responses:
    BadRequest:
      description: >-
        Invalid request. `code` is `validation_failed` for body/query validation
        (one message per field in `details.fields`), or a specific code
        (`invalid_reference`, `unsupported_for_platform`…).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 2 validation errors on the request.
            type: invalid_request_error
            code: validation_failed
            details:
              fields:
                - content should not be empty
                - accountIds must be an array
    Unauthorized:
      description: Missing, invalid or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid API key.
            type: authentication_error
            code: unauthorized
    RateLimited:
      description: >-
        Too many requests (PlugKit per-minute quota, or the shared platform
        quota nearly exhausted). Wait `retry-after` seconds.
      headers:
        retry-after:
          description: Seconds to wait before retrying.
          schema:
            type: integer
        x-ratelimit-limit:
          description: Requests allowed per minute in this bucket.
          schema:
            type: integer
        x-ratelimit-remaining:
          schema:
            type: integer
        x-ratelimit-reset:
          description: Unix time (seconds) when the window resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'Rate limit exceeded: 60 write requests per minute. Retry in 12s.'
            type: rate_limit_error
            code: rate_limited
            details:
              limit: 60
              bucket: write
              retryAfter: 12
    PlatformError:
      description: >-
        The upstream platform refused the call. Its raw payload is in
        `platformError`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Invalid OAuth access token.
            type: platform_error
            code: platform_request_failed
            platform: meta
            platformError:
              code: 190
              message: Invalid OAuth access token.
  securitySchemes:
    api-key:
      scheme: bearer
      bearerFormat: sk_...
      type: http

````

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