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

/botmail/keys/{id}

First published 18 Oct 20260.2.10Unchanged since publication

Update a bot key's rules or pause or resume the key

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

Supply at least one field to update. Set paused to true to pause the key or false to resume it. Only an administrator can resume a key paused by an administrator. The 200 response includes the updated key.

The may field sets the operations the key can perform. The send_mode field accepts self, drafts, or known. Use recipients and blocked to set allowed and blocked recipients. The from_addresses field accepts up to 32 IP addresses or CIDR networks that the bot can call from. The name field accepts up to 64 characters. The sends_per_hour field accepts 1 to 1000, and recipients_per_message accepts 1 to 50. The sends_per_day and calls_per_minute fields each accept values from 1 up to the corresponding server ceiling.

Set from_name to an empty string to send using only the sender's email address. Set copy_to to an empty string to stop sending copies. The expires_days field sets the key's validity period in days. Use 0 to remove expiration.

The API returns 400 if you supply no changes or if a rule value contains ASCII control characters or exceeds 4096 characters, including commas between list entries. It returns 404 if the key is missing or the caller lacks access to it.

As a command

Run as root on the server

Parameters

idpath ·integer, 1 or moreRequired

Request body

JSON ·BotKeyPatch· 16 fields
blockedarray of string, up to 254 characters
Recipient email addresses and domains the key can never send to.
calls_per_minuteinteger, 1 to 6000
Maximum calls per minute, subject to the server's ceiling.
copy_tostring, up to 320 characters or null
Email address that receives a copy of every message sent with this key. Set to null or an empty string to remove it.
expires_daysinteger, 0 to 3650
Number of days until the key expires, or 0 for no expiration.
folders_outarray of string, one of drafts, sent, junk, trash
Special mail folders the key cannot access.
from_addressesarray of string, up to 64 characters
Source IP addresses or CIDR blocks from which the bot can make calls. An empty list allows any source IP address.
from_namestring, up to 64 characters
Sender display name on messages sent with this key. An empty string displays only the sender's email address.
mayarray of string, one of read, search, flag, draft, send, reply
Operations the key can perform. If reply is the only permission, the key can only send replies to messages it was given.
namestring, up to 64 characters
Name the owner gives the key.
pausedboolean
platformstring, up to 32 characters
Name of the platform or program that runs the bot, such as ChatGPT, Claude, or my program.
recipientsarray of string, up to 254 characters
Recipient email addresses and domains the key can send to. An empty list allows any recipient.
recipients_per_messageinteger, 1 to 50
send_modestring, one of self, drafts, known
With self, messages are sent automatically. With drafts, all messages wait in Drafts for the owner, and with known, messages to known contacts are sent automatically while messages to other recipients wait in Drafts.
sends_per_dayinteger, 1 to 100000
Daily sending limit, subject to the server's ceiling.
sends_per_hourinteger, 1 to 1000

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X PATCH "$API/botmail/keys/1" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "blocked": [
      "text"
    ],
    "calls_per_minute": 1,
    "copy_to": "text",
    "expires_days": 1,
    "folders_out": [
      "drafts"
    ],
    "from_addresses": [
      "text"
    ],
    "from_name": "text",
    "may": [
      "read"
    ],
    "name": "alice",
    "paused": true,
    "platform": "text",
    "recipients": [
      "text"
    ],
    "recipients_per_message": 1,
    "send_mode": "self",
    "sends_per_day": 1,
    "sends_per_hour": 1
  }'
Response · 200 OK
{
  "key": {
    "address": "info@example.com",
    "address_made_at": "text",
    "blocked": [
      "text"
    ],
    "calls_per_minute": 1,
    "ceilings": {},
    "copy_to": "text",
    "created_at": "2026-09-09T10:15:00Z",
    "dead_why": "text",
    "expires_at": "2026-09-16T10:15:00Z",
    "folders_out": [
      "drafts"
    ],
    "from_addresses": [
      "text"
    ],
    "from_name": "text",
    "host": "text",
    "id": 1,
    "key_hint": "text",
    "keyword": "text",
    "live": true,
    "login": "text",
    "mailbox": {},
    "may": [
      "read"
    ],
    "mcp_address": "text",
    "name": "alice",
    "old_key_hint": "text",
    "package_botmail": true,
    "paused": true,
    "paused_at": "text",
    "paused_by": "owner",
    "paused_by_name": "text",
    "platform": "text",
    "recipients": [
      "text"
    ],
    "recipients_per_message": 1,
    "send_mode": "self",
    "sends_per_day": 1,
    "sends_per_hour": 1,
    "updated_at": "text",
    "usage": {},
    "used_by_person": true,
    "user": "alice"
  }
}

Errors

20 errors, each a status and a sentence
400--id is required
400<k> holds a character a rule may not
400Domain name required
400Domain name too long
400Invalid IPv4 address
400Invalid IPv6 address
400Invalid boolean
400Invalid domain name
400Invalid id
400Invalid port
400Invalid setting key
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Nothing to change
400Username '<value>' is reserved
401Authentication required
403This bot connector was paused by an administrator; an administrator resumes it
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.10 on 18 Oct 2026.
urbestack.com/docs/api/patch-botmail-keys-id/