# PATCH /users/{name}/cron

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the cron group.

Set the email address for a customer's cron output

- Who may call it: administrator, reseller, customer
- Token scope, any of: files, all
- Answers: 200 OK

UrbeStack replaces the first MAILTO line or adds one at the top if the crontab has none. Send an empty string or null as mailto to restore the default of sending no cron output by email. A job that runs every minute can fill a mailbox and use up the hourly sending limit.

Setting an email address requires the mail stack to be installed and enabled. The API returns 409 if the crontab is set aside. It returns 400 if mailto is missing or invalid, or if name identifies an administrator.

Customers can change their own settings, resellers can change their customers' settings, and administrators can change any customer's settings. The token must have the files scope.

## As a command

- [urbestack-cron-set](https://urbestack.com/docs/commands/urbestack-cron-set.md): Sets where cron sends a customer's job output.

## Parameters

- `name` (path, Username, required)

## Request body

JSON.

- `mailto` (string, up to 254 characters, required): One email address of up to 254 characters, or an empty string to disable email delivery. The default is an empty string.

## 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 PATCH "$API/users/alice/cron" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "mailto": "text"
  }'
```

Response, 200 OK:

```
{
  "cron": {
    "mailto": "text",
    "user": "alice"
  }
}
```

## Errors

- 400: --mailto is required
- 400: --user is required
- 400: <name> is an administrator: administrators have no system account, so no cron jobs
- 400: <what> must be text
- 400: Invalid email address
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Nothing to change: mailto is the one field
- 400: This server has no mail stack: there is nowhere to send the output, so no address is taken
- 400: Username '<value>' is reserved
- 401: Authentication required
- 404: User '<user>' not found
