Acquire a document lock in Dynatrace with the Document API, preventing other users from updating the document while the lock is held.
| POST | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/document/v1/documents/{id}:acquire-lock |
Acquire the lock on the document. A user can lock a maximum of five documents at any given time. Once the lock is acquired by the user, other users cannot make any updates to the document.
The user acquiring the lock can optionally specify the duration for which the lock can be attained. However, the specified duration must not exceed the maximum allowed duration of 15 minutes. If not specified, the lock is acquired for 10 minutes.
If the user who has currently locked the document attempts to acquire the lock for the same document again, the duration of the lock gets extended by the specified duration or by a default duration of 10 minutes, if not specified.
The other users would not be allowed to acquire the lock on an already locked document.
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 |
|---|---|---|---|---|
| body | Acquire | Input to acquire the lock. | body | Optional |
AcquireLock objectInput to acquire the lock.
| Element | Type | Description | Required |
|---|---|---|---|
| documentVersion | integer | The latest version of the document. | Required |
| lockDurationInSeconds | integer | Duration specified in seconds to acquire the lock on the document. | Optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"documentVersion": 3,"lockDurationInSeconds": 20}
| Code | Type | Description |
|---|---|---|
| 200 | Acquire | The lock has been acquired by the user. |
| 400 | - | - |
| 401 | - | - |
| 403 | - | - |
| 404 | - | - |
| 409 | - | - |
| 429 | - | - |
| 500 | - | - |
| 503 | - | - |
| default | - | - |
AcquireLockResult object| Element | Type | Description |
|---|---|---|
| documentVersion | integer | The latest version of the document. |
| lockedUntil | string | Timestamp until the document remains locked. |
{"documentVersion": 3,"lockedUntil": "2023-08-10T05:11:11Z"}