Integrability in codimension 1