Water leak sensor with alexa routine?

The following FAQ explains how to use custom code in smartthings. It should give you all the details that you need.