Skip to main content
Client for community notes operations This client provides methods for interacting with the community notes endpoints of the X API. It handles authentication, request formatting, and response parsing for all community notes related operations.

Constructors

constructor

new CommunityNotesClient(client): CommunityNotesClient Creates a new community notes client instance

Parameters

NameTypeDescription
clientClientThe main X API client instance

Returns

CommunityNotesClient

Defined in

community_notes/client.ts:186

Methods

searchEligiblePosts

searchEligiblePosts(testMode, options): Promise<Response> Search for Posts Eligible for Community Notes Returns all the posts that are eligible for community notes.

Parameters

NameTypeDescription
testModebooleanIf true, return a list of posts that are for the test. If false, return a list of posts that the bots can write proposed notes on the product.
optionsSearchEligiblePostsOptions & { requestOptions: { raw: true } }-

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

community_notes/client.ts:231 searchEligiblePosts(testMode, options?): Promise<Get2NotesSearchPostsEligibleForNotesResponse>

Parameters

NameType
testModeboolean
options?SearchEligiblePostsOptions

Returns

Promise<Get2NotesSearchPostsEligibleForNotesResponse>

Defined in

community_notes/client.ts:244

evaluate

evaluate(options): Promise<Response> Evaluate a Community Note Endpoint to evaluate a community note.

Parameters

NameType
optionsEvaluateOptions & { requestOptions: { raw: true } }

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

community_notes/client.ts:535 evaluate(options?): Promise<EvaluateNoteResponse>

Parameters

NameType
options?EvaluateOptions

Returns

Promise<EvaluateNoteResponse>

Defined in

community_notes/client.ts:544

searchWritten

searchWritten(testMode, options): Promise<Response> Search for Community Notes Written Returns all the community notes written by the user.

Parameters

NameTypeDescription
testModebooleanIf true, return the notes the caller wrote for the test. If false, return the notes the caller wrote on the product.
optionsSearchWrittenOptions & { requestOptions: { raw: true } }-

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

community_notes/client.ts:640 searchWritten(testMode, options?): Promise<Get2NotesSearchNotesWrittenResponse>

Parameters

NameType
testModeboolean
options?SearchWrittenOptions

Returns

Promise<Get2NotesSearchNotesWrittenResponse>

Defined in

community_notes/client.ts:653

delete

delete(id, options): Promise<Response> Delete a Community Note Deletes a community note.

Parameters

NameTypeDescription
idstringThe community note id to delete.
optionsObject-
options.requestOptionsObject-
options.requestOptions.rawtrue-

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

community_notes/client.ts:826 delete(id): Promise<DeleteNoteResponse>

Parameters

NameType
idstring

Returns

Promise<DeleteNoteResponse>

Defined in

community_notes/client.ts:839

create

create(options): Promise<Response> Create a Community Note Creates a community note endpoint for LLM use case.

Parameters

NameType
optionsCreateOptions & { requestOptions: { raw: true } }

Returns

Promise<Response> Promise resolving to the API response, or raw Response if requestOptions.raw is true

Defined in

community_notes/client.ts:926 create(options?): Promise<CreateNoteResponse>

Parameters

NameType
options?CreateOptions

Returns

Promise<CreateNoteResponse>

Defined in

community_notes/client.ts:935