Penal Code PC § 851.6
(a) In any case in which a person is arrested and released pursuant to paragraph (1) , (3) , or (5) of subdivision (b) of Section 849 , the person shall be issued a certificate, signed by the releasing officer or his superior officer, describing the action as a detention.
(b) In any case in which a person is arrested and released and an accusatory pleading is not filed charging him or her with an offense, the person shall be issued a certificate by the law enforcement agency which arrested him or her describing the action as a detention.
(c) The Attorney General shall prescribe the form and content of the certificate.
(d) Any reference to the action as an arrest shall be deleted from the arrest records of the arresting agency and of the Department of Justice. Thereafter, any record of the action shall refer to it as a detention.