Add tags (bulk)

Add tags in bulk API

POST https://api.imagekit.io/v1/files/addTags

Add tags to multiple files in a single request.

Headers

NameTypeDescription

Authorization

string

base64 encoding of your_private_api_key:

Note the colon in the end.

Request Body

NameTypeDescription

fileIds

array

Each value should be a unique fileId of the current version of the uploaded file. fileId is returned in the list files API and upload API.

tags

array

An array of tags to add to these files.

{
    "successfullyUpdatedFileIds": [
        "5e21880d5efe355febd4bccd",
        "5e1c13c1c55ec3437c451403",
        "5f4abf6fae77ae7f0acda3d1", 
        "5f207bd1bd2741182ceadd55"
    ]
}

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 -X POST "https://api.imagekit.io/v1/files/addTags" \
-H 'Content-Type: application/json' \
-u your_private_key: -d '
{
	"fileIds" : [
		"file_id_1",
        "file_id_2"
	],
	"tags" : [
		"tag1",
        "tag2"
	]
}
'

Last updated