> You are reading the Docusign Developer Documentation. For clean Markdown of any page, append .md to the page URL.
>
> Documentation indexes by section:
> - APIs and SDKs: https://docusign.docs.buildwithfern.com/docs/llms.txt
> - Platform 101: https://docusign.docs.buildwithfern.com/platform/llms.txt
> - Extension Apps: https://docusign.docs.buildwithfern.com/extension-apps/llms.txt
> - Docusign CLI: https://docusign.docs.buildwithfern.com/docusign-cli/llms.txt
>
> Authentication (OAuth, JWT Grant, M2M): https://docusign.docs.buildwithfern.com/platform/auth
> Webhooks and Connect: https://docusign.docs.buildwithfern.com/platform/webhooks
>
> OpenAPI specifications: https://docusign.docs.buildwithfern.com/openapi.json
> MCP server: https://docusign.docs.buildwithfern.com/_mcp/server

# TemplateLocks Resource

The TemplateLocks resource provides methods that allow you to
manage locks on a template.

To prevent users from changing a template while another user is
modifying it, you can lock the template and set the time until
the lock expires.

For example, you would use the following flow:

1. Lock the template.
2. Make changes to template.
3. Delete the template lock and save the changes. If the template has a password, you must supply the template password to save the changes.

**Note:** To use template locks, the user must have envelope locking capability enabled.

## Methods supported

| Method                                                                  | Description                                                                                          |
| ----------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| [create](/docs/esign-rest-api/reference/templates/templatelocks/create) | POST `/restapi/v2.1/accounts/{accountId}/templates/{templateId}/lock` Locks a template.              |
| [delete](/docs/esign-rest-api/reference/templates/templatelocks/delete) | DEL `/restapi/v2.1/accounts/{accountId}/templates/{templateId}/lock` Deletes a template lock.        |
| [get](/docs/esign-rest-api/reference/templates/templatelocks/get)       | GET `/restapi/v2.1/accounts/{accountId}/templates/{templateId}/lock` Gets template lock information. |
| [update](/docs/esign-rest-api/reference/templates/templatelocks/update) | PUT `/restapi/v2.1/accounts/{accountId}/templates/{templateId}/lock` Updates a template lock.        |

## TemplateLocks properties

| Property                | Type         | Description                                                                                                                                                                                                                           |
| ----------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `errorDetails`          | errorDetails | This object describes errors that occur. It is only valid for responses and ignored in requests.                                                                                                                                      |
| `lockDurationInSeconds` | string       | The number of seconds until the lock expires when there is no activity on the template. If no value is entered, then the default value of 300 seconds is used. The maximum value is 1,800 seconds. The lock duration can be extended. |
| `lockedByApp`           | string       | Specifies the friendly name of the application that is locking the envelope.                                                                                                                                                          |
| `lockedByUser`          | userInfo     | A complex type containing information about the user that has the envelope or template locked.                                                                                                                                        |
| `lockedUntilDateTime`   | string       | The date and time that the lock expires.                                                                                                                                                                                              |
| `lockToken`             | string       | A unique identifier provided to the owner of the lock. You must use this token with subsequent calls to prove ownership of the lock.                                                                                                  |
| `lockType`              | string       | The type of lock. Currently `edit` is the only supported type.                                                                                                                                                                        |
| `useScratchPad`         | string       | When **true,** a scratchpad is used to edit information.                                                                                                                                                                              |