Goals API
Define, track, and manage growth goals and conversion goal definitions. All endpoints require authentication.
List Goals
GET
/api/goalsRetrieve all goals for the current project
curl https://your-instance.com/api/goals \
-H "x-api-key: apex_key_abc123"
Returns an array of goal objects with current progress:
[
{
"id": "goal_001",
"metric": "monthly_signups",
"target": 500,
"current": 342,
"deadline": "2025-03-31",
"status": "on_track",
"createdAt": "2025-01-01T00:00:00Z"
}
]
Create Goal
POST
/api/goalsCreate a new growth goal
| 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 goal deadline |
description | string | Human-readable description of the goal |
unit | string | Display unit (e.g. users, dollars, percent) |
curl -X POST https://your-instance.com/api/goals \
-H "Content-Type: application/json" \
-H "x-api-key: apex_key_abc123" \
-d '{
"metric": "monthly_signups",
"target": 500,
"deadline": "2025-03-31",
"description": "Reach 500 signups per month by end of Q1"
}'
Update Goal
PATCH
/api/goalsUpdate an existing goal
| Parameter | Type | Description |
|---|---|---|
idrequired | string | Goal ID to update |
target | number | Updated target value |
deadline | string | Updated deadline |
status | string | Manual status override: on_track, at_risk, behind, or completed |
curl -X PATCH https://your-instance.com/api/goals \
-H "Content-Type: application/json" \
-H "x-api-key: apex_key_abc123" \
-d '{ "id": "goal_001", "target": 600, "status": "at_risk" }'
Delete Goal
DELETE
/api/goals?id=goal_001Delete a goal by ID
| Parameter | Type | Description |
|---|---|---|
idrequired | string | Goal ID to delete (query parameter) |
curl -X DELETE "https://your-instance.com/api/goals?id=goal_001" \
-H "x-api-key: apex_key_abc123"
Create Conversion Goal
POST
/api/conversion-goalsDefine a conversion event that goals and experiments can track
Conversion goals define the events that count as conversions for experiments and goal tracking.
| Parameter | Type | Description |
|---|---|---|
namerequired | string | Display name (e.g. 'Signed Up', 'Started Trial') |
eventTyperequired | string | Event type to match (e.g. form_submit, purchase) |
urlPattern | string | URL pattern to scope the conversion (e.g. /signup/complete) |
conditions | object | Additional matching conditions on event data properties |
curl -X POST https://your-instance.com/api/conversion-goals \
-H "Content-Type: application/json" \
-H "x-api-key: apex_key_abc123" \
-d '{
"name": "Trial Signup",
"eventType": "form_submit",
"urlPattern": "/signup/complete"
}'