# Create a fixed schedule for an AutoStopping Rule

Creates a new fixed schedule for an AutoStopping Rule to automatically start or stop resources at specific times.

Endpoint: POST /gateway/lw/api/accounts/{account_id}/schedules
Version: 1.0
Security: x-api-key

## Path parameters:

  - `account_id` (string, required)
    Account Identifier for the Entity
    Example: "abc12_DEFgh-ijkLMNOPqr"

## Query parameters:

  - `cloud_account_id` (string, required)
    Unique identifier of the cloud connector (AWS, Azure, or GCP) configured in CACM.
    Example: "lightwing_nonprod"

  - `accountIdentifier` (string, required)
    Account Identifier for authentication and authorization.
    Example: "abc12_DEFgh-ijkLMNOPqr"

## Request fields (*/*):

  - `schedule` (object)

  - `schedule.name` (string)
    Name of the schedule

  - `schedule.account` (string)
    ID of account

  - `schedule.description` (string)
    Description of fixed schedule

  - `schedule.resources` (array)
    List of resources to be controlled by the schedule

  - `schedule.resources.id` (string)
    ID of the resource to be controlled by schedule. For AutoStopping rule, this would be the ID of the rule

  - `schedule.resources.type` (string)
    Type of the resource to be controlled
    Enum: "autostop_rule"

  - `schedule.details` (object)
    Details of time schedule by which the resource should be controlled

  - `schedule.details.uptime` (object)
    Specifies the occurrence schedule. Occurrence schedule can either be specified as period or as days

  - `schedule.details.uptime.period` (object)
    For schedules that uses an exact time period

  - `schedule.details.uptime.period.start` (string)
    Start time of the period
    Example: "2021-10-19T08:35:00.927Z"

  - `schedule.details.uptime.period.end` (string)
    End time of the period
    Example: "2021-10-19T08:37:58.927Z"

  - `schedule.details.uptime.days` (object)
    For specifying a recurring schedule in terms of week days

  - `schedule.details.uptime.days.days` (array)
    Days of week on which the schedule should be executed

  - `schedule.details.uptime.days.all_day` (boolean)
    Equivalent to selecting all days

  - `schedule.details.uptime.days.start_time` (object)

  - `schedule.details.uptime.days.start_time.hour` (number)
    Hour

  - `schedule.details.uptime.days.start_time.min` (number)
    Minutes

  - `schedule.details.uptime.days.end_time` (object)

  - `schedule.details.downtime` (object)
    Specifies the occurrence schedule. Occurrence schedule can either be specified as period or as days

  - `schedule.details.timezone` (string)
    Time zone in which the schedule should be applied

  - `id` (number)


## Response 400 fields
