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

Constructors

constructor

new WebhooksClient(client): WebhooksClient Creates a new webhooks client instance

Parameters

NameTypeDescription
clientClientThe main X API client instance

Returns

WebhooksClient

Defined in

webhooks/client.ts:96

Methods

getStreamLinks(): Promise<WebhookLinksGetResponse> Get stream links Get a list of webhook links associated with a filtered stream ruleset.

Returns

Promise<WebhookLinksGetResponse> Promise resolving to the API response

Defined in

webhooks/client.ts:109
createStreamLink(webhookId, options?): Promise<WebhookLinksCreateResponse> Create stream link Creates a link to deliver FilteredStream events to the given webhook.

Parameters

NameTypeDescription
webhookIdstringThe webhook ID to link to your FilteredStream ruleset.
optionsCreateStreamLinkOptions-

Returns

Promise<WebhookLinksCreateResponse> Promise resolving to the API response

Defined in

webhooks/client.ts:145
deleteStreamLink(webhookId): Promise<WebhookLinksDeleteResponse> Delete stream link Deletes a link from FilteredStream events to the given webhook.

Parameters

NameTypeDescription
webhookIdstringThe webhook ID to link to your FilteredStream ruleset.

Returns

Promise<WebhookLinksDeleteResponse> Promise resolving to the API response

Defined in

webhooks/client.ts:225

validate

validate(webhookId): Promise<WebhookConfigPutResponse> Validate webhook Triggers a CRC check for a given webhook.

Parameters

NameTypeDescription
webhookIdstringThe ID of the webhook to check.

Returns

Promise<WebhookConfigPutResponse> Promise resolving to the API response

Defined in

webhooks/client.ts:263

delete

delete(webhookId): Promise<WebhookConfigDeleteResponse> Delete webhook Deletes an existing webhook configuration.

Parameters

NameTypeDescription
webhookIdstringThe ID of the webhook to delete.

Returns

Promise<WebhookConfigDeleteResponse> Promise resolving to the API response

Defined in

webhooks/client.ts:301

get

get(options?): Promise<Get2WebhooksResponse> Get webhook Get a list of webhook configs associated with a client app.

Parameters

NameType
optionsGetOptions

Returns

Promise<Get2WebhooksResponse> Promise resolving to the API response

Defined in

webhooks/client.ts:335

create

create(options?): Promise<WebhookConfigCreateResponse> Create webhook Creates a new webhook configuration.

Parameters

NameType
optionsCreateOptions

Returns

Promise<WebhookConfigCreateResponse> Promise resolving to the API response

Defined in

webhooks/client.ts:376