BoldSign AI Assistant
Chat with the BoldSign AI AssistantHow to Extend Expiry Date for Documents
In cases where a signer is unable to complete the signing process within the initial expiry date, BoldSign provides the flexibility to extend the expiry date of the document. This extension can only be performed by the sender and account admins. It's important to note that this action cannot be used to reduce the expiry date of a document, and it can only be applied to documents that have not been signed yet.
Follow these steps to extend the expiry date of a document using the BoldSign API
Check expiry type and date
Before extending the expiry date, you need to retrieve the existing expiry type and expiry date of the document from the document properties.
The following code snippets demonstrate how to obtain the document properties using the API
Code snippet
curl -X 'GET' \ 'https://api.boldsign.com/v1/document/properties?documentId={documentId}' \
-H 'accept: application/json' \
-H 'X-API-KEY: {your-api-key}'
var apiClient = new ApiClient("https://api.boldsign.com", "{your API key}");
var documentClient = new DocumentClient(apiClient);
var documentProperties = documentClient.GetProperties("{documentId}");
import boldsign
configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key = "YOUR_API_KEY")
with boldsign.ApiClient(configuration) as api_client:
document_api = boldsign.DocumentApi(api_client)
document_properties = document_api.get_properties(document_id = "YOUR_DOCUMENT_ID")
<?php require_once "vendor/autoload.php";
use BoldSign\Configuration;
use BoldSign\Api\DocumentApi;
$config = new Configuration();
$config->setHost("https://api.boldsign.com");
$config->setApiKey('YOUR_API_KEY');
$document_api = new DocumentApi($config);
$document_properties = $document_api->getProperties($document_id = 'YOUR_DOCUMENT_ID');
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");
DocumentApi documentApi = new DocumentApi(client);
DocumentProperties documentProperties = documentApi.getProperties("YOUR_DOCUMENT_ID");
import { DocumentApi } from "boldsign";
const documentApi = new DocumentApi("https://api.boldsign.com");
documentApi.setApiKey("YOUR_API_KEY");
const documentProperties = documentApi.getProperties("YOUR_DOCUMENT_ID");
In the provided examples, replace documentId with the actual ID of the document for which you need to extend the expiry time. Once executed, the document properties will be retrieved in JSON, including expiryDateType and expiryValue.
Here, expiryDateType could be Days, Hours, or SpecificDateTime, while expiryValue will be a timestamp. You can convert this timestamp into a human-readable DateTime format.
Extending the document expiry
The following code snippets demonstrate how to extend the document's expiry using the API:
Code snippet
curl -X PATCH "https://api.boldsign.com/v1/document/extendExpiry?documentId={documentId}"
-H 'X-API-KEY: {your API key}'
-H "Content-Type: application/json"
-d "{\"newExpiryValue\": \"2022-12-15\", \"warnPrior\": true}"
var apiClient = new ApiClient("https://api.boldsign.com", "{apikey}");
var documentclient = new DocumentClient(apiClient);
await documentclient.ExtendExpiryAsync("{documentId}", "2022-12-15", true).ConfigureAwait(false);
import boldsign
configuration = boldsign.Configuration(host = "https://api.boldsign.com", api_key = "YOUR_API_KEY")
with boldsign.ApiClient(configuration) as api_client:
document_api = boldsign.DocumentApi(api_client)
extend_expiry = boldsign.ExtendExpiry(
newExpiryValue = "YOUR_EXPIRY_DATE",
warnPrior = True
)
document_api.extend_expiry(
document_id = "YOUR_DOCUMENT_ID",
extend_expiry = extend_expiry
)
<?php require_once "vendor/autoload.php";
use BoldSign\Configuration;
use BoldSign\Api\DocumentApi;
use BoldSign\Model\ExtendExpiry;
$config = new Configuration();
$config->setHost("https://api.boldsign.com");
$config->setApiKey('YOUR_API_KEY');
$document_api = new DocumentApi($config);
$extend_expiry = new ExtendExpiry();
$extend_expiry->setNewExpiryValue('YOUR_EXPIRY_DATE');
$extend_expiry->setWarnPrior(true);
$document_api->extendExpiry($document_id = 'YOUR_DOCUMENT_ID', $extend_expiry);
ApiClient client = Configuration.getDefaultApiClient();
client.setBasePath("https://api.boldsign.com");
client.setApiKey("YOUR_API_KEY");
DocumentApi documentApi = new DocumentApi(client);
ExtendExpiry extendExpiry = new ExtendExpiry();
extendExpiry.setNewExpiryValue("YOUR_EXPIRY_DATE");
extendExpiry.setWarnPrior(true);
documentApi.extendExpiry("YOUR_DOCUMENT_ID", extendExpiry);
import { DocumentApi, ExtendExpiry } from "boldsign";
const documentApi = new DocumentApi();
documentApi.setApiKey("YOUR_API_KEY");
const extendExpiry = new ExtendExpiry();
extendExpiry.newExpiryValue = "YOUR_EXPIRY_DATE";
extendExpiry.warnPrior = true;
documentApi.extendExpiry("YOUR_DOCUMENT_ID", extendExpiry);
In the provided examples, replace documentId with the ID of the document that requires an extended expiry date. Adjust newExpiryValue based on the expiryDateType you obtained from the document properties. If the expiryDateType is Days, set the value in "yyyy-MM-dd" format (e.g., "2023-12-20"). If it is Hours, use an integer (e.g., "12"). For SpecificDateTime, use an ISO date-time format (e.g., "2023-12-20T01:30:00.000-05:00"). Ensure that newExpiryValue is greater than the original expiryValue.
Replace warnPrior with true or false to enable or disable sending a reminder one day before the new expiration date.
Upon executing the code, the document's expiry date will be successfully extended to the specified date.