Skip to main content
PATCH
/
api
/
v2
/
schedules
/
{schedule_id}
Update a schedule
curl --request PATCH \
  --url https://agp.eu.hcompany.ai/api/v2/schedules/{schedule_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": {},
  "timing": {},
  "session_request": {}
}
'
Partial update: only the fields you provide change. Changing timing recomputes the next fire from now. Returns the updated schedule object.

Path parameters

schedule_id
string
required
The schedule’s id (UUID).

Request body

name
string
New display name. May not be null.
description
string | null
New description. Pass null to clear it.
timing
object
New cron timing (same shape and constraints as Create). May not be null. The next fire is recomputed from now.
session_request
object
New session template (same shape and restrictions as Create). May not be null.

Examples

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"}}'

Errors

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