How to Allow Senders to Edit or Delete Template Form Fields via API
This article explains how template creators can allow senders to edit or delete specific form fields when sending documents created from BoldSign templates. These permissions are configured at the individual field level during template creation using the BoldSign API, giving senders flexibility while maintaining control over compliance-sensitive fields.
What Are Sender Actions in BoldSign Templates?
Sender actions define what a sender can modify when sending a document using a template. BoldSign supports two sender action permissions that can be applied per form field:
- Edit form field
- Delete form field
Both options are enabled by default when a template is created.
How Does allowEditFormField Work?
Setting allowEditFormField to true allows senders to modify a form field’s settings, including:
- Field position and size
- Resizing and moving fields
- Validation rules
- Cutting, copying, and pasting fields
This permission does not allow changing the field type (for example, converting a Signature field into a Text field).
How Does allowDeleteFormField Work?
- Setting allowDeleteFormField to true allows senders to remove the form field entirely when using the template.
- This is useful when certain fields are optional or need to be removed depending on the sending scenario.
Example: Create a Template with Sender Edit and Delete Permissions
Below are example code snippets with allowEditFormField and allowDeleteFormField set to true in the template creation request via API:
CURL
curl -X 'POST' \
'https://api.boldsign.com/v1/template/create' \
-H 'accept: application/json' \
-H 'X-API-KEY: {your API key}' \
-H 'Content-Type: multipart/form-data' \
-F 'DocumentMessage=document message for signers' \
-F 'Files=@{your file}' \
-F 'Title=title of the template' \
-F 'AllowMessageEditing=true' \
-F 'Description=testingDescription' \
-F 'DocumentTitle=title of the document' \
-F 'Roles={
"name": "HR",
"index": 1,
"defaultSignerName": "Alex Gayle",
"defaultSignerEmail": "alexgayle@cubeflakes.com",
"signerOrder": 1,
"signerType": "Signer",
"formFields": [
{
"id": "sign_id",
"fieldType": "Signature",
"pageNumber": 1,
"bounds": {
"x": 50,
"y": 100,
"width": 100,
"height": 60
},
"isRequired": true,
"allowEditFormField": true,
"allowDeleteFormField": true
}
]
}'
C#
var apiClient = new ApiClient("https://api.boldsign.com", "YOUR_API_KEY");
var templateClient = new TemplateClient(apiClient);
List<FormField> formField = new List<FormField>
{
new FormField(
id: "Signature",
type: FieldType.Signature,
pageNumber: 1,
bounds: new Rectangle(x: 50, y: 50, width: 200, height: 30))
};
formField[0].AllowDeleteFormField = true;
formField[0].AllowEditFormField = true;
var templateRequest = new CreateTemplateRequest
{
Title = "Agreement",
DocumentTitle = "title of the document",
Roles =
[
new TemplateRole()
{
Index = 1,
Name = "HR",
DefaultSignerName = "David",
DefaultSignerEmail = "david@cubeflakes.com",
SignerType = SignerType.Signer,
FormFields = formField
}
],
Files = new List<IDocumentFile>
{
new DocumentFilePath
{
ContentType = "application/pdf",
FilePath = "YOUR_FILE_PATH",
}
},
};
var templateCreated = templateClient.CreateTemplate(templateRequest);
Python
import boldsign
configuration = boldsign.Configuration(api_key="YOUR_API_KEY")
with boldsign.ApiClient(configuration) as api_client:
template_api = boldsign.TemplateApi(api_client)
form_field = boldsign.FormField(
fieldType="Signature",
page_number=1,
allowDeleteFormField=True,
allowEditFormField=True,
bounds=boldsign.Rectangle(x=50, y=100, width=100, height=60))
role = boldsign.TemplateRole(
index=1,
name="HR",
defaultSignerName="Alex Gayle",
defaultSignerEmail="alexgayle@boldsign.dev",
signerType="Signer",
formFields=[form_field])
create_template_request = boldsign.CreateTemplateRequest(
title="title of the template",
documentTitle="title of the document",
roles=[role],
files=["YOUR_FILE_PATH"]
)
template_created = template_api.create_template(
create_template_request=create_template_request
)
PHP
<?php require_once "vendor/autoload.php";
use BoldSign\Configuration;
use BoldSign\Api\TemplateApi;
use BoldSign\Model\{
FormField,
Rectangle,
TemplateRole,
CreateTemplateRequest
};
$config = new Configuration();
$config->setApiKey('YOUR_API_KEY');
$template_api = new TemplateApi($config);
$form_field = new FormField();
$form_field->setFieldType('Signature');
$form_field->setPageNumber(1);
$form_field->setAllowDeleteFormField(true);
$form_field->setAllowEditFormField(true);
$bounds = new Rectangle([50, 100, 100, 60]);
$form_field->setBounds($bounds);
$role = new TemplateRole();
$role->setIndex(1);
$role->setName('HR');
$role->setDefaultSignerName('Alex Gayle');
$role->setDefaultSignerEmail('alexgayle@boldsign.dev');
$role->setSignerType('Signer');
$role->setFormFields([$form_field]);
$create_template = new CreateTemplateRequest();
$create_template->setTitle('Document SDK API');
$create_template->setDocumentTitle('title of the document');
$create_template->setRoles([$role]);
$create_template->setFiles(['YOUR_FILE_PATH']);
$template_created = $template_api->createTemplate([$create_template]);
Java
ApiClient client = Configuration.getDefaultApiClient();
client.setApiKey("YOUR_API_KEY");
TemplateApi templateApi = new TemplateApi(client);
// Define signature field
FormField signatureField = new FormField();
signatureField.setFieldType(FormField.FieldTypeEnum.SIGNATURE);
signatureField.setPageNumber(1);
signatureField.setAllowDeleteFormField(true);
signatureField.setAllowEditFormField(true);
Rectangle bounds = new Rectangle().x(100f).y(100f).width(100f).height(50f);
signatureField.setBounds(bounds);
// Define role
TemplateRole templateRole = new TemplateRole();
templateRole.setIndex(1);
templateRole.setName("HR");
templateRole.setDefaultSignerName("Alex Gayle");
templateRole.setDefaultSignerEmail("alexgayle@boldsign.dev");
templateRole.setSignerType(TemplateRole.SignerTypeEnum.SIGNER);
templateRole.setFormFields(Arrays.asList(signatureField));
// Create template request
CreateTemplateRequest createTemplate = new CreateTemplateRequest();
createTemplate.setTitle("title of the template");
createTemplate.setDocumentTitle("title of the document");
createTemplate.setRoles(Arrays.asList(templateRole));
File file = new File("YOUR_FILE_PATH");
createTemplate.setFiles(Arrays.asList(file));
// Create template
TemplateCreated templateCreated = templateApi.createTemplate(createTemplate);
Node js
import {
TemplateApi,
CreateTemplateRequest,
TemplateRole,
Rectangle,
FormField
} from "boldsign";
import * as fs from 'fs';
const templateApi = new TemplateApi();
templateApi.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.allowDeleteFormField = true;
formField.allowEditFormField = true;
formField.bounds = bounds;
const role = new TemplateRole();
role.index = 1;
role.name = "Signer";
role.defaultSignerEmail = "alexgayle@boldsign.dev";
role.defaultSignerName = "Alex Gayle";
role.signerType = TemplateRole.SignerTypeEnum.Signer;
role.formFields = [formField];
const file = fs.createReadStream("YOUR_FILE_PATH");
const createTemplateRequest = new CreateTemplateRequest();
createTemplateRequest.title = "Testing node sdk";
createTemplateRequest.documentTitle = "Node sdk test case";
createTemplateRequest.roles = [role];
createTemplateRequest.files = [file];
const templateCreated = await templateApi.createTemplate(createTemplateRequest);
console.log("Template created with ID:", templateCreated.templateId);
In the above example, the template creator has set the allowEditFormField and allowDeleteFormField properties to true for the form field. This means that when senders use the template, they will be able to both edit the field settings and delete the field if needed.
Sender Permission Behavior Summary
| Edit This Field | Delete This Field | Senders Permissions |
|---|---|---|
| Enabled | Enabled | Can edit field settings and delete the field. |
| Disabled | Enabled | Can delete the field; can only change default values |
| Enabled | Disabled | Can edit field settings but cannot delete the field. |
| Disabled | Disabled | Can only modify default values |
Important Notes
- Sender permissions are applied per form field
- Each field must be configured individually
- Disabling both permissions prevents senders from modifying field settings or deleting fields
- Senders can still change default values even when both permissions are disabled
Best Practices
- Enable sender actions only for non-critical fields
- Disable editing and deletion for legal or compliance-sensitive fields
- Review template permissions carefully before using them in production workflows