Directus (flagbit) icon

Directus (flagbit)

Consume Directus API

Overview

This node is designed to update a user record in a system that uses Directus as its backend. It allows you to modify specific fields of an existing user by providing the user's unique identifier and a JSON object containing the fields to update. This is useful in scenarios where you need to programmatically change user details such as roles, titles, or other profile information without manually accessing the admin interface.

Practical examples include:

  • Updating a user's job title or department after a promotion.
  • Changing user permissions or status based on external triggers.
  • Synchronizing user data from another system into Directus.

Properties

Name Meaning
ID The unique identifier (primary key) of the user to update. This is required to specify which user record will be modified.
Data (JSON) A JSON object representing the partial user data to update. You provide only the fields you want to change. For example, {"title": "CTO"} updates the user's title to CTO.

Output

The output contains a JSON object representing the updated user record after the operation completes successfully. This includes all user fields, reflecting the changes made. There is no binary data output for this node.

Dependencies

  • Requires access to a Directus API endpoint configured with appropriate authentication.
  • Needs an API key or token credential to authorize requests to the Directus backend.
  • The node depends on internal methods and routing logic bundled within the node's codebase to handle the update operation.

Troubleshooting

  • Missing or invalid ID: If the provided user ID does not exist or is malformed, the node will fail to find the user to update. Ensure the ID is correct and corresponds to an existing user.
  • Invalid JSON data: The "Data (JSON)" property must be valid JSON and conform to the expected user object schema. Malformed JSON or unsupported fields may cause errors.
  • Authentication errors: If the API key or token is missing or invalid, the node will return authorization errors. Verify credentials and permissions.
  • API connectivity issues: Network problems or incorrect API endpoint configuration can prevent successful updates. Check network access and endpoint URLs.

Links and References

Discussion