There are usually warning signs that something like this is going to happen. But in this case, there was nothing; or, if there was something, it was subtle and easily missed.
Turkey has always been strategically important. During the Cold War, the Americans stationed Minutemen missiles in the country because of its proximity to the Soviet Union. Today, it's an important partner in the fight against ISIL. After all, it shares extensive borders with both Syria and Iraq. It's also home to about two thousand American servicemen stationed at Incirlik air base. If nothing else, the Americans would want to know about an imminent coup to ensure the safety of their soldiers.
Given its stratefic value, the West also has a history of getting involved in Turkish politics. In the 1980s, NATO commissioned a clandestine stay-behind force known as Counter-Guerilla, which was similar to Operation Gladio, a stay-behind operation designed to prevent socialism and communism from taking hold in Italy. Counter-Guerilla had a much broader role and a much more active history that Operation Gladio, and was one of the early steps in Turkey's long and chequered history of coups, counter-coups and coup conspiracies. The deep state, Susurluk scandal, Operation Sledgehammer and Ergenekon can all be traced back to Counter-Guerilla in some way, shape or form.