Glucagon-like peptide-1 receptor agonists (GLP1-RA) have been associated with greater retention of gastric contents, however there have been no controlled, population-based studies performed to evaluate the potential adverse effects of GLP1-RA in the periprocedural setting. We aimed to determine if there is increased risk of aspiration and aspiration-related complications after upper endoscopy in patients using GLP1-RA. We used a nationwide commercial administrative claims database to conduct a retrospective cohort study of patients aged 18-64 with type 2 diabetes who underwent outpatient upper endoscopy from 2005-2021. We identified 6,806,046 unique upper endoscopy procedures. We compared claims for aspiration and associated pulmonary adverse events in the 14 days following upper endoscopy between users of GLP1-RA, dipeptidyl peptidase 4 inhibitors (DPP4i), and chronic opioids. We adjusted for age, sex, Charlson Comorbidity score, underlying respiratory disease, and gastroparesis. We found that pulmonary adverse events following upper endoscopy are rare, ranging from 6-25 events per 10,000 procedures. When comparing GLP1-RA to DPP4i, crude relative risks of aspiration (0.67 95%CI 0.25,1.75), aspiration pneumonia (0.95 95%CI 0.40,2.29), pneumonia (1.07 95%CI 0.62,1.86), or respiratory failure (0.75 95%CI 0.38,1.48) were not higher in patients prescribed GLP1-RA. When comparing GLP1-RA to opioids, crude relative risks (95%CI) were 0.42 (0.15,1.16) for aspiration, 0.60 (0.24,1.52) for aspiration pneumonia, 0.30 (0.19,0.49) for pneumonia, and 0.24 (0.13,0.45) for respiratory failure. These results were consistent across several sensitivity analyses. GLP1-RA use is not associated with increased risk of pulmonary complications after upper endoscopy compared to DPP4i use in patients with type 2 diabetes.