The magnetic and electronic properties of a single atom and a pair of Dy atoms encapsulated inside fullerene carbon cages have been examined using X-ray absorption spectroscopy (XAS) and X-ray magnetic circular dichroism (XMCD) as well as resonant photoelectron spectroscopy (RESPES) across the Dy M(4,5)-edge. The comparison of the measured XAS spectra with multiplet calculations indicates that the encaged Dy has a 4f( 9) configuration. The presence of Dy 5d spectral weight in the valence band is not detected by RESPES, indicating that Dy is in a formally trivalent state. The evolution of the encaged Dy orbital and spin moments of the 4f orbitals as a function of the applied magnetic field and temperature has been obtained from XMCD measurements. At 6.9 T and 4 K, both the orbital and the spin magnetic moments of the encaged Dy 4f electrons are dramatically smaller than those expected for the free Dy(3+) at saturation.