Context : RX J1131-1231 is a gravitationally lensed system which includes four images of a quasar lensed by an elliptical galaxy . The flux in the individual images is known to be affected by microlensing effect in the visible and X-ray bands . Aims : We study the multi-wavelength properties of RX J1131-1231 over a broad energy range , from optical to hard X-ray , during the periods of the microlensing caustic crossings . We aim to constrain the spatial extent of the X-ray emission region at different energies . Methods : We combine the data of the source monitoring in the visible band with the X-ray data of the Burst Alert Telescope ( BAT ) on board of SWIFT satellite and Chandra X-ray observatory . Results : Inspecting the broad band spectrum and lightcurves of the source we identify several microlensing caustic crossing events , and study the details of variability of the source during these events . The caustic crossings of image A on MJD 55150 and 55500 produce strong variations of the overall X-ray flux from the source . In the soft X-ray band , the caustic crossing events are characterised by the exponential growth / decay of the flux ratio between the source images with the exponentiating time scale T _ { d } \simeq 60 d , which corresponds to the caustic transit time of the source of the size \sim 10 ^ { 14 } cm . Variability induced by the microlensing dominates the overall variability of the sum of the fluxes of four images of the source which should also be detectable in the hard X-ray lightcurve , if the hard X-ray source is comparably compact . Non-detection of the caustic crossing events in the SWIFT/BAT lightcurve of the source indicates that geometry of the region of emission of X-rays with energies above 15 keV is different from that of the lower energy X-rays , with the hard X-ray emission an order of magnitude larger in size . Conclusions :