Directus icon

Directus

Consume Directus API

Overview

This node integrates with the Directus API to perform various operations on different resources. Specifically, for the Users resource and the Accept User Invite operation, it allows a user to accept an invitation to join a Directus project by providing a valid invite token and setting their password. This is useful in workflows where user onboarding is automated, such as when inviting users via email and then programmatically accepting their invites once they respond.

Practical example: After sending an invite to a new user, you can use this node to accept the invite on their behalf by supplying the invite token and a password, thereby activating their account without manual intervention.

Properties

Name Meaning
Password The password that the invited user will set for their account upon accepting the invite.
Token The unique token provided in the user invite, used to verify and accept the invitation.

Output

The output of this operation is a JSON object representing the response from the Directus API after accepting the user invite. Typically, this includes details about the newly activated user or confirmation of successful acceptance.

The structure generally contains fields such as user ID, email, role, status, and other metadata related to the user account.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to a Directus instance via an API key credential.
  • The node uses the Directus REST API endpoint users/invite/accept with a POST request.
  • Proper permissions are needed on the Directus API side to accept user invites.

Troubleshooting

  • Invalid or expired token error: If the token provided is invalid or has expired, the API will reject the request. Ensure the token is correct and still valid.
  • Missing required parameters: Both password and token must be provided; missing either will cause the request to fail.
  • API authentication errors: Make sure the API credentials configured in n8n have sufficient rights and are correctly set up.
  • Network or connectivity issues: Verify that the Directus instance is reachable from the n8n environment.

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

Links and References

Discussion