How to Change the Recipient of an eSignature Document via API

how-to-change-the-recipient-of-an-esignature-document-via-api
how-to-change-the-recipient-of-an-esignature-document-via-api

Table of Contents

Sign Docs 3x Faster

Send, sign, and manage documents securely and efficiently.

Summarize the blog post with:

Sending a document to the wrong signer can be stressful. BoldSign provides a straightforward option to change the recipient if the signer has yet to sign. This guide outlines the steps to do that.

Editing the recipient via BoldSign API

BoldSign provides an API that allows you to programmatically change the recipient of a document by providing the following details:

  • Document ID
  • New signer details
  • Old signer email
  • Reason for changing the signer

The recipients of the document cannot be changed if the signing process is in any one of the following states:

  • Signed
  • Declined
  • Revoked
  • Expired

If the document had two or more recipients and either of the recipients has signed, you can still edit the recipients that have yet to sign the document. The old recipient will receive an email notification regarding the changes made.

Code snippets

The following are the code examples in different programming languages to assist you in achieving this task.


curl -X 'PATCH' \ 
'https://api.boldsign.com/v1/document/changeRecipient?documentId={Your document Id}' \ 
-H 'X-API-KEY: {your API key}' \ 
-H 'Content-Type: application/json' \ 
-d '{ 
"newSignerName": "{New signer name}", 
"reason": "{Reason to change signer}", 
"newSignerEmail": "{New signer email}", 
"oldSignerEmail": "{Old signer email}" 
}'  
    

        var apiClient = new ApiClient("https://api.boldsign.com", "{your API key}"); 
var documentClient = new DocumentClient(apiClient); 
 
documentClient.ChangeRecipient( 
"{Your document Id}", 
"{Old signer email}", 
"{Reason to change signer}", 
"{New signer name}", 
"{New signer email}" 
);  

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) 
 
change_recipient_request = boldsign.ChangeRecipient( 
old_signer_email=" old_signer_email ", 
new_signer_name="New signer name", 
new_signer_email=" new_signer_email ", 
reason="Reason to change signer" 
) 
 
response = document_api.change_recipient( 
document_id="Your_document_Id", 
change_recipient=change_recipient_request 
)  

<?php
require_once "vendor/autoload.php"; 
 
use BoldSign\Configuration; 
use BoldSign\Api\DocumentApi; 
use BoldSign\Model\ChangeRecipient; 
 
$config = new Configuration(); 
$config->setHost('https://api.boldsign.com'); 
$config->setApiKey('YOUR_API_KEY'); 
 
$documentApi = new DocumentApi($config); 
 
$documentId = 'YOUR_DOCUMENT_ID'; 
$oldSignerEmail = '[email protected]'; 
$newSignerEmail = '[email protected]'; 
$newSignerName = 'John Doe'; 
$reason = 'Signer replacement requested'; 
 
$changeRecipient = new ChangeRecipient(); 
 
$changeRecipient->setOldSignerEmail($oldSignerEmail); 
$changeRecipient->setNewSignerEmail($newSignerEmail); 
$changeRecipient->setNewSignerName($newSignerName); 
$changeRecipient->setReason($reason); 
 
$documentApi->changeRecipient($documentId, $changeRecipient);  
     

ApiClient apiClient = Configuration.getDefaultApiClient(); 
            apiClient.setApiKey("YOUR_API_KEY"); 
            DocumentApi documentApi = new DocumentApi(apiClient); 
            String documentId = "DOCUMENT_ID";  
            String oldSignerEmail = "[email protected]";  
            String reason = "Wrongly sent";  
            String newSignerName = "David";  
            String newSignerEmail = "[email protected]";   
            ChangeRecipient changeRecipient = new ChangeRecipient(); 
            changeRecipient.setOldSignerEmail(oldSignerEmail); 
            changeRecipient.setReason(reason); 
            changeRecipient.setNewSignerName(newSignerName); 
            changeRecipient.setNewSignerEmail(newSignerEmail); 
            documentApi.changeRecipient(documentId, changeRecipient); 
            System.out.println("Recipient changed successfully for document ID: " + documentId); 
        }  
        catch (ApiException e)  
        { 
            System.err.println("API call failed: " + e.getMessage()); 
        }  
        catch (Exception e)  
        { 
            System.err.println("An unexpected error occurred: " + e.getMessage()); 
        } 
    } 
} 
    

import { DocumentApi, ChangeRecipient } from "boldsign"; 
 
const documentApi = new DocumentApi("https://api.boldsign.com"); 
documentApi.setApiKey("YOUR_API_KEY"); 
 
// Create request object 
const changeRecipient = new ChangeRecipient(); 
changeRecipient.newSignerName = "David"; 
changeRecipient.newSignerEmail = "[email protected]"; 
changeRecipient.oldSignerEmail = "[email protected]"; 
changeRecipient.reason = "Wrongly sent"; 
 
const documentId = "YOUR_DOCUMENT_ID"; 
 
async function changeDocumentRecipient() { 
try { 
await documentApi.changeRecipient(documentId, changeRecipient); 
console.log("Recipient changed successfully!"); 
} catch (error: any) { 
console.error("Error occurred while calling the API:", error.message); 
} 
} 
 
changeDocumentRecipient(); 
    

Conclusion

Fixing errors when you send documents for signature doesn’t need to be difficult. Using BoldSign’s API, you can easily change the recipient of an unsigned document, making sure it gets to the right person. Start your 30-day free BoldSign trial today and see how easy is to change your document recipients for yourself.

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 or reach out to our support team through our support portal.

Like what you see? Share with a friend.

Latest blog posts

How a Retention of Title Clause Protects Consigned Goods

How a Retention of Title Clause Protects Consigned Goods

Learn how a retention of title clause protects consigned goods, preserves ownership rights, and reduces creditor risks when a consignee becomes insolvent.

How to Sign a Document Online with a Legally Valid Electronic Signature

How to Sign a Document Online with a Legally Valid Electronic Signature

Learn how to sign documents online with legally valid electronic signatures, meet U.S. legal requirements, and use key features that strengthen your proof.

E-Signature Audit Trail: What It Records and Why It Matters

E-Signature Audit Trail: What It Records and Why It Matters

See what an e-signature audit trail records, why it matters for UETA, HIPAA, and eIDAS compliance, and how BoldSign automates it for every signed document.

Sign up for your free trial today!

  • Yes
    30-day free trial
  • Yes
    No credit card required
  • Yes
    30-day free trial
  • Yes
    No credit card required
Sign up for a free BoldSign trial