Modify tags attached to an asset
PUT {{api-server}}/{{Filerobot-Token}}/v5/file/:file_uuid/tags
You can edit the list of tags attached to an asset using this API endpoint.
Based on the content of the request body, this multifunctional endpoint can either:
create new tags for the Tags dictionary
append or delete tags from the asset's tag list
overwrite all existing tags attached to an asset
Body parameters:
Name: | Description: | Syntax: | Value/Example: |
---|---|---|---|
lang | Specifies the language (the Regional variant of the metadata) to which the Tags should be associated. | The language needs to be defined in the Project's settings prior to be used. | "lang": "en" |
existing_tags | An array listing the sid values of the Tags that are already associated with this asset. | Leaving existing_tags empty in the request body overwrites the asset's tags. The tags' sid values can be taken from GET File Details - field tags.en.sid | "existing_tags": [] "existing_tags": ["#tg05997", "#tgdef67"] |
new_tags | An array containing the new list of tags that should be attached to an asset. | In case some tag is not existing in the Tags Dictionary, it will be created there and also attached to the asset's list of tags. In case a tag is listed in existing_tags but not listed in new_tags the request will delete this tag from the asset's metadata. | "new_tags": ["Cream"] |
Request Body
{"lang"=>"en", "existing_tags"=>["#tgdef67", "#tg3171f"], "new_tags"=>["Cream"]}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
X-Filerobot-Key | string | ||
Content-Type | string |
RESPONSES
status: OK
{"status":"success","file":{"uuid":"700f6eab-421f-5be2-9867-cc227da50000","name":"10899.jpg","extension":"jpg","size":{"bytes":72704,"pretty":"71.0 KB"},"owner":"535","flags":null,"type":"image/jpeg","info":{"area":1500000,"brand":{"extracted":[],"has_logo":false},"ext":"jpg","image_to_text":"The image features a woman wearing a pink shirt and denim shorts, posing for a picture. She is smiling and appears to be happy.","img_color_space":"RGB","img_h":1000,"img_o":"LD","img_type":"JPEG","img_w":1500,"name":"10899.jpg","thumbnail":"https://fbmjmuoeb.filerobot.com/.internal/thumbnails/700f6eab-421f-5be2-9867-cc227da50000.jpg?vh=6ea2bc","thumbnail_uuid":"0364bdc8-4238-5689-834a-d9c9be850000","type":"image/jpeg","visibility":1},"tags":{"de":[{"label":"~ Jean","sid":"#tg3171f"},{"label":"~ Cream","sid":"#tgdef67"}],"en":[{"label":"Denim","sid":"#tg3171f"},{"label":"Cream","sid":"#tgdef67"}],"fr":[{"label":"Jean","sid":"#tg3171f"},{"label":"~ Cream","sid":"#tgdef67"}]},"labels":[],"meta":{"approved":"","asset_expiration":"","color_1":"","copyright":"","culture":"","description":{},"details":"","id":"","internal":"","materials":"@itm_v1_951e47dd_0@","photographer":"","price":"","product-type":"@itm_v1_b08755af_9@","release_date":"","season":"","seasons":"","tags":null,"territories":"","title":{},"type_of_shoes":"@itm_v1_3d9c0a79_c@","year":"@itm_v1_4a603f1d_7@"},"relevance":null,"visibility":{"in_dam":{"set":"inherited","actual":"all_organisation"},"in_cdn":{"set":"inherited","actual":"public"}},"is_favorite":null,"url":{"public":"https://store.filerobot.com/fbmjmuoeb/Images/T-shirt/10899.jpg","permalink":"https://api.filerobot.com/fbmjmuoeb/v5/get/700f6eab-421f-5be2-9867-cc227da50000","cdn":"https://fbmjmuoeb.filerobot.com/Images/T-shirt/10899.jpg?vh=6ea2bc","path":"/Images/T-shirt/10899.jpg"},"hash":{"sha1":"6ea2bc9aba16539c47c1e8ea2bdeacc3aafa5199","blurhash":null},"iptc_xml":{},"created_at":"2024-05-31T14:56:44Z","modified_at":"2024-06-19T15:23:02Z","folder":{"uuid":"dafbf85a-8141-5f87-ad0d-24c1dd30fe35","name":"/Images/T-shirt"},"product":{"ref":null,"position":null}},"api_version":{"hash":"b0d23b8fa1ae371a4966d57ae5237d65ced42d32","datetime":"2024-06-19T11:07:33+07:00","module":"elastic_v2"}}