---
title: "How to Apply Expiration Date for eSignature Requests via API"
description: "Automate eSignature expiration with BoldSign API to streamline workflows, boost accountability, and prevent outdated document access or delayed signings."
url: "https://boldsign.com/blogs/how-to-apply-expiration-date-for-esignature-requests-through-api/"
---

1. [Blog](https://boldsign.com/blogs.md)
2. [API](https://boldsign.com/category/api.md)

# How to Apply Expiration Date for eSignature Requests Through API

[Starvritsa Buhungi](https://boldsign.com/author/starvritsa-buhungi/) May 16, 2024 Updated March 27, 2026 3 min read

Ensuring documents are signed on time is essential. Setting an expiration date adds a layer of security to the document, ensuring it is only valid for a specified period.

You can configure an expiration date for your document through the BoldSign API by specifying the expiration value with the expiration date type. Once the expiration date is reached, the document will no longer be available for signing.

## Code snippets

Let’s see how to add expiration date via the BoldSign API in various programming languages.

```
curl -X 'POST' \
  'https://api.boldsign.com/v1/document/send' \
  -H 'accept: application/json' \
  -H 'X-API-KEY: {your API key}' \
  -H 'Content-Type: multipart/form-data' \
  -F 'Message={document message}' \
  -F 'Signers={
  "name": "alexgayle",
  "emailAddress": "alexgayle@boldsign.dev",
  "signerType": "Signer",
  "formFields": [
    {
      "id": "textbox1",
      "name": "textbox1",
      "filetype": "Textbox",
      "pageNumber": 1,
      "bounds": {
        "x": 140,
        "y": 140,
        "width": 82,
        "height": 32
      },
      "isRequired": true
    }
  ]
}' \
  -F 'ExpiryDays={The number of days after which the document expires}' \
  -F 'Files=@{your file}' \
  -F 'Title={title}' \
  -F 'ExpiryDateType={set the expirydatetype}' \
  -F 'ExpiryValue={expiryvalue}'
```

```
var apiClient = new ApiClient("https://api.boldsign.com", "{Your API key");
var documentClient = new DocumentClient(apiClient);
var documentFilePath = new DocumentFilePath
{
    ContentType = "application/pdf",
    FilePath = "{your file path}"
};
var filesToUpload = new List
{
    documentFilePath,
};
var signatureField = new FormField(
    id: "sign",
    isRequired: true,
    type: FieldType.Signature,
    pageNumber: 1,
    bounds: new Rectangle(x: 200, y: 200, width: 125, height: 25));
var formFieldCollections = new List()
{
    signatureField
};
var signer = new DocumentSigner(
    signerName: "David",
    signerEmail: "starvritsabuhungi@boldsign.dev",
    signerType: SignerType.Signer,
    formFields: formFieldCollections,
    locale: Locales.EN);
var documentSigners = new List()
{
    signer
};
var sendForSign = new SendForSign()
{
    Signers = documentSigners,
    Title = "Expiration date",
    ExpiryValue = {expiry value},
    ExpiryDateType = ExpiryDateType.Days,
    Files = filesToUpload
};
var documentCreated = documentClient.SendDocument(sendForSign);
Console.WriteLine(documentCreated.DocumentId);
```

```
import requests  # type: ignore
import json

url = "https://api.boldsign.com/v1/document/send"
signer_data = {
    "name": "starvritsa",
    "emailAddress": "starvritsabuhungi@boldsign.dev",
    "signerType": "Signer",
    "signerRole": "Signer",
    "formFields": [
        {
            "id": "signature",
            "name": "signature",
            "fieldType": "Signature",
            "pageNumber": 1,
            "bounds": {"x": 100, "y": 100, "width": 125, "height": 25},
            "isRequired": True,
        }
    ],
    "locale": "EN",
}
payload = {
    "Signers": json.dumps(signer_data),
    "Title": "Expiration date",
    "ExpiryValue": "10",
    "ExpiryDateType": "Days",
}

files = [("Files", ("{your file name}", open("{your file path}", "rb"), "application/pdf"))]
headers = {"accept": "application/json", "X-API-KEY": "{your Api key}"}
response = requests.post(url, headers=headers, data=payload, files=files)
print(response.text)
```

```
const axios = require("axios");
const FormData = require("form-data");
const fs = require("fs");
let data = new FormData();
data.append(
  "Signers",
  '{\r\n        "name": "starvritsa",\r\n        "emailAddress": "starvritsabuhungi@boldsign.dev",\r\n        "signerType": "Signer", \r\n        "signerRole": "Signer",\r\n        "formFields": [\r\n           {\r\n                "id": "signature",\r\n                "name": "signature",\r\n                "fieldType": "Signature",\r\n                "pageNumber": 1,\r\n                "bounds": {\r\n                  "x": 100,\r\n                  "y": 100,\r\n                  "width": 125,\r\n                  "height": 25\r\n                   },\r\n      "isRequired": true\r\n    }\r\n  ],\r\n  "locale": "EN",\r\n  "ExpiryValue": "10",\r\n  "ExpiryDateType": "Days"\r\n}',
);
data.append("Files", fs.createReadStream("{your file path}"));
data.append("Title", "Expiration date");
let config = {
  method: "post",
  maxBodyLength: Infinity,
  url: "https://api.boldsign.com/v1/document/send",
  headers: {
    "accept": "application/json",
    "X-API-KEY": "{Your API key}",
    ...data.getHeaders(),
  },
  data: data,
};
axios
  .request(config)
  .then((response) => {
    console.log(JSON.stringify(response.data));
  })
  .catch((error) => {
    console.log(error);
  });
```

```
<?php
require_once "vendor/autoload.php";
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
use \GuzzleHttp\Psr7\Utils;

$client = new GuzzleHttp\Client([
    'verify' => false,
]);

$headers = [
    'accept' => 'application/json',
    'X-API-KEY' => '{your api key}'
];

$options = [
    'multipart' => [
        [
            'name' => 'DisableExpiryAlert',
            'contents' => 'false'
        ],
        [
            'name' => 'Message',
            'contents' => 'please sign the document'
        ],
        [
            'name' => 'Signers',
            'contents' => '{
                "name": "starvritsa",
                "emailAddress": "starvritsabuhungi@boldsign.dev",
                "signerType": "Signer",
                "formFields": [
                    {
                        "id": "string",
                        "name": "string",
                        "fieldType": "Signature",
                        "pageNumber": 1,
                        "bounds": {
                            "x": 50,
                            "y": 50,
                            "width": 1,
                            "height": 1
                        },
                        "isRequired": true
                    }
                ],
                "locale": "EN"
            }'
        ],
        [
            'name' => 'ExpiryDays',
            'contents' => '10'
        ],
        [
            'name' => 'Files',
            'contents' => Utils::tryFopen('{your file path}', 'r'),
            'filename' => '{your file name}',
            'headers' => [
                'Content-Type' => 'application/pdf'
            ]
        ],
        [
            'name' => 'Title',
            'contents' => 'Expiration date'
        ],
        [
            'name' => 'ExpiryDateType',
            'contents' => 'Days'
        ],
        [
            'name' => 'ExpiryValue',
            'contents' => '10'
        ],
    ]
];

$request = new Request('POST', 'https://api.boldsign.com/v1/document/send', $headers);
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
```

## Conclusion

Incorporating expiration date into document workflows is a strategic move towards ensuring efficiency, [compliance](https://boldsign.com/legalcenter.md), and security. Organizations may enhance productivity, reduce wait times, and retain document control by utilizing solutions such as [BoldSign’s API](https://boldsign.com/esignature-api.md).

Begin your [30-day BoldSign Free trial](https://account.boldsign.com/signup?planId=1018\&utm_source=boldsignblogs\&utm_medium=redirect\&utm_campaign=boldsign) today and unlock its full potential. We value your feedback, so please share your thoughts below. If you have any questions or need more information about our services, don’t hesitate to [Schedule a demo](https://boldsign.com/request-demo.md) or reach out to our support team through our [Support Portal](https://support.boldsign.com/support/tickets/create).

Topics [API integration](https://boldsign.com/blogs/tag/api-integration.md)

## Sign documents 3x faster

Send, sign and manage documents securely and efficiently.

[Try it today](https://account.boldsign.com/signup?planId=1018\&utm_source=boldsignblogs\&utm_medium=redirect\&utm_campaign=boldsign)

## Starvritsa Buhungi

Starvritsa is a Technical Assistant at BoldSign, channelling her passion into crafting top-tier content for users through meticulous documentation. She creates content across various formats, including API tutorials, help articles, and comprehensive guides.

[More posts by Starvritsa Buhungi](https://boldsign.com/author/starvritsa-buhungi/)

## Related posts

- [API](https://boldsign.com/category/api.md) September 29, 2026 10 min read

  ## [How to Migrate from Docusign Without Losing Templates or Workflow Continuity](https://boldsign.com/blogs/migrate-from-docusign.md)

  Learn how to migrate from Docusign while protecting templates, signed records, and active workflows. Explore key risks, a practical checklist, and next steps.

- [API](https://boldsign.com/category/api.md) September 25, 2026 10 min read

  ## [Build vs Buy an eSignature API: What Should You Choose?](https://boldsign.com/blogs/build-vs-buy-esignature-api-guide.md)

  Compare the real cost, compliance risk, launch speed, and maintenance burden of building vs buying an eSignature API before you commit.

- [API](https://boldsign.com/category/api.md) September 22, 2026 9 min read

  ## [What Are the Common Challenges When Using Signature APIs in Software Development](https://boldsign.com/blogs/common-signature-api-challenges.md)

  Explore the common challenges developers face with a Signature API, from authentication issues to PDF rendering, webhooks, templates, and rate limits.

Get started

## Sign up for your free trial today!

[Start free trial](https://account.boldsign.com/signup?planId=1018)

- 30-day free trial
- No credit card required

*Picture: A completed employment contract: signed by John Doe on 11/03/2026, all parties have signed*
