Doorlock API List

Last Updated on : 2023-06-15 05:14:55

This topic describes the processes and APIs for smart lock development. The smart lock cloud development allows you to implement lock services on your self-built servers such as WeChat mini program, web system, and H5 pages.

Integration process

Before you integrate with vertical resources of smart locks, you need to register as a Tuya developer. For more information, see Quick Start.

The following figure shows how to implement cloud development of smart locks.

Doorlock API List

Applicable categories

Protocol Applicable category
Wi-Fi Wi-Fi residential lock pro, Wi-Fi residential lock, and Wi-Fi safe box.
Bluetooth low energy Bluetooth lock, including the Bluetooth lock with gateway features.
Zigbee Zigbee residential lock pro and Zigbee residential lock.

API logs

You can query API call logs for the last seven days. You can provide API request parameters by submitting a service ticket. Tuya will contact you within two hours. For urgent issues, you can contact project managers.

API list

The following table lists the APIs that support smart lock services.

Request method API Description
POST /v1.0/devices/{device_id}/door-lock/password-ticket Get a temporary key for password encryption.
POST /v1.0/devices/{device_id}/door-lock/temp-password Create a temporary password. A periodic password is supported.
POST /v2.0/devices/{device_id}/door-lock/temp-password Create an unnamed temporary password. A periodic password is supported.
POST /v1.0/devices/{device_id}/door-lock/issue-password Synchronize passwords.
GET /v1.0/devices/{device_id}/door-lock/temp-password/{password_id} Get the information about a temporary password.
GET /v1.0/devices/{device_id}/door-lock/temp-passwords Get a list of temporary passwords.
GET /v1.0/smart-lock/devices/{device_id}/stand-by-lock-temp-passwords Get a list of keepalive temporary passwords.
PUT /v1.0/devices/{device_id}/door-lock/temp-passwords/{password_id}/modify-password Modify a temporary password.
PUT /v1.0/devices/{device_id}/door-lock/temp-passwords/{password_id}/freeze-password Freeze a temporary password.
PUT /v1.0/devices/{device_id}/door-lock/temp-passwords/{password_id}/unfreeze-password Unfreeze a temporary password.
DELETE /v1.0/devices/{device_id}/door-lock/temp-passwords/{password_id} Delete a temporary password.
POST /v1.0/devices/{device_id}/door-lock/offline-temp-password Get an offline password.
POST /v1.1/devices/{device_id}/door-lock/offline-temp-password Get an offline password v1.1.
PUT /v1.0/devices/{device_id}/door-lock/offline-temp-password/{password_id} Update the name of an offline password.
GET /v1.0/devices/{device_id}/door-lock/dynamic-password Get a dynamic password.
POST /v1.0/devices/{device_id}/user Add a device user (not a home user).
PUT /v1.0/devices/{device_id}/users/{user_id} Modify a device user (not a home user).
PUT /v1.0/smart-lock/devices/{device_id}/users/{user_id}/actions/role Update the role of a device user.
DELETE /v1.0/devices/{device_id}/users/{user_id} Delete a device user (not a home user).
GET /v1.0/devices/{device_id}/users/{user_id} Query the information about a device user (not a home user ).
GET /v1.1/devices/{device_id}/users/{user_id} Query the information about a device user (v1.1), including the current user.
GET /v1.0/devices/{device_id}/users Query a list of users by device ID (not a home user).
GET /v1.1/devices/{device_id}/users Query a list of users by device ID (not a home user)-v1.1.
POST /v1.0/devices/{device_id}/device-lock/users/{user_id}/allocate Assign a password to a device user (not a home user).
POST /v1.0/devices/{device_id}/door-lock/opmodes/actions/allocate Assign multiple unlocking methods to users.
GET /v1.0/smart-lock/users/{uid}/devices Get the devices linked with a specified user account.
GET /v1.0/devices/{device_id}/door-lock/user-types/{user_type}/users/{user_id}/assigned-keys Get a list of unlocking methods linked with a specified user (home user only).
GET /v1.0/devices/{device_id}/door-lock/unassigned-keys Get a list of unlocking methods that are not linked with users (home user only).
POST /v1.0/smart-lock/devices/{device_id}/opmodes/actions/sync Sync unlocking methods by the cloud.
PUT /v1.0/devices/{device_id}/door-lock/actions/entry Enroll unlocking methods (home user only).
DELETE /v1.0/devices/{device_id}/door-lock/user-types/{user_type}/users/{user_id}/unlock-types/{unlock_type}/keys/{unlock_no} Delete unlocking methods (home user only).
PUT /v1.0/devices/{device_id}/door-lock/unlock-types/{unlock_type}/actions/cancel Cancel unlocking method enrollment (home user only).
PUT /v1.0/devices/{device_id}/door-lock/opmodes/{unlock_sn} Update the names of unlocking methods.
PUT /v1.0/devices/{device_id}/door-lock/unlock-types/{unlock_type}/keys/{unlock_no}/hijack Set an unlocking method to trigger a duress alarm (home user only).
GET /v1.0/devices/{device_id}/door-lock/open-logs Query the unlocking records.
*GET /v1.1/devices/{device_id}/door-lock/open-logs Query the unlocking records.
GET /v1.0/devices/{device_id}/door-lock/alarm-logs Get the alert records.
*GET /v1.1/devices/{device_id}/door-lock/alarm-logs Get the alert records.
GET /v1.0/devices/{device_id}/door-lock/records Get the alert records and unlocking records.
POST /v1.0/devices/{device_id}/door-lock/records/{record_id}/actions/allocate Link a specified record with a user.
POST /v1.0/devices/{device_id}/door-lock/temp-passwords/rest-password Clear temporary passwords.
GET /v1.0/devices/{device_id}/door-lock/remote-unlocks Get the remote unlocking methods supported by a lock.
POST /v1.0/devices/{device_id}/door-lock/remote-unlock/config Set a switch for a remote unlocking method.
POST /v1.0/devices/{device_id}/door-lock/open-door Unlock a door with password.
POST /v1.0/devices/{device_id}/door-lock/password-free/open-door Unlock a door without password.
POST /v1.1/devices/{device_id}/door-lock/password-free/open-door Unlock a door without password (v1.1). A certain channel can be specified for unlocking.
PUT /v1.0/devices/{device_id}/door-lock/password-free/open-door/cancel Revoke a password-free unlocking.
GET /v1.0/devices/{device_id}/door-lock/latest/media/url Get the cover image of the last remote unlocking or alert.
POST /v1.0/devices/{device_id}/door-lock/advanced-password Set an advanced password.
GET /v1.0/devices/{device_id}/door-lock/advanced-password Query an advanced password.
GET /v1.0/devices/{device_id} Get the information about a specified device. You get the local key to encrypt and decrypt the password.
GET /v1.0/smart-lock/devices/{device_id}/users Get a list of home users and unlocking methods.
PUT /v1.0/smart-lock/devices/{device_id}/users/{user_id}/schedule Update the validity period of a home user.
GET /v1.0/smart-lock/devices/{device_id}/albums-media Get a list of albums.
GET /v1.0/devices/{device_id}/door-lock/absent-users Get a list of removed users.
POST /v1.0/smart-lock/devices/{device_id}/users/{user_ids}/actions/delete-users-issue Delete the information about users.
GET /v1.0/smart-lock/devices/{device_id}/opmodes/{user_id} Get a list of unlocking methods applicable to a specified user.
DELETE /v1.0/smart-lock/devices/{device_id}/unlock-types/{unlock_type}/keys/{unlock_sn}/hijack Delete the duress alarm of unlocking methods.
POST /v1.0/smart-lock/devices/{device_id}/password-ticket Get a temporary key for password encryption.
POST /v1.0/smart-lock/devices/{device_id}/password-free/door-operate Remote locking and unlocking without password.
GET /v1.0/smart-lock/devices/{device_id}/media-view-times Query the video views of the current lock.
POST /v1.0/smart-lock/devices/{device_id}/media-view-times Add one video view to a specified video file generated by the current lock each time this video is viewed.
POST /v1.0/smart-lock/devices/{device_id}/opmodes/{opmode_id}/attribute/{attribute}/opmode-attr Enable the image capturing attribute.

Note: The APIs with an asterisk (*) only apply to legacy versions.

For more information, see the following documentation.

Documentation Applicable feature
Standard Instruction Set for Smart Locks Lock settings, such as volume and language.
Device Control Get the standard instruction set of a device.
Global Error Codes A list of error codes that might be returned during your development.