---
title: "Update a scheduled task (partial)."
method: PUT
path: "/scheduled_tasks/{task_id}"
tags: ["Scheduled Tasks"]
---

# Update a scheduled task (partial).

`PUT /scheduled_tasks/{task_id}`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/scheduled_tasks/{task_id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/scheduled_tasks/:task_id/put.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `task_id` string, required

## Request body

- ScheduledTaskUpdateRequest: Partial update. Omit a field to leave it unchanged. To CLEAR a nullable field, use the sentinel: max_executions = -1 clears it; expires_at = 1970-01-01T00:00:00Z clears it. To pause/resume, set status to "paused"/"active".
  - `name` string
  - `description` string
  - `schedule_type` 'once' | 'recurring' | 'interval'
  - `schedule_expression` string
  - `task_type` 'chat_completion' | 'agent_task'
  - `task_config` object
  - `task_config_patch` object: Partial task_config update. Top-level keys are merged into the stored task_config; a key whose value is JSON null is REMOVED (e.g. {"collection_id": null} unbinds the collection). Nested objects are replaced whole, not deep-merged. Mutually exclusive with task_config. The merged result must keep a non-empty 'message'.
  - `status` 'active' | 'paused' | 'completed' | 'expired'
  - `max_executions` integer, nullable
  - `expires_at` string, date-time, nullable
  - `notification_email` string

## Response `200`

OK

- ScheduledTask
  - `id` string, uuid
  - `user_id` string, uuid
  - `username` string
  - `name` string
  - `description` string
  - `schedule_type` 'once' | 'recurring' | 'interval'
  - `schedule_expression` string
  - `task_type` 'chat_completion' | 'agent_task'
  - `task_config` object
  - `status` 'active' | 'paused' | 'completed' | 'expired'
  - `execution_status` string: Runtime execution state: idle or running.
  - `last_execution_at` string, date-time, nullable
  - `next_execution_at` string, date-time, nullable
  - `execution_count` integer
  - `max_executions` integer, nullable
  - `expires_at` string, date-time, nullable
  - `created_at` string, date-time
  - `updated_at` string, date-time
  - `is_owner` boolean
  - `notification_email` string

## Other responses

- `401`: Unauthorized - Invalid or missing API key
- `404`: Not found
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
