Putpattan and his wife, Devadatta, lived in the world of Devas or gods, stitching clothes for the deities. Putpattan had a desire to make the most exquisite clothes for Siva and Parvati. The celestial sartor stitched the best clothes and took them to Kailash, the abode of Siva. He took the clothes to Siva but, in his excitement, forgot to present them to Siva and Parvati. By the time he left Siva's presence, it was dark, and only then did he remember his failure. With no place to sleep, he slept at the entrance to Kailash.
That night, Siva revealed a supreme secret to Parvati, and the celestial tailor overheard it. The next morning, he went to Siva, presented the clothes, and informed him that he had heard the secret Siva had told Parvati. Since the sartor had unintentionally heard the celestial secret, Siva admonished him and advised him not to reveal the secret to anyone. Despite being upset, Siva let him go because the tailor had told the truth. The secret he had heard was a set of Saturnian Mantras to obtain Siva's grace. Tormented by Siva's warning not to divulge the Mantras to anyone, the tailor's wife insisted that he reveal the secrets to her. Unable to withstand her pressure, he eventually revealed the mantras to his wife. Siva came to know of the sartor's indiscretion and dispensed curses on him and his wife. The tailor became a ghost, hanging upside down like a bat from a moringa tree. Siva further stated that, being unable to safeguard a secret, the tailor would spend his life asking questions. As for the curse on his wife, she would play a stringed instrument at night for the rest of her life, disturbing people and preventing them from sleeping.
For many years, the tailor hung upside down from the tree in the funeral grounds. A Muni wanted to enslave the tailor and use his powers to rule the world. To achieve his desire, he performed penance to Kali, who appeared before him and said she would grant his wish if he presented her with one thousand royal heads as gifts. The Muni, using various disguises and deceptions, brought the kings to the Kali temple, sacrificed them, and offered their heads to Kali. The Muni managed to sacrifice 999 kings and gift their heads to Kali, but he still needed one more to accomplish his objective. He went to King Vikramaditya and persuaded him to visit the Kali temple in the forest for worship, promising that it would bring prosperity to his country. Believing the Muni, the king went to the forest temple. After the worship was over, the king heard entrancing music and followed the source. He found a beautiful girl playing the Vina and asked her why she was playing the instrument in the forest.
The girl was none other than the wife of the tailor, who had heard the celestial secret from her husband. She revealed the whole story to the king, who felt compassion for her and promised to do everything to release them from the curse. She told the king that the curse would be lifted if her hanging husband and she went to the temple, but she cried, saying it was impossible to bring her husband down from the moringa tree. King Vikramaditya promised that he would make it possible.
The king brought the ghost down from the tree and carried him on his back towards the temple. The ghost narrated the story to the king and posed a question from the story, and if the king answered it correctly, the ghost would return to the tree. If a wrong answer comes forth from the king , that error would precipitate an explosion of the tailor-ghost's head. Right or wrong, the outcome was hopeless.
The king answered the questions correctly, driving the ghost back up the tree twenty-four times. Once again, the king carried the ghost on his back, and the ghost continued to narrate the story. However, this time, the king,  by moving his lips, pretended as if he answered the question and skillfully reached the temple without the back-riding ghost realizing it. As stipulated by the rules of the curse, the curse lifted once the tailor-ghost and his Vina-playing wife reached the temple.
Expressing his deep gratitude to the king, the curse-free tailor revealed the true nefarious intentions of the Muni. Immediately, the king beheaded the Muni and presented his head to Devi Kali. Appearing before the king in her corporeal form, Kali asked him to seek boons. King Vikramaditya humbly said, "My dear Devi, please resurrect all the dead kings who were killed by the Muni."
Kali Devi granted the boon to the king and resurrected all the 999 kings. She blessed King Vikramaditya, his kingdom, and his subjects. With the curse lifted and justice served, peace and prosperity returned to the land. The tailor and his wife, now free from their unfortunate fate, lived a life of happiness and contentment, forever grateful to King Vikramaditya for his compassion and bravery. And so, the tale of the celestial sartor, the ghostly curse, and the triumphant king became a legend, inspiring generations with the power of truth, compassion, and the triumph of good over evil.