"To deceive the king" or "to hoodwink the king" are both phrases that could be used to describe the act of tricking or deceiving the king.