> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tracecat.com/llms.txt
> Use this file to discover all available pages before exploring further.

# X

> Reference for the Tracecat X integration: registered actions, required secrets, expected inputs, and example workflow usage.

## Get tweet

Action ID: `tools.x.get_tweet`

Get a post. Calls GET /2/tweets/\{tweet\_id} directly.

Reference: [https://docs.x.com/x-api/posts/get-post-by-id](https://docs.x.com/x-api/posts/get-post-by-id)

### Secrets

Required secrets:

* `x`: required values `X_APP_ONLY_TOKEN`.

### Input fields

<ParamField path="tweet_id" type="string" required>
  X post ID.
</ParamField>

<ParamField path="base_url" type="string | null">
  Base URL of the X API.

  Default: `null`.
</ParamField>

<ParamField path="expansions" type="string | null">
  A comma separated list of fields to expand.

  Default: `null`.
</ParamField>

<ParamField path="media_fields" type="string | null">
  A comma separated list of Media fields to display.

  Default: `null`.
</ParamField>

<ParamField path="place_fields" type="string | null">
  A comma separated list of Place fields to display.

  Default: `null`.
</ParamField>

<ParamField path="poll_fields" type="string | null">
  A comma separated list of Poll fields to display.

  Default: `null`.
</ParamField>

<ParamField path="tweet_fields" type="string | null">
  A comma separated list of Post fields to display.

  Default: `null`.
</ParamField>

<ParamField path="user_fields" type="string | null">
  A comma separated list of User fields to display.

  Default: `null`.
</ParamField>

## Get user

Action ID: `tools.x.get_user`

Get a user. Calls GET /2/users/\{user\_id} directly.

Reference: [https://docs.x.com/x-api/users/get-user-by-id](https://docs.x.com/x-api/users/get-user-by-id)

### Secrets

Required secrets:

* `x`: required values `X_APP_ONLY_TOKEN`.

### Input fields

<ParamField path="user_id" type="string" required>
  X user ID.
</ParamField>

<ParamField path="base_url" type="string | null">
  Base URL of the X API.

  Default: `null`.
</ParamField>

<ParamField path="expansions" type="string | null">
  A comma separated list of fields to expand.

  Default: `null`.
</ParamField>

<ParamField path="tweet_fields" type="string | null">
  A comma separated list of Post fields to display.

  Default: `null`.
</ParamField>

<ParamField path="user_fields" type="string | null">
  A comma separated list of User fields to display.

  Default: `null`.
</ParamField>

## Search recent tweets

Action ID: `tools.x.search_recent_tweets`

Search recent posts. Calls GET /2/tweets/search/recent directly.

Reference: [https://docs.x.com/x-api/posts/search-recent-posts](https://docs.x.com/x-api/posts/search-recent-posts)

### Secrets

Required secrets:

* `x`: required values `X_APP_ONLY_TOKEN`.

### Input fields

<ParamField path="query" type="string" required>
  X recent search query.
</ParamField>

<ParamField path="base_url" type="string | null">
  Base URL of the X API.

  Default: `null`.
</ParamField>

<ParamField path="end_time" type="string | null">
  Newest UTC timestamp to include, formatted as YYYY-MM-DDTHH:mm:ssZ.

  Default: `null`.
</ParamField>

<ParamField path="expansions" type="string | null">
  A comma separated list of fields to expand.

  Default: `null`.
</ParamField>

<ParamField path="max_results" type="integer | null">
  Maximum number of results. X supports 10 to 100.

  Default: `null`.
</ParamField>

<ParamField path="media_fields" type="string | null">
  A comma separated list of Media fields to display.

  Default: `null`.
</ParamField>

<ParamField path="next_token" type="string | null">
  A base32hex-encoded pagination token.

  Default: `null`.
</ParamField>

<ParamField path="pagination_token" type="string | null">
  A base32hex-encoded pagination token.

  Default: `null`.
</ParamField>

<ParamField path="place_fields" type="string | null">
  A comma separated list of Place fields to display.

  Default: `null`.
</ParamField>

<ParamField path="poll_fields" type="string | null">
  A comma separated list of Poll fields to display.

  Default: `null`.
</ParamField>

<ParamField path="since_id" type="string | null">
  Return results with a post ID greater than this ID.

  Default: `null`.
</ParamField>

<ParamField path="sort_order" type="string | null">
  Result order, such as recency or relevancy.

  Default: `null`.
</ParamField>

<ParamField path="start_time" type="string | null">
  Oldest UTC timestamp to include, formatted as YYYY-MM-DDTHH:mm:ssZ. Must be within the last 7 days.

  Default: `null`.
</ParamField>

<ParamField path="tweet_fields" type="string | null">
  A comma separated list of Post fields to display.

  Default: `null`.
</ParamField>

<ParamField path="until_id" type="string | null">
  Return results with a post ID less than this ID.

  Default: `null`.
</ParamField>

<ParamField path="user_fields" type="string | null">
  A comma separated list of User fields to display.

  Default: `null`.
</ParamField>
