Roughly, it goes like this:
Thomas, traveling with a merchant into India, was brought before Gundaphorus,
who asked him his craft. Thomas said that he was a carpenter and a builder,
capable of building many things, including palaces for kings. So Gundaphorus
asked him to build him a palace. Thomas replied that he would wait for the
winter months to build the palace; which amazed Gundaphorus, because everyone
else built in the summer. But Thomas insisted, and Gundaphorus gave him a large
quantity of money for building the palace, and continued to send him large
quantities of money and provisions as the months went by. But Thomas took all
the money and provisions he received from Gundaphorus and began dispensing it
to the poor.
After a while King Gundaphorus sent a messenger to Thomas, and asked him how
the palace was going.
"Everything is built except the roof," Thomas replied. So Gundaphorus
sent him gold and silver to roof the palace, and Thomas, thanking God, gave it
all to the poor.
After a while the king came to the city and began inquiring of his friends and
allies about the palace. They told him that Thomas had done nothing about any
palace, but instead had been going about giving large sums of money to the
afflicted, healing the sick, and preaching a new God. Needless to say,
Gundaphorus was a bit angry and sent for Thomas.
"Have you built me my palace?" he asked.
"Yes," the apostle said.
"Then show it to me," the king said.
Then Thomas shook his head. "You cannot see it now; you will only be able
to see it when you have departed from this life."
The king, of course, was exceeding wroth; Thomas was thrown into prison, and
Gundaphorus decided that he would flay the apostle alive.
In the meantime the king's brother Gad had become deathly ill and died. The
king loved his brother, and with great sorrow made preparations to mourn him.
However, as they were putting the burial-clothes on his body, Gad revived. The
king was overjoyed and ran to his side.
Then Gad said to Gundaphorus, "Brother, I know your generous heart, and
how you would give half your kingdom to anyone asked for my sake; I beg that
you grant me one favor."
And Gundaphorus said to Gad, "Ask anything and I will grant it."
Then Gad said, "Brother, sell me your palace in the heavens."
The king was very puzzled by this and asked, "How could I have a palace in
the heavens?"
Then Gad told him that when he died, his soul was carried by angels up to the
heavens, where they showed him many palaces. At length they approached to one
that was particularly beautiful, and Gad had begged the angels to let him live
in even the humblest room of this beautiful palace. But the angels shook their
heads, saying he could not dwell in that building. It had been built by Thomas
for his brother. Then Gad had asked them to let him return to his brother in
order to buy the palace from him. And they let him return for this very
purpose.
Then Gundaphorus said to his brother, "Brother, it is not in my power to
sell you that particular palace. But if you wish to buy such a palace, it is in
my power to give you the means to buy it."
So Thomas was set free in order to build a palace for Gad, just like the one he
had built for Gundaphorus. The two brothers became Christians and devoted much
of their lives to relieving the poor in their dominion; for it is of such
stewardship that the best palaces are made.
...from historic records