Context. Trans-Neptunian objects (TNOs) are considered to be among the most primitive objects in our Solar System. Knowledge of their primary physical properties is essential for understanding their origin and the evolution of the outer Solar System. In this context, stellar occultations are a powerful and sensitive technique for studying these distant and faint objects. Aims. We aim to obtain the size, shape, absolute magnitude, and geometric albedo for TNO (143707) 2003 UY117. Methods. We predicted a stellar occultation by this TNO for 2020 October 23 UT and ran a specific campaign to investigate this event. We derived the projected profile shape and size from the occultation observations by means of an elliptical fit to the occultation chords. We also performed photometric observations of (143707) 2003 UY117 to obtain the absolute magnitude and the rotational period from the observed rotational light curve. Finally, we combined these results to derive the three-dimensional shape, volume-equivalent diameter, and geometric albedo for this TNO. Results. From the stellar occultation, we obtained a projected ellipse with axes of (282 ± 18) × (184 ± 32) km. The area-equivalent diameter for this ellipse is Deq,A = 228 ± 21 km. From our photometric R band observations, we derived an absolute magnitude of HV = 5.97 ± 0.07 mag using V − R = 0.46 ± 0.07 mag, which was derived from a V band subset of these data. The rotational light curve has a peak-to-valley amplitude of ∆m = 0.36 ± 0.13 mag. We find the most likely rotation period to be P = 12.376 ± 0.0033 hours. By combining the occultation with the rotational light curve results and assuming a triaxial ellipsoid, we derived axes of a × b × c = (332 ± 24) km × (216 ± 24) km × (180−24+28) km for this ellipsoid, and therefore a volume-equivalent diameter of Deq,V = 235 ± 25 km. Finally, the values for the absolute magnitude and for the area-equivalent diameter yield a geometric albedo of pV = 0.139 ± 0.027.