Penal Code § 1281
ARTICLE 2. Bail Upon Being Held to Answer Before Indictment
Upon the allowance of bail and the execution and approval of the undertaking, the magistrate must, if the defendant is in custody, make and sign an order for his discharge, upon the delivery of which to the proper officer the defendant must be discharged.