Settings API - POST an object
Creates a new settings object or validates the provided settings object.
The request consumes and produces an application/json
payload.
POST | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v2/settings/objects |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/v2/settings/objects | |
Environment and Cluster ActiveGate (default port 9999) | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/settings/objects |
Authentication
To execute this request, you need an access token with settings.write
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
validateOnly | boolean | If | query | optional |
body | SettingsObjectCreate[] | The JSON body of the request. Contains the settings objects. | body | optional |
Request body objects
The RequestBody
object
The SettingsObjectCreate
object
Configuration of a new settings object.
Element | Type | Description | Required |
---|---|---|---|
externalId | string | External identifier for the object being created | optional |
insertAfter | string | The position of the new object. The new object will be added after the specified one. If If set to empty string, the new object will be placed in the first position. Only applicable for objects based on schemas with ordered objects (schema's | optional |
objectId | string | The ID of the settings object that should be replaced. Only applicable if an external identifier is provided. | optional |
schemaId | string | The schema on which the object is based. | required |
schemaVersion | string | The version of the schema on which the object is based. | optional |
scope | string | The scope that the object targets. For more details, please see Dynatrace Documentation. | required |
value | SettingsValue | The value of the setting. It defines the actual values of settings' parameters. The actual content depends on the object's schema. | required |
The SettingsValue
object
The value of the setting.
It defines the actual values of settings' parameters.
The actual content depends on the object's schema.
Request body JSON model
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
1[2 {3 "externalId": "string",4 "insertAfter": "Y2ktaGdyb3VwLTEyMythZjhjOThlOS0wN2I0LTMyMGEtOTQzNi02NTEyMmVlNWY4NGQ=",5 "objectId": "Y2ktaGdyb3VwLTEyMythZjhjOThlOS0wN2I0LTMyMGEtOTQzNi02NTEyMmVlNWY4NGQ=",6 "schemaId": "builtin:container.built-in-monitoring-rule",7 "schemaVersion": "1.0.0",8 "scope": "HOST-D3A3C5A146830A79",9 "value": {10 "autoMonitoring": true11 }12 }13]
Response
Response codes
Code | Type | Description |
---|---|---|
200 | SettingsObjectResponse[] | Success |
207 | SettingsObjectResponse[] | Multi-status: different objects in the payload resulted in different statuses. |
400 | SettingsObjectResponse[] | Failed. Schema validation failed. |
403 | ErrorEnvelope | Failed. Forbidden. |
404 | SettingsObjectResponse[] | Failed. The requested resource doesn't exist. |
409 | SettingsObjectResponse[] | Failed. Conflicting resource. |
Response body objects
The ResponseBody
object
The SettingsObjectResponse
object
The response to a creation- or update-request.
Element | Type | Description |
---|---|---|
code | integer | The HTTP status code for the object. |
error | Error | - |
invalidValue | SettingsValue | The value of the setting. It defines the actual values of settings' parameters. The actual content depends on the object's schema. |
objectId | string | For a successful request, the ID of the created or modified settings object. |
The Error
object
Element | Type | Description |
---|---|---|
code | integer | The HTTP status code |
constraintViolations | ConstraintViolation[] | A list of constraint violations |
message | string | The error message |
The ConstraintViolation
object
A list of constraint violations
Element | Type | Description |
---|---|---|
location | string | - |
message | string | - |
parameterLocation | string | -
|
path | string | - |
The SettingsValue
object
The value of the setting.
It defines the actual values of settings' parameters.
The actual content depends on the object's schema.
Response body JSON model
1[2 {3 "code": 1,4 "error": {5 "code": 1,6 "constraintViolations": [7 {8 "location": "string",9 "message": "string",10 "parameterLocation": "HEADER",11 "path": "string"12 }13 ],14 "message": "string"15 },16 "invalidValue": {17 "autoMonitoring": true18 },19 "objectId": "Y2ktaGdyb3VwLTEyMythZjhjOThlOS0wN2I0LTMyMGEtOTQzNi02NTEyMmVlNWY4NGQ="20 }21]