# How to query multiple entityTypes in a single API call?

**URL:** <https://community.dynatrace.com/t/how-to-query-multiple-entitytypes-in-a-single-api-call/41380>\
**Category:** Dynatrace API\
**Tags:** dynatrace-api\
**Created:** [August 27, 2023, 9:18am UTC](https://community.dynatrace.com/t/how-to-query-multiple-entitytypes-in-a-single-api-call/41380 "2023-08-27T09:18:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![NavenduGupta](https://avatars.discourse-cdn.com/v4/letter/n/50afbb/32.png) [@NavenduGupta](https://community.dynatrace.com/u/NavenduGupta)\
**Post date:** [August 27, 2023, 9:18am UTC](https://community.dynatrace.com/t/how-to-query-multiple-entitytypes-in-a-single-api-call/41380/1 "2023-08-27T09:18:31Z")

</div>

How can I query for multiple entityTypes in a single call?

e.g. I want to query for all the entities which are either type (HOST) or type(PROCESS\_GROUP\_INSTANCE) for an environment?

GET /e/\<env-id\>/api/v2/entities?pageSIze=500&entitySelector=tag(“TAGABCD”),type(HOST)&fields=firstSeenTms,lastSeenTms,properties,tags,managementZones,fromRelationships,toRelationships

in the above query, I can only entities of type HOST? can I query for multiple entity types e.g. give me the list of all the entities with are either “HOST” or “PROCESS\_GROUP\_INSTANCE”?

---

<div class="post-metadata">

**Author:** ![mark\_bley](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mark_bley/32/20954_2.png) [@mark\_bley](https://community.dynatrace.com/u/mark_bley)\
**Post date:** [September 5, 2023, 9:52am UTC](https://community.dynatrace.com/t/how-to-query-multiple-entitytypes-in-a-single-api-call/41380/2 "2023-09-05T09:52:31Z")

</div>

Hi

If you are looking to e.g. find the process group instances (PGI) for a specific host you can use the relationships.

e.g. to get the PGIs of host(s) tagged with “CF Tag” you can use following entititySelector

```javascript
type(process_group_instance),fromRelationships.isProcessOf(type(host),tag("CF Tag"))

```

Or directly from a specific host using it’s own ID

```javascript
type(process_group_instance),fromRelationships.isProcessOf(type(host),entityId(HOST-EA50C80CC9354652))

```

Atm it is not possible to query multiple entity types in one call.

Hope it helps.

Best,

Mark
