What kind of lock are you using and more importantly, which DTH are you using?
This might be something better suited for a smartapp by either @RBoy ([RELEASE] Door lock code/lock user management (create, delete and schedule codes) with automatic lock/unlock, custom user actions and SHM integration) or Lock Manager by @ethayer ([RELEASE] Lock Manager). Both of them are excellent and will do exactly what you are asking for without needing webCoRE.
For a DTH, if it is a zigbee lock, I’d recommend using this one [DEPRECATED] - Universal ZigBee Lock DTH with Lock Codes by @jhamstead.
Otherwise, for z-wave, you can search through the forum for a DTH for your particular brand.
With all that said, I believe that the invalid notification in webCoRE might be tied to the DTH and not the smartapp so much, but I’m not 100% certain of that. So, changing out your current lock’s DTH for an “enhanced” version might be just what you need.