For a retaining wall, you may need a building consent or a resource consent, depending on:
the scale and nature of your proposed earthworks
the height and location of your proposed retaining wall.
Generally, you will need a building consent if your retaining wall is higher than 1.5m, or has a building or driveway near the top.
You may also need a resource consent if there are significant earthworks involved.