The Prototype Synchrotron Radiation Detector (PSRD) is a small-scale experiment designed to measure the rate of low-energy charged particles and photons in near the Earth's orbit. It is a precursor to the Synchrotron Radiation Detector (SRD), a proposed addition to the upgraded version of the Alpha Magnetic Spectrometer (AMS-02). The SRD will use the Earth's magnetic field to identify the charge sign of electrons and positrons with energies above 1 TeV by detecting the synchrotron radiation they emit in this field. The differential energy spectrum of these particles is astrophysically interesting and not well covered by the remaining components of AMS-02. Precise measurements of this spectrum offer the possibility to gain information on the acceleration mechanism and characteristics of all cosmic rays in our galactic neighbourhood. The SRD will discriminate against protons as they radiate only weakly. Both the number and energy of the synchrotron photons that the SRD needs to detect are small. The identification is complicated by the presence of a large particle and photon background. Existing measurements of these backgrounds are insufficient for the construction of the large-scale SRD, so a measurement in space was indispensable. The PSRD was designed to fly as a Space Shuttle secondary payload, within the Shuttle Small Payloads Project. The flight on board the Space Shuttle Endeavour took place from 5 to 17 December 2001. The scientific goal, hardware and the flight of the PSRD are described in this report.