N8N Tools - X (Twitter) Enhanced icon

N8N Tools - X (Twitter) Enhanced

Comprehensive X (Twitter) API v2 integration for N8N workflows

Overview

The node provides enhanced integration with the X (formerly Twitter) API v2, enabling a wide range of operations on Twitter data within n8n workflows. Specifically for the Tweets resource and the Hide Reply operation, this node allows users to hide a reply to a tweet, effectively making that reply less visible or hidden from public view on the platform.

This functionality is useful in scenarios where you want to moderate conversations by hiding unwanted or inappropriate replies without deleting them entirely. For example, a social media manager could automate hiding negative or spammy replies to important tweets to maintain a positive brand image.

Practical example:

  • Automatically hide replies containing certain keywords or from specific users to protect your tweet's engagement quality.
  • Use in a workflow triggered by new replies to a tweet, applying moderation rules dynamically.

Properties

Name Meaning
Tweet ID The unique identifier of the tweet whose reply you want to hide.
Include Private Metrics Whether to include private metrics in responses (not applicable for hide reply but available for other tweet operations).
Custom Fields Comma-separated list of additional custom fields to include in the response (not used directly in hide reply).
Custom Expansions Comma-separated list of expansions to include in the response (not used directly in hide reply).

For the Hide Reply operation specifically, only the Tweet ID property is required and relevant.

Output

The output JSON contains the response from the Twitter API after attempting to hide the reply. This typically includes confirmation of the action or details about the updated tweet reply visibility status.

The node does not output binary data for this operation.

Example output structure (simplified):

{
  "data": {
    "hidden": true,
    "tweet_id": "1234567890"
  }
}

Where hidden indicates whether the reply was successfully hidden.

Dependencies

  • Requires an active subscription and valid API key for the external service called "N8N Tools API" which validates usage before calling Twitter endpoints.
  • Requires OAuth2 or API key credentials configured in n8n for authenticating with the Twitter API.
  • Uses the bundled TwitterApi class to interact with Twitter's API v2 endpoints.

Troubleshooting

  • Invalid subscription or API key error: If the node throws an error about invalid subscription or API key, verify that your API key credential for the external validation service is correct and active.
  • Twitter API errors: Errors returned from Twitter (e.g., invalid Tweet ID, insufficient permissions) will be surfaced. Ensure the Tweet ID is correct and the authenticated user has permission to hide replies on that tweet.
  • Network or timeout issues: Check network connectivity and API rate limits if requests fail intermittently.
  • Unsupported file upload URL error: Not relevant for Hide Reply but mentioned in code for media uploads; ensure base64 data is used for media uploads instead of URLs.

Links and References

Discussion