I have a REST API function that takes a vocabulary machine name as input and create a term for that vocabulary. This function is working fine with existing vocabulary but not with newly created vocabulary. It returns the following error message:
"message": "Type https://example.com/rest/type/taxonomy_term/fruit does not correspond to an entity on this site."
After spending more than 2 hours on this, I found that my REST API function is working fine and my JSON syntax is correct too. The issue is the newly created vocabulary is not effective until I clear the cache. That is why the message says that it can't find the corresponding entity on my site.