Endoscopy is a nonsurgical procedure used to examine a person’s digestive tract. During an upper endoscopy, an endoscope is easily passed through the mouth and throat and into the esophagus, allowing the doctor to view the esophagus, stomach, and upper part of the small intestine.