Authenticate
See Authentification. Use the access token as e.g. ACCESS_TOKEN.
Get the smartlock ID
curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer ACCESS_TOKEN'
'https://api.nuki.io/smartlock'
Create a new Keypad PIN
You have to set a PIN_NAME (string; up to 20 characters) and a PIN_CODE (6 digits from 1-9 without 0 (zero); not starting with ‘12’ AND not already used by another PIN_NAME (each PIN may only occur once in the system!).
curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json' --header
'Authorization: Bearer ACCESS_TOKEN' -d '{ "name": "PIN_NAME",
"type": 13, "code": PIN_CODE }'
'https://api.nuki.io/smartlock/SMARTLOCK_ID/auth'
Get the PIN ID
If the PIN is created correctly you get an empty reply. In order to access the PIN later on you got to get its authId:
curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer ACCESS_TOKEN'
'https://api.nuki.io/smartlock/SMARTLOCK_ID/auth'
Use the id of the auth for the PIN_NAME you created as PIN_ID.
Edit a PIN
You can update a PIN by overwriting values for a existing PIN_ID.
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header
'Authorization: Bearer ACCESS_TOKEN' -d '{ "name": "NEW_KEY_NAME",
"code": "NEW_PIN_CODE" }'
'https://api.nuki.io/smartlock/SMARTLOCK_ID/auth/PIN_ID'
Deactivate a PIN
Just update the PIN with “enable”: false:
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header
'Authorization: Bearer ACCESS_TOKEN' -d '{ "enable": false }'
'https://api.nuki.io/smartlock/SMARTLOCK_ID/auth/PIN_ID'
Delete a PIN
You can completely delete a PIN:
curl -X DELETE --header 'Accept: application/json' --header 'Authorization: Bearer ACCESS_TOKEN'
'https://api.nuki.io/smartlock/SMARTLOCK_ID/auth/PIN_ID'