API to change modes

Please provide proper integration for 3rd party home automation systems like smart things, or at the very least a public API we can use to do things like change modes. That way, when I unlock my front door, I can automatically set the mode to home and when I lock it I can set it to away (for example).