Endoscopic Retrograde Cholangiopancreatography (ERCP) is a diagnostic and therapeutic procedure used to investigate and treat issues in the bile duct and pancreas. During this procedure, an endoscopic device (a specialized tool that combines an endoscope and a small insert) is inserted through the mouth or rectum to examine the bile and pancreatic systems. ERCP can be used to remove bile duct stones, dilate strictures, or treat other conditions affecting these organs.