Create a Goal
Changed onCreate a goal in the account. A goal only marks page views tracked after it is created; earlier visits are not re-checked. The goal's custom feed is created in the background, so relationships.custom_feed is usually null in the response.
The operators each criterion.field accepts:
| field | Operators |
|---|---|
| page_url | is, is_not, begins_with, not_begins_with, ends_with, contains, not_contains |
| page | is, is_not, begins_with, ends_with, contains, not_contains |
| form_submit | is, is_not, is_present, is_empty |
| file_download_name | is, is_not, contains, is_present, is_empty |
| video_title | is, is_not, begins_with, contains, is_present, is_empty |
| video_url | is, is_not, begins_with, is_present, is_empty |
Credit Note: Creating a goal does not consume credits.
:::info Requires the web_visits:write OAuth2 scope. :::
Request
- Base URLhttps://api.leadfeeder.com
- URLhttps://api.leadfeeder.com/v1/web-visits/goals
- Auth
- API key in header X-Api-Key
- or OAuth 2Authorization code: https://api.leadfeeder.com/v1/oauth/authorizeToken URL: https://api.leadfeeder.com/v1/oauth/token scopes: web_visits:write
Query parameters
The Leadfeeder Account ID. The Account ID can be retrieved using the List Accounts endpoint.
Request body
Example request
{
"data": {
"attributes": {
"criterion": {
"field": "page_url",
"operator": "contains",
"value": "/pricing"
},
"enabled": true,
"name": "Pricing page"
},
"type": "goal"
}
}Response
Success
Example response
{
"data": {
"attributes": {
"created_at": "2026-10-01T10:00:00.000Z",
"criterion": {
"field": "page_url",
"operator": "contains",
"value": "/pricing"
},
"enabled": true,
"name": "Pricing page",
"updated_at": "2026-10-02T11:00:00.000Z"
},
"id": "4182",
"relationships": {
"custom_feed": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "custom_feed"
}
},
"type": "goal"
},
"meta": {
"request_id": "cf054205-dd8c-4473-8689-07c30fe0789f"
}
}Changes
- breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring - breaking
the
/////request property type changed from no type tostring
- breaking
- breaking
removed
subschema #1subschema #2from the///request propertyoneOflist - info
added
subschema #1: page_url: comparisonsubschema #2: page: comparisonsubschema #3: form_submit: comparisonsubschema #4: form_submit: presencesubschema #5: file_download_name: comparisonsubschema #6: file_download_name: presencesubschema #7: video_title: comparisonsubschema #8: video_title: presencesubschema #9: video_url: comparisonsubschema #10: video_url: presenceto the///request propertyanyOflist
- breaking