# Get workspace analytics summary

Read traffic totals across the workspace's hosted websites for the selected dates.

POST https://api.brigg.app/v1/operations/analytics.GetWorkspaceAnalyticsSummary

## Access & visibility

Allow `analytics.GetWorkspaceAnalyticsSummary` on your API key.

**Workspace access by default.** Private member data requires [approved member delegation](https://developer.brigg.app/authentication#member-delegation) through `Brigg-Act-As`; the key supplies permissions while private ownership and project boundaries remain enforced.

[Set up authentication](https://developer.brigg.app/authentication) · [Choose permissions](https://developer.brigg.app/permissions)

## Request fields

Send a JSON object with the following fields. Required fields must be included; omit optional fields you do not need.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | integer | No | First UTC day, inclusive: floor(unixMilliseconds / 86400000). Defaults to 29 days before to. It is not a timestamp or date string. |
| `to` | integer | No | Last UTC day, inclusive, as days since 1970-01-01. Defaults to today. If from is after to it becomes to; a difference above 366 is reduced to 366. Read the effective bounds in the response. |

## Choose and interpret a reporting interval

`from` and `to` are inclusive **UTC day indexes**, not dates or Unix milliseconds. For example, 1 October 2026 is `20727`. In JavaScript use `Math.floor(Date.parse("2026-10-01T00:00:00Z") / 86400000)`. Omitted `to` means today; omitted `from` means 29 days before `to`. The service clamps a span longer than 366 days. Read the response's `from` and `to` to see the interval actually used.

`bounce_rate` is a fraction, so `0.2` means 20%. Fields ending in `Ms` are durations in milliseconds. Summary visitors is the sum of daily visitor counts, not a deduplicated count of people across the interval. The same visitor can count on several days; workspace totals also sum across sites.

## Response

Returns **200 OK** with a JSON body.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | number | Yes | First UTC day in the reporting interval, inclusive. A day index counts days since 1970-01-01; multiply by 86400000 to obtain Unix milliseconds. |
| `to` | number | Yes | Last UTC day in the reporting interval, inclusive, as a day index since 1970-01-01. |
| `series` | array of [object](#response-series) | Yes | Available daily buckets in ascending UTC-day order. Dates without activity are omitted; insert zeros in your chart when a continuous date axis is needed. |
| `pageviews` | number | Yes | Total pageview events in the effective interval. |
| `visitors` | number | Yes | Sum of daily distinct visitors per site. A person returning on another day or site can be counted again; this is not a deduplicated multi-day audience. |
| `sessions` | number | Yes | Visits, separated by an inactivity gap of at least 30 minutes. A visit crossing midnight is attributed to its starting day. |
| `bounces` | number | Yes | Sessions containing a single pageview. |
| `bounce_rate` | number | Yes | bounces divided by sessions, from 0 to 1; 0 when sessions is zero. Multiply by 100 for a percentage. |
| `avg_visit_ms` | number | Yes | Total session duration divided by sessions, rounded to milliseconds; 0 when there are no sessions. |
| `avg_engagement_ms` | number | Yes | Total active-page time divided by pageviews, rounded to milliseconds; 0 when there are no pageviews. This is per pageview, not per session. |
| `bundles` | array of [object](#response-bundles) | Yes | Websites contributing to these workspace totals. |

### response.series[]

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `day` | number | Yes | UTC day for this reporting bucket, as days since 1970-01-01, not Unix milliseconds. |
| `pageviews` | number | Yes | Pageviews whose event time falls on this UTC day. |
| `visitors` | number | Yes | Distinct visitors within this UTC day and site; workspace series sums the per-site counts. |
| `sessions` | number | Yes | Sessions beginning on this UTC day. |

### response.bundles[]

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `bundle_id` | string | Yes | Website bundle ID. Use it as bundle_id for the site-specific analytics operations. |
| `pageviews` | number | Yes | Total pageview events in the effective interval. |
| `visitors` | number | Yes | Sum of daily distinct visitors per site. A person returning on another day or site can be counted again; this is not a deduplicated multi-day audience. |
| `sessions` | number | Yes | Visits, separated by an inactivity gap of at least 30 minutes. A visit crossing midnight is attributed to its starting day. |
| `bounces` | number | Yes | Sessions containing a single pageview. |
| `bounce_rate` | number | Yes | bounces divided by sessions, from 0 to 1; 0 when sessions is zero. Multiply by 100 for a percentage. |
| `avg_visit_ms` | number | Yes | Total session duration divided by sessions, rounded to milliseconds; 0 when there are no sessions. |
| `avg_engagement_ms` | number | Yes | Total active-page time divided by pageviews, rounded to milliseconds; 0 when there are no pageviews. This is per pageview, not per session. |

## Errors & retries

This operation reads data. It needs no idempotency key and can be retried after a transient failure.

For rate limits, follow the server’s retry guidance and back off. See [HTTP errors](https://developer.brigg.app/http#errors) and [safe retries and limits](https://developer.brigg.app/reliability).

| HTTP status | Code | What to do |
| --- | --- | --- |
| 400 | `invalid_json` | Send a JSON object with Content-Type: application/json. |
| 400 | `invalid_input` | Check the request fields and types. |
| 401 | `invalid_key` | The workspace API key is missing, invalid or revoked. |
| 403 | `forbidden` | Check the key’s operation and resource grants. If Brigg-Act-As is supplied, the key must be authorized to delegate to that member. |
| 404 | `not_found` | The requested operation or resource is not available to this credential. |
| 429 | `rate_limited` | Wait for Retry-After before retrying. |

## Next steps

- [Get site analytics summary](https://developer.brigg.app/reference/analytics/GetSiteAnalyticsSummary)
- [Get site analytics breakdown](https://developer.brigg.app/reference/analytics/GetSiteAnalyticsBreakdown)
- [Get site analytics realtime](https://developer.brigg.app/reference/analytics/GetSiteAnalyticsRealtime)

[Download OpenAPI](https://developer.brigg.app/openapi.json) · [Versioning & retirement](https://developer.brigg.app/versioning)

## Examples

### Read two complete UTC days

20727 and 20728 are UTC day indices. The two buckets sum to the displayed counts; visitors is not deduplicated across days.
#### cURL


```sh
curl 'https://api.brigg.app/v1/operations/analytics.GetWorkspaceAnalyticsSummary' \
  -H "Authorization: Bearer $BRIGG_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "from": 20727,
  "to": 20728
}'
```

#### TypeScript


```typescript
const response = await fetch("https://api.brigg.app/v1/operations/analytics.GetWorkspaceAnalyticsSummary", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGG_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "from": 20727,
    "to": 20728
  }),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.error} — ${result.message}`);
console.log(result);
```

#### Python


```python
import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError

payload = {
  "from": 20727,
  "to": 20728
}
request = Request(
    "https://api.brigg.app/v1/operations/analytics.GetWorkspaceAnalyticsSummary",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['BRIGG_API_KEY']}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urlopen(request) as response:
        print(json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))
    raise
```

#### Response example


```json
{
  "from": 20727,
  "to": 20728,
  "series": [
    {
      "day": 20727,
      "pageviews": 80,
      "visitors": 40,
      "sessions": 50
    },
    {
      "day": 20728,
      "pageviews": 40,
      "visitors": 20,
      "sessions": 25
    }
  ],
  "pageviews": 120,
  "visitors": 60,
  "sessions": 75,
  "bounces": 15,
  "bounce_rate": 0.2,
  "avg_visit_ms": 120000,
  "avg_engagement_ms": 60000,
  "bundles": [
    {
      "bundle_id": "c_company_site",
      "pageviews": 120,
      "visitors": 60,
      "sessions": 75,
      "bounces": 15,
      "bounce_rate": 0.2,
      "avg_visit_ms": 120000,
      "avg_engagement_ms": 60000
    }
  ]
}
```

### No activity in the interval

An empty series means no buckets were recorded. It is not an authorization failure.
#### cURL


```sh
curl 'https://api.brigg.app/v1/operations/analytics.GetWorkspaceAnalyticsSummary' \
  -H "Authorization: Bearer $BRIGG_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "from": 20727,
  "to": 20728
}'
```

#### TypeScript


```typescript
const response = await fetch("https://api.brigg.app/v1/operations/analytics.GetWorkspaceAnalyticsSummary", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGG_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "from": 20727,
    "to": 20728
  }),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.error} — ${result.message}`);
console.log(result);
```

#### Python


```python
import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError

payload = {
  "from": 20727,
  "to": 20728
}
request = Request(
    "https://api.brigg.app/v1/operations/analytics.GetWorkspaceAnalyticsSummary",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['BRIGG_API_KEY']}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urlopen(request) as response:
        print(json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))
    raise
```

#### Response example


```json
{
  "from": 20727,
  "to": 20728,
  "series": [],
  "pageviews": 0,
  "visitors": 0,
  "sessions": 0,
  "bounces": 0,
  "bounce_rate": 0,
  "avg_visit_ms": 0,
  "avg_engagement_ms": 0,
  "bundles": []
}
```

## JSON schemas


```json-schema-request
{
  "type": "object",
  "properties": {
    "from": {
      "type": "integer",
      "description": "First UTC day, inclusive: floor(unixMilliseconds / 86400000). Defaults to 29 days before to. It is not a timestamp or date string."
    },
    "to": {
      "type": "integer",
      "description": "Last UTC day, inclusive, as days since 1970-01-01. Defaults to today. If from is after to it becomes to; a difference above 366 is reduced to 366. Read the effective bounds in the response."
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "from": 20727,
      "to": 20728
    }
  ]
}
```


```json-schema-response
{
  "type": "object",
  "properties": {
    "from": {
      "type": "number",
      "description": "First UTC day in the reporting interval, inclusive. A day index counts days since 1970-01-01; multiply by 86400000 to obtain Unix milliseconds."
    },
    "to": {
      "type": "number",
      "description": "Last UTC day in the reporting interval, inclusive, as a day index since 1970-01-01."
    },
    "series": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "day": {
            "type": "number",
            "description": "UTC day for this reporting bucket, as days since 1970-01-01, not Unix milliseconds."
          },
          "pageviews": {
            "type": "number",
            "description": "Pageviews whose event time falls on this UTC day."
          },
          "visitors": {
            "type": "number",
            "description": "Distinct visitors within this UTC day and site; workspace series sums the per-site counts."
          },
          "sessions": {
            "type": "number",
            "description": "Sessions beginning on this UTC day."
          }
        },
        "required": [
          "day",
          "pageviews",
          "visitors",
          "sessions"
        ],
        "additionalProperties": false
      },
      "description": "Available daily buckets in ascending UTC-day order. Dates without activity are omitted; insert zeros in your chart when a continuous date axis is needed."
    },
    "pageviews": {
      "type": "number",
      "description": "Total pageview events in the effective interval."
    },
    "visitors": {
      "type": "number",
      "description": "Sum of daily distinct visitors per site. A person returning on another day or site can be counted again; this is not a deduplicated multi-day audience."
    },
    "sessions": {
      "type": "number",
      "description": "Visits, separated by an inactivity gap of at least 30 minutes. A visit crossing midnight is attributed to its starting day."
    },
    "bounces": {
      "type": "number",
      "description": "Sessions containing a single pageview."
    },
    "bounce_rate": {
      "type": "number",
      "description": "bounces divided by sessions, from 0 to 1; 0 when sessions is zero. Multiply by 100 for a percentage."
    },
    "avg_visit_ms": {
      "type": "number",
      "description": "Total session duration divided by sessions, rounded to milliseconds; 0 when there are no sessions."
    },
    "avg_engagement_ms": {
      "type": "number",
      "description": "Total active-page time divided by pageviews, rounded to milliseconds; 0 when there are no pageviews. This is per pageview, not per session."
    },
    "bundles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "bundle_id": {
            "type": "string",
            "description": "Website bundle ID. Use it as bundle_id for the site-specific analytics operations."
          },
          "pageviews": {
            "type": "number",
            "description": "Total pageview events in the effective interval."
          },
          "visitors": {
            "type": "number",
            "description": "Sum of daily distinct visitors per site. A person returning on another day or site can be counted again; this is not a deduplicated multi-day audience."
          },
          "sessions": {
            "type": "number",
            "description": "Visits, separated by an inactivity gap of at least 30 minutes. A visit crossing midnight is attributed to its starting day."
          },
          "bounces": {
            "type": "number",
            "description": "Sessions containing a single pageview."
          },
          "bounce_rate": {
            "type": "number",
            "description": "bounces divided by sessions, from 0 to 1; 0 when sessions is zero. Multiply by 100 for a percentage."
          },
          "avg_visit_ms": {
            "type": "number",
            "description": "Total session duration divided by sessions, rounded to milliseconds; 0 when there are no sessions."
          },
          "avg_engagement_ms": {
            "type": "number",
            "description": "Total active-page time divided by pageviews, rounded to milliseconds; 0 when there are no pageviews. This is per pageview, not per session."
          }
        },
        "required": [
          "bundle_id",
          "pageviews",
          "visitors",
          "sessions",
          "bounces",
          "bounce_rate",
          "avg_visit_ms",
          "avg_engagement_ms"
        ],
        "additionalProperties": false
      },
      "description": "Websites contributing to these workspace totals."
    }
  },
  "required": [
    "from",
    "to",
    "series",
    "pageviews",
    "visitors",
    "sessions",
    "bounces",
    "bounce_rate",
    "avg_visit_ms",
    "avg_engagement_ms",
    "bundles"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "from": 20727,
      "to": 20728,
      "series": [
        {
          "day": 20727,
          "pageviews": 80,
          "visitors": 40,
          "sessions": 50
        },
        {
          "day": 20728,
          "pageviews": 40,
          "visitors": 20,
          "sessions": 25
        }
      ],
      "pageviews": 120,
      "visitors": 60,
      "sessions": 75,
      "bounces": 15,
      "bounce_rate": 0.2,
      "avg_visit_ms": 120000,
      "avg_engagement_ms": 60000,
      "bundles": [
        {
          "bundle_id": "c_company_site",
          "pageviews": 120,
          "visitors": 60,
          "sessions": 75,
          "bounces": 15,
          "bounce_rate": 0.2,
          "avg_visit_ms": 120000,
          "avg_engagement_ms": 60000
        }
      ]
    }
  ]
}
```

