Gastrointestinal (GI) endoscopy is a diagnostic procedure that allows doctors to view the interior lining of the digestive tract using a flexible tube with a light and camera attached to it. This procedure can help diagnose a variety of conditions, including cancers of the digestive system.