Update alert
PUT https://datafa.st/api/v1/admin/websites/{websiteId}/alerts/{alertId}Update an alert name, watched goal, email template, or enabled state. Send only the fields you want to change.
Disabling an alert (
isEnabled: false) stops emails without deleting the configuration.Related: Alerts announcement · Custom goals
Request
Path parameters
websiteIdstring
alertIdstring
Alert ObjectId from List alerts.
Body parameters
namestring
Human-readable name for the resource or event. The exact meaning depends on the endpoint.
trigger.goalNamestring
Goal that fires the alert. Example:
"purchase". Lowercased when saved. Pick from List tracked goals.template.messagestring
Plain-text email body. Min 10, max 2000 characters. Example:
"Someone just signed up on your site."template.subjectstring
Optional custom subject. Example:
"New signup on example.com". Defaults to a standard alert subject when omitted.isEnabledboolean
true to enable; false to pause emails.Example request body
{
"name": "New signup alert",
"trigger": { "goalName": "signup" },
"template": {
"subject": "New signup!",
"message": "A visitor just completed the signup goal."
},
"isEnabled": true
}
Response
Returns a JSON object with
status: "success" and endpoint-specific fields in data.Response fields
data[].idstring
Alert ObjectId.
data[].websiteIdstring
Website ObjectId used by account tokens to choose which website to query or manage.
data[].namestring
Human-readable name for the resource or event. The exact meaning depends on the endpoint.
data[].trigger.typestring
Trigger type. Currently
goal.data[].trigger.goalNamestring
Goal watched by the alert.
data[].destination.typestring
Destination type. Currently
email.data[].template.subjectstring (optional)
Custom subject when configured; omitted otherwise.
data[].template.messagestring
Human-readable confirmation or status message for the operation.
data[].isEnabledboolean
Whether the alert is enabled.
data[].triggerCountnumber
All-time successful trigger count.
data[].monthlyCountnumber
Current billing-cycle trigger count.
data[].monthlyCountResetAtstring
Timestamp used to reset the monthly counter.
data[].dailyCountnumber
Current UTC-day trigger count.
data[].dailyCountResetAtstring
Timestamp used to reset the daily counter.
data[].lastTriggeredAtstring|null (optional)
Latest successful trigger timestamp, when available; omitted before the first trigger.
data[].lastErrorstring|null (optional)
Latest delivery error, when available; omitted before an error is recorded.
data[].recentLogsobject[]
Recent trigger logs.
data[].createdAtstring
Creation timestamp.
data[].updatedAtstring
Last update timestamp.
Authentication
Use a
dft_ account token with alerts:write.A
df_ website API key for the same website can also call this route when the path websiteId matches the key's website. Write access with a df_ key is capped at member level — owner-only actions such as team management require a dft_ token and owner role.Errors
See API errors for the standard error envelope, auth failures, validation errors, permission errors, and rate limits.