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

/users/{name}/cron

First published 3 Oct 20260.1.0Unchanged since publication

Set the email address for a customer's cron output

Who may call it
AdministratorResellerCustomer
Token scope, any of
filesall
Answers200 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

Run as root on the server

Parameters

namepath ·UsernameRequired

Request body

JSON· 1 field
mailtostring, up to 254 charactersRequired
One email address of up to 254 characters, or an empty string to disable email delivery. The default is an empty string.

Example

See the API overview for how to set $API and $TOKEN.
Request
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

11 errors, each a status and a sentence
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
400Invalid email address
400Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
400Nothing to change: mailto is the one field
400This server has no mail stack: there is nowhere to send the output, so no address is taken
400Username '<value>' is reserved
401Authentication required
404User '<user>' 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.1.0 on 3 Oct 2026.
urbestack.com/docs/api/patch-users-name-cron/