for what purpose is it build?
It was built with the mission of defending the Second Military District in California.
Presidio of Santa Barbara
The presidio was built by Spain in 1782, with the mission of defending the Second Military District in California. 
el presidio de santa barbara state historic park The park contains an original adobe structure called El Cuartel when was it founded? 1782 who founded it? It was built by Spain
wiki:23829812
Presidio of Santa Barbara [SEP] Introduction
El Presidio Real de Santa Bárbara, also known as the Royal Presidio of Santa Barbara, is a former military installation in Santa Barbara, California, USA. The presidio was built by Spain in 1782, with the mission of defending the Second Military District in California. In modern times, the Presidio serves as a significant tourist attraction, museum and an active archaeological site as part of El Presidio de Santa Barbara State Historic Park. The park contains an original adobe structure called El Cuartel, which is the second oldest surviving building in California, only the chapel at Mission San Juan Capistrano, known as "Father Junípero Serra's Church", is older.