Actions100
- Activity Actions
- Asset Actions
- Authentication Actions
- Collection Actions
- Extension Actions
- Field Actions
- File Actions
- Folder Actions
- Item Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
Overview
The Directus n8n node's "Authentication" resource with the "Reset Password" operation allows you to reset a user's password in a Directus instance. This is typically used as part of a password recovery flow, where a user has requested a password reset and received a one-time JWT token (usually via email). The node takes this token and the new password, then submits them to the Directus API to update the user's credentials.
Common scenarios:
- Automating password reset flows for users who have forgotten their passwords.
- Integrating custom user management or support workflows that require programmatic password resets.
- Building self-service portals where users can reset their own passwords securely.
Example use case:
A user clicks "Forgot Password" on your app, receives a reset link by email containing a JWT token, and submits a new password through a form. Your n8n workflow uses this node to finalize the password reset in Directus.
Properties
Name | Type | Meaning |
---|---|---|
Token | String | One-time use JWT token sent to the user, used to verify the password reset request. |
Password | String | The new password to set for the user. |
JSON/RAW Parameters | Boolean | If true, allows passing all body parameters as raw JSON; if false, uses individual fields. |
Body Parameters | JSON | (Used only if JSON/RAW Parameters is true) Raw JSON object containing body parameters. |
Output
- The node outputs a single
json
object per execution. - The structure of the output reflects the response from the Directus API after attempting the password reset. Typically, this will be an object indicating success or failure, possibly including user information or status messages.
Example output:
{
"data": {
// ...fields returned by Directus, e.g., user id, status, etc.
}
}
- If an error occurs and "Continue On Fail" is enabled, the output will include an
error
field with the error message:
{
"error": "Error message here"
}
Dependencies
- Directus API: You must have access to a running Directus instance.
- API Credentials: The node requires valid Directus API credentials configured in n8n under the name
directusApi
. - No additional environment variables are required beyond standard n8n credential setup.
Troubleshooting
Common issues:
- Invalid or expired token: If the JWT token is invalid or has expired, the API will reject the request. Ensure the token is current and matches what was sent to the user.
- Password policy violations: If the new password does not meet Directus's password requirements, the API may return an error.
- Incorrect input format: If using JSON/RAW Parameters, ensure the JSON is correctly structured.
Typical error messages:
"Token is invalid or expired"
: The provided token cannot be used. Request a new password reset."Password does not meet requirements"
: Choose a stronger password according to Directus settings."Missing required parameter"
: Ensure both Token and Password are provided unless using raw JSON.
How to resolve:
- Double-check the token and password values.
- Use the "JSON/RAW Parameters" option only if you need to send custom payloads.
- Review Directus server logs for more detailed error information if available.
Links and References
- Directus Authentication API Documentation
- n8n Documentation: Using Credentials
- Directus Password Reset Flow