> This page is for Itential Platform Cloud.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# Update a schedule

PATCH https://example.itential.io/trigger-service/service-schedules/{scheduleId}
Content-Type: application/json

A request can't give a schedule a form or change the one it has. Inputs are cleaned against the form a schedule already has, if any. A request that sets `inputs` looks that form up, even for empty inputs, and saves the inputs without the values the form no longer has. A schedule with no form, which is every schedule created for a service, saves the inputs as sent. The response shows what was saved.

A form that can't be loaded fails the write and nothing is saved, not even other changes in the same request. The error says why in `formFailure`: 422 NOT_FOUND, 403 FORBIDDEN, 503 UNAVAILABLE.

A paused schedule can't be resumed with `status` set to `active` while its service's trigger set is disabled. The request fails with 409 and nothing is saved, not even other changes in the same request. Pausing and editing stay allowed, and `active` on a schedule that's already active is accepted. Enabling or disabling the trigger set never changes a schedule's own status.

A completed or expired schedule runs again when the request replaces its `schedule` with one that has a run. It becomes `active` with its next run worked out from now, and a limit on occurrences counts again from now. A new schedule with no run fails and the schedule stays as it was. Running a schedule again starts it, so while the trigger set of its service is disabled, the request fails with 409 and nothing is saved, unless it asks for `paused`. Sending the same limit on occurrences again keeps its used-up end date, so it fails too.

Edits that set no `inputs`, such as pause, resume, a new schedule, the missed-run policy, or `legacyWrapper`, never look the form up and leave the stored inputs as they are. A schedule whose form was deleted can still be paused or resumed.

Reference: https://docs.itential.com/itential-cloud/api-reference/trigger-service/service-schedules-update-schedule

## Authentication

- `Authorization` header (basic auth, required) — Basic authentication of the form `Basic <base64(username:password)>`.

## Request

### Path parameters

- `scheduleId` (string, required) — The schedule's unique identifier (triggers._id), a UUIDv7.

### Body (application/json)

This endpoint expects an object.

- `schedule` (TriggerServiceServiceSchedulesScheduleIdPatchRequestBodyContentApplicationJsonSchemaSchedule, optional) — A replacement schedule. Omit to leave the schedule unchanged.
- `inputs` (TriggerServiceServiceSchedulesScheduleIdPatchRequestBodyContentApplicationJsonSchemaInputs, optional) — Replacement inputs the service is requested with each time the schedule fires. Values the schedule's own form, if it has one, no longer has are removed when they are saved. Omit to leave them unchanged.
- `status` (enum, optional) — `paused` stops the schedule firing; `active` resumes it and works out when it fires next. Omit to leave the status unchanged.
  - Allowed values: `active`, `paused`
- `missedRunPolicy` (enum, optional) — What to do with an occurrence found overdue. Leave out to keep the current policy.
  - Allowed values: `skip`, `fireOnce`
- `legacyWrapper` (boolean, optional) — Legacy field, kept only to support workflows written for the old input shape: before July 2023, Operations Manager passed form values to the workflow inside one variable named `formData`. Omit to leave unchanged. Turning it on is refused unless the service's asset is a workflow.

## Response

### 200

result

- `scheduleId` (string, required) — Identifier of the schedule.
- `serviceId` (string, required) — Identifier of the service the schedule requests.
- `serviceName` (string, required) — Name of that service.
- `triggerSetEnabled` (boolean, required) — Master switch that determines whether the trigger and any services associated with it can fire. When false, they cannot fire, regardless of this schedule's own status.
- `createdBy` (TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaCreatedBy, required) — The user who created the schedule. `principalId` is `Pronghorn` when no creator is recorded.
- `createdAt` (string, required) — When the schedule was created, ISO 8601 in UTC.
- `lastUpdatedAt` (string, required) — When the schedule was last changed by a user (an edit, a pause or a resume), ISO 8601 in UTC.
- `status` (enum, required) — `active` fires as scheduled; `paused` was stopped by a user; `completed` fired its last occurrence; `expired` ended without firing its last occurrence.
  - Allowed values: `active`, `paused`, `completed`, `expired`
- `scheduleType` (enum, required) — `recurring` repeats on its schedule; `concrete` fires once, at `concreteDate`.
  - Allowed values: `concrete`, `recurring`
- `input` (TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaInput, required) — Inputs the service is requested with each time the schedule fires.
- `missedRunPolicy` (enum, required) — What happens to an occurrence found overdue, such as after downtime: `skip` drops it and waits for the next one; `fireOnce` fires it, however late.
  - Allowed values: `skip`, `fireOnce`
