We report the results of a search for the decay $B^0 to X(3872)(to J/psi pi^+ pi^-) gamma$. The analysis is performed on a data sample corresponding to an integrated luminosity of $711,{rm fb}^{-1}$ and containing $772 times 10^6 Bbar{B}$ pairs, collected with the Belle detector at the KEKB asymmetric-energy $e^+ e^-$ collider running at the $Upsilon(4S)$ resonance energy. We find no evidence for a signal and place an upper limit of $mathcal{B}(B^0 to X(3872)gamma)times mathcal{B}(X(3872) to J/psi pi^+ pi^-) < 5.1 times 10^{-7}$ at 90% confidence level.