> ## 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.

# Analytics - by workspace

> Cumulative metrics for all posts in one workspace

## By workspace

Returns **`total`** for every platform post row whose parent post belongs to the given workspace.

### Request

<ParamField path="workspace" type="integer" required>
  Workspace id (same as in [list workspaces](/api-reference/workspaces/list)).
</ParamField>

<RequestExample>
  ```bash theme={null}
  curl -X GET "https://postsyncer.com/api/v1/analytics/workspaces/12" \
    -H "Authorization: Bearer YOUR_API_TOKEN"
  ```
</RequestExample>

### Response

<ResponseField name="workspace_id" type="integer">
  Workspace id from the path
</ResponseField>

<ResponseField name="total" type="object">
  `comments`, `likes`, `shares`, `impressions`, `quotes`, `saves`, `engagement_rate` - same shape as the all-workspaces `total` object.
</ResponseField>

<ResponseExample>
  ```json theme={null}
  {
    "workspace_id": 12,
    "total": {
      "comments": 24,
      "likes": 180,
      "shares": 14,
      "impressions": 6500,
      "quotes": 3,
      "saves": 28,
      "engagement_rate": 4.1
    }
  }
  ```
</ResponseExample>

With no published analytics in that workspace, **`total`** uses `0` for every count and `0` for `engagement_rate`.

### Permissions

Requires the **`posts`** ability. You must have access to the workspace.

### Errors

`401` · `403` · `404` if the workspace is missing or not accessible

See also: [Analytics overview](/api-reference/analytics/overview).
