Based on bug 31801#c5, this endpoint should, at least, respect the any default rule as defined in the MARC overlay rules.
I would like to move this forward and try to write a patch. Do I understand it right, that f.e. I have a record source (f.e. union catalogue) defined in admin -> record sources. Then I should pass the source id as header param and add it to the ModBiblio call like ModBiblio( $record, $biblio->id, $frameworkcode, { overlay_context => { source => RECORD_SOURCE_ID } } ); I remember we had a discussion about it but could not built the pieces together..
Jan, thanks stepping up. The MARC overlay rules' sources are not linked to the 'Record sources' feature (yet). That work still needs to be done. That said, my understanding is that there are a few options here: (a) Add an 'API' source to the existing MARC overlay rules valid sources. (b) Add a way to pick 'Record sources' within the MARC overlay rules feature. (c) Move the 'MARC overlay rules sources' to the 'Record sources' handling. Having them be 'system defined' and untouchable, and then make the 'MARC overlay rules' feature pick all the options from the 'Record sources'. (d) Make the API controller at least pass a context to `ModBiblio` so *at least* a fallback overlay rule (*) would be applied. I think the compromise solution is (d), and the ideal is (c). (a) and (b) would be transition steps towards (c), and I'd avoid them as much as possible.