My nodes contain an entity reference field, Ref Term. I want to fetch a list of nodes that have a specific term with jsonapi.

In jsonapi, when I fetch nodes, the field with the taxonomy term reference is returned like this:

"field_ref_term": {
"type": "taxonomy_term--my_vocabulary",
"id": "b1a97358-9834-499d-aee0-ebb0302fb2c3"

So, first, I tried this:


However, that gave me an error:

"title": "Bad Request",
"status": "400",
"detail": "Invalid nested filtering. The field `field_ref_term`, given in the path `field_ref_term` is incomplete, it must end with one of the following specifiers: `id`.",

So I tried adding [id]:


That gave me a different error:

"detail": "You must provide a valid filter condition. Check that you have set the required keys for your filter.",

So I tried a longer version:


That gave me the first error again. I read the documentation on filtering.

How can I filter my nodes based on which are tagged with a specific taxonomy term? (In my case, each node has one and only one taxonomy term in its entity reference field.)

1 Answer 1


You were close, but your syntax was off. This is documented further down in your linked page, in the Filter Examples > Get nodes by a value of a entity reference section.



So, in your example, you'd need to use:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.