How can I export a cropped image through REST API?

I have a group of vectors(first element below) that is actually hided and can see only the half of it. When I export the group through Figma UI I get back the cropped group as it is in the design, but when I use the REST API GET /v1/images/:key?ids=1:2 I get the whole group as image(second element below).

How can I get the cropped group as image through the REST API as the Figma UI does?
Thank you!