The Jade Emperor!
Lord of the Three Realms and the Celestial Court…
It was the authority bestowed upon him by Taishang Laojun.
While the Three Realms had no authority to speak of when the Celestial Court was first established, and perhaps even the Jade Emperor's title of 'Lord of the Celestial Court' was just a fancy but empty title, disciples of major sects tend not to care about the authority of the Celestial Court.
Hence the Investiture of the Gods took place.
After that, many disciples from the three major sects—Chan, Jie, and Ren—had died physically, their souls hence entering the throne of the appointed gods and becoming a servant of the Celestial Court. They were hence divided into the 365 gods, divided to the aspects of Thunder, Fire, Pestilence, the Stars, the Three Mountains and Five Hells, the Rain and the Clouds, the Benevolent and the Malevolent.