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:162

Methods

createStreamLink(webhookId, options): Promise<Response> 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 & { requestOptions: { raw: true } }-

Returns

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

Defined in

webhooks/client.ts:207 createStreamLink(webhookId, options?): Promise<WebhookLinksCreateResponse>

Parameters

NameType
webhookIdstring
options?CreateStreamLinkOptions

Returns

Promise<WebhookLinksCreateResponse>

Defined in

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

Parameters

NameTypeDescription
webhookIdstringThe webhook ID to link to your FilteredStream ruleset.
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

webhooks/client.ts:433 deleteStreamLink(webhookId): Promise<WebhookLinksDeleteResponse>

Parameters

NameType
webhookIdstring

Returns

Promise<WebhookLinksDeleteResponse>

Defined in

webhooks/client.ts:446
getStreamLinks(options): Promise<Response> Get stream links Get a list of webhook links associated with a filtered stream ruleset.

Parameters

NameType
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

webhooks/client.ts:527 getStreamLinks(): Promise<WebhookLinksGetResponse>

Returns

Promise<WebhookLinksGetResponse>

Defined in

webhooks/client.ts:536

createWebhookReplayJob

createWebhookReplayJob(options): Promise<Response> Create replay job for webhook Creates a replay job to retrieve events from up to the past 24 hours for all events delivered or attempted to be delivered to the webhook.

Parameters

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

Returns

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

Defined in

webhooks/client.ts:605 createWebhookReplayJob(options?): Promise<ReplayJobCreateResponse>

Parameters

NameType
options?CreateWebhookReplayJobOptions

Returns

Promise<ReplayJobCreateResponse>

Defined in

webhooks/client.ts:614

validate

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

Parameters

NameTypeDescription
webhookIdstringThe ID of the webhook to check.
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

webhooks/client.ts:704 validate(webhookId): Promise<WebhookConfigPutResponse>

Parameters

NameType
webhookIdstring

Returns

Promise<WebhookConfigPutResponse>

Defined in

webhooks/client.ts:717

delete

delete(webhookId, options): Promise<Response> Delete webhook Deletes an existing webhook configuration.

Parameters

NameTypeDescription
webhookIdstringThe ID of the webhook 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

webhooks/client.ts:808 delete(webhookId): Promise<WebhookConfigDeleteResponse>

Parameters

NameType
webhookIdstring

Returns

Promise<WebhookConfigDeleteResponse>

Defined in

webhooks/client.ts:821

get

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

Parameters

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

Returns

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

Defined in

webhooks/client.ts:908 get(options?): Promise<Get2WebhooksResponse>

Parameters

NameType
options?GetOptions

Returns

Promise<Get2WebhooksResponse>

Defined in

webhooks/client.ts:917

create

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

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

webhooks/client.ts:1023 create(options?): Promise<WebhookConfigCreateResponse>

Parameters

NameType
options?CreateOptions

Returns

Promise<WebhookConfigCreateResponse>

Defined in

webhooks/client.ts:1032