api-referenceDEL
DELETE
https://analytics.flowsery.com/analytics/api/v1/goalsDelete custom goal events by visitor, event name, or within a date range.
Bearer Token (workspace token or website API key)
Workspace tokens need a website selector
Workspace API tokens can access every website in the workspace. Pass either <code>websiteId</code> or <code>domain</code> so Flowsery knows which website to query or mutate. Website API keys are already scoped to one website, so the selector can be omitted.Website selector
| Parameter | Type | Description |
|---|---|---|
websiteId | string | Website ID to use with a workspace API token. Omit when authenticating with a website API key. |
domain | string | Website domain to use with a workspace API token when websiteId is not provided. Omit when authenticating with a website API key. |
At least one filter required
At least one query parameter must be provided. Calling this endpoint with no filters returns a 400 error.Query parameters
| Parameter | Type | Description |
|---|---|---|
visitorId | string | Remove goals tied to a specific visitor ID. |
name | string | Remove goals matching a specific event name (e.g., signup, purchase). |
startAt | string | ISO 8601 start timestamp (e.g., 2024-01-01T00:00:00Z). |
endAt | string | ISO 8601 end timestamp (e.g., 2024-01-31T23:59:59Z). |
Deletion behavior
<strong>Time range only:</strong> Removes every goal within that period.
<strong>Visitor ID only:</strong> Removes all goals for that visitor (all time).
<strong>Name only:</strong> Removes all goals with that name (all time).
<strong>Visitor ID + name:</strong> Removes goals matching both criteria.
<strong>Time range + filters:</strong> Removes goals matching the filters within the given window.
Supplying <code>visitorId</code> or <code>name</code> without a time range deletes ALL matching records across the entire history.
Error responses
<strong>400 Bad Request</strong> -- No filter parameters were provided.
<strong>401 Unauthorized</strong> -- API token is missing, invalid, expired, or not accepted for this endpoint.
Delete by name within a date range
curl -X DELETE "https://analytics.flowsery.com/analytics/api/v1/goals?websiteId=flid_abc123&name=signup&startAt=2024-01-01T00:00:00Z&endAt=2024-01-31T23:59:59Z" \
-H "Authorization: Bearer <workspace-or-website-token>"Delete all goals for a visitor
curl -X DELETE "https://analytics.flowsery.com/analytics/api/v1/goals?websiteId=flid_abc123&visitorId=a3ab2331-989f-4cfa-91c6-2461c9e3c6bd" \
-H "Authorization: Bearer <workspace-or-website-token>"200
{
"status": "success",
"data": [
{
"deleted": 14,
"message": "Goal events deleted successfully"
}
]
}