Directus icon

Directus

Consume Directus API

Overview

The node integrates with the Directus API, a headless CMS and data platform. Specifically, for the Authentication resource and the Reset Password operation, it allows users to reset a user's password by providing a one-time JWT token and a new password.

This operation is useful in scenarios where a user has requested a password reset (typically after receiving a reset email with a token) and now needs to set a new password securely. For example, an automated workflow could use this node to finalize a password reset process after verifying the token sent to the user.

Properties

Name Meaning
Token One-time use JWT token that verifies the user’s identity during password reset.
Password The new password to set for the user.
JSON/RAW Parameters Boolean flag to indicate if the body parameters are provided as raw JSON instead of fields.
Body Parameters Raw JSON or object containing the request body parameters when JSON/RAW Parameters is true.

Output

  • The output json field contains the response from the Directus API after attempting to reset the password.
  • This typically includes confirmation of success or error details.
  • No binary data output is involved in this operation.

Dependencies

  • Requires an active connection to the Directus API via an API key credential configured in n8n.
  • The node uses the Directus REST API endpoint auth/password/reset.
  • Proper API authentication credentials must be set up in n8n for the node to function.

Troubleshooting

  • Invalid or expired token: If the provided JWT token is invalid or expired, the API will reject the request. Ensure the token is correct and has not been used before.
  • Password policy violations: The new password might need to meet certain complexity requirements enforced by Directus. Check the API documentation for password rules.
  • Missing required parameters: Both token and password are required. Omitting either will cause errors.
  • Malformed JSON: When using JSON/RAW parameters, ensure the JSON syntax is valid to avoid parsing errors.
  • API connectivity issues: Verify that the Directus API URL and credentials are correctly configured and accessible.

Links and References


Example usage snippet for Reset Password operation (conceptual):

{
  "token": "eyJ0eXAiOiJKV1Qi...",
  "password": "newSecurePassword123"
}

This would be sent as a POST request body to the Directus API endpoint /auth/password/reset.

Discussion