Minors require a valid travel document to leave Spain. In addition, if they are travelling with an identity card, instead of the passport, they must have a written authorization signed by whoever has legal custody or guardianship.