The utilization of NH3, obtained through nitrogen fixation, as a green alternative fuel and chemical, represents a significant promise in mitigating carbon emissions and reaching energy independence. In particular, the potential of ammonia as an energy vector lies in its ability to store and transport energy efficiently: it can be exploited to release hydrogen, to generate electricity in fuel cells, or directly as a fuel in internal combustion engines, already resulting in the development of ammonia-fueled engines for transport and power generation. The current Haber-Bosch process used to produce ammonia is energy-consuming requiring high temperatures (>500°C) and extremely high pressure (200-300 bar) and accounts for over 1% of total global fossil energy and for 11% of the energy consumed in chemical industries. Photofixation of nitrogen for ammonia production, on the other hand, is a sustainable process leveraging the energy from sunlight to convert atmospheric nitrogen (N₂) into ammonia (NH₃), with the aid of photocatalysts to harness sunlight and drive the reduction of nitrogen to ammonia. Although the fixation of N2 to NH3 is thermodynamically convenient, being the triple bond in N2 extremely strong, the reaction cannot occur spontaneously under ambient conditions. Moreover, low solubility and slow diffusion of nitrogen in water are significant impediments for enhancing the efficiency of the process. The last step of nitrogen photofixation involves the progressive reduction of nitrogen atoms by the electrons to form ammonia, typically in the presence of a hydrogen source such as water. The efficiency of photofixation, as in general for photocatalytic processes, largely depends on the choice of the photocatalysts. In addition to the common requirements of effective photocatalytic materials, the presence of defects such as nitrogen, oxygen and sulfur vacancies, acting as reactive sites for N2 adsorption, is pivotal for nitrogen photofixation. Currently, metal oxides and graphitic carbon nitride (g-C3N4), commonly used in several photocatalytic reactions, have been as well investigated to run nitrogen reduction reaction to NH₃. Together with doped TiO2 and ZnO nanocrystals, the possibility of introducing oxygen vacancies greatly boosted the performance of BiOX (X=Cl,Br,I) oxyhalide compounds which present intense visible light activity (band gap from 2.4 to 3 eV). Recently, bio-inspired sponge systems based on BiOBr with oxygen vacancies achieved more than 2 mmol g -1 h -1 of ammonia evolution rate. At the same time, to overcome the rapid carrier recombination rate of carbon nitride, several strategies have been developed, and the introduction of foreign elements such as metals (e.g., Fe, Co) or non-metals (e.g., S, P) into the g-C3N4 matrix effectively enhanced its electronic properties and improve charge separation. For the nitrogen photofixation reaction the combination of g-C3N4 with other materials, such as metal oxides or conducting polymers, through the realization of heterojunctions, can synergistically enhance photocatalytic activity and stability promoting good ammonia production rates. Among other approaches, the generation of nitrogen vacancies in carbon nitride shows to be a good strategy to boost the nitrogen photofixation as demonstrated in recent times.