Edit template

put/v1/template/edit

The Edit Template API allows users to modify the properties of an existing template and draft template. This API facilitates updates to various properties such as the title, description, document message, document title, roles, and form fields associated with the template. Notably, it does not permit alterations to the files linked to the template.

Partial update

Users can execute partial updates to a template by specifying only the fields they intend to modify. The API will solely modify the provided fields, leaving the remainder unchanged. However, it is limited to top-level properties. When dealing with nested properties within top-level objects, users must provide the complete object for modification.

When you need to update a nested property, you will need to use the template properties API which will retrieve all the properties of the given template. Now, you can modify the required properties within the nested object and send the updated template object to the edit template API.

Read more about template properties API

Code snippet

In the below example request, we are updating the title of the template and a role associated with the template along with the form fields.

curl --location --request PUT 'https://api.boldsign.com/v1/template/edit?templateId=5c305ebe-xxx-xxxx-xxxx-5e285a4f8b0a' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: {API-KEY}' \
--data-raw '{
    "title": "A new title for template",
    "EnableSigningOrder": false,
    "roles": [
        {
            "name": "Manager",
            "index": 1,
            "defaultSignerName": "Alex",
            "defaultSignerEmail": "alexgayle@cubeflakes.com",
            "signerOrder": 1,
            "signerType": "Signer",
            "formFields": [
                {
                    "id": "Signature1",
                    "type": "Signature",
                    "isRequired": true,
                    "bounds": {
                        "x": 625.0,
                        "y": 293.0,
                        "width": 124.0,
                        "height": 32.0
                    },
                    "pageNumber": 1
                }
            ],
            "enableEditRecipients": true,
            "enableDeleteRecipients": true
        }
    ]
}'
var apiClient = new ApiClient("https://api.boldsign.com", "{API-KEY}");
var templateClient = new TemplateClient(apiClient);

var formFields = new List<FormField>
{
    new FormField(
        id: "Sign",
        type: FieldType.Signature,
        pageNumber: 1,
        isRequired: true,
        bounds: new Rectangle(x: 150, y: 150, width: 200, height: 30)),
};

var templateRoles = new List<TemplateRole>
{
    new TemplateRole()
    {
        Name = "Manager",
        Index = 1,
        DefaultSignerName = "Alex",
        DefaultSignerEmail = "alexgayle@cubeflakes.com",
        SignerOrder = 1,
        SignerType = SignerType.Signer,
        FormFields = formFields,
        AllowRoleEdit = true,
        AllowRoleDelete = true,
    },
};

var editTemplateRequest = new EditTemplateRequest("5c305ebe-xxx-xxxx-xxxx-5e285a4f8b0a")
{
    Title = "A new title for template",
    EnableSigningOrder = false,
    Roles = templateRoles,
};

await templateClient.EditTemplateAsync(editTemplateRequest);
import boldsign

configuration = boldsign.Configuration(
    api_key = "YOUR_API_KEY"
)

with boldsign.ApiClient(configuration) as api_client:

    template_api = boldsign.TemplateApi(api_client)
    
    form_fields = [
        boldsign.FormField(
            fieldType="Signature",
            page_number=1,  
            bounds=boldsign.Rectangle(
                x=50,
                y=100,
                width=100,
                height=60
            )
        )
    ]
    
    role = boldsign.TemplateRole(
        index=1,
        name="Manager",
        defaultSignerName="Alex Gayle",
        defaultSignerEmail="alexgayle@boldsign.dev",
        signerOrder=1,
        signerType="Signer",
        formFields=form_fields
    )
    
    template_id = "YOUR_TEMPLATE_ID"
    
    edit_template_request = boldsign.EditTemplateRequest(   
        title="A new title for template",
        enableSigningOrder=False,
        roles=role
    )
    
    edit_template_response = template_api.edit_template(template_id, edit_template_request)
const axios = require('axios');

const url = 'https://api.boldsign.com/v1/template/edit?templateId=5c305ebe-xxx-xxxx-xxxx-5e285a4f8b0a';
const headers = {
    'Content-Type': 'application/json',
    'X-API-KEY': '{API-KEY}'  // Replace {API-KEY} with your actual API key
};

