Delete goals
DELETE https://datafa.st/api/v1/goals
Delete custom goal events by visitor, goal name, or time range. Use this to clean up test data or comply with deletion requests.
startAt and endAt are canonical for every ranged delete. They are optional when filtering by visitor or goal name and required for an unfiltered bulk delete. Deprecated aliases: start and end remain accepted together for compatibility. Incomplete or conflicting ranges return 400 instead of falling back to an all-time delete.Related: Custom goals
Request
Query parameters
websiteIddft_ account token on Website API routes. Omit with a df_ website key. Example: ?websiteId=665f0b3c4d2e1a0012345678.datafast_visitor_iddatafast_visitor_id cookie or tracking script. Example: "a3ab2331-989f-4cfa-91c6-2461c9e3c6bd". Alias: visitorId on some endpoints.name_. Allowed: a-z, 0-9, _, -, :. Max 64 chars. Reserved: identify. Example: "newsletter_signup". See custom goals.startAtstartAt and endAt together. They are optional for a filtered delete and required for an unfiltered bulk delete. Example: startAt=2026-05-01T00:00:00Z&endAt=2026-05-19T23:59:59Z.endAtstartAt so DataFast can build the date range. Canonical end bound. Required with startAt whenever either bound is provided.startstartAt and endAt. Existing clients may continue to pass start and end together. Incomplete or conflicting ranges return 400.endendAt. Pass together with start.Example queries
By goal name and optional canonical range:
DELETE /api/v1/goals?name=signup&startAt=2026-05-01T00:00:00Z&endAt=2026-05-19T23:59:59Z
Bulk delete (also uses
startAt + endAt):DELETE /api/v1/goals?startAt=2026-05-01T00:00:00Z&endAt=2026-05-19T23:59:59Z
Response
Returns a JSON object with
status: "success" and endpoint-specific fields in data (and pagination when the endpoint is paginated).Response fields
statussuccess.data[].messagedata[].datafast_visitor_iddata[].goal_namedata[].timeRange.startdata[].timeRange.endAuthentication
df_website API key: The website is inferred from the key. You do not need awebsiteIdquery parameter.dft_account token: Requiresgoals:writepermission and?websiteId=on every request. The token must be allowed to access that website.
Read authentication and scopes for token creation, permission lists, and scoped tokens.
Errors
400 — No filter provided, invalid goal name, invalid visitor ID, invalid, incomplete, or conflicting range, or missing
startAt/endAt for bulk delete.504 — Delete operation timed out. Retry with a smaller time range.
See API errors for the standard error envelope, auth failures, validation errors, permission errors, and rate limits.