Access schedules
Set the hours when a DUSAW lock accepts electronic credentials. Allow access around the clock, turn off electronic access, or create a weekly schedule.
Access schedules apply to the whole lock, not just one guest or employee. During an allowed period, people still need a valid mobile key, access code, or card. Outside those hours, electronic unlocking is disabled and a mechanical key is required.
Keep a working mechanical key available. Turning off electronic access or setting an incorrect schedule can prevent people from entering. Test changes on a noncritical door first. Do not assume an administrator's mobile key or a remote unlock command can bypass the restriction.
An access schedule does not hold a door open or automatically unlock it when business hours begin. If you need a door to remain unlocked during certain hours, that is a separate feature called passage mode.
Before you begin
- Use a DUSAW API bearer token associated with the lock's administrator account.
- Confirm that the lock model and firmware support access schedules. DUSAW support can help check compatibility.
- To change a schedule remotely, the lock must be reachable through a gateway or its own Wi-Fi connection. These endpoints do not configure Bluetooth-only locks through a nearby phone.
- Confirm the lock's clock and time zone. After an update, check the saved settings and test the actual lock before relying on the schedule.
- For an exit door, have a qualified installer confirm that the hardware and settings meet applicable building, fire, and accessibility requirements. This API does not certify emergency egress behavior.
Both endpoints use your existing DUSAW token. DUSAW handles the device connection internally; no additional device-service credentials or connection flags are needed.
Choose an access mode
mode | When to use it | Effect |
|---|---|---|
always | Remove the lock-wide schedule restriction. | Valid electronic credentials can be used at any time, subject to their own access permissions and expiration dates. This does not automatically unlock the door or turn on passage mode. |
disabled | Require mechanical-key access at all times. | All electronic unlocking is disabled. Make sure authorized staff have a working mechanical key before applying this mode. |
scheduled | Limit electronic access to recurring weekly hours. | Electronic unlocking is allowed only during the periods you provide. A mechanical key is required outside those periods. |
Changing a mode does not create new credentials or extend existing ones. For example, switching to always does not make an expired access code valid again.
Get an access schedule
Retrieve a lock's saved access mode and weekly periods. This request does not change the lock and is not a check of its connectivity or the door's physical position.
Query parameter
- Name
lockId- Type
- integer
- Description
Required. The lock's positive numeric ID, as returned by the lock list endpoint.
Response fields
- Name
lockId- Type
- integer
- Description
The lock you requested.
- Name
mode- Type
- string
- Description
always,disabled, orscheduled.
- Name
periods- Type
- array
- Description
The weekly access periods. This is an empty array for
alwaysanddisabled. Each scheduled period containsdaysandallDay; timed periods also includestartandend.
Request
curl --get 'https://api.dusaw.com/api/v1/lock/access-schedule' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}' \
--data-urlencode 'lockId=76133538'
Response: Monday–Friday, 8:00 a.m.–6:00 p.m.
{
"lockId": 76133538,
"mode": "scheduled",
"periods": [
{
"days": ["monday", "tuesday", "wednesday", "thursday", "friday"],
"allDay": false,
"start": "08:00",
"end": "18:00"
}
]
}
Set an access schedule
Apply a mode or weekly schedule through the lock's gateway or Wi-Fi connection. Send the complete schedule you want to use; this endpoint does not merge new periods with previously saved ones.
Request body
Send JSON with Content-Type: application/json.
- Name
lockId- Type
- integer
- Description
Required. The lock's positive numeric ID.
- Name
mode- Type
- string
- Description
Required.
always,disabled, orscheduled. Use the exact lowercase spelling.
- Name
periods- Type
- array
- Description
Required for
scheduled: a nonempty array of weekly access periods. Omit this field foralwaysanddisabled; any supplied periods are ignored in those modes.
A successful update returns {"success": true}. Read the schedule back and test the expected behavior at the door before putting it into regular use.
Request: Monday–Friday, 8:00 a.m.–6:00 p.m.
curl --request POST 'https://api.dusaw.com/api/v1/lock/access-schedule' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{
"lockId": 76133538,
"mode": "scheduled",
"periods": [
{
"days": ["monday", "tuesday", "wednesday", "thursday", "friday"],
"start": "08:00",
"end": "18:00"
}
]
}'
Response
{
"success": true
}
Request: remove the schedule restriction
curl --request POST 'https://api.dusaw.com/api/v1/lock/access-schedule' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data '{"lockId": 76133538, "mode": "always"}'
Define weekly access periods
Each object in periods defines when electronic unlocking is allowed. Days and times not covered by the schedule are restricted.
| Field | Type | How to use it |
|---|---|---|
days | Array of strings | Required. One or more lowercase weekday names: monday, tuesday, wednesday, thursday, friday, saturday, sunday. Do not repeat a day within the same period. |
allDay | Boolean | Optional; defaults to false. Set to true to allow electronic access throughout the selected days. This does not keep the door unlocked. |
start | String | Required unless allDay is true. Local time in HH:MM format, from 00:00 through 23:59. For example, 08:00 means 8:00 a.m. |
end | String | Required unless allDay is true. Local time in HH:MM format, later than start. Use 18:00 for 6:00 p.m. or 24:00 for the end of the selected day. |
You can use multiple periods on the same day, such as a morning period and an afternoon period. Send periods as a JSON array, not a JSON-encoded string. Do not include fields other than the four listed above within a period.
Time zones and daylight saving time
Use the lock's local clock time, not UTC or the time zone of your server. Wire-format times use a 24-hour clock: 8:00 a.m. is 08:00 and 6:00 p.m. is 18:00. Do not send AM/PM text, dates, Unix timestamps, or UTC offsets in start or end.
These endpoints do not set the lock's time zone or daylight saving time rules. Check the lock's time configuration separately and verify its behavior across seasonal clock changes. Do not assume that saving an access schedule updates the clock.
Overnight access
Each period must fit within one day. For 10:00 p.m. Monday through 6:00 a.m. Tuesday, send two periods:
Request body: overnight access
{
"lockId": 76133538,
"mode": "scheduled",
"periods": [
{ "days": ["monday"], "start": "22:00", "end": "24:00" },
{ "days": ["tuesday"], "start": "00:00", "end": "06:00" }
]
}
24:00 is accepted only as an end time. Do not send an end time earlier than or equal to the start time.
All-day access on selected days
This example allows valid electronic credentials throughout Saturday and Sunday. Electronic access is restricted on the other days:
Request body: weekends only
{
"lockId": 76133538,
"mode": "scheduled",
"periods": [{ "days": ["saturday", "sunday"], "allDay": true }]
}
Omit start and end for an all-day period. Any supplied times are ignored when allDay is true.
Disable electronic access
To require mechanical-key access at all times, send {"lockId": 76133538, "mode": "disabled"}. Only apply this mode if that is your intent and authorized staff have a working mechanical key. To allow valid electronic credentials again without a weekly restriction, send the same request with "mode": "always".
Handle errors
An invalid or missing bearer token returns HTTP 401. Invalid request data returns HTTP 422 with a message and an errors object identifying the fields to correct. For example, a scheduled mode without any periods is rejected before a device command is sent:
HTTP 422: request validation
{
"message": "The periods field is required.",
"errors": {
"periods": ["The periods field is required."]
}
}
A device-service rejection also returns HTTP 422, using the standard DUSAW error format:
HTTP 422: unsupported lock or firmware
{
"success": false,
"error": "Lock does not support this feature"
}
- Unsupported feature: ask DUSAW support to confirm access-schedule support for your lock model and firmware.
- Administrator permission required: use a token associated with the lock's administrator account.
- Connection unavailable: check the gateway or Wi-Fi lock's connectivity before retrying. The connection method is managed by DUSAW, not a request parameter.
- Gateway busy: wait briefly before retrying. If an update's outcome is unclear, read the saved schedule before sending it again.
Never include your bearer token when sharing a request or error with support. See Errors for the general HTTP status reference.