Skip to main content

Update Goal

PATCH/v2/project/{project_key}/goal/{goal_profile_id}

Update fields on a goal profile. Only the fields you include are changed — all other fields remain unchanged.

Path parameters

ParameterDescription
project_keyYour project's API key
goal_profile_idThe numeric goal profile ID

Updatable fields

FieldTypeDescription
goal_namestringRename the goal
goal_typestringChange the conversion type
goal_valuestringChange the selector, URL, or trigger value
goal_purposestringUpdate the intent ("sell", "engage", "generate")
goal_keystringChange the slug (must remain unique per project)
element_urlstringUpdate the associated page URL

Example: change goal selector

curl -X PATCH "https://api-{region}.mida.so/v2/project/YOUR_PROJECT_KEY/goal/3003" \
-H "Authorization: Bearer YOUR_GENERATED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"goal_value": ".cta-button.above-fold"
}'

Example: change goal type from click to form submit

curl -X PATCH "https://api-{region}.mida.so/v2/project/YOUR_PROJECT_KEY/goal/3003" \
-H "Authorization: Bearer YOUR_GENERATED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"goal_type": "formSubmit",
"goal_value": "form#signup-form",
"goal_name": "Signup Form Submit"
}'

Success response

{
"success": true,
"goal_profile_id": 3003
}
Changing a goal affects linked experiments

If this goal is set as the primary goal for one or more active experiments, changing its goal_type or goal_value will immediately affect what those experiments track as conversions.