Appearance
Delete an event
Remove an event definition.
http
DELETE /v1/events/{id}Requires a Full access API key.
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | The event id (evt_…) or the event name. |
Example
bash
curl -X DELETE "https://api.sendgrail.com/v1/events/user.created" \
-H "Authorization: Bearer $SENDGRAIL_API_KEY"js
await fetch('https://api.sendgrail.com/v1/events/user.created', {
method: 'DELETE',
headers: { Authorization: `Bearer ${process.env.SENDGRAIL_API_KEY}` },
});Response
json
{
"object": "event",
"id": "evt_3nBq7Ld2KeR9",
"deleted": true
}What deleting does
Deleting removes the event definition and its schema. The name is freed — a later send using it will auto-create the event again, with no schema, as if it had never existed.
Deleting an event does not delete an automation that triggers on it. An automation whose trigger names a now-missing event will not fire until the event exists again — so if an automation depends on the event, disable or repoint the automation rather than leaving it pointed at nothing. A sending-access key answers 403; an id from another team answers 404. See Errors.