- `legacyWrapper` (boolean, required) — Legacy field, kept only to support workflows written for the old input shape: before July 2023, Operations Manager passed form values to the workflow inside one variable named `formData`. False unless it was turned on.
- `schedule` (TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaSchedule, optional) — How a recurring schedule repeats, and its start and end. Absent for a `concrete` schedule.
- `concreteDate` (string, optional) — The instant a `concrete` schedule fires, ISO 8601 in UTC. Set only when `scheduleType` is `concrete`. A request sets it as `schedule.concreteDate`.
- `formId` (string, optional) — Id of the form the inputs were filled in on. Absent when the schedule has no form.
- `lastRun` (string, optional) — When the schedule last fired, ISO 8601 in UTC. Absent if it has never fired.
- `nextRun` (string, optional) — When the schedule is next due, ISO 8601 in UTC. Present only while the status is `active`.

## Errors

### 500 Internal Server Error

Error response from API

- `any`

## Types

### TriggerServiceServiceSchedulesScheduleIdPatchRequestBodyContentApplicationJsonSchemaSchedule

A replacement schedule. Omit to leave the schedule unchanged.

- `recurrence` (TriggerServiceServiceSchedulesScheduleIdPatchRequestBodyContentApplicationJsonSchemaScheduleRecurrence, optional) — How a recurring schedule repeats. Exclusive with `concreteDate`.
- `startsAt` (string, optional) — A recurring schedule does not fire before this instant. An every-N-seconds-minutes-or-hours schedule with no window and no weekdays counts every gap from it.
- `endsAt` (string, optional) — A recurring schedule does not fire after this instant.
- `maxOccurrences` (double, optional) — End the schedule after this many occurrences, counting every scheduled time including any skipped during downtime. A limit of 1 makes a one-time run. Exclusive with `endsAt`. Recurring schedules only.
- `concreteDate` (string, optional) — One-time firing instant. Exclusive with `recurrence`.

### TriggerServiceServiceSchedulesScheduleIdPatchRequestBodyContentApplicationJsonSchemaInputs

Replacement inputs the service is requested with each time the schedule fires. Values the schedule's own form, if it has one, no longer has are removed when they are saved. Omit to leave them unchanged.

### TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaCreatedBy

The user who created the schedule. `principalId` is `Pronghorn` when no creator is recorded.

- `principalId` (string, required) — Identifier of the account.
- `displayName` (string, optional) — The account's username. Absent when the account no longer exists, or when it could not be looked up.
- `inactive` (boolean, optional) — Whether the account has been deactivated. Present only when the account was found: `true` for a deactivated account, `false` for an active one. Absent, like `displayName`, when the account no longer exists or could not be looked up; treat absence as not deactivated.
- `email` (string, optional) — The account's email address. Present only when the account was found and has an email recorded; absent, like `displayName`, when the account no longer exists, could not be looked up, or has no email.

### TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaInput

Inputs the service is requested with each time the schedule fires.

### TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaSchedule

How a recurring schedule repeats, and its start and end. Absent for a `concrete` schedule.

- `recurrence` (TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaScheduleRecurrence, required) — How the schedule repeats.
- `startsAt` (string, optional) — The schedule does not fire before this instant, ISO 8601 in UTC.
- `endsAt` (string, optional) — The schedule does not fire after this instant, ISO 8601 in UTC. Absent when the schedule is limited to a number of occurrences (`maxOccurrences`), because its end follows from that limit.
- `maxOccurrences` (double, optional) — The number of occurrences the schedule was limited to, if it was. Absent when it ends on a date or never.

### TriggerServiceServiceSchedulesScheduleIdPatchRequestBodyContentApplicationJsonSchemaScheduleRecurrence

How a recurring schedule repeats. Exclusive with `concreteDate`.

- `kind` (enum, required) — How the schedule repeats: `cron` for a cron expression, `periodic` for every so many seconds, minutes or hours, `daily` for every so many days, `weekly` for chosen weekdays, `monthly` for chosen months and a day within them.
  - Allowed values: `cron`, `periodic`, `daily`, `weekly`, `monthly`
- `cron` (string, optional) — Standard 5-field cron, or 6 with a leading seconds field, evaluated in UTC. Fires no more often than every 10 seconds. Used when `kind` is `cron`.
- `months` (list of double, optional) — Months to fire in, 1 (January) to 12 (December), without repeats. Used when `kind` is `monthly`.
- `on` (TriggerServiceServiceSchedulesScheduleIdPatchRequestBodyContentApplicationJsonSchemaScheduleRecurrenceOn, optional) — Which day of the month to fire on. Used when `kind` is `monthly`.
- `everyDays` (double, optional) — Days between runs, 1 up to 3650: 1 for every day, 2 for every other day. From 2 up, counting starts on the day of the first run. Used when `kind` is `daily`.
- `everyWeeks` (double, optional) — Weeks between runs, 1 up to 520: 1 for every week, 2 for every other week. Weeks run Sunday to Saturday. From 2 up, counting starts in the week of the first run. Used when `kind` is `weekly`.
- `every` (TriggerServiceServiceSchedulesScheduleIdPatchRequestBodyContentApplicationJsonSchemaScheduleRecurrenceEvery, optional) — How often to run, in seconds (10 or more), minutes or hours. With no `window` and no `weekdays`, every gap is counted from the start of the schedule. Used when `kind` is `periodic`.
- `window` (TriggerServiceServiceSchedulesScheduleIdPatchRequestBodyContentApplicationJsonSchemaScheduleRecurrenceWindow, optional) — The stretch of the day to run in. The count restarts at its start each day. Leave out to run through the whole day: with `weekdays` the count restarts at 00:00, and without `weekdays` it never restarts and counts every gap from the start of the schedule. Used when `kind` is `periodic`.
- `weekdays` (list of enum, optional) — Days of the week to run on, without repeats. All seven means every day. Required when `kind` is `weekly`; when `kind` is `periodic`, leave out to run every day.
  - Allowed values: `sun`, `mon`, `tue`, `wed`, `thu`, `fri`, `sat`
- `at` (string, optional) — Time of day in UTC, written HH:mm on a 24-hour clock. Used when `kind` is `daily`, `weekly` or `monthly`.

### TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaScheduleRecurrence

How the schedule repeats.

- `kind` (enum, required) — How the schedule repeats: `cron`, `periodic`, `daily`, `weekly` or `monthly`.
  - Allowed values: `cron`, `periodic`, `daily`, `weekly`, `monthly`
- `cron` (string, optional) — The cron expression, evaluated in UTC. Present when `kind` is `cron`.
- `every` (TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaScheduleRecurrenceEvery, optional) — How often the schedule runs. Present when `kind` is `periodic`.
- `window` (TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaScheduleRecurrenceWindow, optional) — The stretch of the day the schedule runs in. Absent when it runs through the whole day. Present only when `kind` is `periodic`.
- `everyDays` (double, optional) — Days between runs: 1 for every day, 2 for every other day. Present when `kind` is `daily`.
- `everyWeeks` (double, optional) — Weeks between runs: 1 for every week, 2 for every other week. Present when `kind` is `weekly`.
- `weekdays` (list of enum, optional) — Days of the week the schedule runs on. Present when `kind` is `weekly`, and when `kind` is `periodic` and days were chosen.
  - Allowed values: `sun`, `mon`, `tue`, `wed`, `thu`, `fri`, `sat`
- `months` (list of double, optional) — Months the schedule fires in, 1 (January) to 12 (December). Present when `kind` is `monthly`.
- `on` (TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaScheduleRecurrenceOn, optional) — Which day of the month the schedule fires on. Present when `kind` is `monthly`.
- `at` (string, optional) — Time of day in UTC, written HH:mm. Present when `kind` is `daily`, `weekly` or `monthly`.

### TriggerServiceServiceSchedulesScheduleIdPatchRequestBodyContentApplicationJsonSchemaScheduleRecurrenceOn

Which day of the month to fire on. Used when `kind` is `monthly`.

- `kind` (enum, required) — How the day is chosen: `dayOfMonth` for a fixed date, `nthWeekday` for a counted weekday such as the first Tuesday, `lastDay` for the last day of the month.
  - Allowed values: `dayOfMonth`, `nthWeekday`, `lastDay`
- `day` (double, optional) — Day of the month, 1 to 31. A month too short for it uses its last day. Used when `kind` is `dayOfMonth`.
- `ordinal` (enum, optional) — Which occurrence of the weekday in the month: `first` to `fourth`, or `last`. Used when `kind` is `nthWeekday`.
  - Allowed values: `first`, `second`, `third`, `fourth`, `last`
- `weekday` (enum, optional) — Day of the week. Used when `kind` is `nthWeekday`.
  - Allowed values: `sun`, `mon`, `tue`, `wed`, `thu`, `fri`, `sat`

### TriggerServiceServiceSchedulesScheduleIdPatchRequestBodyContentApplicationJsonSchemaScheduleRecurrenceEvery

How often to run, in seconds (10 or more), minutes or hours. With no `window` and no `weekdays`, every gap is counted from the start of the schedule. Used when `kind` is `periodic`.

