Edit Document
put/v1-beta/document/editThe Edit Document API allows users to modify the properties of an existing document and draft document. It facilitates updates to various properties such as the title, description, files, signers, and form fields associated with the document.
Partial Update
Users can execute partial updates to a document by specifying only the fields they intend to modify. The API will solely modify the provided fields, leaving the remainder unchanged.
When you need to update a files, signers or its form fields, you need to provide EditAction such as Add, Update, or Remove. So, if you need to update or remove a file, signer or their form fields, you will need to provide the file ID, signer ID and form field ID, which you can retrieve using the Document Properties API that returns all properties of a given document.
Asynchronous Document Processing
This API operates in two different modes based on the input provided in the request body. If the input contains the files, the API will process the request asynchronously. If the input does not contain the files, the API will process the request synchronously. This will be represented in the response as status with the value Queued or Completed, respectively.
The system will trigger either an Edited or EditFailed event, indicating the success or failure of the operation. In the event of failure, the system will send an EditFailed event along with an accompanying error message. It is imperative to address and resolve this error to ensure the proper operation in the next request.
Code Snippet
In the example request below, we are updating the document's description and a signer associated with the document, along with their form fields.
curl -X PUT 'https://api.boldsign.com/v1-beta/document/edit?documentId=2f0df291-xxxx-xxxx-xxxx-97719d93c8b7' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: {API-KEY}' \
-d '{
"Message": "Please sign this document.",
"Signers": [
{
"EditAction": "Update",
"Id": "4771b255-xxx-xxxx-xxxx-3819b11e4b3b",
"AuthenticationType": "EmailOTP",
"FormFields": [
{
"EditAction": "Update",
"Id": "signature_iYQVu",
"FieldType": "Initial",
"IsRequired": false
},
{
"EditAction": "Add",
"FieldType": "TextBox",
"Bounds": {
"X": 100,
"Y": 100,
"Width": 100,
"Height": 20
},
"IsRequired": false,
"PageNumber": 1
}
]
},
{
"EditAction": "Add",
"Name": "Signer",
"EmailAddress": "[email protected]",
"AuthenticationType": "AccessCode",
"AuthenticationCode": "1234",
"FormFields": [
{
"EditAction": "Add",
"FieldType": "Signature",
"Bounds": {
"X": 150,
"Y": 150,
"Width": 200,
"Height": 30
},
"IsRequired": true,
"PageNumber": 1
}
]
}
],
"Labels": ["Label1", "Label2"],
"ReminderSettings": {
"EnableAutoReminder": true,
"ReminderDays": 2,
"ReminderCount": 4
},
"DocumentDownloadOption": "Individually"
}'
var apiClient = new ApiClient("https://api.boldsign.com", "Your_API_Key");
var documentClient = new DocumentClient(apiClient);
var editDocumentRequest = new EditDocumentRequest()
{
DocumentId = "6f0cff9e-xxxx-xxxx-xxxx-a78e389964c2",
Message = "Please sign this document.",
Signers = new List<EditDocumentSigner>()
{
new EditDocumentSigner()
{
EditAction = EditAction.Update,
Id = "3ca6a81a-xxxx-xxxx-xxxx-f88e63f2ca6d",
AuthenticationType = AuthenticationType.EmailOTP,
FormFields = new List<EditFormField>()
{
new EditFormField()
{
EditAction = EditAction.Update,
Id = "signature_iYQVu",
Type = FieldType.Initial,
IsRequired = false,
},
new EditFormField()
{
EditAction = EditAction.Add,
Type = FieldType.TextBox,
IsRequired = false,
Bounds = new Rectangle()
{
X = 100,
Y = 100,
Width = 100,
Height = 20,
},
PageNumber = 1,
},
},
},
new EditDocumentSigner()
{
EditAction = EditAction.Add,
Name = "Signer",
EmailAddress = "[email protected]",
AuthenticationType = AuthenticationType.AccessCode,
AuthenticationCode = "1234",
FormFields = new List<EditFormField>()
{
new EditFormField()
{
EditAction = EditAction.Add,
Type = FieldType.Signature,
IsRequired = false,
Bounds = new Rectangle()
{
X = 150,
Y = 150,
Width = 200,
Height = 30,
},
PageNumber = 1,
},
},
},
},
Labels = new List<string>()
{
"Label1",
"Label2",
},
ReminderSettings = new ReminderSettings()
{
EnableAutoReminder = true,
ReminderCount = 4,
ReminderDays = 2,
},
};
documentClient.EditDocument(editDocumentRequest);
import boldsign
configuration = boldsign.Configuration(api_key="YOUR_API_KEY")
with boldsign.ApiClient(configuration) as api_client:
document_api = boldsign.DocumentApi(api_client)
document_id = "6f0cff9e-xxxx-xxxx-xxxx-a78e389964c2"
signer1 = EditDocumentSigner(
edit_action="Update",
id="3ca6a81a-xxxx-xxxx-xxxx-f88e63f2ca6d",
authentication_type="EmailOTP",
form_fields=[
EditFormField(
edit_action="Add",
fieldType="TextBox",
is_required=False,
bounds=Rectangle(x=100, y=100, width=100, height=20),
page_number=1
)
]
)
signer2 = EditDocumentSigner(
edit_action="Add",
name="Signer",
email_address="[email protected]",
authentication_type="AccessCode",
authentication_code="1234",
form_fields=[
EditFormField(
edit_action="Add",
type="Signature",
is_required=False,
bounds=Rectangle(x=150, y=150, width=200, height=30),
page_number=1
)
]
)
document_file = EditDocumentFile(
edit_action="Add",
file='YOUR_FILE_PATH'
)
edit_request = EditDocumentRequest(
message="Please sign this document.",
files=[document_file],
signers=[signer1],
labels=["Label1", "Label2"],
reminder_settings=ReminderSettings(
enable_auto_reminder=True,
reminder_count=4,
reminder_days=2
)
)
response = document_api.edit_document(document_id, edit_request)
<?php
require_once(__DIR__ . '/../vendor/autoload.php');
use BoldSign\Configuration;
use BoldSign\Api\DocumentApi;
use BoldSign\Model\EditDocumentRequest;
use BoldSign\Model\EditDocumentSigner;
use BoldSign\Model\EditFormField;
use BoldSign\Model\Rectangle;
use BoldSign\Model\ReminderSettings;
use BoldSign\Model\EditDocumentFile;
$config = new Configuration();
$config->setApiKey('YOUR_API_KEY');
$apiInstance = new DocumentApi($config);
$document_id = "6f0cff9e-xxxx-xxxx-xxxx-a78e389964c2";
$formField1 = new EditFormField();
$formField1->setEditAction("Update");
$formField1->setId("signature_iYQVu");
$formField1->setFieldType("Initial");
$formField1->setIsRequired(false);
$formField2 = new EditFormField();
$formField2->setEditAction("Add");
$formField2->setFieldType("TextBox");
$formField2->setIsRequired(false);
$formField2->setBounds(new Rectangle([100, 100, 100, 20]));
$formField2->setPageNumber(1);
$signer1 = new EditDocumentSigner();
$signer1->setEditAction("Update");
$signer1->setId("3ca6a81a-xxxx-xxxx-xxxx-f88e63f2ca6d");
$signer1->setAuthenticationType("EmailOTP");
$signer1->setFormFields([$formField1, $formField2]);
$formField3 = new EditFormField();
$formField3->setEditAction("Add");
$formField3->setFieldType("Signature");
$formField3->setIsRequired(false);
$formField3->setBounds(new Rectangle([150, 150, 200, 30]));
$formField3->setPageNumber(1);
$signer2 = new EditDocumentSigner();
$signer2->setEditAction("Add");
$signer2->setName("Signer");
$signer2->setEmailAddress("[email protected]");
$signer2->setAuthenticationType("AccessCode");
$signer2->setAuthenticationCode("1234");
$signer2->setFormFields([$formField3]);
$document1 = new EditDocumentFile();
$document1->setFileUrl("YOUR_FILE_URL");
$document1->setEditAction('Add');
$reminderSettings = new ReminderSettings();
$reminderSettings->setEnableAutoReminder(true);
$reminderSettings->setReminderCount(4);
$reminderSettings->setReminderDays(2);
$edit_document_request = new EditDocumentRequest();
$edit_document_request->setMessage('Please sign this document.');
$edit_document_request->setSigners([$signer1, $signer2]);
$edit_document_request->setFiles([$document1]);
$edit_document_request->setLabels(["Label1", "Label2"]);
$edit_document_request->setReminderSettings($reminderSettings);
$edit_document_response = $apiInstance->editDocument($document_id, $edit_document_request);
import * as fs from 'fs';
import {
DocumentApi,
EditDocumentFile,
EditDocumentRequest,
EditDocumentSigner,
EditFormField,
Rectangle,
ReminderSettings
} from '../api';
const documentApi = new DocumentApi();
documentApi.setApiKey("YOUR_API_KEY");
const documentId = "6f0cff9e-xxxx-xxxx-xxxx-a78e389964c2";
const bounds1 = new Rectangle();
bounds1.x = 100;
bounds1.y = 100;
bounds1.width = 100;
bounds1.height = 20;
const formField1 = new EditFormField();
formField1.editAction = EditFormField.EditActionEnum.Update;
formField1.id = "signature_iYQVu";
formField1.fieldType = EditFormField.FieldTypeEnum.Initial;
formField1.isRequired = false;
const formField2 = new EditFormField();
formField2.editAction = EditFormField.EditActionEnum.Add;
formField2.fieldType = EditFormField.FieldTypeEnum.TextBox;
formField2.isRequired = false;
formField2.bounds = bounds1;
formField2.pageNumber = 1;
const signer1 = new EditDocumentSigner();
signer1.editAction = EditDocumentSigner.EditActionEnum.Update;
signer1.id = "3ca6a81a-xxxx-xxxx-xxxx-f88e63f2ca6d";
signer1.authenticationType = EditDocumentSigner.AuthenticationTypeEnum.EmailOtp;
signer1.formFields = [formField1, formField2];
const bounds2 = new Rectangle();
bounds2.x = 150;
bounds2.y = 150;
bounds2.width = 200;
bounds2.height = 30;
const formField3 = new EditFormField();
formField3.editAction = EditFormField.EditActionEnum.Add;
formField3.fieldType = EditFormField.FieldTypeEnum.Signature;
formField3.isRequired = false;
formField3.bounds = bounds2;
formField3.pageNumber = 1;
const signer2 = new EditDocumentSigner();
signer2.editAction = EditDocumentSigner.EditActionEnum.Add;
signer2.name = "Signer";
signer2.emailAddress = "[email protected]";
signer2.authenticationType =EditDocumentSigner.AuthenticationTypeEnum.AccessCode;
signer2.authenticationCode = "1234";
signer2.formFields = [formField3];
const documentfile = new EditDocumentFile();
documentfile.file = fs.createReadStream("YOUR_FILE_PATH");
documentfile.editAction = EditDocumentFile.EditActionEnum.Add;
const reminderSettings = new ReminderSettings();
reminderSettings.enableAutoReminder = true;
reminderSettings.reminderCount = 4;
reminderSettings.reminderDays = 2;
const editDocumentRequest = new EditDocumentRequest();
editDocumentRequest.message = "Please review and sign the attached document.";
editDocumentRequest.signers = [signer1, signer2];
editDocumentRequest.files = [documentfile];
editDocumentRequest.labels = ["Label1", "Label2"];
editDocumentRequest.reminderSettings = reminderSettings;
const editDocumentResponse = await documentApi.editDocument(documentId, editDocumentRequest);
ApiClient apiClient = Configuration.getDefaultApiClient();
apiClient.setApiKey("YOUR_API_KEY");
DocumentApi documentApi = new DocumentApi(apiClient);
Rectangle bounds = new Rectangle();
bounds.setX(50f);
bounds.setY(100f);
bounds.setWidth(100f);
bounds.setHeight(60f);
EditFormField formField = new EditFormField();
formField.setEditAction(EditFormField.EditActionEnum.ADD);
formField.setFieldType(EditFormField.FieldTypeEnum.SIGNATURE);
formField.setPageNumber(1);
formField.setBounds(bounds);
EditDocumentSigner signers = new EditDocumentSigner();
signers.setEmailAddress("[email protected]");
signers.setName("signername");
signers.setFormFields(Arrays.asList(formField));
signers.setEditAction(EditDocumentSigner.EditActionEnum.ADD);
EditDocumentFile document1 = new EditDocumentFile();
document1.setEditAction(EditDocumentFile.EditActionEnum.ADD);
document1.setFileUrl( new URI( "YOUR_FILE_URL"));
EditDocumentRequest editDocumentJsonRequest = new EditDocumentRequest();
editDocumentJsonRequest.setSigners(Arrays.asList(signers));
editDocumentJsonRequest.setMessage("Updated documments");
editDocumentJsonRequest.setFiles(Arrays.asList(document1));
String documentId = "6f0cff9e-xxxx-xxxx-xxxx-a78e389964c2";
documentApi.editDocument(documentId, editDocumentJsonRequest);
Request Body
Filesarray | Details of the files to be edited. One or more files can be specified.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Titlestring | This is the title of the document that will be displayed in the BoldSign user interface and in the signature request email. Note : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Messagestring | A message for all recipients. You can include instructions that the signer should know before signing the document. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Signersarray | Details of the signers to be edited. One or more signers can be specified.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CCarray | Email IDs of the CC recipients. One or more CC recipients can be specified.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
EnableSigningOrderNullable boolean | Enables or disables the signing order. If this is enabled, then the signers can sign the document in the specified order and will not be able to sign in parallel. The default value is Note : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ExpiryDateTypeNullable enum | This specifies the type of expiry date for the document. They are Days, Hours, and SpecificDateTime. The default value is Days. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ExpiryValueNullable long | This specifies the expiry value for the document based on the ExpiryDateType selected. The default value is 60 days. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ReminderSettings.EnableAutoReminderboolean | Enables or disables the auto reminder. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ReminderSettings.ReminderDaysinteger | The number of days between each automatic reminder. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ReminderSettings.ReminderCountinteger | The number of times the auto reminder should be sent. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DisableEmailsNullable boolean | Disables the sending of document-related emails to all recipients. The default value is false. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DisableSMSNullable boolean | Disables the sending of document-related SMS to all recipients. The default value is false. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
BrandIdstring | You can customize the logo, colors, and other elements of the signature request emails and document signing pages to match your company branding. The ID of the existing brand can be obtained from the branding API and from the web app. Note : | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| HideDocumentIdNullable boolean | Decides whether the document ID should be hidden or not. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Labelsarray | Labels (tags) are added to the document to categorize and filter the documents. One or more labels can be added. Labels cannot contain whitespaces and must not exceed 255 characters. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| UseTextTagsboolean | When enabled, it will convert all the tags defined in the document to BoldSign form fields. The default value is false. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TextTagDefinitionsarray | This can be used for long text tag handling.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EnablePrintAndSignNullable boolean | Allows the signer to print and sign the document. The default value is false. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EnableReassignNullable boolean | Allows the signer to reassign the signature request to another person. The default value is true. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DisableExpiryAlertNullable boolean | Disables the alert that will be sent one day before the document's expiry. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DocumentInfoarray | Options to customize the information, such as the title and description of the document for a particular signer.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| OnBehalfOfstring | Email ID of the user to send the document on behalf of them. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DocumentDownloadOptionNullable enum | This option allows you to configure how the uploaded files, especially multiple files, should be downloaded: either as a single combined document or as separate documents. The values are Combined and Individually. The default value is Combined. If the value is null, the setting configured in the business profile will be considered. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
FormGroupsarray | Manages the rules and configuration of grouped form fields.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MetaDatadictionary | Additional information about the document in the form of key-value pairs. Up to 50 key-value pairs can be added. The key is limited to 50 characters, and the value is limited to 500 characters. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
RecipientNotificationSettingsobject | Control email notifications to recipients or CC collectively by configuring properties within
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EnableAuditTrailLocalizationNullable boolean | Enable localization for the audit trail based on the signer's language. If null is provided, the value will be inherited from the Business Profile settings. Only one additional language can be specified in the signer's languages besides English. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
DownloadFileNamestring | Defines the custom format for the file name of downloaded document files. You can combine your own file name elements with the following predefined dynamic variables:
The The maximum file name length is 250 characters. If the generated name exceeds this limit, it will be truncated to fit within the limit. This property is optional; if not provided, the default format configured in the business profile will be used. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ScheduledSendTimeNullable long | This property is used to schedule the document for sending at a later time. The value should be a Unix timestamp representing the desired send time. If Note : |
Notes
- Please note that you must use either the
fileUrlsorfilesparameter in a request, both cannot be used together. - For more details on OTP behavior, validity, and resend limits when using Email or SMS OTP for signing, please refer to this article: OTP Limitation and Restriction
Example Response
Request without files
{
"status": "Completed"
}
Request with files
{
"status": "Queued"
}