Update a conversion goal on a Clics project via REST
Update an existing goal.
PATCH
/v1/goals/{goal_id}Authorization
AuthorizationBearer token (API key) · headerrequiredPath parameters
goal_idstringrequiredGoal ID.
min length 1
Request body
requiredapplication/jsondisplay_namestringmin length 1
goal_typestringAllowed:
pageeventoutboundscroll_depthruleobjectShow propertiesHide properties
page_pathstringmin length 1
event_namestringmin length 1
outbound_urlstring<uri>scroll_depth_thresholdintegermin 1 · max 100
Responses
200Updated goal.
idstringrequiredproject_idstringrequiredenv_idstringrequiredAllowed:
productiondevelopmentdisplay_namestringrequired400Invalid request.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequired401Missing or invalid API key.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequired403Forbidden.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequired404Resource not found.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequired500Unexpected error.
errorobjectrequiredShow propertiesHide properties
codestringrequiredmessagestringrequiredRequest
curl -X PATCH "https://api.clics.dev/v1/goals/goal_1" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"rule": {
"page_path": "/thank-you"
}
}'const response = await fetch("https://api.clics.dev/v1/goals/goal_1", {
method: "PATCH",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"rule": {
"page_path": "/thank-you"
}
})
});import requests
response = requests.patch(
"https://api.clics.dev/v1/goals/goal_1",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"rule": {
"page_path": "/thank-you"
}
},
)Response
{
"id": "string",
"project_id": "string",
"env_id": "production",
"display_name": "string"
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}{
"error": {
"code": "string",
"message": "string"
}
}