A California Petition for Writ of Habeas Corpus is a legal document filed in court by a person who is challenging a conviction or sentence. It is a request for the court to review the legality of the detention, and if it is found to be illegal, the court may order the release of the person. The petitioner must show that he or she is being held unlawfully or that the current detention is in violation of the law. There are two types of California Petition for Writ of Habeas Corpus: an original writ and a subsequent writ. An original writ is filed when the petitioner is challenging a conviction or sentence, and a subsequent writ is filed when the petitioner believes he or she is being held unlawfully even after the conviction has been overturned.