Remove tags from template
Remove tags from an existing template.
This endpoint allows you to remove specific tags from a template.
Request Body
The request body should be an array of strings containing the tags you want to remove.
Sample Request
Here’s a sample request to remove tags from a template:
DELETE /v1/template/{templateId}/tags
fetch(`https://api.templated.io/v1/template/${template_id}/tags`, { method: 'DELETE', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify([ "social-media", "instagram" ])}).then(response => response.json()).then(data => console.log(data)).catch(error => console.error('Error:', error));
import requests
api_key = 'API_KEY'template_id = 'template_id'url = f'https://api.templated.io/v1/template/{template_id}/tags'
headers = { 'Authorization': f'Bearer {api_key}', 'Content-Type': 'application/json'}
tags = [ "social-media", "instagram"]
response = requests.delete(url, json=tags, headers=headers)
if response.status_code == 200: print(response.json())else: print('Request failed. Response code:', response.status_code) print(response.text)
import java.net.HttpURLConnection;import java.net.URL;import java.io.OutputStream;import java.io.BufferedReader;import java.io.InputStreamReader;
public class RemoveTemplateTags { public static void main(String[] args) { try { String apiKey = "API_KEY"; String templateId = "template_id"; String url = "https://api.templated.io/v1/template/" + templateId + "/tags";
String jsonTags = """ ["social-media", "instagram"] """;
URL apiUrl = new URL(url); HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection(); connection.setRequestMethod("DELETE"); connection.setRequestProperty("Authorization", "Bearer " + apiKey); connection.setRequestProperty("Content-Type", "application/json"); connection.setDoOutput(true);
try (OutputStream os = connection.getOutputStream()) { byte[] input = jsonTags.getBytes("utf-8"); os.write(input, 0, input.length); }
int responseCode = connection.getResponseCode(); if (responseCode == HttpURLConnection.HTTP_OK) { BufferedReader in = new BufferedReader( new InputStreamReader(connection.getInputStream())); String inputLine; StringBuilder response = new StringBuilder(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString()); } else { System.out.println("Request failed. Response Code: " + responseCode); } } catch (Exception e) { e.printStackTrace(); } }}
<?php$apiKey = 'API_KEY';$templateId = 'template_id';
$tags = [ "social-media", "instagram"];
$url = "https://api.templated.io/v1/template/{$templateId}/tags";
$options = [ 'http' => [ 'header' => "Authorization: Bearer {$apiKey}\r\n" . "Content-Type: application/json\r\n", 'method' => 'DELETE', 'content' => json_encode($tags) ]];
$context = stream_context_create($options);$result = file_get_contents($url, false, $context);
if ($result === FALSE) { echo "Error removing tags";} else { $data = json_decode($result, true); print_r($data);}?>