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

# Cumulative metrics for all social posts tied to profiles in this workspace



## OpenAPI

````yaml /openapi.json get /analytics/workspaces/{workspace}
openapi: 3.1.0
info:
  title: PublishBuddy
  version: 0.0.1
servers:
  - url: https://api.publishbuddy.com/v1
security: []
paths:
  /analytics/workspaces/{workspace}:
    get:
      tags:
        - WorkspaceAnalytics
      summary: >-
        Cumulative metrics for all social posts tied to profiles in this
        workspace
      operationId: workspaceAnalytics.show
      parameters:
        - name: workspace
          in: path
          required: true
          description: The workspace UUID
          schema:
            type: string
        - name: post_type_id
          in: query
          description: Filter posts by post type ID.
          schema:
            type: string
            enum:
              - '1'
              - '2'
              - '3'
              - '4'
              - '5'
              - '6'
              - '7'
              - '8'
              - '9'
              - '10'
              - '11'
        - name: timeframe
          in: query
          description: Predefined timeframe value, e.g. last_7_days.
          schema:
            type: string
            enum:
              - last_14_days
              - last_7_days
              - last_30_days
              - last_90_days
              - prev_month
              - this_month
              - this_week
              - for_all_time
        - name: order[name]
          in: query
          description: Sort field name.
          schema:
            type: string
            enum:
              - social_posts.post_created_at
              - post_metrics.likes
              - post_metrics.comments
              - post_metrics.shares
              - post_metrics.total_engagement
              - post_metrics.engagement_rate
              - post_metrics.reach
        - name: order[value]
          in: query
          description: Sort direction.
          schema:
            type: string
            enum:
              - asc
              - desc
        - name: Authorization
          in: header
          required: true
          description: JWT token.
          schema:
            type: string
          example: Bearer 123
      responses:
        '200':
          description: '`WorkspaceAnalyticsResource`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/WorkspaceAnalyticsResource'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    WorkspaceAnalyticsResource:
      type: object
      properties:
        workspace_id:
          type: string
        total:
          type: object
          properties:
            comments:
              type: string
            likes:
              type: string
            shares:
              type: string
            impressions:
              type: string
            quotes:
              type: string
            saves:
              type: string
            engagement_rate:
              type: string
          required:
            - comments
            - likes
            - shares
            - impressions
            - quotes
            - saves
            - engagement_rate
      required:
        - workspace_id
        - total
      title: WorkspaceAnalyticsResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors

````