The juicio de amparo, the action for protection, first appeared in the Constitution of Yucatán of 1841. According to an article in a law journal of UNAM, its author was Manuel Crescencio Rejón. In 1847, the Acta de Reformas took up the formula of Mariano Otero, under which a court grants protection only in the particular case before it.
The same article notes that most authors agree that the amparo “se inspiró en las ideas de Alexis de Tocqueville” (was inspired by the ideas of Alexis de Tocqueville). The article links these ideas to the judicial review of laws in the United States.