# Is it possible create/update/delete host groups via Rest API?

**URL:** <https://community.dynatrace.com/t/is-it-possible-create-update-delete-host-groups-via-rest-api/50961>\
**Category:** Dynatrace API\
**Tags:** hosts-classic, dynatrace-api\
**Created:** [March 31, 2025, 6:58am UTC](https://community.dynatrace.com/t/is-it-possible-create-update-delete-host-groups-via-rest-api/50961 "2025-03-31T06:58:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gschramm](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gschramm/32/27895_2.png) [@gschramm](https://community.dynatrace.com/u/gschramm)\
**Post date:** [March 31, 2025, 6:58am UTC](https://community.dynatrace.com/t/is-it-possible-create-update-delete-host-groups-via-rest-api/50961/1 "2025-03-31T06:58:38Z")

</div>

Hello,

I’m currently build a script that allows us to quickly setup a new application we want to onboard. The goal is to build a sceleton configuration with all important pieces including permissions.

Application, URL mapping, storage buckets, management zone ect.. all find. One important piece is the host group and there doesn’t seem to be a REST endpunkt for managing host groups.

Can you confirm that or am I simply overlooking something?

regards,

Günter

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [March 31, 2025, 7:12am UTC](https://community.dynatrace.com/t/is-it-possible-create-update-delete-host-groups-via-rest-api/50961/2 "2025-03-31T07:12:39Z")

</div>

That’s correct, there is no API for managing hostgroups.&nbsp; Host groups get automatically created when you set them in the OneAgent installer arguments, in the OneAgent configuration using oneagentctl, by changing them in Deployment status or by using OneAgent configuration API.

---

<div class="post-metadata">

**Author:** ![gschramm](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gschramm/32/27895_2.png) [@gschramm](https://community.dynatrace.com/u/gschramm)\
**Post date:** [March 31, 2025, 11:20am UTC](https://community.dynatrace.com/t/is-it-possible-create-update-delete-host-groups-via-rest-api/50961/3 "2025-03-31T11:20:04Z")

</div>

That’s major disappointment. Host groups are useful config items that are reused in other parts of a configuration, eg. Management Zones, Mainteance Windows, Logs Ingest Rules, Bucket assignment.. also in Policies for boundaries definitions ect.

In our case I simply cannot build a proper starting configuration without a new host group. Connecting / changing an agent to create a new group seems like a very silly workaround to me.

I’ll create a product idea for this.

---

<div class="post-metadata">

**Author:** ![gschramm](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gschramm/32/27895_2.png) [@gschramm](https://community.dynatrace.com/u/gschramm)\
**Post date:** [March 31, 2025, 11:32am UTC](https://community.dynatrace.com/t/is-it-possible-create-update-delete-host-groups-via-rest-api/50961/4 "2025-03-31T11:32:51Z")

</div>

[API Endpoint for Host Groups - Dynatrace Community](https://community.dynatrace.com/post/273949#M51234)&nbsp;- please vote 😉

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [March 31, 2025, 1:38pm UTC](https://community.dynatrace.com/t/is-it-possible-create-update-delete-host-groups-via-rest-api/50961/5 "2025-03-31T13:38:22Z")

</div>

[@gschramm](https://community.dynatrace.com/user/78409)&nbsp;I’m curious about what you are trying to accomplish. You can still create rules such as tagging rules, or management zones referring to a host group name even when such a host group does not exist yet.

---

<div class="post-metadata">

**Author:** ![apasoquen1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/apasoquen1/32/36450_2.png) [@apasoquen1](https://community.dynatrace.com/u/apasoquen1)\
**Post date:** [February 24, 2026, 6:29pm UTC](https://community.dynatrace.com/t/is-it-possible-create-update-delete-host-groups-via-rest-api/50961/6 "2026-02-24T18:29:49Z")

</div>

One use case could be maintenance windows.&nbsp; For example, I have a few agents that I need to deploy however, they will not be in production until a certain time.&nbsp; If I was able to create an ‘empty host group’, I could configure my maintenance window based on that host group.&nbsp; Then when those agents are deployed, they should automatically be in maintenance mode.

---

<div class="post-metadata">

**Author:** ![Didier](https://avatars.discourse-cdn.com/v4/letter/d/41988e/32.png) [@Didier](https://community.dynatrace.com/u/Didier)\
**Post date:** [March 30, 2026, 1:54pm UTC](https://community.dynatrace.com/t/is-it-possible-create-update-delete-host-groups-via-rest-api/50961/7 "2026-03-30T13:54:33Z")

</div>

My use case : create a new host-group with specifics settings before to install OneAgent. I need to desactivate some monitoring features to the new host group only.  
How can i do that ?&nbsp;  
I do not understand how this page can help : The solution&nbsp;[OneAgent remote configuration management API - POST a configuration job — Dynatrace Managed Docs](https://docs.dynatrace.com/managed/shortlink/api-v2-remote-configuration-oneagents-post-job)  
I do not have entities ID because OneAgent is not installed yet on the new hosts.  
I’am interested if you have un curl example

---

<div class="post-metadata">

**Author:** ![Didier](https://avatars.discourse-cdn.com/v4/letter/d/41988e/32.png) [@Didier](https://community.dynatrace.com/u/Didier)\
**Post date:** [April 1, 2026, 8:16am UTC](https://community.dynatrace.com/t/is-it-possible-create-update-delete-host-groups-via-rest-api/50961/8 "2026-04-01T08:16:22Z")

</div>

I’m answering my own question (with Jean-Louis’s help). And in case it’s helpful to others :

To list Host\_Groups, you can use the entities API with the following entitySelector configuration: type(HOST\_GROUP)

/api/v2/entities?entitySelector=type%28HOST\_GROUP%29

Example :

```markup
curl -s "${DT_TENANT_URL}api/v2/entities?entitySelector=type%28HOST_GROUP%29" -X GET -H 'Accept: application/json; charset=utf-8' -H
 'Content-Type: application/json; charset=utf-8' -H "Authorization: Api-Token ${DT_TENANT_TOKEN}"

```

and then, you can modify a specific host group with it’s ID (“scope”:“HOST\_GROUP-ID”) in&nbsp;api/v2/settings/objects

```markup
curl "${DT_TENANT_URL}api/v2/settings/objects" \
-X POST \
-H "Accept: application/json; charset=utf-8" \
-H "Content-Type: application/json; charset=utf-8" \
-H "Authorization: Api-Token ${DT_TENANT_TOKEN}" \
-d $'[{"schemaId":"builtin:process.process-monitoring","schemaVersion":"0.2","scope":"HOST_GROUP-ID","value":{"autoMonitoring":false}}]'

```

However, you cannot create a host group without a host; it must be associated with at least one host.
