Actions109
- Activity Actions
- Assets Actions
- Authentication Actions
- Collections Actions
- Extensions Actions
- Fields Actions
- Files Actions
- Folders Actions
- Items Actions
- Permissions Actions
- Presets Actions
- Relations Actions
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
- Webhooks Actions
Overview
This node integrates with the Directus API, a headless CMS and data platform. Specifically, for the Authentication resource and the Log Out operation, it allows users to log out by invalidating a JWT refresh token.
Typical use cases include:
- Ending a user session securely in an application that uses Directus for authentication.
- Revoking access tokens when a user logs out to prevent further API access.
- Managing user sessions programmatically within n8n workflows.
Example: After a user finishes their work in an app, this node can be used to call the logout endpoint of Directus, passing the refresh token to invalidate it and ensure the user is logged out.
Properties
| Name | Meaning |
|---|---|
| Refresh Token | The JWT refresh token string that you want to log out (invalidate). This is required. |
Output
The node outputs a JSON object representing the response from the Directus API logout endpoint. Typically, this will confirm whether the logout was successful or provide error details if it failed.
The output structure is:
{
"response": { /* API response object */ }
}
No binary data output is involved in this operation.
Dependencies
- Requires an active connection to a Directus instance via an API key credential configured in n8n.
- The node uses the Directus API's
/auth/logoutendpoint, which expects a valid refresh token. - Proper API credentials must be set up in n8n to authenticate requests.
Troubleshooting
- Invalid or expired refresh token: If the provided refresh token is invalid or already expired, the API will return an error. Ensure the token is current and correctly copied.
- Missing refresh token: Since the refresh token is required, omitting it will cause the node to fail.
- API connectivity issues: Network problems or incorrect Directus API URL/credentials will cause request failures.
- Permission errors: The API key used must have permission to perform logout operations.
To resolve errors:
- Verify the refresh token value.
- Check API credentials and permissions.
- Confirm network connectivity to the Directus server.
- Enable "Continue on Fail" in the node settings to handle errors gracefully in workflows.