Targets & Conversions API
Two related surfaces:
- Targets — aggregate KPI numbers to hit by a date (MRR, pipeline, "1,000 signups by Q3"). Canonical route:
/api/targets. - Conversions — the owned-event definitions of a valued action (a purchase, a signup) that experiments, journeys, and Targets reference. Route:
/api/conversion-goals.
"Goal" is retired as a noun. The legacy /api/goals route is a deprecated alias for /api/targets and returns the same shapes — migrate to /api/targets. All endpoints require authentication.
List Targets
/api/targetsRetrieve all Targets for the current workspace
Returns an array of Target objects. When a Target is bound to a Conversion (sourceConversionId), its current is auto-computed from that conversion's completions since createdAt, and currentIsAuto is true. If the bound conversion was deleted, sourceMissing is true and current falls back to the last stored value.
[
{
"id": "target-001",
"metric": "monthly_signups",
"target": 500,
"current": 342,
"deadline": "2026-03-31",
"createdAt": "2026-01-01T00:00:00Z",
"sourceConversionId": "cg_signup",
"currentIsAuto": true
}
]
Create Target
/api/targetsCreate a new KPI Target
| Parameter | Type | Description |
|---|---|---|
metricrequired | string | Metric to track (e.g. monthly_signups, revenue_mrr, trial_conversion_rate) |
targetrequired | number | Target value to reach |
deadlinerequired | string | ISO 8601 date for the Target deadline |
current | number | Starting value for a manual Target. Ignored when sourceConversionId is set (auto-computed). |
sourceConversionId | string | Bind to a Conversion (id from /api/conversion-goals) to auto-track progress from its completions. Must reference an existing owned-event conversion. |
Update Target
/api/targetsUpdate an existing Target
| Parameter | Type | Description |
|---|---|---|
idrequired | string | Target ID to update |
target | number | Updated target value |
deadline | string | Updated deadline |
current | number | Updated value for a manual Target |
sourceConversionId | string | null | Set to a Conversion id to (re)bind for auto-tracking, or null to unbind back to a manual number. |
Delete Target
/api/targets?id=target-001Delete a Target by ID
| Parameter | Type | Description |
|---|---|---|
idrequired | string | Target ID to delete (query parameter) |
Create Conversion
/api/conversion-goalsDefine a Conversion — an owned event that counts as a valued action
Conversions define the events that count as completions for experiments, journeys, and Target auto-tracking. Manage them in the dashboard at /dashboard/conversions.
| Parameter | Type | Description |
|---|---|---|
namerequired | string | Display name (e.g. 'Signed Up', 'Started Trial') |
typerequired | string | How it's detected: form_submit, click, pageview, custom_event, file_download, engaged_time |
eventName | string | For custom_event: the Apex Spec event name to match (e.g. purchase) |
targetUrl | string | For pageview: the URL/path that counts as a completion |
selector | string | For click/form_submit: a CSS selector to match |
isPrimary | boolean | Make this the primary conversion (only one can be primary) |