Directus icon

Directus

Consume Directus API

Overview

The Accept User Invite operation for the Users resource in this n8n node allows you to accept a user invitation in a Directus instance. This is typically used when a new user has been invited to join a Directus project and needs to set their password and activate their account using an invite token.

Common scenarios:

  • Automating onboarding workflows where users are programmatically invited and then need to complete their registration.
  • Integrating external systems that manage user invitations and want to finalize user creation in Directus via automation.

Practical example:
A user receives an email with an invite link containing a token. An n8n workflow can use this node to accept the invite by providing the token and setting the user's password, thus activating the account.


Properties

Name Type Meaning
Password String The password to set for the new user.
Token String The unique invite token from Directus.

Output

The output will be a JSON object representing the result of the invite acceptance. Typically, this includes information about the newly activated user or a success confirmation. The exact structure depends on the Directus API response, but it generally contains user details such as ID, email, status, and other profile fields.

Example output:

{
  "id": "123",
  "email": "[email protected]",
  "status": "active",
  // ...other user fields
}

If there is an error (and "Continue On Fail" is enabled), the output will include an error field with the error message.


Dependencies

  • Directus API: Requires access to a running Directus instance.
  • API Credentials: The node requires valid Directus API credentials configured in n8n under the name directusApi.

Troubleshooting

Common issues:

  • Invalid or expired token: If the invite token is invalid or has expired, the API will return an error. Ensure the token is correct and not previously used.
  • Password policy violation: If the provided password does not meet Directus's password requirements, the request will fail. Check the password policy settings in your Directus instance.
  • Missing required fields: Both token and password are required. Omitting either will result in an error.

Error messages:

  • "Invalid invite token": The token is incorrect or already used. Request a new invite.
  • "Password does not meet requirements": Use a stronger password according to Directus's policy.
  • "User already activated": The invite has already been accepted.

Links and References

Discussion