The length of time that psilocybin can be detected in the body varies depending on several factors, including the amount consumed and the individual's metabolism. In general, it can be detected for up to 24 hours in urine and up to 90 days in hair.