The forbidden city was built between (1406-1420), so it was under the Ming Dynasty that the work was done. More exactly it's under the Emperor Yongle. Here is the history and characteristics of the Ming Dynasty, one of the two whose emperors resided in this palace.
After driving the Mongol regime out of China, the Ming will be supplanted by a non-Chinese power, the Manchu Qing Dynasty. The destiny of this last "national" dynasty presents many aspects of the classic "dynastic cycle": born of rebellions aroused by an oppressive and corrupt regime, founded by a warlord who can boast of having collected the heavenly mandate, confronted, after an initial phase of reconstruction, to difficulties of all kinds which, despite a late recovery in hand, eventually cause a new fire and prevail.
At the origins of the Ming Dynasty, the messianic movement of the Red Turbans that stands up against the Mongolian power from 1351. One of the rebel leaders, Zhu Yuanzhang, settles his base in Nanjing (1356), from where he conquers the empire in a dozen years and where he proclaims himself emperor in 1368 with the reign name of Hongwu. His grandson Jianwen (reign from 1398 to 1402), who succeeded him, intends to return the government to civil power and take away their power to his uncles, appanaged by Hongwu in border fiefs. One of them rose in Peking and, after four years of civil war, seized the throne with the name Yongle reign (reign from 1403 to 1424). It transfers the capital to Beijing (1421), where it will remain until the end of the dynasty, Nanjing remaining secondary capital.
The refurbished Grand Canal is the vital link between the rich southern provinces and the political and strategic centers of the North. Yongle's still very militarist regime (which personally conducts five expeditions against the Mongols) is followed by much more "Confucian" governments favoring literate bureaucracy, even though Hongwu's institutions of imperial despotism are preserved. Put an end to the great maritime expeditions launched by Yongle, his heirs adopt a policy of withdrawal on the borders and prohibit the overseas trade. The military weakening of the dynasty is brought to light when the Mongols seize Emperor Zhengtong, who let himself be led at the head of an expedition against their leader Esen Khan (1449). The Mongols remain a potential threat and sometimes pressing (they besiege Beijing in 1550) until the treaty concluded in 1570 with Altan Khan, and it is to protect themselves from them that the Ming rebuilt the Great Wall. The "maritime closure" is largely responsible for the raids of "Japanese pirates" (wokou) ravaging the provinces of the Southeast (1553-1564), many of these Japanese are in fact Chinese smugglers. The victories of generals Ming like the famous Qi Jiguang, as well as the legalization of the maritime trade (1567), put an end to the episode. At the very moment when Western presence is asserting itself in the Far East (the Portuguese are admitted to Macao in 1557), the reopening of the coast has a considerable impact on the economy and society of China's lower Yangzi and South -Est: rapid development of trade and crafts, agricultural specialization, urbanization ...
Cash inflows from Japan and Spanish America via the Philippines are responsible for the accelerated monetization of the economy and taxation, and their drying up in the late 1630s and early 1640s, will cause a serious recession.
Yet this is only one of the factors that will cause the fall of the Ming, and that will not prevent the efforts of sanitation undertaken under the leadership of the great secretary Zhang Juzheng between 1568 and 1582. We will quote pell-mell the political clashes that have followed each other since the reign of Wanli (1573-1620), especially between the factions that collaborate with the eunuchs (who have always had a disproportionate influence under the Ming) and Confucian fundamentalists, particularly active in lower Yangzi; the paralysis of the state that results; the agrarian crisis due to the abandonment of hydraulic equipment (from the end of the 16th century) and a series of natural calamities and epidemics culminating in the early 1640s; a social crisis partly explained by the break-up of traditional control frameworks and the considerable increase in government levies. This is mainly due to rapidly increasing military expenditures: expeditions against the Japanese in Korea in 1592 and 1597-1598, war against the Manchu from 1618, popular rebellions in the North-West, then in the north and the center of the empire from 1627. Forcing the Ming to divide their forces, the conjunction of rebellions and Manchu will be fatal despite the efforts of recovery of Emperor Chongzhen (reign from 1628 to 1644). The latter is killed when the rebel Li Zicheng enters Beijing, to be soon chased by the Manchus, whose Qing dynasty claims to take possession of the empire.
Mined by the fights of factions, the regime of the Ming of the South installed in Nanjing falls the following year; the last of the Ming suitors will be captured at the border of Burma, about fifteen years later.