Update a Cron Job
Parameters
expressionstring
New cron expression for the job
namestring | null
New name for the cron job
timezonestring | null
New timezone for evaluating the cron expression
statusstring
New status for the cron job ("Active" or "Paused")
endpointstring
New URL endpoint to call
datarecord | null
New JSON data to include in requests
Returns
Returns the updated cron job object.
PATCH/cron/{id}
curl -X PATCH https://api.next-cron.com/cron/49d10214-f4f1-497a-94b7-c0e597ad3fea \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Job",
"status": "Paused"
}'
Response
{
"id": "49d10214-f4f1-497a-94b7-c0e597ad3fea",
"expression": "0 0 * * *",
"name": "Updated Cron Job",
"invocations": 1249,
"timezone": "Europe/London",
"status": "Active",
"endpoint": "https://www.example.com/api/next-cron",
"data": null,
"createdAt": "2024-03-19T10:30:00Z",
"nextInvocation": "2024-03-20T00:00:00Z"
}