Directus icon

Directus

Consume Directus API

File → Update (Raw JSON)

AI-generated

Summary

Updates a Directus file by sending a raw JSON payload to the API.

Inputs

  • fileId (required) — The ID of the file to update. Must be provided for each item processed.
  • jsonData — Raw JSON data to send to Directus as the request body. If omitted, an empty payload is sent.

Output shape

For each input item, returns an object with a json field containing either the parsed Directus response (or raw string) and a pairedItem reference to the input index. If continueOnFail is enabled and an error occurs, the json field contains { error: <message> }.

When the node‑level 'Simplify' option is enabled, the returned file object is simplified using the node's simplifyFile helper.

Examples

Example 1: Update a file's metadata with custom fields

Set File ID to {{$json[“fileId”]}} and JSON Data to {{ { “custom_metadata”: { “tags”: [“logo”, “brand”] } } }}. The node PATCHes /files/:id with the supplied JSON and returns the updated file record.

Discussion