• Home
  • Dynatrace API
  • Environment
  • Settings
  • Objects
  • POST an object

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.

POSTManagedDynatrace for Governmenthttps://{your-domain}/e/{your-environment-id}/api/v2/settings/objects
SaaShttps://{your-environment-id}.live.dynatrace.com/api/v2/settings/objects
Environment ActiveGatehttps://{your-activegate-domain}/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

ParameterTypeDescriptionInRequired
validateOnlyboolean

If true, the request runs only validation of the submitted settings objects, without saving them.

queryoptional
bodySettingsObjectCreate[]

The JSON body of the request. Contains the settings objects.

bodyoptional

Request body objects

The RequestBody object

The object doesn't provide any parameters.

The SettingsObjectCreate object

Configuration of a new settings object.

ElementTypeDescriptionRequired
objectIdstring

The ID of the settings object that should be replaced.

Only applicable if an external identifier is provided.

optional
externalIdstring

External identifier for the object being created

optional
schemaIdstring

The schema on which the object is based.

required
scopestring

The scope that the object targets.

If omitted on creation of a new object and if the schema supports scope generation, the operation will generate a scope from the provided value.

optional
valueSettingsValue

The value of the setting.

It defines the actual values of settings' parameters.

The actual content depends on the object's schema.

required
schemaVersionstring

The version of the schema on which the object is based.

optional
insertAfterstring

The position of the new object. The new object will be added after the specified one.

If null, the new object will be placed in the last position.

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 ordered parameter is set to true).

optional

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.

The object doesn't provide any parameters.

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.

json
[ { "objectId": "Y2ktaGdyb3VwLTEyMythZjhjOThlOS0wN2I0LTMyMGEtOTQzNi02NTEyMmVlNWY4NGQ=", "externalId": "string", "schemaId": "builtin:container.built-in-monitoring-rule", "scope": "HOST-D3A3C5A146830A79", "value": { "autoMonitoring": true }, "schemaVersion": "1.0.0", "insertAfter": "Y2ktaGdyb3VwLTEyMythZjhjOThlOS0wN2I0LTMyMGEtOTQzNi02NTEyMmVlNWY4NGQ=" } ]

Response

Response codes

CodeTypeDescription
200SettingsObjectResponse[]

Success

207SettingsObjectResponse

Multi-status: different objects in the payload resulted in different statuses.

400SettingsObjectResponse

Failed. Schema validation failed.

403ErrorEnvelope

Failed. Forbidden.

404SettingsObjectResponse

Failed. The requested resource doesn't exist.

409SettingsObjectResponse

Failed. Conflicting resource.

Response body objects

The ResponseBody object

The object doesn't provide any parameters.

The SettingsObjectResponse object

The response to a creation- or update-request.

ElementTypeDescription
invalidValueSettingsValue

The value of the setting.

It defines the actual values of settings' parameters.

The actual content depends on the object's schema.

objectIdstring

For a successful request, the ID of the created or modified settings object.

codeinteger

The HTTP status code for the object.

errorError-

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.

The object doesn't provide any parameters.

The Error object

ElementTypeDescription
constraintViolationsConstraintViolation[]

A list of constraint violations

messagestring

The error message

codeinteger

The HTTP status code

The ConstraintViolation object

A list of constraint violations

ElementTypeDescription
parameterLocationstring-
The element can hold these values
  • HEADER
  • PATH
  • PAYLOAD_BODY
  • QUERY
locationstring-
messagestring-
pathstring-

Response body JSON model

json
[ { "invalidValue": { "autoMonitoring": true }, "objectId": "Y2ktaGdyb3VwLTEyMythZjhjOThlOS0wN2I0LTMyMGEtOTQzNi02NTEyMmVlNWY4NGQ=", "code": 1, "error": { "constraintViolations": [ { "parameterLocation": "HEADER", "location": "string", "message": "string", "path": "string" } ], "message": "string", "code": 1 } } ]