# urbestack-botmail-webhook-set

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

UrbeStack release 0.2.35 command, run as root in the server shell.

## Usage

```
urbestack-botmail-webhook-set --key N --url ADDRESS [--bearer-stdin] [--owner USER]
```

## Description

Creates or updates the webhook for the bot key identified by --key. BotMail sends one POST per new message in the mailbox's INBOX with the folder, UID, sender, subject, date and first lines of the message.

Set --url to a full HTTPS URL such as https://example.com/hooks/mail. The host must resolve to an IP address. An explicit port must be between 1 and 65535. The path defaults to /. Loopback IP addresses are always refused. Plain HTTP URLs and hosts that resolve to private or link-local IP addresses require mail.botmail_private_webhooks, labeled Allow private network and HTTP webhooks under Mail > Settings. BotMail checks the destination again before each delivery.

With --bearer-stdin, supply the receiver's bearer key as one line on standard input. The key can be up to 512 characters long with no spaces. BotMail sends it as Authorization: Bearer <key> with every delivery. Supply an empty line to remove the key or omit --bearer-stdin to keep the current one.

Use --owner to run the command on behalf of the customer who owns the mailbox's domain. To resume a paused webhook, use urbestack-botmail-webhook-resume.

## Same in the API

- [PUT /botmail/keys/{id}/webhook](https://urbestack.com/docs/api/put-botmail-keys-id-webhook.md): Create or update a bot key's webhook

## Command family: botmail

- [urbestack-botmail-domain-list](https://urbestack.com/docs/commands/urbestack-botmail-domain-list.md): Lists domains whose mail is hosted on this server.
- [urbestack-botmail-domain-off](https://urbestack.com/docs/commands/urbestack-botmail-domain-off.md): Turns off BotMail for a domain and immediately revokes every BotMail key for its mailboxes.
- [urbestack-botmail-domain-on](https://urbestack.com/docs/commands/urbestack-botmail-domain-on.md): Turns on BotMail for a domain whose mail is hosted on this server or changes its BotMail hostname.
- [urbestack-botmail-events](https://urbestack.com/docs/commands/urbestack-botmail-events.md): Runs one round of BotMail webhook delivery, the same work the timer runs every minute.
- [urbestack-botmail-key-add](https://urbestack.com/docs/commands/urbestack-botmail-key-add.md): Creates a named BotMail key for the mailbox specified by --address.
- [urbestack-botmail-key-address](https://urbestack.com/docs/commands/urbestack-botmail-key-address.md): Issues a new MCP URL for an existing bot key by rotating its secret.
- [urbestack-botmail-key-del](https://urbestack.com/docs/commands/urbestack-botmail-key-del.md): Revokes a bot key immediately and removes its webhook.
- [urbestack-botmail-key-list](https://urbestack.com/docs/commands/urbestack-botmail-key-list.md): Lists all bot keys on the server by default.
- [urbestack-botmail-key-set](https://urbestack.com/docs/commands/urbestack-botmail-key-set.md): Changes selected rules for a bot key, pauses it, or resumes it.
- [urbestack-botmail-prune](https://urbestack.com/docs/commands/urbestack-botmail-prune.md): Deletes BotMail key activity, counters from expired rate-limit windows, and webhook events that have reached a final status when they are older than the retention period set by mail.botmail_activity_days.
- [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.
- [urbestack-botmail-webhook-resume](https://urbestack.com/docs/commands/urbestack-botmail-webhook-resume.md): Resumes a bot key's webhook after BotMail paused it following seven failed delivery attempts.
- [urbestack-botmail-webhook-test](https://urbestack.com/docs/commands/urbestack-botmail-webhook-test.md): Sends an immediate test ping through BotMail to the webhook for the bot key identified by --key.
