> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cronapi.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Update cron

> Update an existing cron

## Path parameters

<ResponseField name="id" type="string" required>
  The UUID of the cron to update.
</ResponseField>

## Request body

All fields are optional. Only provided fields are updated.

<ResponseField name="name" type="string">
  Display name.
</ResponseField>

<ResponseField name="cron" type="string">
  Cron expression. If changed, `next_run_at` is automatically recalculated.
</ResponseField>

<ResponseField name="url" type="string">
  Webhook URL.
</ResponseField>

<ResponseField name="method" type="string">
  HTTP method: `GET`, `POST`, or `DELETE`.
</ResponseField>

<ResponseField name="headers" type="object">
  Custom HTTP headers.
</ResponseField>

<ResponseField name="body" type="object">
  JSON body payload.
</ResponseField>

<ResponseField name="paused" type="boolean">
  Set to `true` to pause execution, `false` to resume.
</ResponseField>

## Response

Returns the updated cron object.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH https://app.cronapi.dev/api/v1/crons/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
    -H "Authorization: Bearer your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "cron": "0 */2 * * *",
      "paused": false
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    `https://app.cronapi.dev/api/v1/crons/${cronId}`,
    {
      method: "PATCH",
      headers: {
        "Authorization": `Bearer your_api_key_here`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        cron: "0 */2 * * *",
        paused: false,
      }),
    }
  );
  const cron = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.patch(
      f"https://app.cronapi.dev/api/v1/crons/{cron_id}",
      headers={"Authorization": "Bearer your_api_key_here"},
      json={"cron": "0 */2 * * *", "paused": False},
  )
  cron = response.json()
  ```
</CodeGroup>

```json 200 theme={null}
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "user_id": "d4e5f6a7-b890-1234-cdef-567890abcdef",
  "name": "Health check",
  "cron": "0 */2 * * *",
  "url": "https://example.com/health",
  "method": "GET",
  "headers": {},
  "body": {},
  "paused": false,
  "next_run_at": "2026-04-15T16:00:00.000Z",
  "last_run_at": "2026-04-15T14:30:00.000Z",
  "created_at": "2026-04-12T10:30:00.000Z"
}
```

```json 400 theme={null}
{
  "error": "Invalid cron expression"
}
```
