Rivera was born in Mizque (now Bolivia) and studied law at the University of Charcas. He was noted for his work with the poor as a lawyer.
Rivera was elected to represent Mizque at the 1813 Assembly and again to the Tucumán Congress, serving in 1816 for the declaration. He supported the idea of a constitutional Incan monarchy.