> For the complete documentation index, see [llms.txt](https://agpt.co/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://agpt.co/docs/integrations/block-integrations/blocks-3.md).

# Twitter Blocks

Blocks for managing blocked users on Twitter/X.

## Twitter Get Blocked Users

### What it is

This block retrieves a list of users blocked by the authenticating user.

### How it works

This block uses the Twitter API v2 via Tweepy to retrieve a paginated list of users that the authenticated account has blocked. It authenticates using OAuth 2.0 with the required scopes (users.read, block.read) and sends a request to Twitter's blocked users endpoint.

The response includes user IDs and usernames by default, with optional expansions to include additional data like pinned tweets. Pagination is supported through tokens, allowing retrieval of large block lists in batches of up to 1,000 users per request.

### Inputs

| Input             | Description                                                                                                                                 | Type                  | Required |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | -------- |
| expansions        | Choose what extra information you want to get with user data. Currently only 'pinned\_tweet\_id' is available to see a user's pinned tweet. | UserExpansionsFilter  | No       |
| tweet\_fields     | Select what tweet information you want to see in pinned tweets. This only works if you select 'pinned\_tweet\_id' in expansions above.      | TweetFieldsFilter     | No       |
| user\_fields      | Select what user information you want to see, like username, bio, profile picture, etc.                                                     | TweetUserFieldsFilter | No       |
| max\_results      | Maximum number of results to return (1-1000, default 100)                                                                                   | int                   | No       |
| pagination\_token | Token for retrieving next/previous page of results                                                                                          | str                   | No       |

### Outputs

| Output      | Description                              | Type            |
| ----------- | ---------------------------------------- | --------------- |
| error       | Error message if the operation failed    | str             |
| user\_ids   | List of blocked user IDs                 | List\[str]      |
| usernames\_ | List of blocked usernames                | List\[str]      |
| included    | Additional data requested via expansions | Dict\[str, Any] |
| meta        | Metadata including pagination info       | Dict\[str, Any] |
| next\_token | Next token for pagination                | str             |

### Possible use case

**Block List Audit**: Review your block list periodically to identify accounts you may want to unblock or to analyze blocking patterns.

**Safety Monitoring**: Track blocked accounts as part of a harassment monitoring workflow, documenting problematic accounts.

**Account Migration**: Export your block list when setting up a new account or for backup purposes.

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://agpt.co/docs/integrations/block-integrations/blocks-3.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
