So, there has been a coup attempt in Turkey. It failed.
There are those who now say it was always supposed to fail, and that all this was just a plan by Erdogan to seize more power within Turkey. But that is implausible.
Too many things could have gone wrong. He could have been killed, parts of the military could have been not as loyal as they were, or other forces could have used to opportunity to move against Erdogan.
I believe the coup attempt was a genuine one, and it was just done by really incompetent people.