Problems filtering with API

Hi, I’ve been having some problems filtering with the API.
I tried to filter products through name, documentation says to use /api/products?pname=name but that doesnt work, just shows all the products.
Currently we’ve been using other filters like /api/products?q=name, but now Im curious about why that specific filter doesnt work.
Same with Categories id_path, I want to get all the main categories through API with my Storefront, so I guess that I would need /api/categories?id_path="" but this gets me the same error as before, gets all the categories.
Thank you in advance.

pname means if the search should be performed by product name. You can use it in the following way