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"
        ]
    )
    add_tag_response = template_api.add_tag(template_tag=templateTag)
const axios = require('axios'); 
await axios.patch( 

    'https://api.boldsign.com/v1/template/addTags', 

    { 
        templateId: '{templateId}', 
        documentLabels: [ 'test', 'api' ],
        templateLabels: [ 'test', 'api' ]
    }, 

    { 
        headers: { 
            'X-API-KEY': '{Your API key}', 
            'Content-Type': 'application/json' 
        } 
    } 
); 
<?php
require_once "vendor/autoload.php";
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;

$client = new Client();
$headers = [
  'X-API-KEY' => '{your API key}',
  'Content-Type' => 'application/json'
];
$body = '{
  "templateId": "{templateId}",
  "documentLabels": [
    "test",
    "api"
  ],
  "templateLabels": [
    "test",
    "api"
  ]
}';
$request = new Request('PATCH', 'https://api.boldsign.com/v1/template/addTags', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

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