Feature request: export layer background only

Using the rest image endpoint, I can get the image of a layer, but in trying to recomposite the layer, do I don’t want the image to include the children within it.

Previously I was using the plugin api, and would hide children, export image, then show children.

I’d really love if this end point would support this functionally. Thanks!