Update files

Updates the information for the files specified in the request body.

If you want to update the file content, uploaded using the uploadUrl, please use the initFileUpload request with the query parameter 'overwrite=true'. Alternatively, delete and recreate the file.

For primitive fields (String, Long, Int), use 'set': 'value' to update value; use 'setNull': true to set that field to null.

For the Json Array field (e.g. assetIds and securityCategories): Use either only 'set', or a combination of 'add' and/or 'remove'.

AssetIds update examples:

Example request body to overwrite assetIds with a new set, asset ID 1 and 2.

{
  "items": [
    {
      "id": 1,
      "update": {
        "assetIds" : {
          "set" : [ 1, 2 ]
        }
      }
    }
  ]
}

Example request body to add one asset Id, and remove another asset ID.

{
  "items": [
    {
      "id": 1,
      "update": {
        "assetIds" : {
          "add" : [ 3 ],
          "remove": [ 2 ]
        }
      }
    }
  ]
}

Metadata update examples:

Example request body to overwrite metadata with a new set.

{
  "items": [
    {
      "id": 1,
      "update": {
        "metadata": {
          "set": {
            "key1": "value1",
            "key2": "value2"
          }
        }
      }
    }
  ]
}

Example request body to add two key-value pairs and remove two other key-value pairs by key for the metadata field.

{
  "items": [
    {
      "id": 1,
      "update": {
        "metadata": {
          "add": {
            "key3": "value3",
            "key4": "value4"
          },
          "remove": [
            "key1",
            "key2"
          ]
        }
      }
    }
  ]
}

Request throttling

This endpoint is a subject of the new throttling schema (limited request rate and concurrency). Please check Files resource description for more information.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
Request Body schema: application/json
required

The JSON request body which specifies which files and fields to update.

required
Array of FileChangeUpdateById (object) or FileChangeUpdateByExternalId (object) (FileChangeUpdate) [ 1 .. 1000 ] items
Responses
200

The response for a successful files/byids, files/search or files/update operation

400

The response for a failed request.

post/files/update
Request samples
application/json
{
  • "items": [
    • {
      }
    ]
}
Response samples
application/json
{
  • "items": [
    • {
      }
    ]
}