Endoscopy is usually a day surgery procedure. You will be advised by the doctor to fast before the upper gastrointestinal tract endoscopy which is usually done under sedation.