> 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

# How to schedule an envelope

> Describes how to create an envelope and automatically send it at a specific time.

eSignature REST API 2.1 only

This topic demonstrates how to schedule an envelope using the [Scheduled sending](/docs/esign-rest-api/esign101/concepts/recipients/scheduled-sending) feature.

> **Note**
>
> Run this code example from our [Quickstart](/docs/esign-rest-api/quickstart) or launcher projects: [Bash](https://github.com/docusign/code-examples-bash), [C#](https://github.com/docusign/code-examples-csharp), [Java](https://github.com/docusign/code-examples-java), [Node.js](https://github.com/docusign/code-examples-node), [PHP](https://github.com/docusign/code-examples-php), [PowerShell](https://github.com/docusign/code-examples-powershell), [Python](https://github.com/docusign/code-examples-python), or [Ruby](https://github.com/docusign/code-examples-ruby).

## Required data

Running the code in this how-to requires this data:

| Data element          | Description                                                                                                                                                                                                                                                                                                            |
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| \{API_ACCOUNT_ID}     | A [GUID](http://guid.one/) value that identifies your account. This value is automatically generated by Docusign for any account you create. Copy the value from the **API Account ID** field on the [Apps and Keys](https://admindemo.docusign.com/authenticate?goTo=appsAndKeys) page.                               |
| \{BASE_PATH}          | A string value that forms the root of the URL required to make API calls. The base path value in the example code is set to target the developer environment at https\://\<domain>/restapi Where \<domain> is demo.docusign.net for the developer environment and is the result of the GetUserInfo call in production. |
| \{DOCS_PATH}          | A string value for the file path to the folder containing the documents you want to include in the [envelope](/docs/esign-rest-api/esign101/concepts/envelopes).                                                                                                                                                       |
| \{DOCUMENT_ID}        | A document identifier such as a name or ID. You can get a [list of envelope documents](/docs/esign-rest-api/how-to/list-envelope-documents) to obtain this information.                                                                                                                                                |
| Document to be signed | You must provide at least one document to be signed. Document used in this how-to:- [PDF file](https://github.com/docusign/code-examples-java/blob/master/src/main/resources/World_Wide_Corp_lorem.pdf)                                                                                                                |
| \{RECIPIENT_ID}       | A unique string value that you assign to identify each recipient. This value assigns tabs on a per-[recipient](/docs/esign-rest-api/esign101/concepts/recipients) basis.                                                                                                                                               |
| \{SCHEDULED_DATE}     | The date and time when the envelope will be sent to the signer represented as a string formatted as ISO8601 DATETIME.                                                                                                                                                                                                  |
| \{SIGNER_EMAIL}       | A string value for the email address where the signer will receive a notification of the signing request.                                                                                                                                                                                                              |
| \{SIGNER_NAME}        | A string value for the full name of the signer.                                                                                                                                                                                                                                                                        |

## Step 1. Obtain your OAuth token

To make the API call shown in this how-to, you need a valid OAuth access token. Docusign supports access tokens for three different recommended OAuth grant types: Public Authorization Code Grant, Confidential Authorization Code Grant, and JSON Web Token (JWT) Grant. Choose the OAuth grant type appropriate for your scenario.

> **Note**
>
> See [Confidential Authorization Code Grant](/platform/auth/authcode#confidential-authorization-code-grant) for guidance on your options to get an Confidential Authorization Code Grant  OAuth token.

![Three icons that represent the three methods a user can use to obtain an OAuth token: JSON Web Token (JWT), Public Authorization Code Grant (ACG), and Confidential Authorization Code grant](/_fern-files/_img/64f473773042ee439449a096bf7673292b1585b86a4ccc55f82ba0dda41f61a1.webp)

## Step 2. Construct the request body

Next, create the request body. Construct an envelope definition with one signer. Add a `workflow` section to the envelope definition. The `scheduledSending` section of the workflow indicates when the envelope should be sent to the recipient. `SCHEDULED_DATE` indicates the exact date and time that the envelope will be sent.

**`Bash`**

```bash title="Bash"
printf \
'{
    "emailSubject": "Please sign this document set",
    "documents": [
        {
            "documentBase64": "' >> $request_data
            cat $doc1_base64 >> $request_data
            printf '",
            "name": "Lorem Ipsum",
            "fileExtension": "pdf",
            "documentId": "1"
        }
    ],
    "workflow": {
        "scheduledSending": {
            "rules": [{
                "resumeDate": "'"${SCHEDULED_DATE}"'"
            }]
        }
    },
    "recipients": {
        "signers": [
            {
                "email": "'"${SIGNER_EMAIL}"'",
                "name": "'"${SIGNER_NAME}"'",
                "recipientId": "1",
                "routingOrder": "1",
                "tabs": {
                    "signHereTabs": [
                        {
                            "anchorString": "/sn1/",
                            "anchorUnits": "pixels",
                            "anchorXOffset": "20",
                            "anchorYOffset": "10"
                        }
                    ]
                }
            }
        ]
    },
    "status": "sent"
}' >> $request_data
```

**`C#`**

```csharp title="C#"
// The envelope has a single recipient.
// recipient 1 - signer
// read file from a local directory
// The reads could raise an exception if the file is not available!
string docPdfBytes = Convert.ToBase64String(System.IO.File.ReadAllBytes(docPdf));

// create the envelope definition
EnvelopeDefinition env = new EnvelopeDefinition();
env.EmailSubject = "Please sign this document set";

// Create document objects, one per document
Document doc = new Document
{
    DocumentBase64 = docPdfBytes,
    Name = "Lorem Ipsum", // can be different from actual file name
    FileExtension = "pdf",
    DocumentId = "1",
};

// The order in the docs array determines the order in the envelope
env.Documents = new List<Document> { doc };

// create a signer recipient to sign the document, identified by name and email
// We're setting the parameters via the object creation
Signer signer1 = new Signer
{
    Email = signerEmail,
    Name = signerName,
    RecipientId = "1",
    RoutingOrder = "1",
};

// Add the workflow rule that sets the schedule for the envelope to be sent
Workflow workflow = new Workflow { ScheduledSending = new DocuSign.eSign.Model.ScheduledSending() };
var rule = new EnvelopeDelayRule();
rule.ResumeDate = resumeDate.ToString("MM/dd/yyyy");
workflow.ScheduledSending.Rules = new List<EnvelopeDelayRule> { rule };
env.Workflow = workflow;

// routingOrder (lower means earlier) determines the order of deliveries
// to the recipients. Parallel routing order is supported by using the
// same integer as the order for two or more recipients.

// Create signHere fields (also known as tabs) on the document,
// We're using anchor (autoPlace) positioning
//
// The DocuSign platform searches throughout your envelope's
// documents for matching anchor strings.
SignHere signHere = new SignHere
{
    AnchorString = "/sn1/",
    AnchorUnits = "pixels",
    AnchorYOffset = "10",
    AnchorXOffset = "20",
};

// Tabs are set per recipient / signer
Tabs signer1Tabs = new Tabs
{
    SignHereTabs = new List<SignHere> { signHere },
};
signer1.Tabs = signer1Tabs;

// Add the recipients to the envelope object
Recipients recipients = new Recipients
{
    Signers = new List<Signer> { signer1 },
};
env.Recipients = recipients;

// Request that the envelope be sent by setting |status| to "sent".
// To request that the envelope be created as a draft, set to "created"
env.Status = "sent";
```

**`Java`**

```java title="Java"
Tabs signerTabs = EnvelopeHelpers.createSignerTabs(
        EnvelopeHelpers.createSignHere("/sn1/", ANCHOR_OFFSET_Y, ANCHOR_OFFSET_X));

// Create a signer recipient to sign the document, identified by name
// and email. We're setting the parameters via the object creation.
// RoutingOrder (lower means earlier) determines the order of deliveries
// to the recipients. Parallel routing order is supported by using the
// same integer as the order for two or more recipients.
Signer signer = new Signer();
signer.setEmail(signerEmail);
signer.setName(signerName);
signer.setRecipientId("1");
signer.setRoutingOrder("1");
signer.setTabs(signerTabs);

// The order in the docs array determines the order in the envelope
EnvelopeDefinition envelope = new EnvelopeDefinition();
envelope.setEmailSubject("Please sign this document");
envelope.setDocuments(List.of(
        EnvelopeHelpers.createDocumentFromFile(PDF_DOCUMENT_FILE_NAME, PDF_DOCUMENT_NAME, "1")));
envelope.setRecipients(EnvelopeHelpers.createSingleRecipient(signer));

// Add the workflow to schedule the envelope with a delay
EnvelopeDelayRule delayRule = new EnvelopeDelayRule();

delayRule.setResumeDate(resumeDate + "T00:00:00Z");

ScheduledSending scheduledSending = new ScheduledSending();
scheduledSending.setRules(List.of(delayRule));

Workflow workflow = new Workflow();
workflow.setScheduledSending(scheduledSending);
envelope.setWorkflow(workflow);

// Request that the envelope be sent by setting |status| to "sent".
// To request that the envelope be created as a draft, set to "created"
envelope.setStatus(status);

return envelope;
```

**`Node.js`**

```javascript title="Node.js"
let docPdfBytes;
// read files from a local directory
// The reads could raise an exception if the file is not available!
docPdfBytes = fs.readFileSync(args.docPdf);

// create the envelope definition
let env = new docusign.EnvelopeDefinition();
env.emailSubject = 'Please sign this document';

// add the document
let doc = new docusign.Document();
let docb64 = Buffer.from(docPdfBytes).toString('base64');
doc.documentBase64 = docb64;
doc.name = 'Lorem Ipsum'; // can be different from actual file name
doc.fileExtension = 'pdf'; // Source data format. Signed docs are always pdf.
doc.documentId = '1'; // a label used to reference the doc

// The order in the docs array determines the order in the envelope
env.documents = [doc];

// create a signer recipient to sign the document, identified by name and email
// We're setting the parameters via the object constructor
let signer1 = docusign.Signer.constructFromObject({
  email: args.signerEmail,
  name: args.signerName,
  recipientId: '1',
  routingOrder: '1',
});
// routingOrder (lower means earlier) determines the order of deliveries
// to the recipients. Parallel routing order is supported by using the
// same integer as the order for two or more recipients.

// Create a workflow model
// Add the workflow rule that sets the schedule for the envelope to be sent
const rule = docusign.EnvelopeDelayRule.constructFromObject({
  resumeDate: args.resumeDate.toString()
});
const scheduledSendingModel = docusign.ScheduledSending.constructFromObject({
  rules: [rule]
});

const workflow = docusign.Workflow.constructFromObject({
  scheduledSending: scheduledSendingModel
});
env.workflow = workflow;

// Create a signHere field (also known as a tab) on the document,
// We're using anchor (autoPlace) positioning
//
// The DocuSign platform searches throughout your envelope's
// documents for matching anchor strings.
let signHere1 = docusign.SignHere.constructFromObject({
    anchorString: '/sn1/',
    anchorYOffset: '10',
    anchorUnits: 'pixels',
    anchorXOffset: '20',
  });
// Tabs are set per recipient / signer
let signer1Tabs = docusign.Tabs.constructFromObject({
  signHereTabs: [signHere1],
});
signer1.tabs = signer1Tabs;

// Add the recipients to the envelope object
let recipients = docusign.Recipients.constructFromObject({
  signers: [signer1]
});
env.recipients = recipients;

// Request that the envelope be sent by setting |status| to "sent".
// To request that the envelope be created as a draft, set to "created"
env.status = 'sent';
```

**`PHP`**

```php title="PHP"
$envelope_definition = CreateAnEnvelopeFunctionService::makeEnvelope(
    $args,
    $clientService,
    $demoDocsPath,
    $docDocx,
    $docPDF
);

# Create the signer recipient model
$signer = new Signer([
    'email' => $args['signer_email'], 'name' => $args['signer_name'],
    'recipient_id' => "1", 'routing_order' => "1"
    ]);
# routingOrder (lower means earlier) determines the order of deliveries
# to the recipients. Parallel routing order is supported by using the
# same integer as the order for two or more recipients.

return ScheduledSendingService::addSignerToTheDelivery($signer, $envelope_definition, $args);
    }

    public static function addSignerToTheDelivery($signer, $envelope_definition, $args)
    {
# Create signHere fields (also known as tabs) on the documents,
# We're using anchor (autoPlace) positioning
#
# The DocuSign platform searches throughout your envelope's
# documents for matching anchor strings. So the
# signHere2 tab will be used in both document 2 and 3 since they
#  use the same anchor string for their "signer 1" tabs.
$sign_here1 = new SignHere([
                               'anchor_string' => '**signature_1**', 'anchor_units' => 'pixels',
                               'anchor_y_offset' => '10', 'anchor_x_offset' => '20']);
$sign_here2 = new SignHere([
                               'anchor_string' => '/sn1/', 'anchor_units' =>  'pixels',
                               'anchor_y_offset' => '10', 'anchor_x_offset' => '20']);

# Add the tabs model (including the sign_here tabs) to the signer
# The Tabs object wants arrays of the different field/tab types
$signer->setTabs(new Tabs([
                               'sign_here_tabs' => [$sign_here1, $sign_here2]]));

# Add the recipients to the envelope object
$recipients = new Recipients([
                                 'signers' => [$signer]]);
$envelope_definition->setRecipients($recipients);

# Add the workflow to schedule the envelope with a delay
$rule = new EnvelopeDelayRuleApiModel([
    'resume_date' => $args['resumeDate']
]);
$scheduled_sending = new DelayedRoutingApiModel([
    'rules' => [$rule]
]);
$workflow = new Workflow([
    'scheduled_sending'  =>  $scheduled_sending]);

$envelope_definition->setWorkflow($workflow);

# Request that the envelope be sent by setting |status| to "sent".
# To request that the envelope be created as a draft, set to "created"
$envelope_definition->setStatus($args["status"]);
```

**`PowerShell`**

```text title="PowerShell"
@{
    emailSubject = "Please sign this document set";
    documents    = @(
        @{
            documentBase64 = "$(Get-Content $docBase64)";
            name           = "Lorem Ipsum";
            fileExtension  = "pdf";
            documentId     = "1";
        }; );
    workflow = @{
            scheduledSending =  @{
            rules =  @(
            @{
                resumeDate =  $ResumeDate;
            }; );
        };
    };
    recipients   = @{
        signers      = @(
            @{
                email        = $variables.SIGNER_EMAIL;
                name         = $variables.SIGNER_NAME;
                recipientId  = "1";
                routingOrder = "1";
                tabs         = @{
                    signHereTabs = @(
                        @{
                            anchorString  = "**signature_1**";
                            anchorUnits   = "pixels";
                            anchorXOffset = "20";
                            anchorYOffset = "10";
                        };
                        @{
                            anchorString  = "/sn1/";
                            anchorUnits   = "pixels";
                            anchorXOffset = "20";
                            anchorYOffset = "10";
                        };
                    );
                };
            };
        );
    };
    status       = "sent";
} | ConvertTo-Json -Depth 32 > $requestData
```

**`Python`**

```python title="Python"
# document 1 (PDF)  has sign here anchor tag /sn1/
#
# The envelope has one recipient.
# recipient 1 - signer

# create the envelope definition
env = EnvelopeDefinition(
    email_subject="Please sign this document"
)

with open(path.join(demo_docs_path, doc_pdf_path), "rb") as file:
    doc1_pdf_bytes = file.read()
doc1_b64 = base64.b64encode(doc1_pdf_bytes).decode("ascii")

# Create the document models
document1 = Document(  # create the DocuSign document object
    document_base64=doc1_b64,
    name="Lorem Ipsum",  # can be different from actual file name
    file_extension="pdf",  # many different document types are accepted
    document_id="1"  # a label used to reference the doc
)
# The order in the docs array determines the order in the envelope
env.documents = [document1]

# Create the signer recipient model
signer1 = Signer(
    email=args["signer_email"],
    name=args["signer_name"],
    recipient_id="1",
    routing_order="1"
)
# routingOrder (lower means earlier) determines the order of deliveries
# to the recipients. Parallel routing order is supported by using the
# same integer as the order for two or more recipients.

# Create signHere fields (also known as tabs) on the documents,
# We're using anchor (autoPlace) positioning

sign_here1 = SignHere(
    anchor_string="/sn1/",
    anchor_units="pixels",
    anchor_y_offset="10",
    anchor_x_offset="20"
)

# Add the tabs model (including the sign_here tabs) to the signer
# The Tabs object wants arrays of the different field/tab types
signer1.tabs = Tabs(sign_here_tabs=[sign_here1])

# Add the recipients to the envelope object
recipients = Recipients(signers=[signer1])
env.recipients = recipients

workflow = Workflow()
scheduled_sending_api_model = ScheduledSending()
workflow.scheduled_sending = scheduled_sending_api_model

envelope_delay_rule = EnvelopeDelayRule()
envelope_delay_rule.resume_date = args["resume_date"] + "T00:00:00.000Z"
workflow.scheduled_sending.rules = [envelope_delay_rule]
env.workflow = workflow

# Request that the envelope be sent by setting |status| to "sent".
# To request that the envelope be created as a draft, set to "created"
env.status = args["status"]
```

**`Ruby`**

```ruby title="Ruby"
# Create the envelope definition
envelope_definition = DocuSign_eSign::EnvelopeDefinition.new

envelope_definition.email_subject = 'Please sign this document'

# Add the document
# Read file from a local directory
# The reads could raise an exception if the file is not available!
doc_pdf = Rails.application.config.doc_pdf
doc_b64 = Base64.encode64(File.binread(File.join('data', doc_pdf)))

# Create the document model
document = DocuSign_eSign::Document.new(
  # Create the Docusign document object
  documentBase64: doc_b64,
  name: 'Lorem Ipsum', # Can be different from actual file name
  fileExtension: 'pdf', # Many different document types are accepted
  documentId: '1' # A label used to reference the doc
)

# The order in the docs array determines the order in the envelope
envelope_definition.documents = [document]

# Create the signer recipient model
signer1 = DocuSign_eSign::Signer.new
signer1.email = envelope_args[:signer_email]
signer1.name = envelope_args[:signer_name]
signer1.recipient_id = '1'
signer1.routing_order = '1'
## routingOrder (lower means earlier) determines the order of deliveries
# to the recipients. Parallel routing order is supported by using the
# same integer as the order for two or more recipients

# Create a signHere field (also known as a tab) on the document
# We're using anchor (autoPlace) positioning
#
# The Docusign platform searches throughout your envelope's documents for matching
# anchor strings.
sign_here = DocuSign_eSign::SignHere.new(
  anchorString: '/sn1/',
  anchorYOffset: '10',
  anchorUnits: 'pixels',
  anchorXOffset: '20'
)
# Add the tabs model (including the sign_here tabs) to the signer
# The Tabs object takes arrays of the different field/tab types
signer1_tabs = DocuSign_eSign::Tabs.new({
                                          signHereTabs: [sign_here]
                                        })

signer1.tabs = signer1_tabs

# Add the recipients to the envelope object
recipients = DocuSign_eSign::Recipients.new(
  signers: [signer1]
)
envelope_definition.recipients = recipients

# Create recipientRules model
rule = DocuSign_eSign::EnvelopeDelayRule.new(
  resumeDate: envelope_args[:resume_date].to_s
)

scheduled_sending = DocuSign_eSign::ScheduledSending.new(
  rules: [rule]
)

workflow = DocuSign_eSign::Workflow.new(scheduledSending: scheduled_sending)
# Add the workflow to the envelope object
envelope_definition.workflow = workflow

# Request that the envelope be sent by setting status to "sent".
# To request that the envelope be created as a draft, set status to "created"
envelope_definition.status = envelope_args[:status]
```

## Step 3. Call the eSignature REST API

Now that you have constructed your API headers and request body, you can schedule the envelope with the [Envelopes:create](/docs/esign-rest-api/reference/envelopes/envelopes/create) method. Here’s how you make the call, but make sure to substitute your API account ID for \{ACCOUNT_ID}.

> **Note**
>
> View the source code for this how-to on GitHub: [Bash](https://github.com/docusign/code-examples-bash/blob/master/examples/eSignature/eg035ScheduledSending.sh), [C#](https://github.com/docusign/code-examples-csharp/blob/master/launcher-csharp/eSignature/Examples/ScheduledSending.cs), [Java](https://github.com/docusign/code-examples-java/blob/master/src/main/java/com/docusign/controller/eSignature/examples/EG035ControllerScheduledSending.java), [Node.js](https://github.com/docusign/code-examples-node/blob/master/lib/eSignature/examples/scheduledSending.js), [PHP](https://github.com/docusign/code-examples-php/blob/master/src/Services/Examples/eSignature/ScheduledSendingService.php), [PowerShell](https://github.com/docusign/code-examples-powershell/blob/master/examples/eSignature/eg035ScheduledSending.ps1), [Python](https://github.com/docusign/code-examples-python/blob/master/app/eSignature/examples/eg035_scheduled_sending.py), or [Ruby](https://github.com/docusign/code-examples-ruby/blob/master/app/services/e_sign/eg035_scheduled_sending_service.rb).

**`Bash`**

```bash title="Bash"
curl --header "Authorization: Bearer ${ACCESS_TOKEN}" \
     --header "Content-Type: application/json" \
     --data-binary @${request_data} \
     --request POST ${base_path}/v2.1/accounts/${account_id}/envelopes \
     --output $response
```

**`C#`**

```csharp title="C#"
EnvelopesApi envelopesApi = new EnvelopesApi(docuSignClient);
var results = envelopesApi.CreateEnvelopeWithHttpInfo(accountId, env);
results.Headers.TryGetValue("X-RateLimit-Remaining", out string remaining);
results.Headers.TryGetValue("X-RateLimit-Reset", out string reset);

if (reset != null && remaining != null)
{
    DateTime resetDate = DateTimeOffset.FromUnixTimeSeconds(long.Parse(reset)).UtcDateTime;
    Console.WriteLine("API calls remaining: " + remaining);
    Console.WriteLine("Next Reset: " + resetDate);
}
```

**`Java`**

```java title="Java"
var results = envelopesApi.createEnvelopeWithHttpInfo(
        session.getAccountId(),
        envelope,
        envelopesApi.new CreateEnvelopeOptions());
Map<String, List<String>> headers = results.getHeaders();
java.util.List<String> remaining = headers.get("X-RateLimit-Remaining");
List<String> reset = headers.get("X-RateLimit-Reset");

if (remaining != null & reset != null) {
    Instant resetInstant = Instant.ofEpochSecond(Long.parseLong(reset.get(0)));
    System.out.println("API calls remaining: " + remaining);
    System.out.println("Next Reset: " + resetInstant);
}
```

**`Node.js`**

```javascript title="Node.js"
let results = await envelopesApi.createEnvelope(args.accountId, {
  envelopeDefinition: envelope,
}, (error, data, response) => {
   const headers = response?.headers;

   const remaining = headers?.['x-ratelimit-remaining'];
   const reset = headers?.['x-ratelimit-reset'];

   if (remaining && reset) {
     const resetInstant = new Date(Number(reset) * 1000);

     console.log(`API calls remaining: ${remaining}`);
     console.log(`Next Reset: ${resetInstant.toISOString()}`);
   }
  });
```

**`PHP`**

```php title="PHP"
$envelopeResponse = $envelope_api->createEnvelopeWithHttpInfo($args['account_id'], $envelope_definition);

$remaining = $envelopeResponse[2]['X-RateLimit-Remaining'] ?? null;
$reset =  $envelopeResponse[2]['X-RateLimit-Reset'] ?? null;

if ($remaining !== null && $reset !== null) {
    $resetInstant = (new DateTime())->setTimestamp((int)$reset);
    error_log("API calls remaining: $remaining");
    error_log("Next Reset: " . $resetInstant->format(\DateTime::ATOM));
}
```

**`PowerShell`**

```text title="PowerShell"
Invoke-RestMethod `
    -Uri "${apiUri}/v2.1/accounts/${accountId}/envelopes" `
    -Method 'POST' `
    -Headers @{
    'Authorization' = "Bearer $accessToken";
    'Content-Type'  = "application/json";
} `
    -InFile (Resolve-Path $requestData).Path `
    -OutFile $response

Write-Output "Response: $(Get-Content -Raw $response)"
```

**`Python`**

```python title="Python"
api_client = create_api_client(base_path=args["base_path"], access_token=args["access_token"])
envelopes_api = EnvelopesApi(api_client)
(results, status, headers) = envelopes_api.create_envelope_with_http_info(account_id=args["account_id"], envelope_definition=envelope_definition)

remaining = headers.get("X-RateLimit-Remaining")
reset = headers.get("X-RateLimit-Reset")

if remaining is not None and reset is not None:
    reset_date = dt.fromtimestamp(int(reset), tz=timezone.utc)
    print(f"API calls remaining: {remaining}")
    print(f"Next Reset: {reset_date}")
```

**`Ruby`**

```ruby title="Ruby"
results, _status, headers = envelope_api.create_envelope_with_http_info args[:account_id], envelope_definition

remaining = headers['X-RateLimit-Remaining']
reset = headers['X-RateLimit-Reset']

if remaining && reset
  reset_date = Time.at(reset.to_i).utc
  puts "API calls remaining: #{remaining}"
  puts "Next Reset: #{reset_date}"
end
```

## Expected response

If you run this code example from our Quickstart or launcher projects, you should see a JSON response similar to the code shown.

In addition, the signer receives an email containing a signing link at the scheduled time that they can use to open and electronically sign a document using the Docusign mobile app or the Docusign website. After signing is complete, the recipient receives a carbon copy (CC) of the email that includes all of the completed and signed documents.

**`Sample response`**

```json title="Sample response"
{
  "envelopeId": "eead435f-xxxx-xxxx-xxxx-25b7d8523d2b",
  "uri": "/envelopes/eead435f-xxxx-xxxx-xxxx-25b7d8523d2b",
  "statusDateTime": "2020-08-18T23:36:26.8830000Z",
  "status": "sent"
}
```

## Next steps

* Run this code example from our [Quickstart](/docs/esign-rest-api/quickstart) or launcher projects:    [Bash](https://github.com/docusign/code-examples-bash), [C#](https://github.com/docusign/code-examples-csharp), [Java](https://github.com/docusign/code-examples-java), [Node.js](https://github.com/docusign/code-examples-node), [PHP](https://github.com/docusign/code-examples-php), [PowerShell](https://github.com/docusign/code-examples-powershell), [Python](https://github.com/docusign/code-examples-python), or [Ruby](https://github.com/docusign/code-examples-ruby).
* Learn more about [Scheduled sending](/docs/esign-rest-api/esign101/concepts/recipients/scheduled-sending).
* Learn [How to send an envelope with delayed routing](/docs/esign-rest-api/how-to/send-envelope-with-delayed-routing).
* See how to [Go-Live](/docs/esign-rest-api/go-live) with a completed app and find the base path for API calls in the production environment.