Site icon Hip-Hop Website Design and Development

How to exclude or include categories in wp rest API without query parameters?

for example I have cat1,cat2,cat3…cat10 in my custom post type.

and this is my rest API address for my custom post type:

https://example.com/wp-json/wp/v2/mycustompost

I don’t want to use parameters in my API address to filter categories.

I just want to show category cat1,cat5,cat7.

Please tell me how can I do this with PHP and without using parameters in address bar.

Thanks