> ## 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.

# WebhooksClient

> Methods for X API v2 Webhooks endpoints.

Access **Webhooks** endpoints via `client.webhooks()` (`WebhooksClient`).

## Methods

| Method | Endpoint | Behavior | Summary |
| :- | :- | :- | :- |
| [`create`](#create) | `POST /2/webhooks` | Standard | Create Webhook |
| [`createStreamLink`](#createstreamlink) | `POST /2/tweets/search/webhooks/{webhook_id}` | Standard | Create Stream Link |
| [`createWebhookReplayJob`](#createwebhookreplayjob) | `POST /2/webhooks/replay` | Standard | Create Replay Job for Webhook |
| [`delete`](#delete) | `DELETE /2/webhooks/{webhook_id}` | Standard | Delete Webhook |
| [`deleteStreamLink`](#deletestreamlink) | `DELETE /2/tweets/search/webhooks/{webhook_id}` | Standard | Delete Stream Link |
| [`get`](#get) | `GET /2/webhooks` | Standard | Get Webhook |
| [`getStreamLinks`](#getstreamlinks) | `GET /2/tweets/search/webhooks` | Standard | Get Stream Links |
| [`validate`](#validate) | `PUT /2/webhooks/{webhook_id}` | Standard | Validate Webhook |

## `create`

POST `/2/webhooks`

**Create Webhook**

Creates a new webhook configuration.

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

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.webhooks().create(
    new Schemas.CreateWebhooksRequest().url("https://example.com/webhook")
);
System.out.println(response);
```

### Parameters

**body** `Schemas.CreateWebhooksRequest` *required*

Request payload.

**Returns:** `Schemas.CreateWebhooksResponse`

***

## `createStreamLink`

POST `/2/tweets/search/webhooks/{webhook_id}`

**Create Stream Link**

Creates a link to deliver FilteredStream events to the given webhook.

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

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.webhooks().createStreamLink("1234567890");
System.out.println(response);
```

### Parameters

**webhookId** `String` *required*

`webhook_id` (path parameter).

**Returns:** `Schemas.CreateWebhooksStreamLinkResponse`

***

## `createWebhookReplayJob`

POST `/2/webhooks/replay`

**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.

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

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.webhooks().createWebhookReplayJob(
    new Schemas.CreateWebhookReplayJobRequest().webhookId("1234567890").fromDate("example").toDate("example")
);
System.out.println(response);
```

### Parameters

**body** `Schemas.CreateWebhookReplayJobRequest` *required*

Request payload.

**Returns:** `Schemas.CreateWebhookReplayJobResponse`

***

## `delete`

DELETE `/2/webhooks/{webhook_id}`

**Delete Webhook**

Deletes an existing webhook configuration.

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

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.webhooks().delete("1234567890");
System.out.println(response);
```

### Parameters

**webhookId** `String` *required*

`webhook_id` (path parameter).

**Returns:** `Schemas.DeleteWebhooksResponse`

***

## `deleteStreamLink`

DELETE `/2/tweets/search/webhooks/{webhook_id}`

**Delete Stream Link**

Deletes the link delivering FilteredStream events to the given webhook.

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

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.webhooks().deleteStreamLink("1234567890");
System.out.println(response);
```

### Parameters

**webhookId** `String` *required*

`webhook_id` (path parameter).

**Returns:** `Schemas.DeleteWebhooksStreamLinkResponse`

***

## `get`

GET `/2/webhooks`

**Get Webhook**

Get a list of webhook configs associated with a client app.

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

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.webhooks().get();
System.out.println(response);
```

### Parameters

**Optional parameters (WebhooksClient.GetOptions — 1)**

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

A comma separated list of WebhookConfig fields to display.

**Returns:** `Schemas.GetWebhooksResponse`

***

## `getStreamLinks`

GET `/2/tweets/search/webhooks`

**Get Stream Links**

Get a list of webhook links associated with a filtered stream ruleset.

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

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.webhooks().getStreamLinks();
System.out.println(response);
```

**Returns:** `Schemas.GetWebhooksStreamLinksResponse`

***

## `validate`

PUT `/2/webhooks/{webhook_id}`

**Validate Webhook**

Triggers a CRC check for a given webhook.

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

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.webhooks().validate("1234567890");
System.out.println(response);
```

### Parameters

**webhookId** `String` *required*

`webhook_id` (path parameter).

**Returns:** `Schemas.ValidateWebhooksResponse`

***
