---
title: "Replace the workspace's web analytics settings"
method: POST
path: "/api/workspaces.setWebAnalyticsSettings"
tags: ["Web Analytics"]
---

# Replace the workspace's web analytics settings

`POST /api/workspaces.setWebAnalyticsSettings`

Gated by the web_analytics write permission (like blog settings, members manage the feature without workspace write access). The attribution filters version is recomputed server-side. Passing null settings clears the configuration.

Writing an identified visitor's goals and navigation to their contact timeline is not configured here and has no setting: calling identify() with an HMAC is the opt-in, because minting that credential requires the workspace secret.

## Request body

- object
  - `workspace_id` string, required
  - `settings` WebAnalyticsSettings, nullable
    - `enabled` boolean
    - `allowed_domains` string[] — Origins allowed to send beats ("example.com", "*.example.com"); empty allows all.
    - `bounce_threshold_seconds` integer — Sessions with less engaged time count as bounces (default 10).
    - `filters` WebFilter[]
      - `id` string, required
      - `name` string, required
      - `priority` integer, required
      - `order` integer
      - `tags` string[]
      - `conditions` WebFilterCondition[], required
        - `field` string, required
        - `operator` 'equals' | 'not_equals' | 'contains' | 'not_contains' | 'is_empty' | 'is_not_empty' | 'regex', required
        - `value` string
      - `operations` WebFilterOperation[], required
        - `dimension` string, required
        - `action` 'set_value' | 'unset_value' | 'set_default_value', required
        - `value` string
      - `enabled` boolean, required
      - `version` string
    - `filters_version` string
    - `custom_dimension_labels` object
    - `identify_from_email_links` boolean — Adds a signed identity to the links of tracked emails, so a recipient who clicks one is recognised on landing without any code on the customer's site, and their visit is tied to their contact record. Off by default: unlike identify(), which the customer's own server calls with their own secret, this credential is minted by Notifuse for every recipient of every tracked send, so it is theirs to ask for.
    - `geo_enabled` boolean
    - `geo_store_city` boolean
    - `geo_store_region` boolean
    - `geo_coordinates_precision` integer

## Response `200`

Settings updated

## Other responses

- `400` — Validation failed
- `403` — The caller lacks web_analytics write, returned with the missing resource named in the error message.

## Changes

- **2026-08-17** `d26605f2fc47` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/pierre-b/apis/notifuse-api/changes/api/workspaces.setWebAnalyticsSettings/post.md)

---

[API](https://skmtc.dev/pierre-b/apis/notifuse-api.md) · [All operations](https://skmtc.dev/pierre-b/apis/notifuse-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/pierre-b/notifuse-api/revisions/d26605f2fc47/schema)
