But can a whole city pray to God? As an example, take the story of Jonah? When he (finally) walked into the city of Nineveh and warned them to repent and turn from their evil ways … the whole city fasted and prayed to God:
6 When word reached the king of Nineveh, he got up from his throne, took off his royal robe, put on sackcloth, and sat in ashes. 7 Then he issued a decree in Nineveh:
By order of the king and his nobles: No man or beast, herd or flock, is to taste anything at all. They must not eat or drink water.8 Furthermore, both man and beast must be covered with sackcloth, and everyone must call out earnestly to God. Each must turn from his evil ways and from the violence he is doing. 9 Who knows? God may turn and relent; He may turn from His burning anger so that we will not perish.
10 Then God saw their actions—that they had turned from their evil ways—so God relented from the disaster He had threatened to do to them. And He did not do it. Jonah 3:6-10 Holman (click=> 3 translations)