A gastroscopy, also known as an upper gastrointestinal endoscopy or just upper endoscopy, is usually done to investigate the cause of symptoms such as heartburn, abdominal pain, difficulty swallowing, vomiting or bleeding from the digestive tract, and to make or confirm a diagnosis