Endoscopy is a procedure that uses a flexible tube (an endoscope) with a light and camera which is inserted into the mouth and then goes through part of the alimentary canal as the doctor guides it to provide an accurate picture of what is going on in the digestive tract.