Links
Comment on page

Remove tags (bulk)

post
https://api.imagekit.io
/v1/files/removeTags
Remove tags in bulk API

Response structure and status code

In case of an error, you will get an error code along with the error message. On success, you will receive a 200 status code with an array of successfully updated fileIds.

Examples

Here is the example request to understand the API usage.
cURL
Node.js
Python
PHP
Java
Ruby
Go
.Net
curl -X POST "https://api.imagekit.io/v1/files/removeTags" \
-H 'Content-Type: application/json' \
-u your_private_key: -d '
{
"fileIds" : [
"file_id_1",
"file_id_2"
],
"tags" : [
"tag_to_remove_1",
"tag_to_remove_2"
]
}
'
var ImageKit = require("imagekit");
var imagekit = new ImageKit({
publicKey : "your_public_api_key",
privateKey : "your_private_api_key",
urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
});
var fileIds = ["file_id_1", "file_id_2"];
var tags = ["tag_to_remove_1", "tag_to_remove_2"];
imagekit.bulkRemoveTags(fileIds, tags, function(error, result) {
if(error) console.log(error);
else console.log(result);
});
from imagekitio import ImageKit
imagekit = ImageKit(
public_key='your_public_api_key',
private_key='your_private_api_key',
url_endpoint = 'https://ik.imagekit.io/your_imagekit_id/'
)
remove_tags = imagekit.remove_tags(file_ids=['file-id-1', 'file-id-2'], tags=['tag1', 'tag2'])
print("Remove tags-", remove_tags, end="\n\n")
# Raw Response
print(remove_tags.response_metadata.raw)
# list successfully updated file ids
print(remove_tags.successfully_updated_file_ids)
# print the first file's id
print(remove_tags.successfully_updated_file_ids[0])
use ImageKit\ImageKit;
$public_key = "your_public_api_key";
$your_private_key = "your_private_api_key";
$url_end_point = "https://ik.imagekit.io/your_imagekit_id";
$imageKit = new ImageKit(
$public_key,
$your_private_key,
$url_end_point
);
$fileIds = [
"file_id_1",
"file_id_2"
];
$tags = [
"tag_to_remove_1",
"tag_to_remove_2"
];
$bulkRemoveTags = $imageKit->bulkRemoveTags($fileIds, $tags);
echo("Remove Tags (Bulk) : " . json_encode($bulkRemoveTags));
List<String> fileIds = new ArrayList<>();
fileIds.add("file_id_1");
fileIds.add("file_id_2");
List<String> tags = new ArrayList<>();
tags.add("tag_to_remove_1");
tags.add("tag_to_remove_2");
TagsRequest tagsRequest =new TagsRequest();
tagsRequest.setFileIds(fileIds);
tagsRequest.setTags(tags);
ResultTags resultTags = ImageKit.getInstance().removeTags(tagsRequest);
imagekitio = ImageKitIo::Client.new("your_private_key", "your_public_key", "your_url_endpoint")
imagekitio.delete_bulk_tags(
file_ids: [
"file_id_1",
"file_id_2"
],
tags: [
"tag_to_remove_1",
"tag_to_remove_2"
]
)
resp, err := ik.Media.RemoveTags(ctx, media.TagsParam{
FileIds: []string{
"file_id_1",
"file_id_2",
},
Tags: []string{
"tag_to_remove_1",
"tag_to_remove_2",
},
})
var imagekit = new ImageKit({
publicKey : "your_public_api_key",
privateKey : "your_private_api_key",
urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
});
TagsRequest removeTagsRequest = new TagsRequest
{
tags = new List<string>
{
"tag_1",
"tag_2"
},
fileIds = new List<string>
{
"fileId_1",
},
};
ResultTags removeTags = imagekit.RemoveTags(removeTagsRequest);