There's two microswitches in the tailgate lock:
56 Switch, luggage compartment lighting, in the tailgate lock
184H Motor, central locking system, tailgate in tailgate
388 Switch, tailgate in the driver's door
540 Main instrument unit, in dashboard in front of driver
594 Relay, motor, tailgate on main relay board in dashboard
622 Microswitch, tailgate lock in the tailgate lock
632 Control module, TWICE under left-hand seat
8-pin connectors
H8-1 Black connector by LH tailgate hinge
H8-2 Grey connector by LH tailgate hinge