---
title: "Changes schedule state."
method: POST
path: "/agents/{agentId}/schedules/{scheduleId}/setenabled"
tags: ["agentSchedules"]
---

# Changes schedule state.

`POST /agents/{agentId}/schedules/{scheduleId}/setenabled`

Enables or disables the selected agent schedule and returns the updated schedule.

<Check title="Required Permissions" icon="key">Any authenticated user.</Check>

## Path parameters

- `agentId` string, uuid, required
- `scheduleId` string, uuid, required

## Request body

- SetAgentScheduleEnabledRequestModel — Represents a request to enable or disable an agent schedule.
  - `isEnabled` boolean, required — Whether the schedule is enabled.

## Response `200`

OK

- AgentScheduleResponseModel — Represents a scheduled agent run configuration.
  - `name` string, nullable — The schedule display name.
  - `id` string, uuid — The schedule id.
  - `createdOn` string, date-time — When the schedule was created.
  - `agentId` string, uuid, nullable — The agent id that is executed by this schedule.
  - `type` string, nullable — Runtime target type: personal-agent or custom-agent.
  - `ownerUserId` string, uuid — The user id whose context is used to execute the scheduled run.
  - `prompt` string, nullable — Optional custom instructions. An omitted or null prompt means no custom instructions.
  - `cronRule` string, nullable — The normalized cron rule used for recurring execution.
  - `recurrenceInterval` integer — The number of matching cron occurrences between scheduled runs.
  - `timezone` string, nullable — The timezone used to evaluate the cron rule.
  - `projectId` string, uuid, nullable — The optional project context id.
  - `taskId` string, uuid, nullable — The optional task context id.
  - `isEnabled` boolean — Whether this schedule is active.
  - `needsAttention` boolean — Whether the schedule needs user attention.
  - `lastFailureReason` string, nullable — The latest rejection reason.
  - `consecutiveFailureCount` integer — The number of consecutive failed scheduled executions.
  - `lastAttemptOn` string, date-time, nullable — The latest occurrence time.
  - `lastSuccessfulRunOn` string, date-time, nullable — The latest accepted occurrence time.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found

## Changes

- **2026-09-23** `eadefd26df12` — 1 breaking, 1 info
  - the response property `agentId` became nullable for the status `200`
  - added the optional property `type` to the response with the `200` status
- **2026-09-20** `5332322ffca3` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/awork-io/apis/api-v1-reference/changes/agents/:agentId/schedules/:scheduleId/setenabled/post.md)

---

[API](https://skmtc.dev/awork-io/apis/api-v1-reference.md) · [All operations](https://skmtc.dev/awork-io/apis/api-v1-reference/llms.txt) · [OpenAPI document](https://skmtc.dev/awork-io/apis/api-v1-reference/revisions/eadefd26df12?raw)