const data = {
    "title": "A new title for template",
    "EnableSigningOrder": false,
    "roles": [
        {
            "name": "Manager",
            "index": 1,
            "defaultSignerName": "Alex",
            "defaultSignerEmail": "alexgayle@cubeflakes.com",
            "signerOrder": 1,
            "signerType": "Signer",
            "formFields": [
                {
                    "id": "Signature1",
                    "type": "Signature",
                    "isRequired": true,
                    "bounds": {
                        "x": 625.0,
                        "y": 293.0,
                        "width": 124.0,
                        "height": 32.0
                    },
                    "pageNumber": 1
                }
            ],
            "enableEditRecipients": true,
            "enableDeleteRecipients": true
        }
    ]
};

axios.put(url, data, { headers: headers })
    .then(response => {
        console.log(response.status);
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
<?php

require 'vendor/autoload.php'; // Include Guzzle HTTP library

use GuzzleHttp\Client;

$url = 'https://api.boldsign.com/v1/template/edit?templateId=5c305ebe-xxx-xxxx-xxxx-5e285a4f8b0a';

$headers = [
    'Content-Type' => 'application/json',
    'X-API-KEY' => '{API-KEY}' // Replace {API-KEY} with your actual API key
];

$data = [
    "title" => "A new title for template",
    "EnableSigningOrder" => false,
    "roles" => [
        [
            "name" => "Manager",
            "index" => 1,
            "defaultSignerName" => "Alex",
            "defaultSignerEmail" => "alexgayle@cubeflakes.com",
            "signerOrder" => 1,
            "signerType" => "Signer",
            "formFields" => [
                [
                    "id" => "Signature1",
                    "type" => "Signature",
                    "isRequired" => true,
                    "bounds" => [
                        "x" => 625.0,
                        "y" => 293.0,
                        "width" => 124.0,
                        "height" => 32.0
                    ],
                    "pageNumber" => 1
                ]
            ],
            "enableEditRecipients" => true,
            "enableDeleteRecipients" => true
        ]
    ]
];

$client = new Client();

try {
    $response = $client->request('PUT', $url, [
        'headers' => $headers,
        'json' => $data
    ]);

    $statusCode = $response->getStatusCode();
    $responseData = $response->getBody()->getContents();

    echo 'HTTP Status: ' . $statusCode . "\n";
    echo 'Response: ' . $responseData . "\n";
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage() . "\n";
}

?>

Query Parameters

templateIdstringRequiredThe unique identifier of the template to update.

Request body

TitlestringThe title of the template.
DescriptionstringThe description of the template.
DocumentTitlestringThis is the name of the document that will be displayed in the BoldSign user interface as well as in the signature request email.
DocumentMessagestringThe message that will be seen by all recipients. You can include any instructions related to this document that the signer should be aware of before signing.

Rolesarray

A role is simply a placeholder for a real person. For example, if we have a purchase order that will always be signed by two people, one from the company and one from the customer, we can create a template with two roles, Customer and Representative.

namestringThe name of the Role.
indexintegerThe row index of the role. The role index should be in linear increments for each role (1, 2, 3, and so on). The index value must be between 1 and 50.
defaultSignerNamestringThe signer name of the document. This name appears in all email communications, signing notifications, and the audit file.
defaultSignerEmailstringThe signer email of the document. This email appears in all email communications, signing notifications, and the audit file.
signerOrderintegerThe order of the signer. When you enable the signing order option, this will be required. The value must be between 1 and 50.
signerTypestringThe type of the signer and the values are Signer, Reviewer, and InPersonSigner.
hostEmailstringThe host email address. It is a required property when the signerType is set to InPersonSigner. Your organization should have HostEmail.
languageintegerThe language for the signer. The supported languages are 1-English, 2-Spanish, 3-German, 4-French, and 5-Romanian. Note that 'locale' should now be used instead of 'language' as it has replaced the deprecated term.
localestringSpecify the language index for rendering document signing pages and emails for the signer, choosing from the supported locales such as EN-English, NO-Norwegian, FR-French, DE-German,ES-Spanish, BG-Bulgarian, CS-Czech, DA-Danish,IT-Italian, NL-Dutch, PL-Polish, PT-Portuguese,RO-Romanian, RU-Russian, and SV-Swedish.
imposeAuthenticationstringThis is used to allow authentication for a specific signer. We have three types of authentication. They are AccessCode , EmailOTP, SMSOTP and IdVerification. The default value is None.

phoneNumberobject

When the delivery mode is set to SMS or EmailAndSMS, you can provide the phone number with the country code.

countryCodestringThis property represents the country code associated with the phone number.
numberstringThis property represents the actual phone number.
deliveryModestringThis property allows you to specify the desired delivery mode for sending notifications. We have three types of delivery modes. They are Email , SMS and EmailAndSMS. The default value is Email.
allowFieldConfigurationbooleanThis option enables the signer to add fields at their end while signing the document. You can also assign fields to the signer if anything is required, and it becomes mandatory if set to false. By default, it is set to false.

formFieldsarray

List of fields associated with the signer.

idstringThe id of the form field.
namestringThe name of the form field.
typestringThe type of the form field. The available values are Signature, Initial, CheckBox, TextBox, Label, DateSigned, RadioButton, Image, Attachment, EditableDate, Hyperlink, and Dropdown.
pageNumberintegerThis will be used to specify which page the form field should be placed on.

boundsobject

This will contain the form field's x and y coordinates, width, and height.

xfloatThe form field's x coordinate value.
yfloatThe form field's y coordinate value.
widthfloatThe form field's width.
heightfloatThe form field's height.
isRequiredbooleanWhen disabled, the signer does not want to fill out the form field. The default value is true.
tabIndexNullable intAssign tab index to control the flow of field focus while using TAB key navigation. Default to null, which denotes it will follow regular flow. The accepted range starts from -1 to a valid integer.
labelstringThe label used to represent the value for a radio button. Also, can be used to prefill a radio button.
valuestringThe value of the form field.
fontSizeintegerThe fontsize of the form field.
fontstringThe font family of the form field.
fontHexColorstringThe font color of the form field.
isBoldFontbooleanWhen enabled, the font will be displayed in bold.
isItalicFontbooleanWhen enabled, the font will be italic.
isUnderLineFontbooleanWhen enabled, the font will be displayed in Underline format.
lineHeightintegerThe line height of the form field.
characterLimitintegerThe character limit in the form field.
groupNamestringThe groupName of the form field. This field is required when the type is set to RadioButton.
placeHolderstringThe placeholder of the form field.
validationTypestringThe validation type of the text box form field. The available values are None, NumbersOnly, EmailAddress, Currency, and CustomRegex. The default value is None.
validationCustomRegexstringThe custom regex of the text box form field. When we set the ValidationType to CustomRegex, it will be required.
validationCustomRegexMessagestringThe text box field's custom regex message. This message is displayed when the signer enters an invalid regex format value in the text box form field while signing the document.
dateFormatstringFormat of the date to be displayed on the date signed form field. The default value is MM/dd/yyyy. When null is provided, the value is inherited from the business profile settings of your account. Accepted formats are MM/dd/yyyy (02/08/2024), dd/MM/yyyy (08/02/2024), dd-MMM-yyyy (08-Feb-2024), MMM-dd-yyyy (Feb-08-2024), MMM dd, yyyy (Feb 08, 2024), dd MMM, yyyy (08 Feb, 2024), yyyy, MMM dd (2024, Feb 08), yyyy/MM/dd (2024/02/08), dd-MM-yyyy (08-02-2024), MM-dd-yyyy (02-08-2024), yyyy-MM-dd (2024-02-08).
timeFormatstringFormat of the time to be displayed on the date signed form field. When null is provided, the value is inherited from the business profile settings of your account. Accepted formats are hh:mm tt (12:30 PM), h:mm tt (2:45 PM), HH:mm (14:30), H:mm (9:15), None (Disabled, no time will be displayed).

imageInfoobject

The information about the image field.

titlestringThe title of the image.
descriptionstringThe description of the image.
allowedFileExtensionsstringThis includes file extensions such as .jpg or .jpeg, .svg, .png, and .bmp.

attachmentInfoobject

The information about the attachment field.

titlestringThe title of the attachment.
descriptionstringThe description of the attachment.
allowedFileTypesstringThe file types that can be used are .pdf, .docx, .jpg, .jpeg, and .png.

editableDateFieldSettingsobject

The settings for the editable date form field and it contains date format, min and max values.

dateFormatstringThe dateFormat of the editable date field.
minDatestringThe min date of the editable date field.
maxDatestringThe max date of the editable date field.
hyperlinkTextstringThe text of the hyperlink form field.
dataSyncTagstringThe value of the dataSync tag.
dropdownOptionsarrayThe options of the dropdown form field.
textAlignstringDetermines the horizontal alignment of text for the textbox and label form fields, and can be set to Left, Center, or Right.
textDirectionstringDetermines the text direction of text for the textbox and label form fields, and can be set to LTR or RTL
characterSpacingfloatDetermines the character spacing of text for the textbox and label form fields. It can be set as a floating-point value.
allowRoleEditbooleanYou can't change the signer details while sending the document out for signature if it's disabled. The default value is true.
allowRoleDeletebooleanYou can't remove the signer details while sending the document out for signature if it's disabled. The default value is true.

recipientNotificationSettingsobject

Control email notifications to recipients by configuring the properties within recipientNotificationSettings.

signatureRequestbooleanIndicates whether the recipient should be notified when a document is sent.
declinedbooleanIndicates whether the recipient should be notified when a document is declined.
revokedbooleanIndicates whether the recipient should be notified when a document is revoked.
signedbooleanIndicates whether the recipient should be notified when a document is signed by other recipient.
completedbooleanIndicates whether the recipient should be notified when the document is completed.
expiredbooleanIndicates whether the recipient should be notified when a document expires.
reassignedbooleanIndicates whether the recipient should be notified when the document is reassigned.
deletedbooleanIndicates whether the recipient should be notified when a document is deleted.
remindersbooleanIndicates whether the recipient should receive reminders for pending signature requests.
editRecipientbooleanIndicates whether the recipient should be notified when there is an change in the recipient.
editDocumentbooleanIndicates whether the recipient should be notified when a document is edited.
AllowNewFilesbooleanWhen set to true, the sender can add new files while using this template to send signature requests. If set to false, the sender will not be able to add new files.
AllowModifyFilesbooleanWhen set to true, the sender can replace or delete existing files while using this template to send signature requests. If set to false, the sender will not have the ability to replace or delete files.
CCarrayYou can add anyone who needs to receive a copy of the signed document by adding their email address.
BrandIdstringYou can customize the branding of signature request emails and document signing pages with your own colors, logos, and other elements. The brand id can be obtained from both the branding API and the web app branding page.
AllowMessageEditingbooleanWhen disabled, you cannot change the message while creating a document with this template. The default value is true.
AllowNewRolesbooleanWhen disabled, you cannot add additional signers to the document. The default value is true.
EnableReassignbooleanWhen disabled, the reassign option is not available after sending the document out of signature. The default value is true.
EnablePrintAndSignbooleanWhen enabled, the document can be printed and signed offline. The default value is false.
EnableSigningOrderbooleanWhen enabled, signers can only sign the document in the order specified. Furthermore, the next signer will be notified when the previous signer has signed the document. The default value is false.

DocumentInfoarray

This is used to specify the title and description of the document in the various supported languages.

languageintegerThe language of the document. The supported languages are 1-English, 2-Spanish, 3-German, 4-French, and 5-Romanian. Note that 'locale' should now be used instead of 'language' as it has replaced the deprecated term.
titlestringThe title of the document.
descriptionstringThe description of the document.
localestringSpecify the language index for rendering document signing pages and emails for the signer, choosing from the supported locales such as EN-English, NO-Norwegian, FR-French, DE-German,ES-Spanish, BG-Bulgarian, CS-Czech, DA-Danish,IT-Italian, NL-Dutch, PL-Polish, PT-Portuguese,RO-Romanian, RU-Russian, and SV-Swedish.
UseTextTagsbooleanWhen 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 the long text tag handling.

definitionIdstringThe definition id of the text tag.
typestringThe type of the form field.
signerIndexintegerThe signer index of the form field.
isRequiredbooleanWhen disabled, the signer is not required to fill out the specific form field. The default value is true.
placeholderstringThe placeholder of the form field.
tabIndexNullable intAssign tab index to control the flow of field focus while using TAB key navigation. Default to null, which denotes it will follow regular flow. The accepted range starts from -1 to a valid integer.
labelstringThe label used to represent the value for a radio button. Also, can be used to prefill a radio button.
fieldIdstringThe field id of the form field.

fontobject

The font of the form field.

namestringThe name of the font in form field.
colorstringThe font color of the form field.
sizeintegerThe font size of the form field.
stylestringThe font style of the form field.
lineHeightintegerThe lineheight of the form field.

validationobject

When we select the type as TextBox, the validation of the form field is required.

typestringThe validation type of the text box form field. The available values are None, NumbersOnly, EmailAddress, Currency, and CustomRegex. The default value is None.
regexstringThe custom regex of the text box form field. When we set the ValidationType to CustomRegex, it will be required.

sizeobject

This can be used to specify the form field's height and width.

widthfloatThe width of the form field.
heightfloatThe height of the form field.
dateFormatstringFormat of the date to be displayed on the date signed form field. The default value is MM/dd/yyyy. When null is provided, the value is inherited from the business profile settings of your account. Accepted formats are MM/dd/yyyy (02/08/2024), dd/MM/yyyy (08/02/2024), dd-MMM-yyyy (08-Feb-2024), MMM-dd-yyyy (Feb-08-2024), MMM dd, yyyy (Feb 08, 2024), dd MMM, yyyy (08 Feb, 2024), yyyy, MMM dd (2024, Feb 08), yyyy/MM/dd (2024/02/08), dd-MM-yyyy (08-02-2024), MM-dd-yyyy (02-08-2024), yyyy-MM-dd (2024-02-08).
timeFormatstringFormat of the time to be displayed on the date signed form field. When null is provided, the value is inherited from the business profile settings of your account. Accepted formats are hh:mm tt (12:30 PM), h:mm tt (2:45 PM), HH:mm (14:30), H:mm (9:15), None (Disabled, no time will be displayed).
radioGroupNamestringThe form field's groupName, which is required when we set the type RadioButton.
valuestringThe value of the form field.
dropdownOptionsarrayThe options of the dropdown form field.

offSetobject

Specifies the offset positioning for the text tag, allowing adjustments to its location relative to the computed position. The computed value after value must remain within the page dimensions.

offSetXdoubleAdjusts the text tag's position horizontally (left or right).
offSetYdoubleAdjusts the text tag's position vertically (top or bottom).
autoDetectFieldsbooleanWhen enabled, it will convert all the fillable form fields in the document to BoldSign form fields. BoldSign supports Textbox, Checkbox, Radio button, and Signature form fields. Other fields will not be detected as of now. The default value is false.
labelsstring[ ]The labels (Tags) that will be assigned to the document when a document is created using this template which can be used to categorize and filter the documents.

formGroupsarray

Manages the rules and configuration of grouped form fields.

minimumCountintegerThe minimum number of items that must be selected in a form group.
maximumCountintegerThe maximum number of items that must be selected in a form group.
dataSyncTagstringThe data sync tag of the form group.
groupNamesarrayThe group names to which this form group rule should be applied.
groupValidationstringSpecify the form group validation type, the available validations are Minimum, Maximum, Absolute, and Range.
templateLabelsstring[ ]The template labels (Tags) are added to the template to categorize and filter the documents.
onBehalfOfstringThe email address of the user that was used to create the template on their behalf.

recipientNotificationSettingsobject

Control email notifications to recipients or CC collectively by configuring properties within recipientNotificationSettings.

signatureRequestbooleanIndicates whether the recipient or CC should be notified when a document is sent.
declinedbooleanIndicates whether the recipient or CC should be notified when a document is declined.
revokedbooleanIndicates whether the recipient or CC should be notified when a document is revoked.
signedbooleanIndicates whether the recipient or CC should be notified when a document is signed by other recipient.
completedbooleanIndicates whether the recipient or CC should be notified when the document is completed.
expiredbooleanIndicates whether the recipient or CC should be notified when a document expires.
reassignedbooleanIndicates whether the recipient or CC should be notified when the document is reassigned.
deletedbooleanIndicates whether the recipient or CC should be notified when a document is deleted.
remindersbooleanIndicates whether the recipient should receive reminders for pending signature requests.
editRecipientbooleanIndicates whether the recipient should be notified when there is a change in the recipient.
editDocumentbooleanIndicates whether the recipient or CC should be notified when the document is edited.

Example response

204 No Content