The writ may be had for the purpose of admitting a prisoner to bail in civil and criminal actions. When any person has an interest in the detention, and the prisoner shall not be discharged until the person having such interest is notified.
RCW 7.36.160