Monterey was the first capital of California from 1774 to October 13, 1849. Monterey was the capital from the era of Spanish rule, the brief period of Mexican rule after the Mexicans gained independence, up to the the period right before statehood. The California State constitution was drafted in Monterey and later accepted by the U.S. Congress. The state capital was in Pueblo de San Jose from December 15, 1849 to May 1, 1851.
Then the capital moved to Vallejo from January 5, 1852 to January 12 1852. After that, the Capital was at Sacramento from January 16, 1852 to November 2, 1853. Vallejo was the capital a second time from January 3rd 1853 to February 4, 1853. Benicia served as the capital from February 11th 1853 to February 24th 1854. Sacramento was the final capital location from February 28, 1854 to present, for part of that time Benicia, San Francisco and Vallejo were the capitals at the same time.The legislature, during the gold rush was indecisive on where the capital should be, thus creating a period of movement between the 1850s and the 1860s.
The California State Library has a list of the former state capitals of California. The capital building moved five times within the 31st state of the United States.