1. Prepare selected files

PUT {{api-server}}/{{Filerobot-Token}}/v5/bulk/prepare

Body parameters:

NameDescriptionSyntaxValue/Example
bulkThe main Object, containing information about the files that need to be updated ( target) and the changes that need to be applied ( changes)Object"bulk": {
"target": {}, "changes" : []
}
targetContains the file_uuids that need to be updatedObject"target" : { "file_uuids" : [] }
file_uuidsA List of fileuuids that need to be updated. The fileuuids can be taken from the response of the Seach/List API endpoint or Get File DetailsList"file_uuids" : [
"file_uuid1",
"file_uuid2",
...
]
changesDescribes the changes that need to be applied in the metadata field(s)List"changes": [ { "type": "", "key": "", "value": { "lang1": "",
"lang2": "" } } ]
typeDescribes the type of the Update operation.String.
Several options are possible:
meta.replace - default. The new values will overwrite the old data

The following options are possible only for MULTI-SELECT metadata fields:
meta.add - add new values to the list of the already existing
meta.remove - removes values from the list of the already existing
"type": "meta.replace"
keyThe metadata_key of the field that needs to be modified. It can be taken from the Get Metadata taxonomy response.String."key": "warranty"
valueThe new value of the metadata fieldThe type of the metadata field can be checked using the Get Metadata taxonomy endpoint, fields.type

When the metadata field is type NUMERIC or BOOLEAN, the value is a String.

For TEXT and TEXTAREA, the type of the value depends on the fact if the Filerobot project is set to support multiple languages (en, de, fr, es, etc) or not.
If not, the value is a String.
"value" : "abc"
If yes, the value is an object in format
"value" : { "en" : "abc"}

In case of MULTI-SELECT field, the value is in format:
"value" : [ "api_slug1", "api_slug2"]

In case of SELECTONE field, the value is in format
`value : "api
slug"`

The api_keys can be taken from the Get List options endpoint.
"value" : "123"
"value" : false







"value": "text"
"value" : { "en" : "text_en" }










"value" : [ "api_slug1", "api_slug2"]




"value" : "api_slug"

Request Body

{"bulk"=>{"target"=>{"files_uuids"=>["f98a69b0-7391-59af-afd8-bf338b750000", "689b8a2f-151a-5d0f-98e1-fd0cdd550000", "6b66979a-6edd-5bfc-af01-6a017e050000"]}, "changes"=>[{"type"=>"meta.replace", "key"=>"warranty", "value"=>{"en"=>"123"}}]}}

HEADERS

KeyDatatypeRequiredDescription
Content-Typestring
X-Filerobot-KeystringThe API key or the SASS_key generated from a Security template

RESPONSES

status: OK

{"status":"success","bulk_uuid":"ca1a2258-4d39-4456-8aa6-8e7fe8265991","api_version":{"hash":"376984c150c4e7a5fa9919eba263111d4fa7e041","datetime":"2024-07-05T04:46:26+00:00","module":"elastic_v2"}}