Directus (DrWade) icon

Directus (DrWade)

Consume Directus API

Overview

The Directus (DrWade) n8n node for the resource Users and operation Update Me allows you to update the profile information of the currently authenticated user in a Directus instance. This is particularly useful in automation scenarios where users need to programmatically change their own details, such as updating their job title, contact information, or other personal metadata.

Common use cases:

  • Allowing users to update their own profiles via automated workflows.
  • Synchronizing user data from another system into Directus for the current user.
  • Enabling self-service updates for user attributes without admin intervention.

Example:
A workflow that lets users update their "title" field after a promotion, or change their contact preferences automatically based on an external trigger.


Properties

Name Type Meaning
Data (JSON) json The JSON object containing fields and values to update for the current user. For example:
{"title": "CTO"}
This property is required and should include only the fields you wish to update.

Output

  • The output will be a single item with a json field containing the updated user object as returned by the Directus API.
  • The structure of the output typically mirrors the user schema in Directus, including all user fields (such as id, email, first_name, last_name, title, etc.) with updated values.

Example output:

{
  "id": "123",
  "email": "user@example.com",
  "first_name": "Jane",
  "last_name": "Doe",
  "title": "CTO",
  // ...other user fields
}
  • No binary data is produced by this operation.

Dependencies

  • Directus API: You must have access to a running Directus instance.
  • API Credentials: The node requires valid Directus API credentials (directusApi) configured in n8n.
  • User Authentication: The operation acts on the currently authenticated user; ensure the credentials correspond to the intended user.

Troubleshooting

Common issues:

  • Invalid JSON in Data (JSON): If the input is not valid JSON, the node will throw a parsing error. Double-check your syntax.
  • Insufficient Permissions: If the authenticated user does not have permission to update their own profile, the API will return an authorization error.
  • Field Validation Errors: Attempting to update fields that do not exist or providing invalid values (e.g., wrong data type) will result in validation errors from Directus.

Error messages and resolutions:

  • "Unexpected token ... in JSON": Check the Data (JSON) property for correct JSON formatting.
  • "You are not authorized to perform this action": Ensure the user's role has permission to update their own profile.
  • "Field 'xyz' does not exist": Only include valid user fields in your update payload.

Links and References


Discussion