Skip to main content

Endpoint

Deletes a goal by its ID. If the goal belongs to a funnel, the funnel will be automatically adjusted or removed.

Authentication

Requires a Plugins API token with write access.
string
required
Bearer token for authentication

Path Parameters

integer
required
The unique ID of the goal to deleteExample: 123

Response

On successful deletion, returns a 204 No Content status with an empty response body.

Status Codes

  • 204 No Content - Goal deleted successfully
  • 401 Unauthorized - Missing or invalid API token
  • 404 Not Found - Goal with specified ID not found

Funnel Behavior

When deleting a goal that belongs to one or more funnels:
  • If the funnel has more than the minimum steps (2): The step associated with the deleted goal is removed, and the funnel continues to exist with the remaining steps.
  • If the funnel has exactly the minimum steps (2): The entire funnel is deleted along with the goal, as a funnel cannot exist with fewer than 2 steps.

Examples

Delete a Goal

Response:

Error: Goal Not Found

Response:

Bulk Delete Goals

Delete multiple goals in a single request.

Request Body

array
required
Array of goal IDs to deleteExample: [123, 124, 125]

Examples

Response:

Delete All Goals for a Site

Notes

  • Deletion is permanent and cannot be undone
  • Historical event data is not affected - only the goal definition is removed
  • Deleting a goal removes it from all associated funnels
  • If a funnel has only 2 steps and one goal is deleted, the entire funnel is removed
  • Goals can only be deleted for sites you have access to via your API token
  • Non-existent goal IDs in bulk delete operations are silently ignored