Skip to main content
Manage the goals defined on one of the current team’s sites. A goal has a match type (match_type) and, for most types, a match value (match_value) that scopes it:
  • Page goal (page) — a match_value page path.
  • Scroll goal (scroll) — a page path plus a scroll_threshold.
  • Event goal (event) — a custom event name.
  • Autocapture goal (outbound, download, button, form, copy) — an optional selector; omit match_value to match any event of that kind.
A site is addressed by {siteKey} (UUID or domain). All endpoints require Authorization: Bearer {token}.

List goals

List a site’s goals, ordered by display name. This is a paginated endpoint — it keeps the data / meta / links envelope. See Conventions for the shared pagination envelope every paginated endpoint uses. Query parameters Response — each item in data: Status: 200 OK.

Create a goal

Create a goal. Set match_type, and a match_value to scope it — required for page, scroll, and event types, optional for the autocapture types. Body parameters An event goal cannot use a reserved name (each returns 422): pageview, engagement, performance, web-vitals, and the Stripe lifecycle goals payment, free_trial, trial_started, trial_converted, subscription_started, subscription_renewed, subscription_upgraded, subscription_downgraded, subscription_cancel_scheduled, subscription_reactivated, subscription_ended are written only by Clickbase. Those Stripe names appear automatically as filterable goals after Connect — you do not create them as custom goals. See Track revenue for why they are off-limits. Additional invariants enforced by the CreateGoal Action (each returns 422): an identical goal config (same type, value, operator, scroll threshold, and custom props) already exists; the display name is taken; the site has reached its 1000-goal ceiling. Response — the created goal (same fields as the list). Status: 201 Created.

Update a goal

Update a goal’s full definition — this replaces the goal’s whole record, the same edit the web settings form performs. It is not a rename-only or partial-patch endpoint: it accepts the exact same body as create, re-validated the same way (match_type is required again, match_value is required again for page/scroll/event), and every field you omit is reset rather than left alone — omitting currency clears it, omitting custom_props clears the property filters, and omitting display_name re-derives it from the (possibly new) match type/value rather than keeping the old label. Always send the goal’s complete definition on update, not just the field you changed. Path parameters Body parameters — identical set and rules as create: match_type, match_value, match_operator, scroll_threshold, display_name, currency, custom_props. The duplicate-config and duplicate-display-name checks exclude this goal itself, so re-saving a goal under its own current config/name is never rejected as a collision with itself. Metrics recompute live from ClickHouse against the goal’s current definition, so retargeting match_type/match_value/match_operator is safe — historical numbers simply reflect the new definition going forward. A goal’s funnel usage is unaffected: a funnel step is its own inline match definition, not a foreign key to a saved goal. Response — the updated goal (same fields as the list). Status: 200 OK.

Batch-create event goals

Create one event-type goal per given event name in a single call — the “add all suggested events” action on the web goals settings page. Any name that already exists as a goal, or otherwise fails a goal’s create validation (e.g. a reserved event name), is silently skipped rather than aborting the whole batch. Body parameters Response — the site’s full, current goal list (all goals, not just the ones this call created), newest first. Flat JSON array, not paginated. Status: 200 OK.

Delete a goal

Delete a goal. Cannot be undone. This does not touch any funnel: a funnel step is its own inline match definition, not a foreign key to a saved goal, so there is nothing to cascade. Path parameters Status: 204 No Content.