Skip to content

The raw crontab endpoints let you read and replace the full crontab text for a system user, or list every user that currently has a crontab. These operations work on the complete crontab file as a single string and do not parse, validate, or manage individual scheduled entries. For per-entry management, use the managed entry endpoints under /api/cron/users/{user}/entries/.

GET /crontab

Returns a paginated list of every system user that has a crontab installed. Each item contains the username and the raw crontab text.

NameInTypeRequiredDescription
pagequeryintegerNoPage number (1-based)
limitqueryintegerNoItems per page (max 200)
{
"items": [
{
"user": "deploy",
"crontab": "0 2 * * * /usr/local/bin/backup.sh\n"
},
{
"user": "www-data",
"crontab": "*/15 * * * * /usr/local/bin/rotate-logs.sh\n"
}
],
"limit": 50,
"page": 1,
"total": 2
}
const result = await client.cron.crontab.listGlobalIterator({
page: 1,
limit: 50,
});
Terminal window
curl -X GET "https://api.example.com/api/cron/crontab/?page=1&limit=50" \
-H "Authorization: Bearer <token>"

GET /users/{user}/crontab

Returns the raw crontab text for a single system user.

NameInTypeRequiredDescription
userpathstringYesSystem username
{
"user": "deploy",
"crontab": "0 2 * * * /usr/local/bin/backup.sh\n"
}
const result = await client.cron.crontab.get({
user: "deploy",
});
Terminal window
curl -X GET "https://api.example.com/api/cron/crontab/users/deploy/crontab" \
-H "Authorization: Bearer <token>"

PUT /users/{user}/crontab

Replaces the entire crontab for a system user with the supplied text. The response includes removed_expired, the number of expired managed entries that were pruned during the replacement.

NameInTypeRequiredDescription
userpathstringYesSystem username
FieldTypeRequiredDescription
crontabstringYesFull crontab text to install for the user. Replaces any existing crontab.
{
"user": "deploy",
"crontab": "0 2 * * * /usr/local/bin/backup.sh\n",
"removed_expired": 1
}
await client.cron.crontab.put({
user: "deploy",
data: {
crontab: "0 2 * * * /usr/local/bin/backup.sh\n",
},
});
Terminal window
curl -X PUT "https://api.example.com/api/cron/crontab/users/deploy/crontab" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{"crontab": "0 2 * * * /usr/local/bin/backup.sh\n"}'