Directus icon

Directus

Consume Directus API

Overview

This node integrates with the Directus API, a headless CMS and data platform. Specifically, the Users - Update Me operation allows updating the profile information of the currently authenticated user. This is useful in scenarios where a user wants to modify their own account details such as name, title, avatar, or other custom fields managed by Directus.

Practical examples include:

  • Updating your user profile after changing your job title or contact information.
  • Modifying personal preferences stored in the user record.
  • Syncing user metadata from another system into Directus for the current user.

The node handles authentication via an API key credential and sends a PATCH request to the users/me endpoint with the provided JSON data.

Properties

Name Meaning
Data (JSON) A JSON object containing the fields and values to update on the currently authenticated user. Example: { "title": "CTO" }. This property is required.

Output

The output is a JSON object representing the updated user record returned by the Directus API after the PATCH request to users/me. It contains all the user fields including any that were updated.

Example output structure (simplified):

{
  "id": "user-id",
  "email": "user@example.com",
  "title": "CTO",
  "first_name": "John",
  "last_name": "Doe",
  ...
}

No binary data output is produced by this operation.

Dependencies

  • Requires a valid Directus API authentication token configured in n8n credentials.
  • The node uses the Directus REST API endpoint PATCH /users/me.
  • No additional external dependencies beyond the Directus API and n8n environment.

Troubleshooting

  • Invalid or missing authentication: Ensure the API key or authentication token credential is correctly set up and has permission to update the user.
  • Malformed JSON in Data property: The JSON must be valid and properly formatted. Invalid JSON will cause parsing errors.
  • Permission denied: The authenticated user must have rights to update their own user record.
  • Network or API errors: Check connectivity to the Directus instance and verify the API URL and credentials.
  • Unexpected response format: If the API changes or returns unexpected data, the node may fail to parse the response.

If errors occur, enabling "Continue On Fail" in the node settings can help capture error messages in the output for debugging.

Links and References

Discussion