Your data needs REST? Core already has a route.
Real code from our plugins on wordpress.org:
- 4WP FAQ: the faq post type has ‘showinrest’ => true → /wp/v2/faq, no custom route.
- registerpostmeta( ‘answers’ ) with a REST schema → meta.answers appears in GET /wp/v2/faq/{id}.
- FAQ category term meta: showinrest for reading, authcallback → managecategories for writing.
- 4WP TODO: 9 private note fields keep ‘showinrest’ => false — showinrest is a publish button.
Property of a post or term? Extend wp/v2. A resource of its own? Own namespace.
Go deeper
- Full guide: 4wp.dev/development/rest-api/extending-wp-v2