# OneAgent fullstack mode to infra mode change via API

**URL:** <https://community.dynatrace.com/t/oneagent-fullstack-mode-to-infra-mode-change-via-api/48166>\
**Category:** Dynatrace API\
**Tags:** discovery-coverage, dynatrace-api\
**Created:** [October 6, 2024, 10:09am UTC](https://community.dynatrace.com/t/oneagent-fullstack-mode-to-infra-mode-change-via-api/48166 "2024-10-06T10:09:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dinesh\_chandra](https://avatars.discourse-cdn.com/v4/letter/d/7ba0ec/32.png) [@dinesh\_chandra](https://community.dynatrace.com/u/dinesh_chandra)\
**Post date:** [October 6, 2024, 10:09am UTC](https://community.dynatrace.com/t/oneagent-fullstack-mode-to-infra-mode-change-via-api/48166/1 "2024-10-06T10:09:11Z")

</div>

Hello Folks,

We have one agent running in fullstack mode in DC & want to change infra mode in one shot via api, could you please guide me how to do this.

Note: Dynatrace is in SaaS based model.

Thanaks

---

<div class="post-metadata">

**Author:** ![Peter\_Youssef](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/peter_youssef/32/14668_2.png) [@Peter\_Youssef](https://community.dynatrace.com/u/Peter_Youssef)\
**Post date:** [October 6, 2024, 1:06pm UTC](https://community.dynatrace.com/t/oneagent-fullstack-mode-to-infra-mode-change-via-api/48166/2 "2024-10-06T13:06:10Z")

</div>

Hi&nbsp;[@dinesh\_chandra](https://community.dynatrace.com/user/72910)

It’s easy so, Kindly follow the shown example as per Dynatrace documentation , you will replace the example info with real environment info

[api-config-oneagent-on-host-monitoring-put](https://docs.dynatrace.com/docs/shortlink/api-config-oneagent-on-host-monitoring-put)

Regards,

Peter

---

<div class="post-metadata">

**Author:** ![Peter\_Youssef](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/peter_youssef/32/14668_2.png) [@Peter\_Youssef](https://community.dynatrace.com/u/Peter_Youssef)\
**Post date:** [October 6, 2024, 1:19pm UTC](https://community.dynatrace.com/t/oneagent-fullstack-mode-to-infra-mode-change-via-api/48166/3 "2024-10-06T13:19:45Z")

</div>

Hi&nbsp;[@dinesh\_chandra](https://community.dynatrace.com/user/72910)

1. create access token with “writeconfig” scope.
2. Through the Rest Api either use the SaaS directly or the environment AG.

 ![2024-10-06_17h06_48.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/8/a86bb81a239c5284d89e9abfa4bcc90cff346855.png)

 ![2024-10-06_17h09_40.png](https://global.discourse-cdn.com/dynatrace/original/2X/b/bb0dc4997ce5a8457bd8dc7afad9211e5af9bd58.png)

To get host id , access the server directly and check the SaaS URL as per attached example, use it to get the host id and run the Rest API accordingly

![2024-10-06_17h16_49.png](https://global.discourse-cdn.com/dynatrace/original/2X/b/bfc0a63171689954a0e78da7967ddfe0744a3424.png)

KR,

Peter.
