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

# Update a schedule

> Change a schedule's name, timing, or session template.

Partial update: only the fields you provide change. Changing `timing` recomputes the next fire from now.

**Returns** the updated [schedule object](/computer-use-agents/schedules/retrieve).

***

## Path parameters

<ParamField path="schedule_id" type="string" required>
  The schedule's id (UUID).
</ParamField>

## Request body

<ParamField body="name" type="string">
  New display name. May not be `null`.
</ParamField>

<ParamField body="description" type="string | null">
  New description. Pass `null` to clear it.
</ParamField>

<ParamField body="timing" type="object">
  New cron timing (same shape and constraints as [Create](/computer-use-agents/schedules/create)). May not be `null`. The next fire is recomputed from now.
</ParamField>

<ParamField body="session_request" type="object">
  New session template (same shape and restrictions as [Create](/computer-use-agents/schedules/create)). May not be `null`.
</ParamField>

***

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH "https://agp.eu.hcompany.ai/api/v2/schedules/9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f" \
    -H "Authorization: Bearer $HAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"timing": {"expression": "30 8 * * 1-5", "timezone": "Europe/Paris"}}'
  ```

  ```python Python theme={null}
  from hai_agents import Client

  client = Client()

  schedule = client.schedules.update_schedule(
      "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
      timing={"expression": "30 8 * * 1-5", "timezone": "Europe/Paris"},
  )
  print(schedule.next_run_times[0])
  ```

  ```typescript TypeScript theme={null}
  import { HaiAgentsClient } from "hai-agents";

  const client = new HaiAgentsClient();

  const schedule = await client.schedules.updateSchedule({
    scheduleId: "9f8e7d6c-5b4a-4c3d-8e2f-1a0b9c8d7e6f",
    timing: { expression: "30 8 * * 1-5", timezone: "Europe/Paris" },
  });
  console.log(schedule.nextRunTimes[0]);
  ```
</CodeGroup>

***

## Errors

| Status | Cause                                                                                                                                    |
| ------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `400`  | The new expression fires more often than once every 5 minutes, or the new template is invalid (no messages, or `parent_session_id` set). |
| `404`  | No schedule with this id in your organization.                                                                                           |
| `422`  | Body failed validation: invalid cron expression, unknown timezone, or explicit `null` for `name`, `timing`, or `session_request`.        |
