match_type) and, for most types, a match value (match_value) that scopes it:
- Page goal (
page) — amatch_valuepage path. - Scroll goal (
scroll) — a page path plus ascroll_threshold. - Event goal (
event) — a custom event name. - Autocapture goal (
outbound,download,button,form,copy) — an optional selector; omitmatch_valueto match any event of that kind.
{siteKey} (UUID or domain). All endpoints require Authorization: Bearer {token}.
List goals
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
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
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
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
Status:
204 No Content.

