Skip to content

deleteKey on Keypad Touch returns success but password is not removed #466

@a16036868481

Description

@a16036868481

Analysis

When calling the deleteKey command on a Keypad Touch device via Open API v1.1, the API always returns:

{"statusCode":100,"body":{},"message":"success"}
but the corresponding passcode is not actually deleted
It remains visible in the SwitchBot mobile app.
It can still be used on the keypad to unlock the door.
A subsequent /v1.1/devices call still returns the same key (same id, name).
In contrast, the createKey command works as expected for the same Keypad Touch device.

### Expected Behavior

I expect the `deleteKey` API for Keypad Touch to work normally. If it is supported, I would like to know what the correct JSON format for the request should be so that the passcode is actually deleted.


### Steps To Reproduce

1. Set up the following devices:
   - SwitchBot Smart Lock Pro (WoLockPro)
   - SwitchBot Keypad Touch
   - SwitchBot Hub Mini 2
   - Pair the Keypad Touch with the Lock Pro and enable Cloud Service.

2. Create a **timeLimit** passcode on the Keypad Touch:
   - Either from the SwitchBot mobile app, or using the Open API `createKey` command.
   - Confirm that:
     - The passcode is listed in `/v1.1/devices` under the Keypad Touch `keyList`.
     - The passcode is visible and usable on the keypad.

3. Call the `deleteKey` command on the Keypad Touch device:
```http
   POST https://api.switch-bot.com/v1.1/devices/{keypadDeviceId}/commands
   Content-Type: application/json
   Authorization: <token>
   sign: <sign>
   t: <timestamp>
   nonce: <nonce>

with body:
{
  "commandType": "command",
  "command": "deleteKey",
  "parameter": {
    "id": 12
  }
4.Observe API response:
{"statusCode":100,"body":{},"message":"success"}

5.Call /v1.1/devices again and check the same Keypad Touch entry:
The passcode with id: 12 is still present in keyList and status remains "normal".

6.Open the SwitchBot mobile app:
The passcode is still visible and can still be used to unlock the door.

### Logs

```markdown
[SwitchBot] deleteKey JSON body = {"commandType":"command","parameter":{"id":12},"command":"deleteKey"}
[SwitchBot] deleteKey response = {"statusCode":100,"body":{},"message":"success"}
[SwitchBot] createRoomTempKey result = {"statusCode":100,"body":{},"message":"success"}

Configuration

I am not using the official SDK or a config.json file.

I call the HTTPS API directly from a Java Spring Boot application.
My only configuration is:

switchbot.api.base-url = https://api.switch-bot.com

Environment

  • Device: SwitchBot Smart Lock Pro + Keypad Touch + Hub Mini 2
  • Region: Japan
  • Open API: v1.1
  • Integration: custom Java (Spring Boot) client calling https://api.switchbot.com/v1.1/devices/{deviceId}/commands

Additional Context

No response

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions