In the Element API plugin, how can I get only tags that are related to a particular section? I tried to get all tags that are related to an section.
Everything I tried failed. Is there a way to get all assigned tags for a particular element type by using element criteria model.
In this case travelImages? I want to avoid to display not related tags.

'elementType' =&gt; 'Tag',
'criteria' =&gt; ['relatedto' =&gt; 'travelImages']
The relatedTo parameter accepts either a single element ID or model, or an array of element IDs or models. It doesn't accept asset source handles, section handles, or a particular element type constant.

This means that in order to pull all tags related to a specific element type, you'll need to give the relatedTo parameter an array of all IDs for that particular element type.

You're not specific about what travelImages are, but assuming it's an Asset source, something like this should work:

'elementType' =&gt; ElementType::Tag,
'criteria' =&gt; [
    'relatedTo' =&gt; craft()-&gt;elements-&gt;getCriteria(ElementType::Asset, [
        'limit' =&gt; null,
    ])-&gt;ids(),
    'limit' =&gt; null,
],


Note that if travelImages isn't an Asset source, you'll need to change ElementType::Asset to the appropriate element type (e.g. ElementType::Entry, ElementType::Category etc).