Phase retrieval for object and probe in the optical near field Lensless holographic X ray microscopy is a non invasive imaging technique that provides resolution on the nanometer scale. Therefore a divergent coherent and especially clean wave front impinging on the sample is needed. Yet focusing X rays by even the most advanced X ray mirrors causes so called figure errors of high spatial frequency content. The results are strongly deteriorated intensity profiles that are often even more pronounced than the holographic image of the sample itself. A common strategy to compensate these figure errors is to divide the hologram by the pure intensity profile of the beam (the so called flat field). However this division is only valid in the limiting case of an illumination focused down to a point source. In reality as a consequence of a fi nite spot size one has to accept a loss in resolution when performing the flat field correction. An approach different from the described straightforward procedure is necessary. Here the simultaneous reconstruction of object and probe is proposed using holograms which were not flat field corrected before phase retrieval. To this end a method has been developed that allows simultaneously reconstructing object and probe in amplitude and phase from holographic intensity recordings. The experimental way of proceeding was mainly inspired by well established holographic full field X ray imaging techniques that require holograms defocused to different degrees. Consequently the conclusion seems reasonable that diversity in the optical near field arises mainly from variation of the propagation distance of light. This so called longitudinal diversity is used to properly phase the transmission function of the sample of interest. The algorithmic strategy of simultaneous phase retrieval for object and probe draws on far field ptychography where lateral translations of the sample create diverse diffraction patterns. In view of the need for longitudinal diversity realized by shifts of the sample along the optical axis ptychography has been generalized and adapted for the optical near field. Hence translations of the sample in all three dimensions of space need to be exploited to collect enough information about object and probe such that both can be reconstructed simultaneously in amplitude and phase. Concepts have been put into practice by simulations as well as by experiments with coherent visible light and hard X rays from synchrotron sources. The presented approach offers the opportunity to perform high resolution imaging to be extended to tomography and to be adapted to super resolution experiments.