Documentation should be here:
https://www.advancedcustomfields.com/resources/add_sub_row/
So, you need to know your flex-content fields’ field name too.
For example, if your field_name is ‘page_blocks’, you’d do something like:
foreach ($config as $index => $field) {
foreach ($field['subfields'] as $key => $value) {
add_sub_row(array('page_blocks', $index, $key), $value);
}
}
p.s i haven’t tested yet.
Cheers