How can I filter nodes by term (entity reference) with jsonapi? 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:
&quot;field_ref_term&quot;: {
&quot;type&quot;: &quot;taxonomy_term--my_vocabulary&quot;,
&quot;id&quot;: &quot;b1a97358-9834-499d-aee0-ebb0302fb2c3&quot;
},

So, first, I tried this:
/jsonapi/node/my_content_type?filter[field_ref_term]=f9c171db-1a1d-4d9a-bb55-5b0f8b033749

However, that gave me an error:
&quot;title&quot;: &quot;Bad Request&quot;,
&quot;status&quot;: &quot;400&quot;,
&quot;detail&quot;: &quot;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`.&quot;,

So I tried adding [id]:
/jsonapi/node/my_content_type?filter[field_ref_term][id]=f9c171db-1a1d-4d9a-bb55-5b0f8b033749

That gave me a different error:
&quot;detail&quot;: &quot;You must provide a valid filter condition. Check that you have set the required keys for your filter.&quot;,

So I tried a longer version:
/jsonapi/node/my_content_type?&amp;filter[term-filter][condition][path]=field_ref_term&amp;filter[term-filter][condition][id]=f9c171db-1a1d-4d9a-bb55-5b0f8b033749

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.)
You were close, but your syntax was off. This is documented further down in your linked page, in the Filter Examples &gt; Get nodes by a value of a entity reference section.
SHORT
filter[uid.id][value]=BB09E2CD-9487-44BC-B219-3DC03D6820CD

NORMAL
filter[author-filter][condition][path]=uid.id
filter[author-filter][condition][value]=BB09E2CD-9487-44BC-B219-3DC03D6820CD

So, in your example, you'd need to use:
SHORT
/jsonapi/node/my_content_type?filter[field_ref_term.id][value]=f9c171db-1a1d-4d9a-bb55-5b0f8b033749

LONG
/jsonapi/node/my_content_type?filter[term-filter][condition][path]=field_ref_term.id&amp;filter[term-filter][condition][value]=f9c171db-1a1d-4d9a-bb55-5b0f8b033749