> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seam.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Thermostat Schedule

> Creates a new [thermostat schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules) for a specified [thermostat](https://docs.seam.co/capability-guides/thermostats).



## OpenAPI

````yaml /openapi.json post /thermostats/schedules/create
openapi: 3.0.0
info:
  title: Seam Connect
  version: 1.0.0
servers:
  - url: https://connect.getseam.com
security: []
tags:
  - description: access_codes
    name: /access_codes
  - description: acs
    name: /acs
  - description: action_attempts
    name: /action_attempts
  - description: client_sessions
    name: /client_sessions
  - description: connected_accounts
    name: /connected_accounts
  - description: connect_webviews
    name: /connect_webviews
  - description: devices
    name: /devices
  - description: events
    name: /events
  - description: health
    name: /health
  - description: locks
    name: /locks
  - description: networks
    name: /networks
  - description: noise_sensors
    name: /noise_sensors
  - description: phones
    name: /phones
  - description: thermostats
    name: /thermostats
  - description: user_identities
    name: /user_identities
  - description: webhooks
    name: /webhooks
  - description: workspaces
    name: /workspaces
paths:
  /thermostats/schedules/create:
    post:
      tags:
        - /thermostats
      summary: Create a Thermostat Schedule
      description: >-
        Creates a new [thermostat
        schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules)
        for a specified
        [thermostat](https://docs.seam.co/capability-guides/thermostats).
      operationId: thermostatsSchedulesCreatePost
      requestBody:
        content:
          application/json:
            schema:
              properties:
                climate_preset_key:
                  description: >-
                    Key of the [climate
                    preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets)
                    to use for the new thermostat schedule.
                  type: string
                device_id:
                  description: >-
                    ID of the thermostat device for which you want to create a
                    schedule.
                  type: string
                ends_at:
                  description: >-
                    Date and time at which the new thermostat schedule ends, in
                    [ISO
                    8601](https://www.iso.org/iso-8601-date-and-time-format.html)
                    format.
                  type: string
                is_override_allowed:
                  description: >-
                    Indicates whether a person at the thermostat or using the
                    API can change the thermostat's settings while the new
                    schedule is active. See also [Specifying Manual Override
                    Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions).
                  type: boolean
                max_override_period_minutes:
                  description: >-
                    Number of minutes for which a person at the thermostat or
                    using the API can change the thermostat's settings after the
                    activation of the scheduled climate preset. See also
                    [Specifying Manual Override
                    Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions).
                  exclusiveMinimum: true
                  minimum: 0
                  nullable: true
                  type: integer
                name:
                  description: Name of the thermostat schedule.
                  type: string
                starts_at:
                  description: >-
                    Date and time at which the new thermostat schedule starts,
                    in [ISO
                    8601](https://www.iso.org/iso-8601-date-and-time-format.html)
                    format.
                  type: string
              required:
                - device_id
                - climate_preset_key
                - starts_at
                - ends_at
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  ok:
                    type: boolean
                  thermostat_schedule:
                    $ref: '#/components/schemas/thermostat_schedule'
                required:
                  - thermostat_schedule
                  - ok
                type: object
          description: OK
        '400':
          description: Bad Request
        '401':
          description: Unauthorized
      security:
        - client_session: []
        - pat_with_workspace: []
        - console_session_with_workspace: []
        - client_session_with_customer: []
        - api_key: []
      x-codeSamples:
        - lang: javascript
          label: Seam SDK
          source: |-
            await seam.thermostats.schedules.create({
              device_id: "d710aa35-232d-442b-a817-c28045de1c74",
              name: "Jane's Stay",
              climate_preset_key: "Occupied",
              max_override_period_minutes: 90,
              starts_at: "2025-06-19T15:00:00.000Z",
              ends_at: "2025-06-22T11:00:00.000Z",
              is_override_allowed: true,
            });

            /*
            {
              "climate_preset_key": "Occupied",
              "created_at": "2025-06-14T16:54:17.946316Z",
              "device_id": "d710aa35-232d-442b-a817-c28045de1c74",
              "ends_at": "2025-06-22T11:00:00.000Z",
              "errors": [],
              "is_override_allowed": true,
              "max_override_period_minutes": 90,
              "name": "Jane's Stay",
              "starts_at": "2025-06-22T11:00:00.000Z",
              "thermostat_schedule_id": "af2cb7f7-9f28-40da-a0a0-e7a008ef7a35",
              "workspace_id": "58419b36-6103-44e5-aa83-2163e90cce01"
            }
            */
        - lang: bash
          label: cURL
          source: >-
            curl --include --request POST
            "https://connect.getseam.com/thermostats/schedules/create" \
              --header "Authorization: Bearer $SEAM_API_KEY" \
              --json @- <<EOF
            {
              "device_id": "d710aa35-232d-442b-a817-c28045de1c74",
              "name": "Jane's Stay",
              "climate_preset_key": "Occupied",
              "max_override_period_minutes": 90,
              "starts_at": "2025-06-19T15:00:00.000Z",
              "ends_at": "2025-06-22T11:00:00.000Z",
              "is_override_allowed": true
            }

            EOF


            # Response:

            # {

            #   "thermostat_schedule": {

            #     "climate_preset_key": "Occupied",

            #     "created_at": "2025-06-14T16:54:17.946316Z",

            #     "device_id": "d710aa35-232d-442b-a817-c28045de1c74",

            #     "ends_at": "2025-06-22T11:00:00.000Z",

            #     "errors": [],

            #     "is_override_allowed": true,

            #     "max_override_period_minutes": 90,

            #     "name": "Jane's Stay",

            #     "starts_at": "2025-06-22T11:00:00.000Z",

            #     "thermostat_schedule_id":
            "af2cb7f7-9f28-40da-a0a0-e7a008ef7a35",

            #     "workspace_id": "58419b36-6103-44e5-aa83-2163e90cce01"

            #   }

            # }
        - lang: python
          label: Seam SDK
          source: |-
            seam.thermostats.schedules.create(
                device_id="d710aa35-232d-442b-a817-c28045de1c74",
                name="Jane's Stay",
                climate_preset_key="Occupied",
                max_override_period_minutes=90,
                starts_at="2025-06-19T15:00:00.000Z",
                ends_at="2025-06-22T11:00:00.000Z",
                is_override_allowed=true,
            )

            # ThermostatSchedule(
                climate_preset_key="Occupied",
                created_at="2025-06-14T16:54:17.946316Z",
                device_id="d710aa35-232d-442b-a817-c28045de1c74",
                ends_at="2025-06-22T11:00:00.000Z",
                errors=[],
                is_override_allowed=true,
                max_override_period_minutes=90,
                name="Jane's Stay",
                starts_at="2025-06-22T11:00:00.000Z",
                thermostat_schedule_id="af2cb7f7-9f28-40da-a0a0-e7a008ef7a35",
                workspace_id="58419b36-6103-44e5-aa83-2163e90cce01",
            )
        - lang: ruby
          label: Seam SDK
          source: |-
            seam.thermostats.schedules.create(
              device_id: "d710aa35-232d-442b-a817-c28045de1c74",
              name: "Jane's Stay",
              climate_preset_key: "Occupied",
              max_override_period_minutes: 90,
              starts_at: "2025-06-19T15:00:00.000Z",
              ends_at: "2025-06-22T11:00:00.000Z",
              is_override_allowed: true,
            )

            # => {
              "climate_preset_key" => "Occupied",
              "created_at" => "2025-06-14T16:54:17.946316Z",
              "device_id" => "d710aa35-232d-442b-a817-c28045de1c74",
              "ends_at" => "2025-06-22T11:00:00.000Z",
              "errors" => [],
              "is_override_allowed" => true,
              "max_override_period_minutes" => 90,
              "name" => "Jane's Stay",
              "starts_at" => "2025-06-22T11:00:00.000Z",
              "thermostat_schedule_id" => "af2cb7f7-9f28-40da-a0a0-e7a008ef7a35",
              "workspace_id" => "58419b36-6103-44e5-aa83-2163e90cce01",
            }
        - lang: php
          label: Seam SDK
          source: |-
            $seam->thermostats->schedules->create(
                device_id: "d710aa35-232d-442b-a817-c28045de1c74",
                name: "Jane's Stay",
                climate_preset_key: "Occupied",
                max_override_period_minutes: 90,
                starts_at: "2025-06-19T15:00:00.000Z",
                ends_at: "2025-06-22T11:00:00.000Z",
                is_override_allowed: true,
            );

            // [
                "climate_preset_key" => "Occupied",
                "created_at" => "2025-06-14T16:54:17.946316Z",
                "device_id" => "d710aa35-232d-442b-a817-c28045de1c74",
                "ends_at" => "2025-06-22T11:00:00.000Z",
                "errors" => [],
                "is_override_allowed" => true,
                "max_override_period_minutes" => 90,
                "name" => "Jane's Stay",
                "starts_at" => "2025-06-22T11:00:00.000Z",
                "thermostat_schedule_id" => "af2cb7f7-9f28-40da-a0a0-e7a008ef7a35",
                "workspace_id" => "58419b36-6103-44e5-aa83-2163e90cce01",
            ];
        - lang: bash
          label: Seam CLI
          source: >-
            seam thermostats schedules create --device_id
            "d710aa35-232d-442b-a817-c28045de1c74" --name "Jane's Stay"
            --climate_preset_key "Occupied" --max_override_period_minutes 90
            --starts_at "2025-06-19T15:00:00.000Z" --ends_at
            "2025-06-22T11:00:00.000Z" --is_override_allowed true


            # {

            #   "climate_preset_key": "Occupied",

            #   "created_at": "2025-06-14T16:54:17.946316Z",

            #   "device_id": "d710aa35-232d-442b-a817-c28045de1c74",

            #   "ends_at": "2025-06-22T11:00:00.000Z",

            #   "errors": [],

            #   "is_override_allowed": true,

            #   "max_override_period_minutes": 90,

            #   "name": "Jane's Stay",

            #   "starts_at": "2025-06-22T11:00:00.000Z",

            #   "thermostat_schedule_id":
            "af2cb7f7-9f28-40da-a0a0-e7a008ef7a35",

            #   "workspace_id": "58419b36-6103-44e5-aa83-2163e90cce01"

            # }
components:
  schemas:
    thermostat_schedule:
      description: >-
        Represents a [thermostat
        schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules)
        that activates a configured [climate
        preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets)
        on a [thermostat](https://docs.seam.co/capability-guides/thermostats) at
        a specified starting time and deactivates the climate preset at a
        specified ending time.
      properties:
        climate_preset_key:
          description: >-
            Key of the [climate
            preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets)
            to use for the [thermostat
            schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules).
          type: string
        created_at:
          description: >-
            Date and time at which the [thermostat
            schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules)
            was created.
          format: date-time
          type: string
        device_id:
          description: >-
            ID of the desired
            [thermostat](https://docs.seam.co/capability-guides/thermostats)
            device.
          format: uuid
          type: string
        ends_at:
          description: >-
            Date and time at which the [thermostat
            schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules)
            ends, in [ISO
            8601](https://www.iso.org/iso-8601-date-and-time-format.html)
            format.
          format: date-time
          type: string
        errors:
          description: >-
            Errors associated with the [thermostat
            schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules).
          items:
            properties:
              error_code:
                description: >-
                  Unique identifier of the type of error. Enables quick
                  recognition and categorization of the issue.
                type: string
              message:
                description: >-
                  Detailed description of the error. Provides insights into the
                  issue and potentially how to rectify it.
                type: string
            required:
              - error_code
              - message
            type: object
          type: array
        is_override_allowed:
          description: >-
            Indicates whether a person at the thermostat can change the
            thermostat's settings after the [thermostat
            schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules)
            starts.
          type: boolean
        max_override_period_minutes:
          description: >-
            Number of minutes for which a person at the thermostat can change
            the thermostat's settings after the activation of the scheduled
            [climate
            preset](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-climate-presets).
            See also [Specifying Manual Override
            Permissions](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules#specifying-manual-override-permissions).
          exclusiveMinimum: true
          minimum: 0
          nullable: true
          type: integer
        name:
          description: >-
            User-friendly name to identify the [thermostat
            schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules).
          nullable: true
          type: string
        starts_at:
          description: >-
            Date and time at which the [thermostat
            schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules)
            starts, in [ISO
            8601](https://www.iso.org/iso-8601-date-and-time-format.html)
            format.
          format: date-time
          type: string
        thermostat_schedule_id:
          description: >-
            ID of the [thermostat
            schedule](https://docs.seam.co/capability-guides/thermostats/creating-and-managing-thermostat-schedules).
          format: uuid
          type: string
        workspace_id:
          description: >-
            ID of the [workspace](https://docs.seam.co/core-concepts/workspaces)
            that contains the thermostat schedule.
          format: uuid
          type: string
      required:
        - thermostat_schedule_id
        - device_id
        - name
        - climate_preset_key
        - starts_at
        - ends_at
        - workspace_id
        - created_at
        - errors
      type: object
      x-route-path: /thermostats/schedules
  securitySchemes:
    client_session:
      bearerFormat: Client Session Token
      scheme: bearer
      type: http
    pat_with_workspace:
      bearerFormat: API Token
      scheme: bearer
      type: http
    console_session_with_workspace:
      bearerFormat: Console Session Token
      scheme: bearer
      type: http
    client_session_with_customer:
      bearerFormat: Customer Client Session Token
      scheme: bearer
      type: http
    api_key:
      bearerFormat: API Key
      scheme: bearer
      type: http

````