Delete Goal Events
delete_goalsPermanently delete recorded goal completions filtered by visitor, goal name, or date range. At least one filter is required; goal definitions remain intact.
Instructions
Permanently delete recorded goal completions matching every filter given (filters combine with AND). At least one of visitorId, name, startAt, or endAt is required or the call fails before reaching the API; startAt and endAt are independent, so one bound alone is allowed. Without a date range, matches are deleted across the whole history. Returns the number of rows deleted. Cannot be undone: restate website, filters, and range and get explicit confirmation first. Deletes completions only; the goal definition stays and get_goals still lists it. Use delete_payments for revenue records and update_issue_status for issues. Requires websiteId or domain with a workspace token.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "delete_goals"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Delete completions of this goal name (as listed by get_goals) | |
| endAt | No | ISO 8601 end of the deletion window, inclusive (e.g. "2026-01-31T23:59:59Z"). May be used without startAt. | |
| domain | No | Website domain from list_websites (e.g. "example.com"). Alternative to websiteId with a workspace token. | |
| startAt | No | ISO 8601 start of the deletion window, inclusive (e.g. "2026-01-01T00:00:00Z"). May be used without endAt. | |
| visitorId | No | Delete completions of this visitor (the id get_visitor takes). Combined with the other filters using AND. | |
| websiteId | No | Website ID from list_websites. Required with a workspace token unless domain is given; ignored with a website key. | |
| workspaceId | No | Workspace to act in: an id from list_workspaces. Omit to use the default workspace. Use the same workspaceId for every call about the same workspace, since ids from one workspace do not exist in another |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |