> This page is for Itential Platform On-Prem, version 6 (default).
> For other versions, use one of these documentation indexes:
> - 6 (default): https://docs.itential.com/itential-platform/6/llms.txt
> - 2023.2: https://docs.itential.com/itential-platform/2023-2/llms.txt

> 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.

# Create a schedule

POST https://example.itential.io/trigger-service/services/{serviceId}/schedules
Content-Type: application/json

Creates a recurring schedule for a service.

Reference: https://docs.itential.com/itential-platform/6/api-reference/trigger-service/services-create-schedule

## Authentication

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

## Request

### Path parameters

- `serviceId` (string, required) — The scheduled service's unique identifier (services._id), a UUIDv7.

### Body (application/json)

This endpoint expects an object.

- `schedule` (TriggerServiceServicesServiceIdSchedulesPostRequestBodyContentApplicationJsonSchemaSchedule, required) — When the schedule fires: a recurrence, or a single one-time date.
- `inputs` (TriggerServiceServicesServiceIdSchedulesPostRequestBodyContentApplicationJsonSchemaInputs, required) — Inputs the service is requested with each time the schedule fires.
- `missedRunPolicy` (enum, optional) — What to do with an occurrence found overdue. Defaults to skip.
  - 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`. Defaults to false. Turning it on is refused unless the service's asset is a workflow.

## Response

### 200

result

- `scheduleId` (string, required)

## Errors

### 500 Internal Server Error

Error response from API

- `any`

## Types

### TriggerServiceServicesServiceIdSchedulesPostRequestBodyContentApplicationJsonSchemaSchedule

When the schedule fires: a recurrence, or a single one-time date.

- `recurrence` (TriggerServiceServicesServiceIdSchedulesPostRequestBodyContentApplicationJsonSchemaScheduleRecurrence, 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`.

### TriggerServiceServicesServiceIdSchedulesPostRequestBodyContentApplicationJsonSchemaInputs

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

### TriggerServiceServicesServiceIdSchedulesPostRequestBodyContentApplicationJsonSchemaScheduleRecurrence

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` (TriggerServiceServicesServiceIdSchedulesPostRequestBodyContentApplicationJsonSchemaScheduleRecurrenceOn, 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` (TriggerServiceServicesServiceIdSchedulesPostRequestBodyContentApplicationJsonSchemaScheduleRecurrenceEvery, 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` (TriggerServiceServicesServiceIdSchedulesPostRequestBodyContentApplicationJsonSchemaScheduleRecurrenceWindow, 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`.

### TriggerServiceServicesServiceIdSchedulesPostRequestBodyContentApplicationJsonSchemaScheduleRecurrenceOn

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`

### TriggerServiceServicesServiceIdSchedulesPostRequestBodyContentApplicationJsonSchemaScheduleRecurrenceEvery

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`

### TriggerServiceServicesServiceIdSchedulesPostRequestBodyContentApplicationJsonSchemaScheduleRecurrenceWindow

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.

## Examples

**Request**

```json
{}
```

**Response**

```json
{
  "scheduleId": "string"
}
```

**SDK Code**

```python
import requests

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

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

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

print(response.json())
```

```javascript
const url = 'https://example.itential.io/trigger-service/services/serviceId/schedules';
const options = {method: 'POST', 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/services/serviceId/schedules"

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

	req, _ := http.NewRequest("POST", 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/services/serviceId/schedules")

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

request = Net::HTTP::Post.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.post("https://example.itential.io/trigger-service/services/serviceId/schedules")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

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

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

```csharp
using RestSharp;

var client = new RestClient("https://example.itential.io/trigger-service/services/serviceId/schedules");
var request = new RestRequest(Method.POST);
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/services/serviceId/schedules")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```