To answer the question directly – The REST API do not initialize a main query, therefor there should not be any for requests coming that way.
What you should do is to create your own end point and server what ever custom data you need on it. Modifying the REST API, while possible, violates the whole idea of having a consistent and documented API in the first place.
Related Posts:
- Tell wordpress to show a single page instead of an archive page
- How to use a custom post type archive as front page?
- Custom Post Type Archives by Year & Month?
- Get custom post type slug for an archive page
- How to set a custom post type to have viewable future posts
- Meta_Query as a way how to setup CPT permalinks – is it a good thing?
- Proper way of making custom post type landing page or archive page
- Custom Post Type Archives by Date with Custom Permalink
- Change title in head on Archive page
- Custom Post Type Archives with 0 Posts Redirects as 404
- Page is defaulting to archive page and not designated template
- Better to use a post type archive, page template, or shortcode for generating a highly configurable CPT archive?
- How to get_queried_object on multiple objects?
- paginate function in archive for custom-post-type
- Custom post type archive sorted and grouped by date in post meta field
- How to create archive page for taxonomy terms within custom post type
- WordPress custom post type archive with description
- Custom-post-type-archive: posts sorted/filtered by year?
- How to list custom post types?
- Custom post type archive page pagination
- Editable content on a Custom Archive page
- Second Custom Post Type Archive
- How to use WP_Query in a CPT achive page?
- WP_Query | ‘post_type’ doesn’t work
- CPT Archive with core Category
- Changing number of posts per page on CPT-archive.php, have tried 20-30 code chunks so far
- get the custom post type title/name
- URL of a custom post type’s post format archive?
- Filtering WP_Query
- Create template for taxonomy results limited by Custom Post Type
- Custom post type archive page blank
- How to display custom post in archive section of the wordpress page?
- What’s the name of the custom post type yearly archive template?
- How can I use archive-{post_type}.php theme template?
- Return the name of the post type
- Use the custom post type archive for taxonomies?
- Custom Post Type Archive Pagination
- Query Posts that have Custom Taxonomy
- Archive page for custom post type and custom taxonomy
- Make Next and Previous on single-$posttype.php use the same order as archive-$posttype.php
- How to have multiple archive pages?
- Create a Custom Path to Archive
- Custom Post Type Date Based Archive URL rewrite [duplicate]
- WordPress sitemap with Custom Post Types
- Is possible register two archive pages for single custom post type?
- WP_Query: how to search tags in addition to a custom post type?
- How can I sort the results of a REST API response by the title of a connected custom post type?
- Custom Post type page content (archive page)
- Group custom post type posts by month
- Creating an archive page or simple template to list all values of a custom field of specific post type listing
- Do not show child pages within a file page
- Custom Post Type archive page listing a 404 or single post
- One of my headings is mysteriously coming up as a link in my CPT Archive
- Only show categories that have posts within custom post type
- Want to display my custom date archive to date.php but dont know how
- Custom Post Type shows pagination (w/404) or posts_per_page query, but not both
- why custom post archive gives always no more than 10 posts despite of paging settings?
- Rewriting archive page slug to be different than custom post type slug
- Site loads very slow for archive custom post type page
- Stop Custom post type from being searched via URL
- Custom post type category page not working
- paging is not working properly on news archives page [duplicate]
- How can I set up the URL for a category archive for a custom post type?
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Pagination not working for archive
- how to pass args for archive.php query?
- How to have a dynamic slug and rendering the archive-{post_type}.php?
- Remove plugin’s custom post type archive page and single pages [closed]
- Store custom post type with JSON content
- querying to custom field over ACF REST API
- WP Query + custom fields: How to query event posts from the current date backwards 6 months and organize it month by month?
- WordPress CPT archive page display sticky post first and then display the rest of the posts in same Query
- Remove date rewrite rule for custom post type archive page
- How to check if I’m on a custom post type archive in the admin area
- How do you create an archive for a custom post type from a plugin?
- Counting Posts of a Given Post Type Having a Specific Taxonomy?
- How to create posts (not post template) to be displayed on projects page?
- WP_Query post at custom position
- wrong template for page of archive
- Search tags in CPTs
- Exclude the parent custom post-type posts only
- Display custom post type taxonomies as an archive page
- Unable to retrieve any posts of CPT in wp-admin
- Custom post type templating problem
- Including metaboxes from custom post types in global search — continued
- Creating a Custom Post Type
- How to get specific post meta by title or id
- WP_Query of custom post type sorted by meta_key has unexpected results
- Display custom-post type based on the Title matching the current selected value
- Numeric pagination custom post type
- WP Query filter search. Result show all posts instead just custom post type
- Display posts of a hierarchical custom post type excluding parent posts
- get_post_meta for Custom Post Type ( CPT )
- How to query posts by meta keys AND under specific category?
- How can I base a query off of the current page post type AND a meta value from another custom post type
- Fallback if statement based on the number filtered from it
- Display ACF object field data using Elementor Custom Query
- WordPress custom field sorting, weird behavior: the latest post is at the end
- Quering a post object based on another related post object
- Custom Post Type Pagination Showing 404 On archive pages