post
https://api.imagekit.io
/v1/files/removeAITags

This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time.

fileIds
array[string]
required

An array of fileIds from which you want to remove AITags.

AITags
array[string]
required

An array of AITags that you want to remove from the files.

Auth
API key
:
Body
Note

Here, you can explore machine-generated code examples. For practical applications, refer to the examples section below, which includes detailed code snippets from the ImageKit SDKs.

curl --request POST \
--url https://api.imagekit.io/v1/files/removeAITags \
--header 'Accept: application/json' \
--header 'Authorization: Basic 123' \
--header 'Content-Type: application/json' \
--data '{
"fileIds": [
"598821f949c0a938d57563bd",
"598821f949c0a938d57563be"
],
"AITags": [
"t-shirt",
"round-neck",
"sale2019"
]
}'

AITags removed successfully.

responses
/
200
successfullyUpdatedFileIds
array[string]

An array of fileIds that in which AITags were successfully removed.

1
{
2
"successfullyUpdatedFileIds": [
3
"string"
4
]
5
}

Examples

Here is an example request to understand the API usage.

Copy
curl -X POST "https://api.imagekit.io/v1/files/removeAITags" \
-H 'Content-Type: application/json' \
-u your_private_key: -d '
{
	"fileIds" : [
		"file_id_1",
		"file_id_2"
	],
	"AITags" : [
		"ai_tag_to_remove_1", 
		"ai_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 = ["ai_tag_to_remove_1", "ai_tag_to_remove_2"];

imagekit.bulkRemoveAITags(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_ai_tags = imagekit.remove_ai_tags(file_ids=['file-id-1', 'file-id-2'], ai_tags=['remove-ai-tag-1', 'remove-ai-tag-2'])

print("Remove AI tags-", remove_ai_tags, end="\n\n")

# Raw Response
print(remove_ai_tags.response_metadata.raw)

# list successfully updated file ids
print(remove_ai_tags.successfully_updated_file_ids)

# print the first file's id
print(remove_ai_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"
];

$AITags = [
	"ai_tag_to_remove_1", 
	"ai_tag_to_remove_2"
];

$bulkRemoveAITags = $imageKit->bulkRemoveAITags($fileIds, $AITags);

echo("Remove AI Tags (Bulk) : " . json_encode($bulkRemoveAITags));
List<String> fileIds = new ArrayList<>();
fileIds.add("file_id_1");
fileIds.add("file_id_2");
List<String> aiTags = new ArrayList<>();
aiTags.add("ai_tag_to_remove_1");
aiTags.add("ai_tag_to_remove_2");
AITagsRequest aiTagsRequest = new AITagsRequest();
aiTagsRequest.setFileIds(fileIds);
aiTagsRequest.setAITags(aiTags);
ResultTags resultTags = ImageKit.getInstance().removeAITags(aiTagsRequest);
imagekitio = ImageKitIo::Client.new("your_private_key", "your_public_key", "your_url_endpoint")
imagekitio.delete_bulk_ai_tags(
  file_ids:  [
        "file_id_1",
        "file_id_2"
    ],
    ai_tags: [
        "ai_tag_to_remove_1", 
        "ai_tag_to_remove_2"
    ]
)
resp, err := ik.Media.RemoveAITags(ctx, media.AITagsParam{
    FileIds: []string{
        "file_id_1",
        "file_id_2",
    },
    AITags: []string{"ai_tag_to-remove_1", "ai_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/"
});
 AITagsRequest removeAITagsRequest = new AITagsRequest
    {
        AITags = new List<string>
        {
            "tag_1",
            "tag_2"
        },
        fileIds = new List<string>
        {
            "fileId_1",
        },
};
ResultTags removeAITags = imagekit.RemoveAITags(removeAITagsRequest);