The Mexican American war was basically when The U.S. Invaded mexico during the period April 25, 1846 – February 2, 1848:
The dispute grew up from the United States’ annexation of Texas in 1845 and from a dispute over whether Texas ended at the Nueces River (Mexican claim) or the Rio Grande