/botmail/keys/{id}/webhook
0.2.15Unchanged since publicationCreate or update a bot key's webhook
mailallBotMail sends one POST for each new message in the mailbox's INBOX. The request body includes the folder, UID, sender, subject, date, and first lines of the message. The operation returns the saved configuration in webhook. Use POST /botmail/keys/{id}/webhook/resume to resume a paused webhook.
Supply a full HTTPS URL in url, such as https://example.com/hooks/mail. A missing or empty url, a value over 2048 characters, or a value containing control characters returns 400. The host must resolve to an IP address. An explicit port must be between 1 and 65535, and the path defaults to /. 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. UrbeStack always refuses loopback IP addresses. BotMail checks the destination again before each delivery.
The optional bearer value is a single line of up to 512 characters with no spaces. BotMail sends it with every delivery in the Authorization: Bearer <key> header. Set bearer to null or an empty string to remove the stored token. Omit bearer to keep the current token.
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
Run as root on the serverParameters
idpath ·integer, 1 or moreRequiredurlstringRequiredbearerstring, up to 512 characters or nullExample
See the API overview for how to set $API and $TOKEN.curl -sS -X PUT "$API/botmail/keys/1/webhook" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"bearer": "text",
"url": "text"
}'200 OK{
"webhook": {
"created_at": "2026-09-09T10:15:00Z",
"dead_why": "text",
"has_bearer": true,
"id": 1,
"key_id": 1,
"live": true,
"paused": true,
"paused_at": "text",
"paused_reason": "text",
"updated_at": "text",
"url": "text"
}
}Errors
18 errors, each a status and a sentence400--key is required400--url is required400Domain name required400Domain name too long400Invalid IPv4 address400Invalid IPv6 address400Invalid domain name400Invalid id400Invalid port400Invalid setting key400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter400The webhook address is a full address, like https://example.com/hooks/mail400Username '<value>' is reserved401Authentication required404No such bot connector: <c.params>{id}404No such bot connector: <id>404No such domain: <domain>404Setting '<key>' not foundurbestack.com/docs/api/put-botmail-keys-id-webhook/