Vcard export based on contact group

Is it possible for a system to get the vcards out of nextcloud based on the contact group?

I have a home assistant setup with asterisk voip that i have contact detection based on vcards and khard for incoming calls.

I have special rules for family and close friends. But I have to export those vcards to a khard folder manually. There is a tool called vdirsyncer to sync between khard and nextcloud but that does not discriminate in contact groups.