Skip to navigation

Lock envelope

View as Markdown

This method locks the specified envelope and sets the time until the lock expires to prevent other users or recipients from changing the envelope.

The response to this request includes a lockToken parameter that you must use in the X-DocuSign-Edit header for every PUT method (typically a method that updates an envelope) while the envelope is locked.

If you do not provide the lockToken when accessing a locked envelope, you will get the following error:

{
"errorCode": "EDIT_LOCK_NOT_LOCK_OWNER",
"message": "The user is not the owner of the lock. The template is locked by another user or in another application"
}

The X-DocuSign-Edit header

The X-DocuSign-Edit header looks like this and can be specified in either JSON or XML.

JSON

{
"LockToken": "token-from-response",
"LockDurationInSeconds": "600"
}

XML

<DocuSignEdit>
<LockToken>token-from-response</LockToken>
<LockDurationInSeconds>600</LockDurationInSeconds>
</DocuSignEdit>

In the actual HTTP header, you would remove the linebreaks:

X-DocuSign-Edit: {"LockToken": "token-from-response", "LockDurationInSeconds": "600" }
or
X-DocuSign-Edit:<DocuSignEdit><LockToken>token-from-response</LockToken><LockDurationInSeconds>600</LockDurationInSeconds></DocuSignEdit>

Authentication

AuthorizationBearer

OAuth 2.0 access token (JWT or auth-code grant). Sent as Authorization: Bearer <token> on every request except GET /v2.1 and GET /service_information, which are public discovery endpoints.

Path parameters

accountIdstringRequired

The external account number (int) or account ID Guid.

envelopeIdstringRequired

The envelope’s GUID.

Example: 93be49ab-xxxx-xxxx-xxxx-f752070d71ec

Request

This endpoint expects an object: lockRequest

lockDurationInSecondsstringOptional

The configured value is not used; the timeout is hardcoded to 600 seconds. To use a different timeout, implement a custom timer and explicitly control locking and unlocking.

lockedByAppstringOptional
A friendly name of the application used to lock the envelope. Will be used in error messages to the user when lock conflicts occur.
lockTypestringOptional

The type of lock. Currently edit is the only supported type.

templatePasswordstringOptional

The password for the template. If you are using a lock for a template that has a password or an envelope that is based on a template that has a password, you must enter the templatePassword to save the changes.

useScratchPadstringOptional

When true, a scratchpad is used to edit information.

Response

Successful response.
errorDetailsobjectOptional
This object describes errors that occur. It is only valid for responses, and ignored in requests.
lockDurationInSecondsstringOptional

The number of seconds to lock the envelope for editing. This value must be greater than 0 seconds.

lockedByAppstringOptional

The human-readable name of the application that is locking the envelope or template. This value displays to the user in error messages when lock conflicts occur.

lockedByUserobjectOptional
lockedUntilDateTimestringOptional
The date and time that the lock expires.
lockTokenstringOptional
A unique identifier provided to the owner of the lock. You must use this token with subsequent calls to prove ownership of the lock.
lockTypestringOptional

The type of lock. Currently edit is the only supported type.

useScratchPadstringOptional

When true, a scratchpad is used to edit information.

Errors

400
Bad Request Error