add_filter postbox_classes multiple post types

Do I need to add filter twice, once for each post type?

Yes! you can’t insert an array into a string, if you could it wouldn’t result in a matching filter name anyway. The filters for posts and pages are different filters. You need to add them separately.

e.g. postbox_classes_post_my-metabox-api versus postbox_classes_page_my-metabox-api

If I had to guess, your current code results in this filter name: postbox_classes_array_my-metabox-api