# DELETE /botmail/keys/{id}/webhook

First published 22 Oct 2026 (release 0.2.15) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the mail group.

Delete a bot key's webhook

- Who may call it: administrator, reseller, customer
- Token scope, any of: mail, all
- Answers: 200 OK

The key must have a webhook. Deletion removes the stored bearer token and stops new-mail notifications for the key. Removing a mailbox's last webhook clears its Dovecot push opt-in. Removing the server's last webhook disables the webhook delivery timer. A successful response sets deleted to true and returns the key ID in key_id.

Administrators can access any key. Customers can access their own keys, and resellers can access their own keys and those of the customers they manage. A missing or inaccessible key returns 404.

## As a command

- [urbestack-botmail-webhook-del](https://urbestack.com/docs/commands/urbestack-botmail-webhook-del.md): Removes a bot key's webhook and its stored bearer token, ending new-mail notifications for that key.

## Parameters

- `id` (path, integer, 1 or more, required)

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X DELETE "$API/botmail/keys/1/webhook" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "deleted": true,
  "key_id": 1
}
```

## Errors

- 400: --key is required
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid IPv4 address
- 400: Invalid IPv6 address
- 400: Invalid domain name
- 400: Invalid id
- 400: Invalid port
- 400: Invalid setting key
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Username '<value>' is reserved
- 401: Authentication required
- 404: No such bot connector: <c.params>{id}
- 404: No such bot connector: <id>
- 404: No such domain: <domain>
- 404: Setting '<key>' not found
- 404: The bot connector <k.name> has no webhook
