When you take cocaine, it quickly absorbs into your blood plasma.
Enzymes in the blood and the liver metabolize cocaine, transforming it into various metabolites, including benzoylecgonine which leaves the body in your urine. Your blood also deposits cocaine and its metabolites in your hair as it grows.
Drug tests can detect cocaine and its metabolites in your blood plasma, urine, and hair.