Skip to content

The Managed Entries API provides endpoints to create, list, retrieve, update, and delete cron entries that the platform manages on behalf of a system user. Each managed entry pairs a cron schedule with a shell command, supports optional expiration and human-readable metadata, and tracks creation and update timestamps. Use these endpoints when you need programmatic control over scheduled jobs for a specific system user on the host.

GET /users/{user}/entries

Returns a paginated list of crontab entries for the given system user. The response includes both managed entries (with schedule, command, and metadata) and raw crontab lines that exist outside of managed tracking.

NameInTypeRequiredDescription
userpathstringYesSystem username
pagequeryintegerNoPage number (1-based)
limitqueryintegerNoItems per page (max 200)
{
"user": "deploy",
"page": 1,
"limit": 50,
"total": 2,
"entries": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "managed",
"name": "Daily backup",
"comment": "Runs the daily backup script",
"schedule": "0 2 * * *",
"schedule_human": "At 02:00 AM, every day",
"command": "/usr/local/bin/backup.sh",
"enabled": true,
"expired": false,
"expires_at": null,
"created_at": "2024-11-01T10:30:00Z",
"updated_at": "2024-11-15T14:22:00Z"
},
{
"type": "raw",
"line": "*/15 * * * * /usr/local/bin/healthcheck.sh"
}
]
}
for await (const entry of client.cron.entries.listIterator({ user: "deploy" })) {
console.log(entry);
}

GET /users/{user}/entries/{id}

Returns the details of a single managed cron entry for the given system user.

NameInTypeRequiredDescription
userpathstringYesSystem username
idpathstringYesManaged entry id
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"user": "deploy",
"name": "Daily backup",
"comment": "Runs the daily backup script",
"schedule": "0 2 * * *",
"schedule_human": "At 02:00 AM, every day",
"command": "/usr/local/bin/backup.sh",
"enabled": true,
"expired": false,
"expires_at": null,
"created_at": "2024-11-01T10:30:00Z",
"updated_at": "2024-11-15T14:22:00Z"
}
const entry = await client.cron.entries.get({
user: "deploy",
id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
});

POST /users/{user}/entries

Creates a new managed cron entry for the given system user. The endpoint requires a JSON request body describing the schedule and command to run.

NameInTypeRequiredDescription
userpathstringYesSystem username
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"user": "deploy",
"name": "Daily backup",
"comment": "Runs the daily backup script",
"schedule": "0 2 * * *",
"schedule_human": "At 02:00 AM, every day",
"command": "/usr/local/bin/backup.sh",
"enabled": true,
"expired": false,
"expires_at": null,
"created_at": "2024-11-01T10:30:00Z",
"updated_at": "2024-11-01T10:30:00Z"
}
const entry = await client.cron.entries.create({
user: "deploy",
data: {
schedule: "0 2 * * *",
command: "/usr/local/bin/backup.sh"
}
});

PATCH /users/{user}/entries/{id}

Updates an existing managed cron entry for the given system user. Only the fields included in the request body are modified; omitted fields are left unchanged.

NameInTypeRequiredDescription
userpathstringYesSystem username
idpathstringYesManaged entry id
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"user": "deploy",
"name": "Daily backup",
"comment": "Runs the daily backup script",
"schedule": "0 2 * * *",
"schedule_human": "At 02:00 AM, every day",
"command": "/usr/local/bin/backup.sh",
"enabled": false,
"expired": false,
"expires_at": null,
"created_at": "2024-11-01T10:30:00Z",
"updated_at": "2024-11-15T14:22:00Z"
}
const entry = await client.cron.entries.update({
user: "deploy",
id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
data: {
enabled: false
}
});

DELETE /users/{user}/entries/{id}

Deletes a managed cron entry for the given system user. The underlying crontab is rewritten to remove the entry; raw crontab lines are not affected.

NameInTypeRequiredDescription
userpathstringYesSystem username
idpathstringYesManaged entry id
{
"deleted": true
}
const result = await client.cron.entries.delete({
user: "deploy",
id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
});