Create a settings object in Dynatrace with the App Settings API, validating or saving schemaId, value, and insertAfter data.
| POST | SaaS | https://{your-environment-id}.apps.dynatrace.com/v2/objects |
You create a new settings object by sending the schemaId, value, and optional insertAfter fields in the request body. If you set validate-only to true, Dynatrace runs validation only and returns success when no validation errors occur.
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 |
|---|---|---|---|---|
| validate-only | boolean | If | query | Optional |
| body | App | The JSON body of the request. Contains the settings object. | body | Required |
AppSettingsObjectCreate objectConfiguration of a new settings object.
| Element | Type | Description | Required |
|---|---|---|---|
| schemaId | string | The schema on which the object is based. | 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 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 |
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.
{"schemaId": "jira-connection","value": {"autoMonitoring": true},"insertAfter": "Y2ktaGdyb3VwLTEyMythZjhjOThlOS0wN2I0LTMyMGEtOTQzNi02NTEyMmVlNWY4NGQ="}
| Code | Type | Description |
|---|---|---|
| 200 | - | Success. No validation errors. |
| 201 | App | Created |
| 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 | - | - |
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
|
{"error": {"code": 1,"message": "string","retryAfterSeconds": 1,"details": {"errorRef": "string","constraintViolations": [{"path": "string","message": "string","parameterLocation": "PATH"}],"missingScopes": ["string"]}}}