Actions74
- Lists Actions
- Tweets Actions
- Users Actions
- Timelines Actions
- Media Actions
- Spaces Actions
- Direct Messages Actions
- Analytics Actions
- Compliance Actions
Overview
The "Block User" operation in the Users resource allows you to block a specified user on X (formerly Twitter) via the API. This action prevents the blocked user from interacting with your account, such as viewing your tweets or following you.
This node is useful in scenarios where you want to automate moderation or manage your social media interactions programmatically. For example, you could automatically block users who meet certain criteria detected in other parts of your workflow, helping maintain a positive community environment without manual intervention.
Practical example: Automatically block users who post spammy content by integrating this node into a workflow that detects such behavior and triggers the block action.
Properties
| Name | Meaning |
|---|---|
| User ID | The ID or @username of the user to block |
Note: Although the full node supports many properties for various resources and operations, for the Users - Block User operation, only the User ID property is required and relevant.
Output
The output JSON contains the response from the Twitter API after attempting to block the user. It typically includes confirmation details about the block action, such as success status or any metadata returned by the API.
If the operation fails and "Continue On Fail" is enabled, the output will include an error message describing the failure for each item processed.
No binary data is produced by this operation.
Dependencies
- Requires valid credentials for accessing the Twitter API v2, specifically an OAuth2 or API key credential configured in n8n.
- Requires a subscription and valid API key for the external "N8N Tools API" service used for request validation.
- The node uses an internal helper class to interact with Twitter's API endpoints.
Troubleshooting
- Invalid subscription or API key error: If you receive an error indicating invalid subscription or API key, verify that your N8N Tools API credentials are correct and active.
- User not found or invalid User ID: Ensure the User ID or username provided is valid and exists on Twitter.
- Permission errors: Blocking a user requires appropriate permissions; ensure your Twitter API credentials have the necessary scopes.
- Rate limits: Twitter API enforces rate limits; if you hit these, consider adding delays or handling retries in your workflow.
- Unhandled exceptions: Enable "Continue On Fail" to allow the workflow to continue processing other items even if blocking one user fails.