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

# CommunityNotesClient

> Methods for X API v2 Community Notes endpoints.

Access **Community Notes** endpoints via `client.communityNotes()` (`CommunityNotesClient`).

## Methods

| Method | Endpoint | Behavior | Summary |
| :- | :- | :- | :- |
| [`create`](#create) | `POST /2/notes` | Standard | Create a Community Note |
| [`delete`](#delete) | `DELETE /2/notes/{id}` | Standard | Delete a Community Note |
| [`evaluate`](#evaluate) | `POST /2/notes/evaluate` | Standard | Evaluate a Community Note |
| [`searchEligiblePosts`](#searcheligibleposts) | `GET /2/notes/search/posts_eligible_for_notes` | Paginated | Search for Posts Eligible for Community Notes |
| [`searchWritten`](#searchwritten) | `GET /2/notes/search/notes_written` | Paginated | Search for Community Notes Written |

## `create`

POST `/2/notes`

**Create a Community Note**

Creates a Community Note on a Post. With test\_mode set to true, the note is only for testing and is not publicly visible.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.communityNotes().create(
    new Schemas.CreateCommunityNotesRequest().testMode(true).postId("1895000000000000000")
);
System.out.println(response);
```

### Parameters

**body** `Schemas.CreateCommunityNotesRequest` *required*

Request payload.

**Returns:** `Schemas.CreateCommunityNotesResponse`

***

## `delete`

DELETE `/2/notes/{id}`

**Delete a Community Note**

Deletes a community note.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.communityNotes().delete("1895000000000000000");
System.out.println(response);
```

### Parameters

**id** `String` *required*

`id` (path parameter).

**Returns:** `Schemas.DeleteCommunityNotesResponse`

***

## `evaluate`

POST `/2/notes/evaluate`

**Evaluate a Community Note**

Evaluates the text of a proposed Community Note on a Post and returns its claim-opinion score.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.communityNotes().evaluate(
    new Schemas.EvaluateCommunityNotesRequest().postId("1895000000000000000").noteText("example")
);
System.out.println(response);
```

### Parameters

**body** `Schemas.EvaluateCommunityNotesRequest` *required*

Request payload.

**Returns:** `Schemas.EvaluateCommunityNotesResponse`

***

## `searchEligiblePosts`

GET `/2/notes/search/posts_eligible_for_notes` Paginated

**Search for Posts Eligible for Community Notes**

Retrieves Posts that are eligible for Community Notes.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.communityNotes().searchEligiblePostsPages(true)) {
    System.out.println(page);
}
```

### Parameters

**testMode** `Boolean` *required*

`test_mode` (query parameter).

**Optional parameters (CommunityNotesClient.SearchEligiblePostsOptions — 9)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

`pagination_token` (query parameter).

**options.postSelection** `String`

`post_selection` (query parameter).

**options.postFields** `List\<String\>`

A comma separated list of Post fields to display.

**options.expansions** `List\<String\>`

A comma separated list of fields to expand.

**options.userFields** `List\<String\>`

A comma separated list of User fields to display.

**options.mediaFields** `List\<String\>`

A comma separated list of Media fields to display.

**options.pollFields** `List\<String\>`

A comma separated list of Poll fields to display.

**options.placeFields** `List\<String\>`

A comma separated list of Place fields to display.

**Returns:** `Schemas.SearchEligiblePostsResponse` (use `searchEligiblePostsPages(...)` for automatic `Paginator<...>` iteration)

***

## `searchWritten`

GET `/2/notes/search/notes_written` Paginated

**Search for Community Notes Written**

Retrieves the Community Notes written by the authenticated user.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

for (var page : client.communityNotes().searchWrittenPages(true)) {
    System.out.println(page);
}
```

### Parameters

**testMode** `Boolean` *required*

`test_mode` (query parameter).

**Optional parameters (CommunityNotesClient.SearchWrittenOptions — 3)**

**options.maxResults** `Integer`

`max_results` (query parameter).

**options.paginationToken** `String`

`pagination_token` (query parameter).

**options.noteFields** `List\<String\>`

A comma separated list of Note fields to display.

**Returns:** `Schemas.SearchCommunityNotesWrittenResponse` (use `searchWrittenPages(...)` for automatic `Paginator<...>` iteration)

***