- `quantity` (double, required) — How many seconds, minutes or hours between runs, 1 or more. Counted in seconds, at least 10, the same minimum as a cron expression.
- `unit` (enum, required) — Whether `quantity` counts `seconds`, `minutes` or `hours`.
  - Allowed values: `seconds`, `minutes`, `hours`

### TriggerServiceServiceSchedulesScheduleIdPatchRequestBodyContentApplicationJsonSchemaScheduleRecurrenceWindow

The stretch of the day to run in. The count restarts at its start each day. Leave out to run through the whole day: with `weekdays` the count restarts at 00:00, and without `weekdays` it never restarts and counts every gap from the start of the schedule. Used when `kind` is `periodic`.

- `from` (string, required) — When the window opens each day, in UTC, written HH:mm on a 24-hour clock. The first run of each day is at this time.
- `to` (string, required) — When the window closes, in UTC, written HH:mm. A run at exactly this time is included. A time earlier than `from` closes the window the next morning.

### TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaScheduleRecurrenceEvery

How often the schedule runs. Present when `kind` is `periodic`.

- `quantity` (double, required) — How many seconds, minutes or hours between runs.
- `unit` (enum, required) — Whether `quantity` counts `seconds`, `minutes` or `hours`.
  - Allowed values: `seconds`, `minutes`, `hours`

### TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaScheduleRecurrenceWindow

The stretch of the day the schedule runs in. Absent when it runs through the whole day. Present only when `kind` is `periodic`.

- `from` (string, required) — When the window opens each day, in UTC, written HH:mm.
- `to` (string, required) — When the window closes, in UTC, written HH:mm. A time earlier than `from` closes it the next morning.

### TriggerServiceServiceSchedulesScheduleIdPatchResponsesContentApplicationJsonSchemaScheduleRecurrenceOn

Which day of the month the schedule fires on. Present when `kind` is `monthly`.

- `kind` (enum, required) — How the day is chosen: `dayOfMonth` for a fixed date, `nthWeekday` for a counted weekday such as the first Tuesday, `lastDay` for the last day of the month.
  - Allowed values: `dayOfMonth`, `nthWeekday`, `lastDay`
- `day` (double, optional) — Day of the month, 1 to 31. A month too short for it uses its last day. Present when `kind` is `dayOfMonth`.
- `ordinal` (enum, optional) — Which occurrence of the weekday in the month. Present when `kind` is `nthWeekday`.
  - Allowed values: `first`, `second`, `third`, `fourth`, `last`
- `weekday` (enum, optional) — Day of the week. Present when `kind` is `nthWeekday`.
  - Allowed values: `sun`, `mon`, `tue`, `wed`, `thu`, `fri`, `sat`

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "scheduleId": "string",
  "serviceId": "string",
  "serviceName": "string",
  "triggerSetEnabled": true,
  "createdBy": {
    "principalId": "string",
    "displayName": "string",
    "inactive": true,
    "email": "string"
  },
  "createdAt": "string",
  "lastUpdatedAt": "string",
  "status": "active",
  "scheduleType": "concrete",
  "input": {},
  "missedRunPolicy": "skip",
  "legacyWrapper": true,
  "schedule": {
    "recurrence": {
      "kind": "cron",
      "cron": "string",
      "every": {
        "quantity": 1.1,
        "unit": "seconds"
      },
      "window": {
        "from": "string",
        "to": "string"
      },
      "everyDays": 1.1,
      "everyWeeks": 1.1,
      "weekdays": [
        "sun"
      ],
      "months": [
        1.1
      ],
      "on": {
        "kind": "dayOfMonth",
        "day": 1.1,
        "ordinal": "first",
        "weekday": "sun"
      },
      "at": "string"
    },
    "startsAt": "string",
    "endsAt": "string",
    "maxOccurrences": 1.1
  },
  "concreteDate": "string",
  "formId": "string",
  "lastRun": "string",
  "nextRun": "string"
}
```

**SDK Code**

```python
import requests

url = "https://example.itential.io/trigger-service/service-schedules/scheduleId"

payload = {}
headers = {"Content-Type": "application/json"}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://example.itential.io/trigger-service/service-schedules/scheduleId';
const options = {method: 'PATCH', headers: {'Content-Type': 'application/json'}, body: '{}'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://example.itential.io/trigger-service/service-schedules/scheduleId"

	payload := strings.NewReader("{}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://example.itential.io/trigger-service/service-schedules/scheduleId")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://example.itential.io/trigger-service/service-schedules/scheduleId")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://example.itential.io/trigger-service/service-schedules/scheduleId', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://example.itential.io/trigger-service/service-schedules/scheduleId");
var request = new RestRequest(Method.PATCH);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://example.itential.io/trigger-service/service-schedules/scheduleId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```