Actions74
- Lists Actions
- Tweets Actions
- Users Actions
- Timelines Actions
- Media Actions
- Spaces Actions
- Direct Messages Actions
- Analytics Actions
- Compliance Actions
Overview
This node provides an enhanced integration with the X (formerly Twitter) API v2, enabling various operations across multiple Twitter resources. Specifically for the Direct Messages resource and the Send Direct Message operation, it allows sending a direct message to a specified user by their participant ID.
Use cases include:
- Automating personalized outreach or customer support messages.
- Sending notifications or alerts directly to users on X.
- Integrating direct messaging into broader workflows for marketing or engagement.
Example: Automatically send a welcome message to a new follower by specifying their user ID and the message content.
Properties
| Name | Meaning |
|---|---|
| Participant ID | The user ID of the recipient to whom the direct message will be sent. |
| Message Text | The content of the direct message to send. |
Output
The node outputs JSON data representing the response from the X API after sending the direct message. This typically includes details about the sent message such as message ID, timestamps, and status.
No binary data output is involved in this operation.
Dependencies
- Requires an active subscription and valid API key for the external "N8N Tools API" service used for validation.
- Requires OAuth2 or API key credentials configured in n8n to authenticate with the X (Twitter) API.
- The node uses an internal helper class to interact with the Twitter API v2 endpoints.
Troubleshooting
- Invalid subscription or API key error: If you receive an error indicating invalid subscription or API key, verify that your API key credential is correct and has the necessary permissions.
- Message sending failure: Errors during sending may occur if the participant ID is invalid or the authenticated user lacks permission to message the recipient. Check the participant ID and ensure the account can send DMs.
- Network or API errors: Temporary network issues or rate limits from the X API may cause failures. Implement retry logic or check API usage quotas.
Links and References
- X (Twitter) Developer Platform
- Direct Messages API Reference
- n8n Documentation (for general usage of this node)