Options to get my custom post type metadata via the WordPress API
You should use register_meta to add the meta field to the rest controller. Here the example from the link to expose the field my_meta of the custom post type my_article: register_meta(‘post’, ‘my_meta’, [ ‘object_subtype’ => ‘my_article’, ‘show_in_rest’ => true ]);