> ## 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 job

> Update a pending job

You can only update jobs with `status: "pending"`. Completed and failed jobs cannot be modified.

## Path parameters

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

## Request body

All fields are optional. Only provided fields are updated.

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

<ResponseField name="at" type="string">
  ISO 8601 timestamp. Must be in the future.
</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>

## Response

Returns the updated job object.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH https://app.cronapi.dev/api/v1/jobs/b2c3d4e5-f6a7-8901-bcde-f12345678901 \
    -H "Authorization: Bearer your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "at": "2026-04-21T12:00:00.000Z",
      "body": {"user_id": "usr_456"}
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    `https://app.cronapi.dev/api/v1/jobs/${jobId}`,
    {
      method: "PATCH",
      headers: {
        "Authorization": `Bearer your_api_key_here`,
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        at: "2026-04-21T12:00:00.000Z",
        body: { user_id: "usr_456" },
      }),
    }
  );
  const job = await response.json();
  ```

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

  response = requests.patch(
      f"https://app.cronapi.dev/api/v1/jobs/{job_id}",
      headers={"Authorization": "Bearer your_api_key_here"},
      json={
          "at": "2026-04-21T12:00:00.000Z",
          "body": {"user_id": "usr_456"},
      },
  )
  job = response.json()
  ```
</CodeGroup>

```json 200 theme={null}
{
  "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "user_id": "d4e5f6a7-b890-1234-cdef-567890abcdef",
  "name": "Send welcome email",
  "at": "2026-04-21T12:00:00.000Z",
  "url": "https://example.com/send-email",
  "method": "POST",
  "headers": {},
  "body": {"user_id": "usr_456"},
  "status": "pending",
  "created_at": "2026-04-15T10:00:00.000Z"
}
```

```json 400 theme={null}
{
  "error": "Cannot update a completed or failed job"
}
```
