RBoy
(www.rboyapps.com - Making SmartThings Easy!)
1108
There is no universal answer, it depends on the lock and how it interfaces via ST.
Some locks only report codes used to lock/unlock to ST (e.g. Yale RFID or Danalock V2), for those lock you can use this SmartApp to interface and take actions when the codes are used (no programming):
Other locks which support programming over Z-Wave can use this comprehensive app for programming and taking actions: