# Webhook Configs

## Create Webhook Config

`WebhookConfigResponse webhookConfigs().create(WebhookConfigCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none())`

**post** `/api/v1/beta/webhook-configs`

Create a reusable webhook configuration for the current project.

### Parameters

- `WebhookConfigCreateParams params`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

  - `WebhookConfigCreate webhookConfigCreate`

    Request to create a stored webhook configuration.

    The owning tenant is taken from the request context (e.g. the project in the
    path), not the body.

### Returns

- `class WebhookConfigResponse:`

  A stored webhook configuration. The signing secret is never included.

  - `String id`

    Unique identifier for the webhook configuration.

  - `boolean hasSecret`

    Whether a signing secret is configured for this endpoint.

  - `String tenantId`

    Owner tenant ID.

  - `JsonValue; tenantType "project"constant`

    Owner tenant type.

    - `PROJECT("project")`

  - `String webhookUrl`

    URL that receives webhook POST notifications.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

  - `Optional<List<WebhookEvent>> webhookEvents`

    Subscribed events (null = all events).

    - `BATCH_CANCELLED("batch.cancelled")`

    - `BATCH_ERROR("batch.error")`

    - `BATCH_PENDING("batch.pending")`

    - `BATCH_RUNNING("batch.running")`

    - `BATCH_SUCCESS("batch.success")`

    - `CLASSIFY_CANCELLED("classify.cancelled")`

    - `CLASSIFY_ERROR("classify.error")`

    - `CLASSIFY_PARTIAL_SUCCESS("classify.partial_success")`

    - `CLASSIFY_PENDING("classify.pending")`

    - `CLASSIFY_RUNNING("classify.running")`

    - `CLASSIFY_SUCCESS("classify.success")`

    - `EXTRACT_CANCELLED("extract.cancelled")`

    - `EXTRACT_ERROR("extract.error")`

    - `EXTRACT_PARTIAL_SUCCESS("extract.partial_success")`

    - `EXTRACT_PENDING("extract.pending")`

    - `EXTRACT_SUCCESS("extract.success")`

    - `PARSE_CANCELLED("parse.cancelled")`

    - `PARSE_ERROR("parse.error")`

    - `PARSE_PARTIAL_SUCCESS("parse.partial_success")`

    - `PARSE_PENDING("parse.pending")`

    - `PARSE_RUNNING("parse.running")`

    - `PARSE_SUCCESS("parse.success")`

    - `SHEETS_CANCELLED("sheets.cancelled")`

    - `SHEETS_ERROR("sheets.error")`

    - `SHEETS_PARTIAL_SUCCESS("sheets.partial_success")`

    - `SHEETS_PENDING("sheets.pending")`

    - `SHEETS_SUCCESS("sheets.success")`

    - `SPLIT_CANCELLED("split.cancelled")`

    - `SPLIT_ERROR("split.error")`

    - `SPLIT_PENDING("split.pending")`

    - `SPLIT_PROCESSING("split.processing")`

    - `SPLIT_SUCCESS("split.success")`

    - `UNMAPPED_EVENT("unmapped_event")`

  - `Optional<WebhookHeaders> webhookHeaders`

    Custom HTTP headers sent with each request.

  - `Optional<WebhookOutputFormat> webhookOutputFormat`

    Response format sent to the webhook.

    - `JSON("json")`

    - `STRING("string")`

### Example

```java
package ai.llamaindex.llamacloud.example;

import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.webhookconfigs.WebhookConfigCreate;
import ai.llamaindex.llamacloud.models.webhookconfigs.WebhookConfigCreateParams;
import ai.llamaindex.llamacloud.models.webhookconfigs.WebhookConfigResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        WebhookConfigCreate params = WebhookConfigCreate.builder()
            .webhookUrl("https://example.com/webhooks/llamacloud")
            .build();
        WebhookConfigResponse webhookConfigResponse = client.webhookConfigs().create(params);
    }
}
```

#### Response

```json
{
  "id": "id",
  "has_secret": true,
  "tenant_id": "tenant_id",
  "tenant_type": "project",
  "webhook_url": "webhook_url",
  "created_at": "2019-12-27T18:11:19.117Z",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "webhook_events": [
    "batch.cancelled"
  ],
  "webhook_headers": {
    "foo": "string"
  },
  "webhook_output_format": "json"
}
```

## List Webhook Configs

`List<WebhookConfigResponse> webhookConfigs().list(WebhookConfigListParamsparams = WebhookConfigListParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**get** `/api/v1/beta/webhook-configs`

List the webhook configurations for the current project, newest first.

### Parameters

- `WebhookConfigListParams params`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

### Example

```java
package ai.llamaindex.llamacloud.example;

import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.webhookconfigs.WebhookConfigListParams;
import ai.llamaindex.llamacloud.models.webhookconfigs.WebhookConfigResponse;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        List<WebhookConfigResponse> webhookConfigResponses = client.webhookConfigs().list();
    }
}
```

#### Response

```json
[
  {
    "id": "id",
    "has_secret": true,
    "tenant_id": "tenant_id",
    "tenant_type": "project",
    "webhook_url": "webhook_url",
    "created_at": "2019-12-27T18:11:19.117Z",
    "updated_at": "2019-12-27T18:11:19.117Z",
    "webhook_events": [
      "batch.cancelled"
    ],
    "webhook_headers": {
      "foo": "string"
    },
    "webhook_output_format": "json"
  }
]
```

## Get Webhook Config

`WebhookConfigResponse webhookConfigs().retrieve(WebhookConfigRetrieveParamsparams = WebhookConfigRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**get** `/api/v1/beta/webhook-configs/{config_id}`

Get a single webhook configuration by ID.

### Parameters

- `WebhookConfigRetrieveParams params`

  - `Optional<String> configId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

### Returns

- `class WebhookConfigResponse:`

  A stored webhook configuration. The signing secret is never included.

  - `String id`

    Unique identifier for the webhook configuration.

  - `boolean hasSecret`

    Whether a signing secret is configured for this endpoint.

  - `String tenantId`

    Owner tenant ID.

  - `JsonValue; tenantType "project"constant`

    Owner tenant type.

    - `PROJECT("project")`

  - `String webhookUrl`

    URL that receives webhook POST notifications.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

  - `Optional<List<WebhookEvent>> webhookEvents`

    Subscribed events (null = all events).

    - `BATCH_CANCELLED("batch.cancelled")`

    - `BATCH_ERROR("batch.error")`

    - `BATCH_PENDING("batch.pending")`

    - `BATCH_RUNNING("batch.running")`

    - `BATCH_SUCCESS("batch.success")`

    - `CLASSIFY_CANCELLED("classify.cancelled")`

    - `CLASSIFY_ERROR("classify.error")`

    - `CLASSIFY_PARTIAL_SUCCESS("classify.partial_success")`

    - `CLASSIFY_PENDING("classify.pending")`

    - `CLASSIFY_RUNNING("classify.running")`

    - `CLASSIFY_SUCCESS("classify.success")`

    - `EXTRACT_CANCELLED("extract.cancelled")`

    - `EXTRACT_ERROR("extract.error")`

    - `EXTRACT_PARTIAL_SUCCESS("extract.partial_success")`

    - `EXTRACT_PENDING("extract.pending")`

    - `EXTRACT_SUCCESS("extract.success")`

    - `PARSE_CANCELLED("parse.cancelled")`

    - `PARSE_ERROR("parse.error")`

    - `PARSE_PARTIAL_SUCCESS("parse.partial_success")`

    - `PARSE_PENDING("parse.pending")`

    - `PARSE_RUNNING("parse.running")`

    - `PARSE_SUCCESS("parse.success")`

    - `SHEETS_CANCELLED("sheets.cancelled")`

    - `SHEETS_ERROR("sheets.error")`

    - `SHEETS_PARTIAL_SUCCESS("sheets.partial_success")`

    - `SHEETS_PENDING("sheets.pending")`

    - `SHEETS_SUCCESS("sheets.success")`

    - `SPLIT_CANCELLED("split.cancelled")`

    - `SPLIT_ERROR("split.error")`

    - `SPLIT_PENDING("split.pending")`

    - `SPLIT_PROCESSING("split.processing")`

    - `SPLIT_SUCCESS("split.success")`

    - `UNMAPPED_EVENT("unmapped_event")`

  - `Optional<WebhookHeaders> webhookHeaders`

    Custom HTTP headers sent with each request.

  - `Optional<WebhookOutputFormat> webhookOutputFormat`

    Response format sent to the webhook.

    - `JSON("json")`

    - `STRING("string")`

### Example

```java
package ai.llamaindex.llamacloud.example;

import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.webhookconfigs.WebhookConfigResponse;
import ai.llamaindex.llamacloud.models.webhookconfigs.WebhookConfigRetrieveParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        WebhookConfigResponse webhookConfigResponse = client.webhookConfigs().retrieve("config_id");
    }
}
```

#### Response

```json
{
  "id": "id",
  "has_secret": true,
  "tenant_id": "tenant_id",
  "tenant_type": "project",
  "webhook_url": "webhook_url",
  "created_at": "2019-12-27T18:11:19.117Z",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "webhook_events": [
    "batch.cancelled"
  ],
  "webhook_headers": {
    "foo": "string"
  },
  "webhook_output_format": "json"
}
```

## Update Webhook Config

`WebhookConfigResponse webhookConfigs().update(WebhookConfigUpdateParamsparams = WebhookConfigUpdateParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**put** `/api/v1/beta/webhook-configs/{config_id}`

Update a webhook configuration. Only fields present in the request change.

### Parameters

- `WebhookConfigUpdateParams params`

  - `Optional<String> configId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

  - `Optional<List<WebhookEvent>> webhookEvents`

    Updated event subscriptions. Omit to leave unchanged; [] is rejected.

    - `BATCH_CANCELLED("batch.cancelled")`

    - `BATCH_ERROR("batch.error")`

    - `BATCH_PENDING("batch.pending")`

    - `BATCH_RUNNING("batch.running")`

    - `BATCH_SUCCESS("batch.success")`

    - `CLASSIFY_CANCELLED("classify.cancelled")`

    - `CLASSIFY_ERROR("classify.error")`

    - `CLASSIFY_PARTIAL_SUCCESS("classify.partial_success")`

    - `CLASSIFY_PENDING("classify.pending")`

    - `CLASSIFY_RUNNING("classify.running")`

    - `CLASSIFY_SUCCESS("classify.success")`

    - `EXTRACT_CANCELLED("extract.cancelled")`

    - `EXTRACT_ERROR("extract.error")`

    - `EXTRACT_PARTIAL_SUCCESS("extract.partial_success")`

    - `EXTRACT_PENDING("extract.pending")`

    - `EXTRACT_SUCCESS("extract.success")`

    - `PARSE_CANCELLED("parse.cancelled")`

    - `PARSE_ERROR("parse.error")`

    - `PARSE_PARTIAL_SUCCESS("parse.partial_success")`

    - `PARSE_PENDING("parse.pending")`

    - `PARSE_RUNNING("parse.running")`

    - `PARSE_SUCCESS("parse.success")`

    - `SHEETS_CANCELLED("sheets.cancelled")`

    - `SHEETS_ERROR("sheets.error")`

    - `SHEETS_PARTIAL_SUCCESS("sheets.partial_success")`

    - `SHEETS_PENDING("sheets.pending")`

    - `SHEETS_SUCCESS("sheets.success")`

    - `SPLIT_CANCELLED("split.cancelled")`

    - `SPLIT_ERROR("split.error")`

    - `SPLIT_PENDING("split.pending")`

    - `SPLIT_PROCESSING("split.processing")`

    - `SPLIT_SUCCESS("split.success")`

    - `UNMAPPED_EVENT("unmapped_event")`

  - `Optional<WebhookHeaders> webhookHeaders`

    Updated headers.

  - `Optional<WebhookOutputFormat> webhookOutputFormat`

    Updated output format.

    - `JSON("json")`

    - `STRING("string")`

  - `Optional<String> webhookSigningSecret`

    Updated signing secret (write-only). Send to rotate the secret.

  - `Optional<String> webhookUrl`

    Updated webhook URL.

### Returns

- `class WebhookConfigResponse:`

  A stored webhook configuration. The signing secret is never included.

  - `String id`

    Unique identifier for the webhook configuration.

  - `boolean hasSecret`

    Whether a signing secret is configured for this endpoint.

  - `String tenantId`

    Owner tenant ID.

  - `JsonValue; tenantType "project"constant`

    Owner tenant type.

    - `PROJECT("project")`

  - `String webhookUrl`

    URL that receives webhook POST notifications.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

  - `Optional<List<WebhookEvent>> webhookEvents`

    Subscribed events (null = all events).

    - `BATCH_CANCELLED("batch.cancelled")`

    - `BATCH_ERROR("batch.error")`

    - `BATCH_PENDING("batch.pending")`

    - `BATCH_RUNNING("batch.running")`

    - `BATCH_SUCCESS("batch.success")`

    - `CLASSIFY_CANCELLED("classify.cancelled")`

    - `CLASSIFY_ERROR("classify.error")`

    - `CLASSIFY_PARTIAL_SUCCESS("classify.partial_success")`

    - `CLASSIFY_PENDING("classify.pending")`

    - `CLASSIFY_RUNNING("classify.running")`

    - `CLASSIFY_SUCCESS("classify.success")`

    - `EXTRACT_CANCELLED("extract.cancelled")`

    - `EXTRACT_ERROR("extract.error")`

    - `EXTRACT_PARTIAL_SUCCESS("extract.partial_success")`

    - `EXTRACT_PENDING("extract.pending")`

    - `EXTRACT_SUCCESS("extract.success")`

    - `PARSE_CANCELLED("parse.cancelled")`

    - `PARSE_ERROR("parse.error")`

    - `PARSE_PARTIAL_SUCCESS("parse.partial_success")`

    - `PARSE_PENDING("parse.pending")`

    - `PARSE_RUNNING("parse.running")`

    - `PARSE_SUCCESS("parse.success")`

    - `SHEETS_CANCELLED("sheets.cancelled")`

    - `SHEETS_ERROR("sheets.error")`

    - `SHEETS_PARTIAL_SUCCESS("sheets.partial_success")`

    - `SHEETS_PENDING("sheets.pending")`

    - `SHEETS_SUCCESS("sheets.success")`

    - `SPLIT_CANCELLED("split.cancelled")`

    - `SPLIT_ERROR("split.error")`

    - `SPLIT_PENDING("split.pending")`

    - `SPLIT_PROCESSING("split.processing")`

    - `SPLIT_SUCCESS("split.success")`

    - `UNMAPPED_EVENT("unmapped_event")`

  - `Optional<WebhookHeaders> webhookHeaders`

    Custom HTTP headers sent with each request.

  - `Optional<WebhookOutputFormat> webhookOutputFormat`

    Response format sent to the webhook.

    - `JSON("json")`

    - `STRING("string")`

### Example

```java
package ai.llamaindex.llamacloud.example;

import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.webhookconfigs.WebhookConfigResponse;
import ai.llamaindex.llamacloud.models.webhookconfigs.WebhookConfigUpdateParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        WebhookConfigResponse webhookConfigResponse = client.webhookConfigs().update("config_id");
    }
}
```

#### Response

```json
{
  "id": "id",
  "has_secret": true,
  "tenant_id": "tenant_id",
  "tenant_type": "project",
  "webhook_url": "webhook_url",
  "created_at": "2019-12-27T18:11:19.117Z",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "webhook_events": [
    "batch.cancelled"
  ],
  "webhook_headers": {
    "foo": "string"
  },
  "webhook_output_format": "json"
}
```

## Delete Webhook Config

`webhookConfigs().delete(WebhookConfigDeleteParamsparams = WebhookConfigDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`

**delete** `/api/v1/beta/webhook-configs/{config_id}`

Delete a webhook configuration.

### Parameters

- `WebhookConfigDeleteParams params`

  - `Optional<String> configId`

  - `Optional<String> organizationId`

  - `Optional<String> projectId`

### Example

```java
package ai.llamaindex.llamacloud.example;

import ai.llamaindex.llamacloud.client.LlamaCloudClient;
import ai.llamaindex.llamacloud.client.okhttp.LlamaCloudOkHttpClient;
import ai.llamaindex.llamacloud.models.webhookconfigs.WebhookConfigDeleteParams;

public final class Main {
    private Main() {}

    public static void main(String[] args) {
        LlamaCloudClient client = LlamaCloudOkHttpClient.fromEnv();

        client.webhookConfigs().delete("config_id");
    }
}
```

## Domain Types

### Webhook Config Create

- `class WebhookConfigCreate:`

  Request to create a stored webhook configuration.

  The owning tenant is taken from the request context (e.g. the project in the
  path), not the body.

  - `String webhookUrl`

    URL to receive webhook POST notifications.

  - `Optional<List<WebhookEvent>> webhookEvents`

    Events to subscribe to. If null, all events are delivered. An empty list subscribes to nothing and is rejected.

    - `BATCH_CANCELLED("batch.cancelled")`

    - `BATCH_ERROR("batch.error")`

    - `BATCH_PENDING("batch.pending")`

    - `BATCH_RUNNING("batch.running")`

    - `BATCH_SUCCESS("batch.success")`

    - `CLASSIFY_CANCELLED("classify.cancelled")`

    - `CLASSIFY_ERROR("classify.error")`

    - `CLASSIFY_PARTIAL_SUCCESS("classify.partial_success")`

    - `CLASSIFY_PENDING("classify.pending")`

    - `CLASSIFY_RUNNING("classify.running")`

    - `CLASSIFY_SUCCESS("classify.success")`

    - `EXTRACT_CANCELLED("extract.cancelled")`

    - `EXTRACT_ERROR("extract.error")`

    - `EXTRACT_PARTIAL_SUCCESS("extract.partial_success")`

    - `EXTRACT_PENDING("extract.pending")`

    - `EXTRACT_SUCCESS("extract.success")`

    - `PARSE_CANCELLED("parse.cancelled")`

    - `PARSE_ERROR("parse.error")`

    - `PARSE_PARTIAL_SUCCESS("parse.partial_success")`

    - `PARSE_PENDING("parse.pending")`

    - `PARSE_RUNNING("parse.running")`

    - `PARSE_SUCCESS("parse.success")`

    - `SHEETS_CANCELLED("sheets.cancelled")`

    - `SHEETS_ERROR("sheets.error")`

    - `SHEETS_PARTIAL_SUCCESS("sheets.partial_success")`

    - `SHEETS_PENDING("sheets.pending")`

    - `SHEETS_SUCCESS("sheets.success")`

    - `SPLIT_CANCELLED("split.cancelled")`

    - `SPLIT_ERROR("split.error")`

    - `SPLIT_PENDING("split.pending")`

    - `SPLIT_PROCESSING("split.processing")`

    - `SPLIT_SUCCESS("split.success")`

    - `UNMAPPED_EVENT("unmapped_event")`

  - `Optional<WebhookHeaders> webhookHeaders`

    Custom HTTP headers sent with each webhook request.

  - `Optional<WebhookOutputFormat> webhookOutputFormat`

    Response format sent to the webhook: 'string' (default) or 'json'.

    - `JSON("json")`

    - `STRING("string")`

  - `Optional<String> webhookSigningSecret`

    Shared secret used to sign deliveries to this endpoint. Write-only: it is never returned in responses.

### Webhook Config Response

- `class WebhookConfigResponse:`

  A stored webhook configuration. The signing secret is never included.

  - `String id`

    Unique identifier for the webhook configuration.

  - `boolean hasSecret`

    Whether a signing secret is configured for this endpoint.

  - `String tenantId`

    Owner tenant ID.

  - `JsonValue; tenantType "project"constant`

    Owner tenant type.

    - `PROJECT("project")`

  - `String webhookUrl`

    URL that receives webhook POST notifications.

  - `Optional<LocalDateTime> createdAt`

    Creation datetime

  - `Optional<LocalDateTime> updatedAt`

    Update datetime

  - `Optional<List<WebhookEvent>> webhookEvents`

    Subscribed events (null = all events).

    - `BATCH_CANCELLED("batch.cancelled")`

    - `BATCH_ERROR("batch.error")`

    - `BATCH_PENDING("batch.pending")`

    - `BATCH_RUNNING("batch.running")`

    - `BATCH_SUCCESS("batch.success")`

    - `CLASSIFY_CANCELLED("classify.cancelled")`

    - `CLASSIFY_ERROR("classify.error")`

    - `CLASSIFY_PARTIAL_SUCCESS("classify.partial_success")`

    - `CLASSIFY_PENDING("classify.pending")`

    - `CLASSIFY_RUNNING("classify.running")`

    - `CLASSIFY_SUCCESS("classify.success")`

    - `EXTRACT_CANCELLED("extract.cancelled")`

    - `EXTRACT_ERROR("extract.error")`

    - `EXTRACT_PARTIAL_SUCCESS("extract.partial_success")`

    - `EXTRACT_PENDING("extract.pending")`

    - `EXTRACT_SUCCESS("extract.success")`

    - `PARSE_CANCELLED("parse.cancelled")`

    - `PARSE_ERROR("parse.error")`

    - `PARSE_PARTIAL_SUCCESS("parse.partial_success")`

    - `PARSE_PENDING("parse.pending")`

    - `PARSE_RUNNING("parse.running")`

    - `PARSE_SUCCESS("parse.success")`

    - `SHEETS_CANCELLED("sheets.cancelled")`

    - `SHEETS_ERROR("sheets.error")`

    - `SHEETS_PARTIAL_SUCCESS("sheets.partial_success")`

    - `SHEETS_PENDING("sheets.pending")`

    - `SHEETS_SUCCESS("sheets.success")`

    - `SPLIT_CANCELLED("split.cancelled")`

    - `SPLIT_ERROR("split.error")`

    - `SPLIT_PENDING("split.pending")`

    - `SPLIT_PROCESSING("split.processing")`

    - `SPLIT_SUCCESS("split.success")`

    - `UNMAPPED_EVENT("unmapped_event")`

  - `Optional<WebhookHeaders> webhookHeaders`

    Custom HTTP headers sent with each request.

  - `Optional<WebhookOutputFormat> webhookOutputFormat`

    Response format sent to the webhook.

    - `JSON("json")`

    - `STRING("string")`
