Unify and manage your data

Update schedule

Learn more about update schedule.

Use the Update schedule to update a schedule. This lets you change only the fields you need without recreating the schedule.

HTTP method and endpoint

Use the following HTTP method and endpoint path to update schedule.

PATCH {TenantURL}/ai/agentflow/api/v202605/{tenant_id}/schedules/{schedule_id}

The following table describes the endpoint path parameters.

ParameterTypeRequiredDescription
TenantURLStringYesThe base URL for your tenant.
tenant_idStringYesThe unique identifier of your tenant.
schedule_idStringYesThe unique identifier of the schedule.

Request headers

The following request headers must be included.

HeaderValueRequired
Authorization<access_token>Yes
Content-Typeapplication/jsonYes

Request body

The following table describes the request body parameters.

ParameterTypeRequiredDescriptionAccepted values / Default
nameStringNoThe new display name for the schedule.—
queryStringNoThe new prompt or query to send to the agent.—
agent_idStringNoThe unique identifier of the new agent to run.—
cron_expressionStringNoThe new cron expression, in the format minute hour day-of-month month day-of-week.—
interval_minutesIntegerNoThe new interval in minutes between runs.—
statusStringNoThe new status. Use active to resume the schedule, paused to stop it without deleting it, or cancelled to delete it.—

Example request

Use the following example to see how a complete request is structured, with headers and a JSON body.

PATCH {TenantURL}/ai/agentflow/api/v202605/tenant-xyz/schedules/example-id
Authorization: <access_token>
Content-Type: application/json

{
  "name": "Updated escalation check",
  "query": "Check high-priority support tickets",
  "agent_id": "improved-support-agent",
  "cron_expression": "0 10 * * MON-FRI",
  "interval_minutes": 120,
  "status": "paused"
}

Response body

The following table describes the fields returned in the response body.

ParameterTypeDescription
schedule_idStringThe unique identifier of the schedule.
tenant_idStringThe unique identifier of the tenant.
agent_idStringThe unique identifier of the agent that the job or schedule runs.
nameStringThe display name.
queryStringThe prompt or query sent to the agent on each run.
schedule_typeStringThe type of schedule: recurring or run-once.
cron_expressionStringThe cron expression for the schedule, when schedule_type is recurring.
interval_minutesIntegerThe interval in minutes between runs, when schedule_type is recurring.
statusStringThe status of the schedule: active, paused, running, cancelled, completed, or failed.
next_run_atStringThe date and time of the next scheduled run.
last_run_atStringThe date and time of the last run.
run_countIntegerThe number of times this schedule has run.
run_onceBooleanWhether this is a one-time (run-once) schedule.
last_conversation_idStringThe unique identifier of the conversation from the most recent run.
created_byStringThe unique identifier of the user who created the schedule.
created_atStringThe date and time when the job or schedule was created.
updated_atStringThe date and time when the record was last updated.

Example response

The following example shows a response with successful response.

{
  "schedule_id": "sched-abc123",
  "tenant_id": "tenant-xyz",
  "agent_id": "my-support-agent",
  "name": "Daily support escalation check",
  "query": "Check for support tickets requiring escalation",
  "schedule_type": "recurring",
  "cron_expression": "0 9 * * MON-FRI",
  "interval_minutes": 60,
  "status": "active",
  "next_run_at": "2025-05-14T09:00:00Z",
  "last_run_at": "2025-05-13T09:00:00Z",
  "run_count": 5,
  "run_once": false,
  "last_conversation_id": "conv-abc123",
  "created_by": "user@example.com",
  "created_at": "2025-05-01T10:00:00Z",
  "updated_at": "2025-05-13T15:30:00Z"
}

The following table lists the possible error responses returned by this API.

HTTP statusDescriptionRecommended action
422 Unprocessable EntityValidation ErrorReview the request parameters or body, correct the invalid values, and resend the request.