Add tags (bulk)

post
Add tags in bulk API

https://api.imagekit.io/v1/files/addTags
Add tags to multiple files in a single request.
Request
Response
Request
Headers
Authorization
required
string
base64 encoding of your_private_api_key: Note the colon in the end.
Body Parameters
fileIds
required
array
Each value should be a unique fileId of the uploaded file. fileId is returned in list files API and upload API
tags
required
array
An array of tags to add on these files.
Response
200: OK
{
"successfullyUpdatedFileIds": [
"5e21880d5efe355febd4bccd",
"5e1c13c1c55ec3437c451403",
"5f4abf6fae77ae7f0acda3d1",
"5f207bd1bd2741182ceadd55"
]
}
404: Not Found
If any of the fileId is not found in your media library then a 404 response is returned and no tags are added to any file. The whole operation fails.
{
"message": "The requested file(s) does not exist.",
"help": "For support kindly contact us at support@imagekit.io .",
"missingFileIds": [
"5e21880d5efe355febd4bccd",
"5e1c13c1c55ec3437c451403"
]
}

Response structure and status code

In case of error, you will get an error code along with the error message. On success, you will receive a 200 status code with an empty body.

Examples

Here is the example request to understand the API usage.

cURL
cURL
curl -X POST "https://api.imagekit.io/v1/files/addTags" \
-H 'Content-Type: application/json' \
-u your_private_key: -d '
{
"fileIds" : [
"5e21880d5efe355febd4bccd",
"5e1c13c1c55ec3437c451403",
"5f4abf6fae77ae7f0acda3d1",
"5f207bd1bd2741182ceadd55"
],
"tags" : [
"tag-to-add-1",
"tag-to-add-2"
]
}
'