Articles in this section
Category / Section

How to schedule and send documents via API?

Published:
4 mins read

The schedule send feature allows users to automate document delivery by setting a specific date and time for sending. Once scheduled, the system will automatically send the documents to recipients at the designated time.

To schedule a document for sending, configure the scheduledSendTime property to define the exact date and time for sending the document. This value should be provided in Unix Timestamp format (e.g, 1744279200). The minimum value for this option should be 30 minutes from the current time and the maximum value must be set to a time earlier than the expiry date.

Scheduled documents will appear on the My Documents page with the status Scheduled to be sent along with the scheduled date and time.

Below is an example code snippet demonstrating how to schedule and send documents via API:

cUrl

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=' \
     -F 'Signers={
        "name": "Hanky",
        "emailAddress": "hankyWhites@cubeflakes.com",
        "signerType": "Signer",
        "deliveryMode": "Email",
        "formFields": [
           {
                "id": "string",
                "name": "string",
                "fieldType": "Signature",
                "pageNumber": 1,
                "bounds": {
                  "x": 50,
                  "y": 50,
                  "width": 1,
                  "height": 1
                   },
      "isRequired": true
    }
  ],
  "locale": "EN"
}' \
  -F 'Files=@{your file}' \
  -F 'scheduledSendTime=1745107200' \
  -F 'Title={title}' \

.Net

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<IDocumentFile>
{
    documentFilePath,
};

var signatureField = new FormField(
   id: "sign",
   isRequired: true,
   type: FieldType.Signature,
   pageNumber: 1,
   bounds: new Rectangle(x: 100, y: 100, width: 100, height: 50));

var formFieldCollections = new List<FormField>()
{
    signatureField
};

var signer = new DocumentSigner(
    signerName: "David",
    signerType: SignerType.Signer,
    signerEmail: "david@cubeflakes.com",
    formFields: formFieldCollections,
    locale: Locales.EN);

signer.DeliveryMode = DeliveryMode.Email;

var documentSigners = new List<DocumentSigner>()
{
    signer
};

var sendForSign = new SendForSign()
{
    Message = "please sign this",
    Title = "Agreement",
    Signers = documentSigners,
    Files = filesToUpload,
    ScheduledSendTime = 1745107200, 
};

var documentCreated = documentClient.SendDocument(sendForSign);

Python

import boldsign

configuration = boldsign.Configuration(
    api_key = "Your API Key"
)

with boldsign.ApiClient(configuration) as api_client:
    
    document_api = boldsign.DocumentApi(api_client)

    
    signatureField = boldsign.FormField(
        fieldType="Signature",  
        pageNumber=1,  
        bounds=boldsign.Rectangle(x=100, y=100, width=100, height=50),  
    )


    signer = boldsign.DocumentSigner(
        name="David",  
        emailAddress="hankwhite@cubeflakes.com", 
        signerType="Signer",  
        formFields=[signatureField]  
    )


    send_for_sign = boldsign.SendForSign(
        title="Agreement",  
        signers=[signer],  
        files=["Your file path.pdf"],
        scheduledSendTime=1745107200,  
         
    )
    
   
    api_response = document_api.send_document(send_for_sign=send_for_sign)
    

PHP

<?php require_once "vendor/autoload.php";
 
use BoldSign\Configuration;
use BoldSign\Api\DocumentApi;
use BoldSign\Model\{FormField, Rectangle, DocumentSigner, SendForSign, FileInfo};
 
$config = new Configuration();
$config->setApiKey('YOUR_API_KEY');
 
$document_api = new DocumentApi($config);
 
$form_field = new FormField();
$form_field->setFieldType('Signature');
$form_field->setPageNumber(1);
$bounds = new Rectangle([100, 100, 100, 50]);
$form_field->setBounds($bounds);
 
$document_signer = new DocumentSigner();
$document_signer->setName("David");
$document_signer->setEmailAddress("david@cubeflakes.com");
$document_signer->setSignerType("Signer");
$document_signer->setFormFields([$form_field]);
 
$send_for_sign = new SendForSign();
$files = new FileInfo();
$files = 'YOUR_FILE_PATH';
$send_for_sign->setFiles([$files]);
$send_for_sign->setSigners([$document_signer]);
$send_for_sign->setTitle('Document SDK API');
 
$send_for_sign->setScheduledSendTime(1745107200);
 
$document_created = $document_api->sendDocument($send_for_sign);

Java

ApiClient client = Configuration.getDefaultApiClient();  
client.setApiKey("YOUR_API_KEY");
 
DocumentApi documentApi = new DocumentApi(client);
 
FormField signatureField = new FormField();
signatureField.setFieldType(FormField.FieldTypeEnum.SIGNATURE);
signatureField.setPageNumber(1);
Rectangle bounds = new Rectangle().x(100f).y(100f).width(100f).height(50f);
signatureField.setBounds(bounds);
 
DocumentSigner signer = new DocumentSigner();
signer.setName("David");
signer.setEmailAddress("david@cubeflakes.com");
signer.setSignerType(DocumentSigner.SignerTypeEnum.SIGNER);
signer.setFormFields(Arrays.asList(signatureField));
 
SendForSign sendForSign = new SendForSign();
File file = new File("YOUR_FILE_PATH");  
sendForSign.setFiles(Arrays.asList(file));
sendForSign.setSigners(Arrays.asList(signer));
sendForSign.setTitle("Document SDK API");
 

sendForSign.setScheduledSendTime(1745107200); 
 
DocumentCreated documentCreated = documentApi.sendDocument(sendForSign);

Node.js

import { DocumentApi, DocumentSigner, FormField, Rectangle, SendForSign } from "boldsign"; 
import * as fs from 'fs';

const documentApi = new DocumentApi();
documentApi.setApiKey("Your API Key");

const bounds = new Rectangle();
bounds.x = 100;
bounds.y = 50;
bounds.width = 100;
bounds.height = 100;

const formField = new FormField();
formField.fieldType = FormField.FieldTypeEnum.Signature;
formField.pageNumber = 1;
formField.bounds = bounds;

const documentSigner = new DocumentSigner();
documentSigner.name = "David";
documentSigner.emailAddress = "david@cubeflakes.com";
documentSigner.signerType = DocumentSigner.SignerTypeEnum.Signer;
documentSigner.formFields = [formField];

const files = fs.createReadStream("Your file path");

const sendForSign = new SendForSign();
sendForSign.title = "Agreement";
sendForSign.signers = [documentSigner];
sendForSign.files = [files]
sendForSign.scheduledSendTime= 1745107200;

const sendDocumentResponse =documentApi.sendDocument(sendForSign);

In the above code examples, specify the scheduleSendTime value as per your preference. Once executed, the document will be scheduled for sending at the defined date and time.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Access denied
Access denied