How to delete a template via BoldSign API?

BoldSign supports the functionality to delete previously created templates using API. In case your organization has so many templates, there is possibility that there are some that are not much useful anymore, you can review and delete the templates that are not used any more with the help of API.

In order to delete a template, you need to retrieve the Template ID of the template you want to delete. You can list your templates using the API to find this ID or get it from the web app. Refer to this on how to list templates via API: List Templates Via API.

Here are some example codes demonstaring on how to delete a template via API:

Code snippet

curl -X 'DELETE' \
  'https://api.boldsign.com/v1/template/delete?templateId={your templateId}' \
  -H 'accept: */*' \
  -H 'X-API-KEY: {your API key}'
var apiClient = new ApiClient("https://api.boldsign.com", "Your API-KEY");
var templateClient = new TemplateClient(apiClient);
var documentStream = templateClient.DeleteTemplate("{your templateId}");

import requests
url = "https://api.boldsign.com/v1/template/delete?templateId={your templateId}"
payload={}
headers = {
  'accept': '*/*',
  'X-API-KEY': '{API-KEY}'
}

response = requests.request("DELETE", url, headers=headers, data=payload)
print(response.text)
const axios = require('axios');

async function deleteTemplate() {
    try {
        const response = await axios.delete('https://api.boldsign.com/v1/template/delete', { 
            params: { 
                'templateId': '{your templateId}' 
            }, 
            headers: { 
                'accept': '*/*', 
                'X-API-KEY': '{your api key}' 
            } 
        });
        console.log(response.data);
    } catch (error) {
        console.error('Error deleting template:', error);
    }
}

deleteTemplate();

<?php
require_once "vendor/autoload.php";
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Request;
use \GuzzleHttp\Psr7\Utils;
$client = new GuzzleHttp\Client([     'verify' => false, ]);
$headers = [
  'accept' => '*/*',
  'X-API-KEY' => '{your API key}'
];
$request = new Request('DELETE', 'https://api.boldsign.com/v1/template/delete?templateId={your templateId}', $headers);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

In the above examples, make sure to replace templateId with the ID of the template that you want to delete. Once the codes are executed, the provided template will be permanently deleted from your account.