Skip to main content
Solved

How to set the envelope expire values eSignature

  • April 30, 2025
  • 2 replies
  • 125 views

Forum|alt.badge.img+1

Set the ExpireEnabled, ExpireAfter and ExpireDateTime using Docusign SDK 8 for C# and its not taking the values.
 

Key points :

  • Using Docusing SDK 8 with C#
  • Using developer account
  • I’m creating the envelope from a template.
  • I changed the expiration days in docuSign settings
  • These are the lines of code :
     

    // Get the envelope definition after configuration
    var envelopeDefinition = config.GetEnvelopeDefinition();

    // Set the envelope status to "sent". The signer will get an email from DocuSign
    envelopeDefinition.Status = "sent";

    // Set expiration date
    envelopeDefinition.ExpireEnabled = "true"; // Enable expiration
    envelopeDefinition.ExpireDateTime = DateTimeOffset.UtcNow.AddDays(14).ToString();
    envelopeDefinition.ExpireAfter = "14"; // Set expiration days

    // Initialize the EnvelopesApi client (reuse existing ApiClient)
    EnvelopesApi envelopesApi = new(this.ApiClient);

    // Create the envelope on DocuSign (it will not be sent due to the "created" status)
    EnvelopeSummary envelopeSummary = envelopesApi.CreateEnvelope(this.account.AccountId, envelopeDefinition);

    // Get envelope created to verify the expiration values
    Envelope envelope = envelopesApi.GetEnvelope(this.account.AccountId, envelopeSummary.EnvelopeId) ??
        throw new Exception($"Error cannot get envelope status.");

    Console.WriteLine($"ExpireEnabled: {envelope.ExpireEnabled}");   // displays "true"
    Console.WriteLine($"ExpireAfter: {envelope.ExpireAfter}");       // displays 120
    Console.WriteLine($"ExpireDateTime: {envelope.ExpireDateTime}"); // displays todaydate + 120 days
     

  • The envelope were created successfully but the “Expire” fields keeps taking the default value (120) even after I changed the default values in the DocuSign Admin settings.


What am I doing wrong ?

Best answer by Troy.Winterbottom

Hi,

 

Here is a great article that walks through it with examples: https://www.docusign.com/blog/developers/dsdev-common-api-tasks-add-reminders-and-expiration-to-an-envelope

It should be for example:

EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
var notification = new Notification();
notification.UseAccountDefaults = "false"; // customize the notification for this envelope
notification.Reminders = new Reminders
{
ReminderEnabled = "true",
ReminderDelay = "3", // first reminder to be sent three days after envelope was sent
ReminderFrequency = "2" // keep sending reminders every two days
};
notification.Expirations = new Expirations
{
ExpireEnabled = "true",
ExpireAfter = "30", // envelope will expire after 30 days
ExpireWarn = "2" // expiration reminder would be sent two days before expiration
};
envelopeDefinition.Notification = notification;

 

2 replies

Forum|alt.badge.img+5

Hi,

 

Here is a great article that walks through it with examples: https://www.docusign.com/blog/developers/dsdev-common-api-tasks-add-reminders-and-expiration-to-an-envelope

It should be for example:

EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition();
var notification = new Notification();
notification.UseAccountDefaults = "false"; // customize the notification for this envelope
notification.Reminders = new Reminders
{
ReminderEnabled = "true",
ReminderDelay = "3", // first reminder to be sent three days after envelope was sent
ReminderFrequency = "2" // keep sending reminders every two days
};
notification.Expirations = new Expirations
{
ExpireEnabled = "true",
ExpireAfter = "30", // envelope will expire after 30 days
ExpireWarn = "2" // expiration reminder would be sent two days before expiration
};
envelopeDefinition.Notification = notification;

 


Forum|alt.badge.img
  • Newcomer
  • November 6, 2025

Hi ,

While calling REST API service , I am trying to use override the Account expire setting , But still it is setting the expire date 120 days.

 

,"notification":{
"useAccountDefaults":false
,"reminders":{
"reminderEnabled":false
}
,"expirations":{
"expireEnabled":false
,"expireAfter":0
,"expireWarn":0
}
}

 

 

2) In Docusign Account setting

i) Reminders and Expiration section --Allow senders to override account defaults is ticked
ii) Expiration
Days before request expires:* --1
Days to warn signers before expiration:* -0

 

3- Envelope status showing 

    "expireEnabled": "true",
    "expireDateTime": "2026-02-05T09:13:09.0630000Z",
    "expireAfter": "91",
    "sender": {
        "userName": "ABC",
        "userId": "AA",
        "accountId": "AA",
        "email": "AA",
        "ipAddress": "AA"
    },

Can ‘expireEnabled’ can not set the false. I objective do not set expire date for envelope.

Thanks

Salil