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

/botmail/domains/{name}

First published 22 Oct 20260.2.15Unchanged since publication

Enable BotMail for a domain or change its BotMail hostname

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

The domain's mail must be hosted on this server, and the customer's package must allow BotMail. The label sets the hostname in the form LABEL.DOMAIN. UrbeStack trims surrounding whitespace and converts the label to lowercase. It accepts up to 32 letters, digits, and hyphens, with a letter or digit at each end. An invalid or reserved label returns 400. If label is omitted or empty, UrbeStack tries mcp, then mcp2 through mcp20. Choose another label if a site, domain alias, or DNS record already uses the hostname.

If the domain is already ready at the requested hostname, the API returns 200 with the domain. When it queues setup, it returns 202 with the domain and job. A queued or running setup job for the domain must finish before you can submit another. Changing the hostname disables the previous hostname immediately.

The job publishes DNS records if the zone is hosted on or distributed from this server. It checks once whether the hostname resolves to this server. If the check fails, the job stops and reports which A or AAAA records to add or update. After correcting the records, submit PUT /botmail/domains/{name} again. Retries are manual.

UrbeStack uses the domain's wildcard certificate if it covers the hostname. Otherwise it obtains a dedicated certificate using HTTP-01. Apache serves the hostname over HTTPS on port 443. Once the domain is ready, you can create bot keys for its mailboxes. Bots connect only through that hostname.

As a command

Run as root on the server

Parameters

namepath ·DomainNameRequired

Request body

JSON ·BotDomainOn· 1 field
labelstring
First label of the BotMail hostname, using letters, digits, and hyphens. If omitted, UrbeStack uses mcp when available or the first free label in the numbered sequence beginning with mcp2.

Example

See the API overview for how to set $API and $TOKEN.
Request
curl -sS -X PUT "$API/botmail/domains/example.com" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "my laptop"
  }'
Response · 200 OK
{
  "domain": {
    "cert_error": "text",
    "cert_not_after": "text",
    "error": "Domain 'example.com' already exists",
    "host": "text",
    "job": {
      "id": 1,
      "status": "active"
    },
    "keys": 1,
    "label": "my laptop",
    "mailboxes": 1,
    "name": "alice",
    "records": [
      {
        "name": "alice",
        "type": "A",
        "value": 8443
      }
    ],
    "state": "off",
    "suggested": "text",
    "user": "alice",
    "wildcard": true
  },
  "job": {
    "created_at": "2026-09-09T10:15:00Z",
    "created_by": 1,
    "created_by_name": "text",
    "dismissed_at": "text",
    "finished_at": "2026-09-09T10:15:04Z",
    "id": 1,
    "lane": "short",
    "log": "",
    "params": {},
    "progress": 100,
    "result": {},
    "started_at": "2026-09-09T10:15:01Z",
    "status": "queued",
    "type": "rebuild",
    "usual_seconds": 1
  }
}

Errors

18 errors, each a status and a sentence
400--name is required
400<value> is kept for the domain's own use; pick another name, like mcp
400A name is letters, digits and hyphens, up to 32, like mcp
400A new job is queued or running
400Domain name required
400Domain name too long
400Invalid IPv4 address
400Invalid IPv6 address
400Invalid domain name
400Invalid port
400Invalid setting key
400Job parameters must be an object
400Unknown job type
401Authentication required
403The package <p.name> does not include <SWITCH_WHAT>{<switch>}
404Setting '<key>' not found
409<why>; pick another name
409BotMail is being turned on for <name> already
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-domains-name/