You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
What is Ursodeoxycholic acid and explain in detail?
Ursodeoxycholic acid (UDCA), also known as ursodiol, is a secondary bile acid, produced in humans and most other species from metabolism by intestinal bacteria. It is synthesized in the liver in some species, and was first identified in bile of bears of genus Ursus, from which its name derived. In purified form, it has been used to treat or prevent several diseases of the liver or bile ducts.
It is available as a generic medication.

Medical uses
UDCA has been used as medical therapy in gallstone disease (cholelithiasis) and for biliary sludge.  UDCA helps reduce the cholesterol saturation of bile and leads to gradual dissolution of cholesterol-rich gallstones.UDCA may be given after bariatric surgery to prevent cholelithiasis, which commonly occurs due to the rapid weight loss producing biliary cholesterol oversaturation and also biliary dyskinesia secondary hormonal changes.

Primary biliary cholangitis
UDCA is used as therapy in primary biliary cholangitis (PBC; previously known as primary biliary cirrhosis) where it can produce an improvement in biomarkers. Meta-analyses have borne out conflicting results on the mortality benefit.  However analyses that exclude trials of short duration (i.e. < 2 years) have demonstrated a survival benefit and are generally considered more clinically relevant. A Cochrane systematic review in 2012 found no significant benefit in reducing mortality, the rate of liver transplantation, pruritus or fatigue. Ursodiol and obeticholic acid are FDA-approved for the treatment of primary biliary cholangitis.

Primary sclerosing cholangitis
UDCA use is associated with improved serum liver tests that do not always correlate with improved liver disease status. WHO Drug Information advises against its use in primary sclerosing cholangitis in unapproved doses beyond 13–15 mg/kg/day.UDCA in a dose of 28-30mg/kg/day increases risk of death and need for liver transplant by 2.3 folds among those with primary sclerosing cholangitis, despite decrease in liver enzymes.

Intrahepatic cholestasis of pregnancy
UDCA has been used for intrahepatic cholestasis of pregnancy. UDCA lessens itching in the mother and may reduce the number of preterm births. Effects on fetal distress and other adverse outcomes are unlikely to be great.

Cholestasis
UDCA use is not licensed in children, as its safety and effectiveness have not been established. Evidence is accumulating that ursodeoxycholic acid is ineffective, unsafe and its use is associated with significant risk of morbidity and mortality in neonatal hepatitis and neonatal cholestasis.

Other conditions
UDCA has been suggested to be an adequate treatment of bile reflux gastritis.In cystic fibrosis there is insufficient evidence to justify routine use of UDCA, especially as there is a lack of available data for long-term outcomes such as death or need for liver transplantation.UDCA has also been in effective in non-alcoholic fatty liver disease, in liver bile duct-paucity syndromes. It is contraindicated in obstruction of biliary tracts such as biliary atresia. Its not effective in liver allograft rejection, and in Graft-versus-host disease involving the liver.

Adverse effects
Diarrhea was the most frequent adverse event seen in trial of UDCA in gallstone dissolution, occurring in 2 to 9%, which is less frequent than with chenodeoxycholic acid therapy. Bacterial conversion of UDCA to chenodeoxycholic acid may be the mechanism for this side effect. Right upper quadrant abdominal pain and exacerbation of pruritus was occasionally reported in trials in patients with PBC.  Additional symptoms may include bloating, weight gain, and occasionally, thinning of hair.

Mechanisms of action
Choleretic effects
Primary bile acids are produced by the liver and stored in the gall bladder. When secreted into the intestine, primary bile acids can be metabolized into secondary bile acids by intestinal bacteria. Primary and secondary bile acids help the body digest fats. Ursodeoxycholic acid helps regulate cholesterol by reducing the rate at which the intestine absorbs cholesterol molecules while breaking up micelles containing cholesterol. The drug reduces cholesterol absorption and is used to dissolve (cholesterol) gallstones in patients who want an alternative to surgery. There are multiple mechanisms involved in cholestatic liver diseases.

Immunomodulating effects
Ursodeoxycholic acid has also been shown experimentally to suppress immune response such as immune cell phagocytosis. Prolonged exposure and/or increased quantities of systemic (throughout the body, not just in the digestive system) ursodeoxycholic acid can be toxic.

Anti-inflammatory effects
Ursodeoxycholic acid has been shown to exert anti-inflammatory and protective effects in human epithelial cells of the gastrointestinal tract. It has been linked to regulation of immunoregulatory responses by regulation of cytokines, antimicrobial peptides defensins, and take an active part in increased restitution of wound in the colon. Moreover, UDCAs effects has been shown to have exert actions outside the epithelial cells.While some bile acids are known to be colon tumor promoters (e.g. deoxycholic acid), others such as ursodeoxycholic acid are thought to be chemopreventive, perhaps by inducing cellular differentiation and/or cellular senescence in colon epithelial cells.

Chemistry
Ursodeoxycholic acid is an epimer of chenodeoxycholic acid, which has similar choleretic effects and a wider species distribution