Skip to content

Create Rules

Creates the provided set of setting rules.

Verb PUT
Endpoint {base-url}/machines/settings/rules
Max Page Size N/A

Request Body

{
    "body":
    [
      {
        "value": "unique at machine",
        "setting": "1",
        "organizationId": 1,
        "accountId": null,
        "siteId": null,
        "groupId": null,
        "machineId": 402,
        "createdAt": "2023-08-07T01:48:50.783",
        "isActive": true
      }
    ]
}

Note

All changes in this request are atomic. If any item fails, the entire batch is rolled back and no changes are made.

Returns

On Success

A list containing the IDs of the created settings rules.

Response Body

[
  1
]

On Error

HTTP Code Error Code Definition
403 DATA_ACCESS_VIOLATION One or more rules reference an organizationId, accountId, siteId, groupId, or machineId belonging to an organization you do not have access to.
404 MISSING_RECORD One or more rules reference an accountId, siteId, groupId, or machineId that does not exist.
422 DATA_VALIDATION_ERROR One or more rules had more than one of the mutually exclusive scope fields (accountId, siteId, groupId, machineId) set to a non-null value.
422 VALIDATION_ERROR One or more rules failed model validation (e.g. organizationId is missing or zero, value exceeds 500 characters).