# Is there any API to POST Process Group Monitoring Rule?

**URL:** <https://community.dynatrace.com/t/is-there-any-api-to-post-process-group-monitoring-rule/31285>\
**Category:** Dynatrace API\
**Tags:** process-groups, monaco, synthetic-monitoring, dynatrace-api\
**Created:** [April 28, 2021, 8:43am UTC](https://community.dynatrace.com/t/is-there-any-api-to-post-process-group-monitoring-rule/31285 "2021-04-28T08:43:59Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![nakb](https://avatars.discourse-cdn.com/v4/letter/n/8edcca/32.png) [@nakb](https://community.dynatrace.com/u/nakb)\
**Post date:** [April 28, 2021, 8:43am UTC](https://community.dynatrace.com/t/is-there-any-api-to-post-process-group-monitoring-rule/31285/1 "2021-04-28T08:43:59Z")

</div>

Hi I am trying to automate the Process Group Monitoring Rule in Dynatrace but I am unable to find any POST API for this, please let me know if any available or any other way to automate it.

 ![naveen_0-1619599365306.png](https://global.discourse-cdn.com/dynatrace/original/3X/7/0/70b8e8f577b67588c5cd71b4a7b2ac7a66448081.png)

---

<div class="post-metadata">

**Author:** ![pahofmann](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pahofmann/32/17076_2.png) [@pahofmann](https://community.dynatrace.com/u/pahofmann)\
**Post date:** [April 28, 2021, 9:03am UTC](https://community.dynatrace.com/t/is-there-any-api-to-post-process-group-monitoring-rule/31285/2 "2021-04-28T09:03:28Z")

</div>

Unfortunately there is no API for this yet. [You can vote for my RFE here](https://community.dynatrace.com/post/154667).

---

<div class="post-metadata">

**Author:** ![MaciejNeumann](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@MaciejNeumann](https://community.dynatrace.com/u/MaciejNeumann)\
**Post date:** [April 26, 2022, 1:26pm UTC](https://community.dynatrace.com/t/is-there-any-api-to-post-process-group-monitoring-rule/31285/3 "2022-04-26T13:26:12Z")

</div>

As&nbsp;[@pahofmann](https://community.dynatrace.com/user/22796)&nbsp;and [@mark\_bley](https://community.dynatrace.com/user/13072)&nbsp;are mentioning in the related Product Idea, this is now possible through&nbsp;[Settings API](https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings?_ga=2.263790991.2061216437.1650870575-939210357.1648450979).

 ![pahofmann_0-1643187417266.png](https://global.discourse-cdn.com/dynatrace/original/2X/d/dc18253bc0ce68a3ad9fb69fbd395fe972d05220.png)

You can try following payload and send it to “/api/v2/settings/objects”

```markup
[
    {
        "schemaVersion": "1.0.7",
        "schemaId": "builtin:declarativegrouping",
        "scope": "environment",
        "value": {
            "enabled": true,
            "name": "MY TEST",
            "detection": [
                {
                    "id": "MY TEST",
                    "processGroupName": "Some PG Name",
                    "rules": [
                        {
                            "property": "executablePath",
                            "condition": "$eq(/path/to/exec)"
                        }
                    ]
                }
            ]
        }
    }
]

```

---

<div class="post-metadata">

**Author:** ![nakb](https://avatars.discourse-cdn.com/v4/letter/n/8edcca/32.png) [@nakb](https://community.dynatrace.com/u/nakb)\
**Post date:** [May 30, 2022, 11:46am UTC](https://community.dynatrace.com/t/is-there-any-api-to-post-process-group-monitoring-rule/31285/4 "2022-05-30T11:46:29Z")

</div>

Hi&nbsp;[@MaciejNeumann](https://community.dynatrace.com/user/6),

I have tried the above API and it’s not working. I am getting 400 error. Also documentation is not clear.

Could you please check.

---

<div class="post-metadata">

**Author:** ![pahofmann](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pahofmann/32/17076_2.png) [@pahofmann](https://community.dynatrace.com/u/pahofmann)\
**Post date:** [May 30, 2022, 3:01pm UTC](https://community.dynatrace.com/t/is-there-any-api-to-post-process-group-monitoring-rule/31285/5 "2022-05-30T15:01:19Z")

</div>

A 400 (Bad Request) means somthing is wrong with the payload&nbsp; you are trying to send.

It should also list a message with the problem (e.g. which part of the json could not be parsed).

---

<div class="post-metadata">

**Author:** ![nakb](https://avatars.discourse-cdn.com/v4/letter/n/8edcca/32.png) [@nakb](https://community.dynatrace.com/u/nakb)\
**Post date:** [May 31, 2022, 2:27pm UTC](https://community.dynatrace.com/t/is-there-any-api-to-post-process-group-monitoring-rule/31285/6 "2022-05-31T14:27:56Z")

</div>

Hi&nbsp;[@pahofmann](https://community.dynatrace.com/user/22796),

I used exact same payload as above also tried from the API documentation it’s not working.

Also documentation is not clear like what are the valid schema id’s

> **[Settings API - POST an object](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/settings/objects/post-object)**
>
> Create or validate a settings object via the Dynatrace API.

---

<div class="post-metadata">

**Author:** ![pahofmann](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pahofmann/32/17076_2.png) [@pahofmann](https://community.dynatrace.com/u/pahofmann)\
**Post date:** [May 31, 2022, 6:47pm UTC](https://community.dynatrace.com/t/is-there-any-api-to-post-process-group-monitoring-rule/31285/7 "2022-05-31T18:47:06Z")

</div>

I’d be easier if you could post the output from your request. It should list what is wrong.

You can get the schema id’s either from the UI as mentioned above or from the&nbsp;[dedicated endpoint for it.](https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings/schemas/get-all)

---

<div class="post-metadata">

**Author:** ![nakb](https://avatars.discourse-cdn.com/v4/letter/n/8edcca/32.png) [@nakb](https://community.dynatrace.com/u/nakb)\
**Post date:** [June 7, 2022, 1:13pm UTC](https://community.dynatrace.com/t/is-there-any-api-to-post-process-group-monitoring-rule/31285/8 "2022-06-07T13:13:01Z")

</div>

Hi&nbsp;[@pahofmann](https://community.dynatrace.com/user/22796),

Payload:

```markup
[{
    "schemaId": "builtin:process.custom-process-monitoring-rule",
    "scope": "environment",
    "value":{
        "autoMonitoring": true
    }
}]

```

I am getting below error:

```markup
[
    {
      "code": 400,
      "error": {
        "code": 400,
        "message": "Validation failed for 4 Validators.",
        "constraintViolations": [
          {
            "path": "builtin:process.custom-process-monitoring-rule/0/mode",
            "message": "Given property 'mode' with value: 'null' does not comply with required NonNull of schema",
            "parameterLocation": "PAYLOAD_BODY",
            "location": null
          },
          {
            "path": "builtin:process.custom-process-monitoring-rule/0/condition",
            "message": "Given property 'condition' with value: 'null' does not comply with required NonNull of schema",
            "parameterLocation": "PAYLOAD_BODY",
            "location": null
          },
          {
            "path": "builtin:process.custom-process-monitoring-rule/0/autoMonitoring",
            "message": "Given property 'autoMonitoring' with value: 'true' was not found in the schema",
            "parameterLocation": "PAYLOAD_BODY",
            "location": null
          },
          {
            "path": "builtin:process.custom-process-monitoring-rule/0/enabled",
            "message": "Given property 'enabled' with value: 'null' does not comply with required NonNull of schema",
            "parameterLocation": "PAYLOAD_BODY",
            "location": null
          }
        ]
      },
      "invalidValue": {
        "autoMonitoring": true
      }
    }
  ]

```

On API [page](https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings/objects/post-object) **SettingsValue** navigation not working, unable to check what are the valid parameters.

 ![naveen_0-1654607280369.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/895bd1796dfeb7480c738f1de863c8dce2e2e287.png)

---

<div class="post-metadata">

**Author:** ![pahofmann](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pahofmann/32/17076_2.png) [@pahofmann](https://community.dynatrace.com/u/pahofmann)\
**Post date:** [June 7, 2022, 1:32pm UTC](https://community.dynatrace.com/t/is-there-any-api-to-post-process-group-monitoring-rule/31285/9 "2022-06-07T13:32:25Z")

</div>

Well it lists all the values that must be present that you are missing.

You can check the schema via&nbsp;​_ **/settings​/schemas​/{schemaId}** _ to to see all the fields.

Or you can just create a setting in the GUI and then list all the objects from the schema via&nbsp;_ **/settings/objects** &nbsp;_to check what it should look like.

---

<div class="post-metadata">

**Author:** ![Naveen](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/naveen/32/2570_2.png) [@Naveen](https://community.dynatrace.com/u/Naveen)\
**Post date:** [June 9, 2022, 9:49am UTC](https://community.dynatrace.com/t/is-there-any-api-to-post-process-group-monitoring-rule/31285/10 "2022-06-09T09:49:14Z")

</div>

Hi&nbsp;[@pahofmann](https://community.dynatrace.com/user/22796),

Thanks I am able to create custom process monitoring rule.

Below is the example payload used.

```javascript
[
    {
        "schemaId": "builtin:process.custom-process-monitoring-rule",
        "scope": "environment",
        "value": {
            "enabled": true,
            "mode": "MONITORING_ON",
            "condition": {
                "item": "IIS_APP_POOL",
                "operator": "STARTS",
                "value": "Demo"
            }
        }
    }
]

```
