# POST /botmail/keys/{id}/address

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

UrbeStack release 0.2.35 API operation in the mail group.

Issue a new MCP URL for a bot key

- Who may call it: administrator, reseller, customer
- Token scope, any of: mail, all
- Answers: 201 Created

UrbeStack rotates the secret and returns the new MCP URL and secret in the 201 response. The secret is returned only once. The new URL belongs to the same key, with its existing name, rules, activity, and webhook.

By default, the previous URL keeps working while you update the bot. Use DELETE /botmail/keys/{id}/address/old to disable it after the update. Set now to true to disable the previous URL immediately during rotation, for example if it leaked. Each rotation also disables any URL older than the one it replaces.

The API returns 404 if the key is missing or the caller lacks access to it.

## As a command

- [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.

## Parameters

- `id` (path, integer, 1 or more, required)

## Request body

JSON, the type [BotKeyAddress](https://urbestack.com/docs/api/types/BotKeyAddress.md).

- `now` (boolean)

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X POST "$API/botmail/keys/1/address" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "now": true
  }'
```

Response, 201 Created:

```
{
  "key": {}
}
```

## Errors

- 400: --id is required
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid IPv4 address
- 400: Invalid IPv6 address
- 400: Invalid boolean
- 400: Invalid domain name
- 400: Invalid id
- 400: Invalid port
- 400: Invalid setting key
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Username '<value>' is reserved
- 401: Authentication required
- 404: No such bot connector: <c.params>{id}
- 404: No such bot connector: <id>
- 404: No such domain: <domain>
- 404: Setting '<key>' not found
- 409: BotMail is not on for <k.domain>: turn it on for the domain first
- 409: The bot connector <k.name> has no old address
