Get your free beta license ↗
API operation · mail group
PUT

/botmail/keys/{id}/webhook

First published 22 Oct 20260.2.15Unchanged since publication

Create or update a bot key's webhook

Who may call it
AdministratorResellerCustomer
Token scope, any of
mailall
Answers200 OK

BotMail 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 server

Parameters

idpath ·integer, 1 or moreRequired

Request body

JSON ·BotWebhookSet· 2 fields
urlstringRequired
Full webhook URL starting with https://. Private IP addresses and plain http:// require mail.botmail_private_webhooks to be enabled, and the server's own loopback IP addresses are always disallowed.
bearerstring, up to 512 characters or null
Token sent in the Authorization: Bearer header with every delivery. Omit this field to keep the stored token, or set it to null or an empty string to remove it.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X PUT "$API/botmail/keys/1/webhook" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "bearer": "text",
    "url": "text"
  }'
Response · 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 sentence
400--key is required
400--url is required
400Domain name required
400Domain name too long
400Invalid IPv4 address
400Invalid IPv6 address
400Invalid domain name
400Invalid id
400Invalid port
400Invalid setting key
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400The webhook address is a full address, like https://example.com/hooks/mail
400Username '<value>' is reserved
401Authentication required
404No such bot connector: <c.params>{id}
404No such bot connector: <id>
404No such domain: <domain>
404Setting '<key>' not found
Generated from release 0.2.35 (current) · the API’s own descriptionThis entry has been unchanged since it was first published in release 0.2.15 on 22 Oct 2026.
urbestack.com/docs/api/put-botmail-keys-id-webhook/