In this note the AKSZ construction is applied to the BFV description of the reduced phase space of the Einstein-Hilbert and of the Palatini--Cartan theories in every space-time dimension greater than two. In the former case one obtains a BV theory for the first-order formulation of Einstein--Hilbert theory, in the latter a BV theory for Palatini--Cartan theory with a partial implementation of the torsion-free condition already on the space of fields. All theories described here are