https://www.docusign.com/v2.1/accounts/{accountId}/templates/{templateId}/lockThis method locks the specified template and sets the time until the lock expires to prevent other users or recipients from changing the template. 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 a template) while the template is locked. If you do not provide the `lockToken` when accessing a locked template, 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> ``` ### Related topics - Common API Tasks: Locking and unlocking envelopes
The external account number (int) or account ID GUID.
The ID of the template.
{
"success": true,
"data": {
"id": "abc123",
"created_at": "2025-01-01T00:00:00Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters"
}
}1curl --request POST \2 --url 'https://www.docusign.com/v2.1/accounts/{accountId}/templates/{templateId}/lock' \3 --header 'accept: application/json' \4 --header 'content-type: application/json'1{2 "success": true,3 "data": {4 "id": "abc123",5 "created_at": "2025-01-01T00:00:00Z"6 }7}https://www.docusign.com/v2.1/accounts/{accountId}/templates/{templateId}/lockThis method locks the specified template and sets the time until the lock expires to prevent other users or recipients from changing the template. 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 a template) while the template is locked. If you do not provide the `lockToken` when accessing a locked template, 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> ``` ### Related topics - Common API Tasks: Locking and unlocking envelopes
The external account number (int) or account ID GUID.
The ID of the template.
{
"success": true,
"data": {
"id": "abc123",
"created_at": "2025-01-01T00:00:00Z"
}
}{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid request parameters"
}
}1curl --request POST \2 --url 'https://www.docusign.com/v2.1/accounts/{accountId}/templates/{templateId}/lock' \3 --header 'accept: application/json' \4 --header 'content-type: application/json'1{2 "success": true,3 "data": {4 "id": "abc123",5 "created_at": "2025-01-01T00:00:00Z"6 }7}