# Schedules requests

> The following request enables you to create a schedule named ApiTest, on the GMT Standard Time time zone, which is triggered every 5 months, on Sundays.

## Starting a schedule with dynamic robot allocation

The following request enables you to create a schedule named ApiTest, on the GMT Standard Time time zone, which is triggered every 5 months, on Sundays.

The `StartStrategy` parameter lets you choose how you want to run the job.

**Possible values for** `StartStrategy`

| Value | Name | Description | Folder Context |
| --- | --- | --- | --- |
| `-1` | All robots | Runs the job once for each robot present in the environment of the process. | classic |
| `0` | Custom robots | Runs the job once on each of the specified robots. To specify the robots, include the robot Ids as values in `ExecutorRobots`. For example, `"ExecutorRobots" : [ {"Id" : 44881 | classic |
| `1` | 1 robot | Runs the job on a dynamically selected robot of any user who has access to the folder where the process is.  You can also set the job to run on the robot you specify in `MachineRobots`. See the sample request body below for an example. | modern |
| any other number | Dynamic allocation | Creates the specified number of jobs and dynamically chooses the robots on which to run them from the available robots in the modern folder of the process, or from the robots in the environment for classic folders.  For modern folders, you can also specify one or more machine templates, robots, or both machine templates and robots using the list parameter `MachineRobots`. In this case, the `StartStrategy` value represents the number of times to execute the job on each specified robot or robot-machine combination.  This is not possible for classic folders and, if specified, the `ExecutorRobots` parameter is ignored. | classic or modern |

**POST**

`https://{yourDomain}/odata/ProcessSchedules`

### Request headers

| Key | Value |
| --- | --- |
| Authorization | Bearer |

### Request body

```
{
  "Name":"ApiTest",
  "ReleaseId":75,
  "ReleaseName":"BlankProcess_DocEnv",
  "StartProcessCron":"0 0 0 ? 1/5 SUN *",
  "StartProcessCronDetails":"{\"type\":4,\"minutely\":{},\"hourly\":{},\"daily\":{},\"weekly\":{\"weekdays\":[]},\"monthly\":{\"weekdays\":[{\"id\":\"SUN\",\"weekly\":\"Sunday\",\"monthly\":\"Sunday\"}],\"atMinute\":0,\"atHour\":0,\"frequencyInMonths\":\"5\"},\"advancedCronExpression\":\"\"}",
  "StartStrategy":15,
  "ExecutorRobots":[],
  "MachineRobots":[
    {
      "MachineId":null,
      "MachineName":null,
      "RobotId":44880,
      "RobotUserName":"acme\\john.doe"
    }
  ],
  "StopProcessExpression":"",
  "StopStrategy":null,
  "TimeZoneId":"GMT Standard Time"
}
```

:::note
To determine the correct value for the `TimeZoneId` parameter, make a `GET` request to the `/odata/Settings/UiPath.Server.Configuration.OData.GetTimezones` endpoint. In the response, locate the entry for your time zone and copy the string in the `Value` field. Then, when you create the schedule, use the string as the value of the `TimeZoneId` parameter in the request body.
:::

### Response code

200 OK

### Response body

```
{
    "@odata.context": "https://{yourDomain}/odata/$metadata#ProcessSchedules/$entity",
    "Enabled": true,
    "Name": "ApiTest",
    "ReleaseId": 75,
    "ReleaseKey": "00000000-0000-0000-0000-000000000000",
    "ReleaseName": null,
    "PackageName": null,
    "EnvironmentName": null,
    "EnvironmentId": "0",
    "StartProcessCron": "0 0 0 ? 1/5 SUN *",
    "StartProcessCronDetails": "{\"type\":4,\"minutely\":{},\"hourly\":{},\"daily\":{},\"weekly\":{\"weekdays\":[]},\"monthly\":{\"weekdays\":[{\"id\":\"SUN\",\"weekly\":\"Sunday\",\"monthly\":\"Sunday\"}],\"atMinute\":0,\"atHour\":0,\"frequencyInMonths\":\"5\"},\"advancedCronExpression\":\"\"}",
    "StartProcessCronSummary": null,
    "StartProcessNextOccurrence": null,
    "StartStrategy": 15,
    "StopProcessExpression": "",
    "StopStrategy": null,
    "ExternalJobKey": "8cda4b35-e835-445b-b477-1ea0961d62e5",
    "TimeZoneId": "GMT Standard Time",
    "TimeZoneIana": "Europe/London",
    "UseCalendar": false,
    "StopProcessDate": null,
    "InputArguments": "{}",
    "Id": 43
}
```

