Schedules

A Schedule is a named, reusable weekday-and-time schedule shared by scheduled resources across a Site.

List Schedules

Endpoint

GET/schedules

Return Object

Schedule[]

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Additional Arguments

Example Request

curl https://app.files.com/api/rest/v1/schedules.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

[
  {
    "id": 1,
    "name": "Weekday overnight",
    "schedule_days_of_week": [
      1,
      2,
      3,
      4,
      5
    ],
    "schedule_times_of_day": [
      "01:00"
    ],
    "schedule_time_zone": "Eastern Time (US & Canada)",
    "holiday_region": "us",
    "human_readable_schedule": "Triggered every Monday, Tuesday, Wednesday, Thursday, Friday at 01:00 AM UTC TZ.",
    "created_at": "2000-01-01T01:00:00Z",
    "updated_at": "2000-01-01T01:00:00Z"
  }
]

Show Schedule

Endpoint

GET/schedules/{id}

Return Object

Schedule

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDescription
id
int64
Required
Schedule ID.

Example Request

curl https://app.files.com/api/rest/v1/schedules/{id}.json \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "Weekday overnight",
  "schedule_days_of_week": [
    1,
    2,
    3,
    4,
    5
  ],
  "schedule_times_of_day": [
    "01:00"
  ],
  "schedule_time_zone": "Eastern Time (US & Canada)",
  "holiday_region": "us",
  "human_readable_schedule": "Triggered every Monday, Tuesday, Wednesday, Thursday, Friday at 01:00 AM UTC TZ.",
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Create Schedule

Endpoint

POST/schedules

Return Object

Schedule

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDescription
name
string
Required
Schedule name.
schedule_days_of_week
array(int64)
Required
0-based weekdays used by the Schedule. 0 is Sunday.
schedule_times_of_day
array(string)
Required
Times of day in HH:MM format (24-hour).
schedule_time_zone
string
Time zone for scheduled times. If not set, times are interpreted as UTC.
holiday_region
string
Optional holiday region on which linked resources do not run.

Example Request

curl https://app.files.com/api/rest/v1/schedules.json \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"name":"Weekday overnight","schedule_days_of_week":[1,2,3,4,5],"schedule_times_of_day":["01:00"],"schedule_time_zone":"Eastern Time (US & Canada)","holiday_region":"us"}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "Weekday overnight",
  "schedule_days_of_week": [
    1,
    2,
    3,
    4,
    5
  ],
  "schedule_times_of_day": [
    "01:00"
  ],
  "schedule_time_zone": "Eastern Time (US & Canada)",
  "holiday_region": "us",
  "human_readable_schedule": "Triggered every Monday, Tuesday, Wednesday, Thursday, Friday at 01:00 AM UTC TZ.",
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Update Schedule

Endpoint

PATCH/schedules/{id}

Return Object

Schedule

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDescription
id
int64
Required
Schedule ID.
name
string
Schedule name.
schedule_days_of_week
array(int64)
0-based weekdays used by the Schedule. 0 is Sunday.
schedule_times_of_day
array(string)
Times of day in HH:MM format (24-hour).
schedule_time_zone
string
Time zone for scheduled times. If not set, times are interpreted as UTC.
holiday_region
string
Optional holiday region on which linked resources do not run.

Example Request

curl https://app.files.com/api/rest/v1/schedules/{id}.json \
  -X PATCH \
  -H 'Content-Type: application/json' \
  -d '{"name":"Weekday overnight","schedule_days_of_week":[1,2,3,4,5],"schedule_times_of_day":["01:00"],"schedule_time_zone":"Eastern Time (US & Canada)","holiday_region":"us"}' \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

Example Response

{
  "id": 1,
  "name": "Weekday overnight",
  "schedule_days_of_week": [
    1,
    2,
    3,
    4,
    5
  ],
  "schedule_times_of_day": [
    "01:00"
  ],
  "schedule_time_zone": "Eastern Time (US & Canada)",
  "holiday_region": "us",
  "human_readable_schedule": "Triggered every Monday, Tuesday, Wednesday, Thursday, Friday at 01:00 AM UTC TZ.",
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}

Delete Schedule

Endpoint

DELETE/schedules/{id}

Return Object

No return value.

Authorization Requirement

Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.

Request Parameters

ParameterDescription
id
int64
Required
Schedule ID.

Example Request

curl https://app.files.com/api/rest/v1/schedules/{id}.json \
  -X DELETE \
  -H 'X-FilesAPI-Key: YOUR_API_KEY'

The Schedule Object

Some of the endpoints above return a Schedule object. The attributes of this object are listed below.

AttributeDescription
id
int64
Schedule ID.
name
string
Schedule name.
schedule_days_of_week
array(int64)
0-based weekdays used by the Schedule. 0 is Sunday.
schedule_times_of_day
array(string)
Times of day in HH:MM format (24-hour).
schedule_time_zone
string
Time zone for scheduled times. If not set, times are interpreted as UTC.
holiday_region
string
Optional holiday region on which linked resources do not run.
human_readable_schedule
string
Human-readable Schedule description.
created_at
date-time
Creation time.
updated_at
date-time
Last update time.

Example Schedule Object

{
  "id": 1,
  "name": "Weekday overnight",
  "schedule_days_of_week": [
    1,
    2,
    3,
    4,
    5
  ],
  "schedule_times_of_day": [
    "01:00"
  ],
  "schedule_time_zone": "Eastern Time (US & Canada)",
  "holiday_region": "us",
  "human_readable_schedule": "Triggered every Monday, Tuesday, Wednesday, Thursday, Friday at 01:00 AM UTC TZ.",
  "created_at": "2000-01-01T01:00:00Z",
  "updated_at": "2000-01-01T01:00:00Z"
}