Open Platform
Skip to content

Delete by passcode ​

https://cnapi.ttlock.com/v3/keyboardPwd/deleteByCode

Delete a random passcode or custom passcode,there are two methods to do it:

(1)Delete by APP nearby the lock via bluetooth: ​

You can develop your own APP based on our APP SDK,call Delete passcode method to delete the passcode from the lock,then request this API ( with deleteType=1) to delete it from the cloud.

(2)Delete by cloud API via gateway or WiFi lock: ​

If the lock is WiFi lock or it's connected to a gateway, you can delete the passcode remotely,just request this API ( with deleteType=2) .

1 Request example ​

POST, ContentType:application/x-www-form-urlencoded
javascript
curl --location -g --request POST 'https://cnapi.ttlock.com/v3/keyboardPwd/deleteByCode' \
--data-urlencode 'clientId=fd2ff35ee3xxxxxx' \
--data-urlencode 'accessToken=780f7671b6e6bxxxxxxx' \
--data-urlencode 'lockId=24451' \
--data-urlencode 'keyboardPwd=123456' \
--data-urlencode 'deleteType=2' \
--data-urlencode 'date=1626945087000'

2 Request parameters ​

NameTypeRequiredDescription
clientIdStringYclient_id from Create application
accessTokenStringYAccess token,refer to: Get access token
lockIdIntYLock ID, generated by Lock init
keyboardPwdStringYPasscode
deleteTypeIntYMethod: 1-delete with App via Bluetooth, you should delete via bluetooth first 2-delete via WiFi gateway, you can call this api directly if it's a WiFi lock or it's connected to gateway.
dateLongYCurrent time (timestamp in millisecond)

3 Response and example ​

ParameterTypeDescription
errcodeIntError code
errmsgStringError message
{
    "errcode": 0, 
    "errmsg": "none error message"
}
CopyRight © 2012-2026 TTLock.All Rights Reserved