Add template tags

patch/v1/template/addTags

You can add tags (labels) to the template either during its creation process or afterwards, utilizing your tenant IDs or any unique identifier. This facilitates easy retrieval or listing of templates based on tenants or users. Any added tags can be accessed by all users within the organization who have permission to access templates. When the template is created on behalf of a particular sender email, then the add tag operation can be performed on the same account by specifying the email in the onBehalfOf.

Please refer to the Create template article for adding tags(labels) while creating the template.

Code snippet

curl -X PATCH "https://api.boldsign.com/v1/template/addTags" 
     -H 'X-API-KEY: {your API key}'   
     -H "Content-Type: application/json" 
     -d "{\"templateId\": \"{templateId}\", \"documentLabels\": [\"test\", \"api\"], \"templateLabels\": [\"test\", \"api\"]}"
var apiClient = new ApiClient("https://api.boldsign.com", "{apikey}");
var templateClient = new TemplateClient(apiClient);
var addtag = new TemplateTag()
{
    TemplateId = "{documentId}",
    DocumentLabels = new List<string>() { "test", "api" },
    TemplateLabels = new List<string>() { "test", "api" },
};
await templateApi.AddTagAsync(addtag).ConfigureAwait(false);
import boldsign

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

with boldsign.ApiClient(configuration) as api_client:

    template_api = boldsign.TemplateApi(api_client)
    templateTag = boldsign.TemplateTag(
        templateId="YOUR_TEMPLATE_ID",
        documentLabels=["test", "api"],        
        templateLabels=["test", "api"]
    )
    
    template_api.add_tag(templateTag)
<?php require_once "vendor/autoload.php";

$config = new BoldSign\Configuration();
$config->setApiKey('YOUR_API_KEY');

$template_api = new BoldSign\Api\TemplateApi($config);
$templateTag = new BoldSign\Model\TemplateTag();
$templateTag->setTemplateId('YOUR_TEMPLATE_ID'); 
$templateTag->setDocumentLabels(['test', 'api']);
$templateTag->setTemplateLabels(['test', 'api']);

$template_api->addTag($templateTag);
ApiClient client = Configuration.getDefaultApiClient();  
client.setApiKey("YOUR_API_KEY");
			
TemplateApi templateApi = new TemplateApi(client);
TemplateTag templateTag = new TemplateTag();
templateTag.setTemplateId("YOUR_TEMPLATE_ID");
templateTag.setDocumentLabels(Arrays.asList("test", "api"));
templateTag.setTemplateLabels(Arrays.asList("test", "api"));

templateApi.addTag(templateTag);
import { TemplateApi,TemplateTag  } from "@boldsign/node-sdk";

const templateApi = new TemplateApi();
templateApi.setApiKey("YOUR_API_KEY");

const addTag = new TemplateTag();
addTag.templateId = "YOUR_TEMPLATE_ID";
addTag.documentLabels = ["test", "api"];
addTag.templateLabels = ["test", "api"];

templateApi.addTag(addTag);

Request body

templateIdstringRequiredID of the requested template.
documentTagsarrayRequiredA collection of tags that will be added to the document that derived from this template. It can only contain a maximum of 50 tags. Each tag cannot exceed 255 characters and cannot contain white space.
templateTagsarrayRequiredA collection of tags that will be added to the template. It can only contain a maximum of 50 tags. Each tag cannot exceed 255 characters and cannot contain white space.
onBehalfOfstringThe email address of the user that was used to create the template on their behalf.

Example response

200 Success