Abstract Background: Patient portal secure messaging allows patients to describe health-related behaviors in ways that may not be sufficiently captured in standard electronic health record (EHR) documentation, but little is known about how cannabis is discussed on this platform. Objective: This study aimed to identify patient and provider secure messages that discussed cannabis and contextualize these discussions over periods before and after its legalization for medical purposes in Pennsylvania. Methods: We examined 382,982 secure messages sent by 15,340 patients and 6101 providers from an integrated health delivery system in Pennsylvania, United States, from January 2012 to June 2022. We used an unsupervised natural language...