Skip to main content
POST
/
scheduler
/
schedules
Create a schedule
import requests

url = "https://{FUSION HOST}/api/scheduler/schedules"

payload = {
    "id": "1",
    "creatorType": "human",
    "creatorId": "admin1",
    "repeatUnit": "DAY",
    "interval": 1,
    "active": True,
    "callParams": {
        "uri": "service://connectors/jobs/LocalDocs2",
        "method": "POST"
    }
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
{
  "id": "1",
  "trigger": "1_1400007488512_-9223372036854775808",
  "schedule": {
    "id": "1",
    "creatorType": "human",
    "creatorId": "admin1",
    "createTime": "2014-05-13T18:58:08.512Z",
    "startTime": "2014-05-13T18:58:08.512Z",
    "endTime": null,
    "repeatUnit": "DAY",
    "interval": 1,
    "active": true,
    "callParams": {
      "uri": "service://connectors/jobs/LocalDocs2",
      "method": "POST",
      "queryParams": {},
      "headers": {},
      "entity": null
    }
  }
}

Body

application/json

JSON-formatted schedule configuration values.

id
string

The ID of the schedule. This is required when creating a schedule with a POST request.

creatorType
string

The type of user that created the schedule. If you have resources creating schedules programmatically, you could define a type that helps distinguish those schedules from others created by people.

creatorId
string

An ID for the user that created the schedule.

createTime
string<date-time>
startTime
string<date-time>

A time when the schedule should be started. If this is not set, it will be set to the date/time when the schedule was created.

endTime
string<date-time>

A time when the schedule should be terminated, i.e., when it will not run any more in the future. If not set, the schedule will run until it is disabled (i.e., active is set to false) or deleted.

repeatUnit
enum<string>

A unit of time that when combined with the interval property defines how often the schedule will run. Allowed values are: <br/>millisecond or ms<br/>second or sec<br/>minute or min<br/>hour or hr<br/>day<br/>week<br/>month These time units are not case-sensitive.

Available options:
MILLISECOND,
SECOND,
MINUTE,
HOUR,
DAY,
WEEK,
MONTH
interval
integer

An integer that when combined with the repeatUnit property defines how often the schedule will run. If this is not set, or set to a number lower than '1' (i.e., '0'), the schedule will only be run once.

active
boolean

If true, the schedule will be executed according to the defined interval. If false, the schedule will be disabled and will not run at the defined time.

callParams
object

Response

200 - application/json

successful operation

The response is of type object.