Certain Schlage residential devices are equipped with a keypad that allows users to enter an access code to unlock or lock their devices. An access code has a name, a code, and a schedule that says when the code is valid. Access codes cannot be shared across multiple devices, but different devices can be configured manually to have the same access codes. The Schlage Encode device is limited to one hundred access codes.

    If you haven't registered for authentication to use the platform yet, you can visit the Getting Started  documentation here for more information on how to obtain credentials.

 

     

    Access Codes in the Schlage Home API must: 

  • Be unique among your access codes.
  • Contain numbers only.
  • Have a length between 4 and 8 digits, inclusive.        
  • Be provided to the API in the form of a string.

    The length of all access codes on a specific device must be the same. The API determines the length based on the first access code the user adds to the device.  

    The device knows the length of its access codes.  Consequently, it knows when a user has entered the corresponding number of digits for a lock/unlock attempt. It can then lock/unlock the device without the need for an "confirm" button. The access code length for a device can be accessed by viewing the "accessCodeLength" attribute when requesting details for a device as well as the list of access codes for the device.

    The access code length can be changed by deleting all access codes on the device and entering a new code with the desired length.

    Examples:

    Valid Codes:

  • "7345"
  • "980012"
  • "001234"

     Invalid Codes:

  • "*12#"
  • "012"
  • "012345678"

 

                        {

                                             "Name" : "Example",

                                             "AccessCode" : "012345",

                                             "Schedule": { 

                                                                  "ScheduleType" : "Always"

                                              }

                       }

 

    Access code names are displayed to help users differentiate their access codes (Ex. "Housekeeper", "Landlord"). An access code must be assigned a name when it's created in the Schlage Home API.

    Access code names must be between 1-12 characters (alpha-numeric only). They can be updated without affecting the access code itself.   Any changes made will be visible in the iOS and Android Schlage Home mobile applications.   

    Examples:

    Valid Names:    

  • "Test"
  • "A 5"

    Invalid Names:

  • "   "
  • "Code Too Loooooong"
  • "%@^$&#"

 

                       {

                                             "Name" : "Example",

                                             "AccessCode" : "012345",

                                             "Schedule": { 

                                                                  "ScheduleType" : "Always"

                                              }

                       }

 

    Schedules describe when an access code is active.  The Schlage Home API supports three types of schedules: AlwaysTemporary, and Recurring.  The schedule type is denoted in the request or response body by the enumerated type ScheduleType.    

    Time values are used to set when an access code is valid.  All times are set in the same time zone as the lock's location.  As a result, no time zone information is required when adding or updating an access code.  

    To discover the time zone a lock resides in, simply request the device details, and view the tmezoneOffset value, which indicates the offset from UTC. The timezone offset is presented in a 24-hour format.     

 

    Always:    

        An Always schedule can be used at any time and it does not expire. 

                  EX:  A home's primary resident can enter and exit at any time.

 

                  Example Request:

                       {

                                             "Name" : "Example",

                                             "AccessCode" : "012345",

                                             "Schedule": { 

                                                                  "ScheduleType" : "Always"

                                              }

                       }

 

    Temporary:    

 

        A Temporary schedule can be used at any time between two given date-times. The start (startDateTime) and end (endDateTime) timestamps must be provided in ISO 8601 local time format ("yyyyMMddTHH:mm"). 

                  EX: A code used during a short-term property rental such as Airbnb and VRBO.

                

                  Example Request:

                       {

                                             "Name" : "Example",

                                             "AccessCode" : "012345",

                                             "Schedule": { 

                                                                  "ScheduleType" : "Temporary",

                                                                  "StartDateTime" : "20191202T20:00",

                                                                  "EndDateTime" : "20191204T10:30"

                                              }

                       }

 

    Recurring: 

 

        A Recurring schedule can be used when an access code must be valid during repeated windows throughout the week.  Each schedule must be populated with a start time (startTime) and end time (endTime ) in 24 hour time format (HH:mm).  The lock will handle the time as it knows which time zone it currently resides in.  The days of the week are provided in the DaysOfWeek variable, which is passed as a string array.  Days of the week can be provided either in abbreviated format (“mon”, “tue”, “wed”, etc.) or in their entirety (“Monday”, “Tuesday”, “Wednesday”, etc.).  Days of the week can also be provided in any order of the client's choosing.

                  Ex:  A house cleaning service is permitted access during a certain day and time of the week.

                     Example Request:

                       {

                                              "Name" : "Example",

                                              "AccessCode" : "012345",

                                              "Schedule": { 

                                                                  "ScheduleType" : "Recurring",

                                                                   "Schedule": [

                                                                     {

                                                                                          "StartTime" : "12:00",

                                                                                          "EndTime" : "22:00",

                                                                                          "DaysOfWeek" : ["Mon", "Tuesday"]

                                                                    },

                                                                    {

                                                                                          "StartTime" : "08:00",

                                                                                          "EndTime" :  "13:45",

                                                                                          "DaysOfWeek"  : [ "Thursday", "Friday", "Saturday"]

                                                                    }

                                                                    ]

                                              }

                       }