## Starting a schedule with input parameters values

The following POST request to the `/odata/ProcessSchedules` endpoint allows you to create an enabled schedule with the "API_schedule_test" name on the process with the 55 Id, while also adding custom values for some of the processes' parameters. The schedule starts every five minutes on all available Robots and does not take into account non-working days.

:::note
A maximum of 10.000 characters is accepted for the entire length of the JSON representation of **input parameters**, including argument names, all the escaped characters, spaces, brackets, and arguments values.
:::

**POST**

`https://{yourDomain}/odata/ProcessSchedules`

### Request headers

| Key | Value |
| --- | --- |
| Authorization | Bearer |

### Request body

```
{
      "Enabled": true,
      "Name": "API_schedule_test",
      "ReleaseId": 55,
      "ReleaseKey": "429cf1cc-283c-424f-a935-43f72c2ca719",
      "ReleaseName": "input_output_test_DocEnv",
      "PackageName": "input_output_test",
      "EnvironmentName": "DocEnv",
      "EnvironmentId": "7",
      "StartProcessCron": "0 0/5 * 1/1 * ? *",
      "StartProcessCronDetails": "{\"type\":0,\"minutely\":{\"atMinute\":5},\"hourly\":{},\"daily\":{},\"weekly\":{\"weekdays\":[]},\"monthly\":{\"weekdays\":[]},\"advancedCronExpression\":\"\"}",
      "StartProcessCronSummary": "Every 5 minutes",
      "StartProcessNextOccurrence": null,
      "StartStrategy": 0,
      "StopProcessExpression": "",
      "StopStrategy": null,
      "ExternalJobKey": "af486c19-c797-48cd-b586-cfb7a12110a2",
      "TimeZoneId": "Morocco Standard Time",
      "TimeZoneIana": "Africa/Casablanca",
      "UseCalendar": false,
      "StopProcessDate": null,
      "InputArguments": "{\"arrayStrings\":[\"test\",\"test\"],\"age\":666,\"trueOrFalse\":false,\"dateNow\":\"2012-04-23T18:25:43.511Z\",\"stringNew\":\"stringTest\",\"DoubleTest\":7.555555}",
      "Id": 37
    }
```

:::note
To determine the correct value for the `TimeZoneId` parameter, make a `GET` request to the `/odata/Settings/UiPath.Server.Configuration.OData.GetTimezones` endpoint. In the response, locate the entry for your time zone and copy the string in the `Value` field. Then, when you create the schedule, use the string as the value of the `TimeZoneId` parameter in the request body.
:::

### Response code

200 OK

### Response body

```
{
    "@odata.context": "https://{yourDomain}/odata/$metadata#ProcessSchedules/$entity",
    "Enabled": true,
    "Name": "API_schedule_test",
    "ReleaseId": 55,
    "ReleaseKey": "00000000-0000-0000-0000-000000000000",
    "ReleaseName": null,
    "PackageName": null,
    "EnvironmentName": null,
    "EnvironmentId": "0",
    "StartProcessCron": "0 0/5 * 1/1 * ? *",
    "StartProcessCronDetails": "{\"type\":0,\"minutely\":{\"atMinute\":5},\"hourly\":{},\"daily\":{},\"weekly\":{\"weekdays\":[]},\"monthly\":{\"weekdays\":[]},\"advancedCronExpression\":\"\"}",
    "StartProcessCronSummary": "Every 5 minutes",
    "StartProcessNextOccurrence": null,
    "StartStrategy": 0,
    "StopProcessExpression": "",
    "StopStrategy": null,
    "ExternalJobKey": "7ecbff8d-832d-41e1-a3ed-aee0957caffe",
    "TimeZoneId": "Morocco Standard Time",
    "TimeZoneIana": "Africa/Casablanca",
    "UseCalendar": false,
    "StopProcessDate": null,
    "InputArguments": "{\"arrayStrings\":[\"test\",\"test\"],\"age\":666,\"trueOrFalse\":false,\"dateNow\":\"2012-04-23T18:25:43.511Z\",\"stringNew\":\"stringTest\",\"DoubleTest\":7.555555,\"inOutTry\":\"2012-04-23T18:25:43.511Z\"}",
    "Id": 37
}
```
