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

# Get analytics for all workspaces

> Get the totals of the published posts in every workspace the key can reach, and a row per workspace.

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

Gives the totals over every workspace the key can reach, and in `workspaces` one row per workspace with published posts counted. A workspace with none counted has no row. The dates pick which posts count, by the day each was published; leave both out for every post.

For a workspace whose owner is on Free, the dates are limited to its last 7 days, in its time zone: only the asked days inside them count, and the 7 days when you send no dates. Its row has `range_limited`, and so does the answer. See [Plan limits](/docs/plan-limits.md#analytics-on-free).

## Errors

| Status | `error` | When | Retry? |
| - | - | - | - |
| 401 | | No API key, or not a valid one. | No: fix the key. |
| 403 | | The key lacks `analytics:read`, or its user is inactive. | No: grant it in Settings → API. |
| 422 | | A date isn't `Y-m-d`, or `end_date` is before `start_date`. | No: fix the request. |
| 429 | | More than 60 requests a minute. | Yes, after `Retry-After` seconds. |

## Related

* [Get a workspace's analytics](/docs/api-reference/analytics/workspace.md): one workspace, with its accounts.
* [Analytics](/docs/api-reference/analytics/overview.md): what each number means.


## OpenAPI

````yaml GET /analytics
openapi: 3.0.3
info:
  title: PostSyncer API
  description: >-
    Post to 12 social networks from your code: posts, media, comments,
    analytics, webhooks and more.
  version: 1.0.0
servers:
  - url: https://postsyncer.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: The workspaces the key can reach.
  - name: Accounts
    description: Connected social accounts, links to connect more, and disconnecting them.
  - name: Posts
    description: Drafts, scheduled and published posts, approvals and a post's history.
  - name: Post settings
    description: A post's auto-plug, comment moderation and contact collection.
  - name: Media
    description: >-
      The media library: file uploads, URL imports, and reading videos and
      social posts' files.
  - name: Folders
    description: Folders that organise the media library.
  - name: Comments
    description: >-
      Comments on your posts: reading, replying, editing, hiding, deleting and
      syncing them.
  - name: Reviews
    description: Google Business Profile reviews and your replies to them.
  - name: Analytics
    description: Workspace, account and post performance.
  - name: Brand
    description: >-
      A workspace's brand: identity, voice, look, accounts, competitors,
      learnings and rules.
  - name: Labels
    description: Labels used to tag posts.
  - name: Campaigns
    description: Campaigns used to group posts.
  - name: Snippets
    description: Saved snippets and hashtag groups to drop into posts.
  - name: Webhooks
    description: Signed webhook endpoints that get your notification events.
  - name: Billing
    description: >-
      The owner's plan, invoices and the links that pay for, change or cancel
      it.
  - name: Team
    description: A workspace's teammates and invitations, and their roles.
  - name: Notifications
    description: >-
      Your bell and notification settings, and the workspace's Slack, Discord
      and Telegram channels.
  - name: Blog-to-social
    description: Blog feeds that turn a workspace's new articles into posts.
  - name: Products
    description: Products the workspace's posts can promote.
  - name: Contacts
    description: People who commented on the workspace's posts, and the lists they are on.
  - name: Profile
    description: 'The key''s user: their name and sign-in email.'
  - name: API keys
    description: 'Your API keys: listing and deleting them.'
  - name: Agent sign-up
    description: >-
      An AI agent signs a person up with a code emailed to them, and gets their
      first key. No key needed.
paths:
  /analytics:
    get:
      tags:
        - Analytics
      summary: Get analytics for all workspaces
      description: >-
        Needs `analytics:read`. Totals over every workspace the key can reach,
        and one row per workspace with published posts counted. The numbers are
        each post's totals as last read from its network, not what changed
        between the dates: the dates pick which posts count, by the day each was
        published. For a workspace whose owner is on Free, the dates are limited
        to its last 7 days (in its time zone): its row has `range_limited`, and
        so does the answer.
      operationId: getAnalyticsSummary
      parameters:
        - name: start_date
          in: query
          required: false
          description: >-
            Only posts published on this day or later (`Y-m-d`, in the
            workspace's time zone). Leave both dates out for lifetime numbers
            over every post (on the free plan, only the last 7 days; see
            `range_limited`).
          schema:
            type: string
            format: date
            example: '2030-03-01'
        - name: end_date
          in: query
          required: false
          description: >-
            Only posts published on this day or earlier. It must not be before
            `start_date`.
          schema:
            type: string
            format: date
            example: '2030-03-31'
      responses:
        '200':
          description: The totals, and a row per workspace with posts counted.
          content:
            application/json:
              schema:
                type: object
                required:
                  - total
                  - workspaces
                properties:
                  total:
                    $ref: '#/components/schemas/AnalyticsTotals'
                  workspaces:
                    type: array
                    description: >-
                      By `workspace_id`. A workspace with no published post
                      counted has no row.
                    items:
                      $ref: '#/components/schemas/AnalyticsWorkspaceRow'
                  range_limited:
                    $ref: '#/components/schemas/AnalyticsRangeLimited'
              examples:
                default:
                  summary: One workspace
                  value:
                    total:
                      comments: 19
                      likes: 312
                      shares: 14
                      impressions: 4970
                      quotes: 0
                      saves: 34
                      views: 0
                      reach: 4270
                      clicks: 41
                      profile_visits: 56
                      engagement_rate: 8.45
                    workspaces:
                      - workspace_id: 12
                        total:
                          comments: 19
                          likes: 312
                          shares: 14
                          impressions: 4970
                          quotes: 0
                          saves: 34
                          views: 0
                          reach: 4270
                          clicks: 41
                          profile_visits: 56
                          engagement_rate: 8.45
                free:
                  summary: A second workspace, whose owner is on Free
                  value:
                    total:
                      comments: 21
                      likes: 353
                      shares: 15
                      impressions: 5590
                      quotes: 0
                      saves: 37
                      views: 0
                      reach: 4860
                      clicks: 41
                      profile_visits: 61
                      engagement_rate: 8.35
                    workspaces:
                      - workspace_id: 12
                        total:
                          comments: 19
                          likes: 312
                          shares: 14
                          impressions: 4970
                          quotes: 0
                          saves: 34
                          views: 0
                          reach: 4270
                          clicks: 41
                          profile_visits: 56
                          engagement_rate: 8.45
                      - workspace_id: 15
                        total:
                          comments: 2
                          likes: 41
                          shares: 1
                          impressions: 620
                          quotes: 0
                          saves: 3
                          views: 0
                          reach: 590
                          clicks: 0
                          profile_visits: 5
                          engagement_rate: 7.58
                        range_limited:
                          days: 7
                          reason: free_plan
                    range_limited:
                      days: 7
                      reason: free_plan
        '401':
          $ref: '#/components/responses/Unauthorized401'
        '403':
          description: The key lacks `analytics:read`, or its user is inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_permission:
                  summary: The key lacks analytics:read
                  value:
                    message: >-
                      This API key does not have the "analytics:read"
                      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.
        '422':
          description: A date isn't `Y-m-d`, or `end_date` is before `start_date`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
              examples:
                start_date:
                  summary: Not Y-m-d
                  value:
                    message: The start date field must match the format Y-m-d.
                    errors:
                      start_date:
                        - The start date field must match the format Y-m-d.
                end_before_start:
                  summary: end_date before start_date
                  value:
                    message: The end date must be on or after the start date.
                    errors:
                      end_date:
                        - The end date must be on or after the start date.
        '429':
          $ref: '#/components/responses/RateLimited429'
components:
  schemas:
    AnalyticsTotals:
      type: object
      description: >-
        Totals of the published copies counted: each counter summed over the
        copies whose network reports it (0 when none does).
      required:
        - comments
        - likes
        - shares
        - impressions
        - quotes
        - saves
        - views
        - reach
        - clicks
        - profile_visits
        - engagement_rate
      properties:
        comments:
          type: integer
          description: Comments and replies.
        likes:
          type: integer
          description: Likes and reactions.
        shares:
          type: integer
          description: Shares plus reposts (retweets, boosts).
        impressions:
          type: integer
          description: >-
            Views of the post: its impressions or views, as the app shows them
            under Views. Engagement rate divides by this.
        quotes:
          type: integer
          description: Quote posts.
        saves:
          type: integer
          description: Saves and bookmarks.
        views:
          type: integer
          description: Video views, where the network counts them apart from `impressions`.
        reach:
          type: integer
          description: Accounts reached, where the network reports it.
        clicks:
          type: integer
          description: Link or pin clicks.
        profile_visits:
          type: integer
          description: Profile visits from the post.
        engagement_rate:
          type: number
          format: float
          nullable: true
          description: >-
            A percent with 2 decimals (5.23 means 5.23%): (likes + comments +
            shares + quotes + saves + clicks) ÷ impressions × 100. Worked out
            from the summed numbers of the copies that have impressions, never
            an average of their rates. Null when no copy has impressions.
    AnalyticsWorkspaceRow:
      type: object
      required:
        - workspace_id
        - total
      properties:
        workspace_id:
          type: integer
        total:
          $ref: '#/components/schemas/AnalyticsTotals'
        range_limited:
          $ref: '#/components/schemas/AnalyticsRangeLimited'
    AnalyticsRangeLimited:
      type: object
      description: >-
        Only when the workspace's owner is on Free: the numbers cover the posts
        published in its last 7 days (today and the 6 days before, in the
        workspace's time zone). Asked dates inside those days are kept and the
        rest left out; without dates it is these 7 days instead of every post.
      required:
        - days
        - reason
      properties:
        days:
          type: integer
          enum:
            - 7
        reason:
          type: string
          enum:
            - free_plan
    Error:
      type: object
      description: >-
        An error answer. Every one has `message`, in plain words; some add an
        `error` code and fields of their own.
      required:
        - message
      properties:
        message:
          type: string
          description: What went wrong and what to do about it.
        error:
          type: string
          description: >-
            A code a few errors add, such as `rate_limited`. See [Handle
            errors](/essentials/error-handling#answers-with-an-error-code).
    ValidationError:
      type: object
      description: '422: the request didn''t pass validation, and nothing changed.'
      required:
        - message
        - errors
      properties:
        message:
          type: string
          description: >-
            The first error and, when there are more, how many: `(and 1 more
            error)`, `(and 2 more errors)`.
        errors:
          type: object
          description: >-
            The messages, by field. A field inside a list is named with dots:
            `accounts.0.id`.
          additionalProperties:
            type: array
            items:
              type: string
  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.