You need to apply for permiso de obras menores (minor building works) at your town hall planning dept. You will need to include in your application a description of the planned work, plus an approx. cost of the work. Since it sounds like you are doing the work yourself, this will be negligible, obviously - just put down a small figure for materials (to make good etc.) There will be a small fee (tax) based on the estimated cost of work (so make sure it is small!)
Additionally, if you live in a community, you should check with the president or administrator if there are any rules governing carrying out work (hours permitted for using power tools, for example)
If you live in a villa on your own land miles from anyone else (especially nasty neighbours who could report you), you could do like everyone else, and ignore all the above, but you didn't read it here
Hope this helps.