Update a document in Dynatrace with the Document API, changing metadata or content and optionally creating a snapshot before the update.
| PATCH | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/document/v1/documents/{id} |
Update metadata and/or the content of the document.
Name, type, and content must be non-empty. Name, type, content, isPrivate and isReshareable are optional, but at least one of them must be provided.
isPrivate is deprecated - use the dedicated makePublic and
makePrivate operations instead to change a document's public visibility.
The document must be accessible to you - therefore, you must either own it or you have received access through sharing.
As part of this operation, you can optionally create a snapshot of the document before the update is applied. In that case, if the document has more than 50 snapshots, its oldest snapshot gets automatically deleted. A maximum of 5 snapshots can be created per document within a 60-second period.
To execute this request, you need a platform token or OAuth access token with document:documents:write scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| id | string | System-generated or user-given id of a document. | path | Required |
| optimistic-locking-version | string | To protect users from accidental overrides, the current version of the document must match the optimistic locking version parameter - otherwise, this request will fail and the entity is left unchanged. | query | Required |
| create-snapshot | boolean | Indicates whether a new snapshot of the document should be created before the update is applied. | query | Optional |
| admin-access | boolean | Indicates whether the operation should be performed with elevated permissions - additionally requires document:documents:admin. If provided, the user effectively operates as owner of all documents. This isn't supported for ready-made documents. | query | Optional |
| body | object | - | body | Required |
RequestBody object| Element | Type | Description | Required |
|---|---|---|---|
| name | string | The name of this document. This name doesn't need to be unique and is not used as identifier. Maximum length is 128 characters. Optional - if not provided, no change happens. | Optional |
| type | string | The type of this document. This type is not the Content-Type of the document, but instead adds a user-defined semantic. Maximum length is 128 characters. Optional - if not provided, no change happens. | Optional |
| description | string | Description of this document. Maximum length is 256 characters. Optional - if not provided, no change happens. | Optional |
| content | string | The binary content of this document. Its exact type is taken from the | Optional |
| snapshotDescription | string | An optional user-provided description of the snapshot's content or the changes it introduced. This description gets ignored if the query-param Maximum length is 128 characters. | Optional |
| labels | string[] | An optional set of user-defined labels. The maximum length of each label is 80 characters and the maximum number of labels is 25. Allowed characters: Optional - if not provided, no change happens. | Optional |
| boolean | DEPRECATED Deprecated - use the makePublic and makePrivate operations instead to change a document's public visibility. Controls whether this document should be public. Public documents can be read by every user of the environment. This can only be changed by the document owner. Optional - if not provided, no change happens. | Optional | |
| isReshareable | boolean | Controls whether users who receive write access via shares may re-share the document with other users. This can only be changed by the document owner. Optional - if not provided, no change happens. | Optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"name": "","type": "","description": "","content": "string","snapshotDescription": "","labels": null,"isPrivate": null,"isReshareable": null}
| Code | Description |
|---|---|
| 200 | - |
| 400 | - |
| 401 | - |
| 403 | - |
| 404 | - |
| 409 | - |
| 413 | - |
| 429 | - |
| 500 | - |
| 503 | - |
| 507 | - |
| default | - |