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

# Get a workspace's analytics

> Get the totals of one workspace's published posts, and each account's latest follower count.

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

Gives the totals of the workspace's published posts, and in `accounts` every account of the workspace with its latest follower count, whatever the dates. The dates pick which posts count, by the day each was published.

On Free (the workspace owner's plan), the dates are limited to the workspace's last 7 days, in its time zone: only the asked days inside them count, and the 7 days when you send no dates. The answer has `range_limited`. 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. |
| 404 | | No workspace with that id among the ones the key can reach. | No. |
| 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 an account's analytics](/docs/api-reference/analytics/account.md): one account, with each post.
* [Analytics](/docs/api-reference/analytics/overview.md): what each number means.


## OpenAPI

````yaml GET /analytics/workspaces/{workspace}
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/workspaces/{workspace}:
    get:
      tags:
        - Analytics
      summary: Get a workspace's analytics
      description: >-
        Needs `analytics:read`. Totals of one workspace's published posts, and
        each of its accounts with its latest follower count. 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. On Free (the workspace owner's plan), the dates are limited
        to the workspace's last 7 days (today and the 6 days before, in its time
        zone): only the asked days inside them count, the last 7 days when no
        dates are sent, and none when every asked day is older. The answer has
        `range_limited`.
      operationId: getWorkspaceAnalytics
      parameters:
        - name: workspace
          in: path
          required: true
          description: The workspace's id.
          schema:
            type: integer
        - 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 workspace's totals and accounts.
          content:
            application/json:
              schema:
                type: object
                required:
                  - workspace_id
                  - total
                  - accounts
                properties:
                  workspace_id:
                    type: integer
                  total:
                    $ref: '#/components/schemas/AnalyticsTotals'
                  accounts:
                    type: array
                    description: Every account in the workspace, by id, whatever the dates.
                    items:
                      $ref: '#/components/schemas/AnalyticsAccountFollowers'
                  range_limited:
                    $ref: '#/components/schemas/AnalyticsRangeLimited'
              examples:
                default:
                  summary: Halden Coffee
                  value:
                    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
                    accounts:
                      - account_id: 301
                        platform: instagram
                        name: Halden Coffee
                        username: haldencoffee
                        followers: 4210
                        followers_synced_at: '2030-03-16T06:00:00+00:00'
                      - account_id: 302
                        platform: linkedin
                        name: Halden Coffee
                        username: halden-coffee
                        followers: 1180
                        followers_synced_at: '2030-03-16T06:00:00+00:00'
                      - account_id: 304
                        platform: google_business
                        name: Halden Coffee · Harbourside
                        username: halden-coffee-harbourside
                        followers: null
                        followers_synced_at: null
                free:
                  summary: 'On Free: the last 7 days'
                  value:
                    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
                    accounts:
                      - account_id: 301
                        platform: instagram
                        name: Halden Coffee
                        username: haldencoffee
                        followers: 4210
                        followers_synced_at: '2030-03-16T06:00:00+00:00'
                      - account_id: 302
                        platform: linkedin
                        name: Halden Coffee
                        username: halden-coffee
                        followers: 1180
                        followers_synced_at: '2030-03-16T06:00:00+00:00'
                      - account_id: 304
                        platform: google_business
                        name: Halden Coffee · Harbourside
                        username: halden-coffee-harbourside
                        followers: null
                        followers_synced_at: null
                    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.
        '404':
          $ref: '#/components/responses/NotFound404'
        '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.
    AnalyticsAccountFollowers:
      type: object
      required:
        - account_id
        - platform
        - name
        - username
        - followers
        - followers_synced_at
      properties:
        account_id:
          type: integer
        platform:
          type: string
          description: The network, like `instagram`.
        name:
          type: string
          nullable: true
        username:
          type: string
          nullable: true
        followers:
          type: integer
          nullable: true
          description: The latest follower count read; null when none was read.
        followers_synced_at:
          type: string
          format: date-time
          nullable: true
          description: When it was read, ISO 8601.
    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.
    NotFound404:
      description: Nothing with that id in the workspaces the key can reach.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            not_found:
              summary: Not found
              value:
                message: Not found.
    RateLimited429:
      description: >-
        More than 60 requests in a minute from this key's user (the API and the
        MCP server share the count). Wait `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds until requests are allowed again.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests allowed a minute.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left this minute.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: When requests are allowed again, as a Unix timestamp.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            too_many_attempts:
              summary: Too many requests
              value:
                message: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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