The classical Birkhoff conjecture claims that the boundary of a strictly convex integrable billiard table is necessarily an ellipse (or a circle as a special case). In this article we prove a complete local version of this conjecture: a small integrable perturbation of an ellipse must be an ellipse. This extends and completes the result in Avila-De Simoi-Kalsohin, where nearly circular domains were considered. One of the crucial ideas in the proof is to extend action-angle coordinates for elliptic billiards into complex domains (with respect to the angle), and to thoroughly analyze the nature of their complex singularities. As an application, we are able to prove some spectral rigidity results for elliptic domains.