Update a settings object in Dynatrace with the App Settings API, using optimistic locking and optional admin access to change stored values.
| PUT | SaaS | https://{your-environment-id}.apps.dynatrace.com/v2/objects/{object-id} |
You provide the object ID path parameter and the required optimistic-locking-version query parameter, plus optional admin-access. In the request body, you send value and can place items with insertAfter or insertBefore; the response confirms success.
To execute this request, you need a platform token or OAuth access token with app-settings:objects:write scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| object-id | string | The ID of the required settings object | path | Required |
| optimistic-locking-version | string | The version of the object for optimistic locking. You can use it to detect simultaneous modifications by different users. It is generated upon retrieval (GET requests). If set on update (PUT request) or deletion, the update/deletion will be allowed only if there wasn't any change between the retrieval and the update. | query | Required |
| admin-access | boolean | If set to true and user has app-settings:objects:admin permission, the endpoint will act as if the user is the owner of all objects | query | Optional |
| body | App | The JSON body of the request. Contains updated parameters of the settings object. | body | Required |
AppSettingsObjectUpdate objectAn update of a settings object.
| Element | Type | Description | Required |
|---|---|---|---|
| value | App | The value of the setting. It defines the actual values of settings' parameters. The actual content depends on the object's schema. | Required |
| insertAfter | string | The position of the updated object. The new object will be moved behind the specified one. insertAfter and insertBefore are evaluated together and only one of both can be set. If If set to empty string, the updated 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 | Optional |
| insertBefore | string | The position of the updated object. The new object will be moved in front of the specified one. insertAfter and insertBefore are evaluated together and only one of both can be set. If If set to empty string, the updated object will be placed in the last position. Only applicable for objects based on schemas with ordered objects (schema's ordered parameter is set to | Optional |
AppSettingsValue objectThe value of the setting.
It defines the actual values of settings' parameters.
The actual content depends on the object's schema.
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"value": {"autoMonitoring": true},"insertAfter": "Y2ktaGdyb3VwLTEyMythZjhjOThlOS0wN2I0LTMyMGEtOTQzNi02NTEyMmVlNWY4NGQ=","insertBefore": "Y2ktaGdyb3VwLTEyMythZjhjOThlOS0wN2I0LTMyMGEtOTQzNi02NTEyMmVlNWY4NGQ="}
| Code | Type | Description |
|---|---|---|
| 200 | App | Success |
| 400 | Error | Failed. The input is invalid. |
| 403 | Error | Failed. Forbidden. |
| 404 | Error | Failed. The requested resource doesn't exist. |
| 409 | - | - |
| 429 | - | - |
| 503 | - | - |
| 4XX | - | - |
| 5XX | - | - |
AppSettingsUpdateResponse objectThe response to an update request.
| Element | Type | Description |
|---|---|---|
| version | string | The version of the object for optimistic locking. You can use it to detect simultaneous modifications by different users. It is generated upon retrieval (GET requests). If set on update (PUT request) or deletion, the update/deletion will be allowed only if there wasn't any change between the retrieval and the update. |
ErrorResponse object| Element | Type | Description |
|---|---|---|
| error | Error | Standard error response |
Error objectStandard error response
| Element | Type | Description |
|---|---|---|
| code | number | The error code (HTTP response) |
| message | string | The error message |
| retryAfterSeconds | number | Number of seconds a request can be retried after a 'too many requests' error response. |
| details | Error | Optional details of the error |
ErrorDetails objectOptional details of the error
| Element | Type | Description |
|---|---|---|
| errorRef | string | reference to the error occurrence in the internal self-monitoring, logging, etc. |
| constraintViolations | Constraint | A list of constraint violations of input parameters (path, query, request body) |
| missingScopes | string[] | In case of a 403 - Forbidden response, a list of missing scopes necessary to successfully execute the request |
ConstraintViolation objectContains information about a constraint violation caused by invalid input.
| Element | Type | Description |
|---|---|---|
| path | string | The path of the parameter that caused the constraint violation |
| message | string | The constraint violation description message |
| parameterLocation | string | Describes the general location of the violating parameter The element can hold these values
|
{"version": "Y2ktaGdyb3VwLTEyMythZjhjOThlOS0wN2I0LTMyMGEtOTQzNi02NTEyMmVlNWY4NGQ="}
{"error": {"code": 1,"message": "string","retryAfterSeconds": 1,"details": {"errorRef": "string","constraintViolations": [{"path": "string","message": "string","parameterLocation": "PATH"}],"missingScopes": ["string"]}}}