# Webhook Configs

## Create Webhook Config

`webhook_configs.create(WebhookConfigCreateParams**kwargs)  -> WebhookConfigResponse`

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

Create a reusable webhook configuration for the current project.

### Parameters

- `webhook_url: str`

  URL to receive webhook POST notifications.

- `organization_id: Optional[str]`

- `project_id: Optional[str]`

- `webhook_events: Optional[List[Literal["batch.cancelled", "batch.error", "batch.pending", 30 more]]]`

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

  - `"batch.cancelled"`

  - `"batch.error"`

  - `"batch.pending"`

  - `"batch.running"`

  - `"batch.success"`

  - `"classify.cancelled"`

  - `"classify.error"`

  - `"classify.partial_success"`

  - `"classify.pending"`

  - `"classify.running"`

  - `"classify.success"`

  - `"extract.cancelled"`

  - `"extract.error"`

  - `"extract.partial_success"`

  - `"extract.pending"`

  - `"extract.success"`

  - `"parse.cancelled"`

  - `"parse.error"`

  - `"parse.partial_success"`

  - `"parse.pending"`

  - `"parse.running"`

  - `"parse.success"`

  - `"sheets.cancelled"`

  - `"sheets.error"`

  - `"sheets.partial_success"`

  - `"sheets.pending"`

  - `"sheets.success"`

  - `"split.cancelled"`

  - `"split.error"`

  - `"split.pending"`

  - `"split.processing"`

  - `"split.success"`

  - `"unmapped_event"`

- `webhook_headers: Optional[Dict[str, str]]`

  Custom HTTP headers sent with each webhook request.

- `webhook_output_format: Optional[Literal["json", "string"]]`

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

  - `"json"`

  - `"string"`

- `webhook_signing_secret: Optional[str]`

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

### Returns

- `class WebhookConfigResponse: …`

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

  - `id: str`

    Unique identifier for the webhook configuration.

  - `has_secret: bool`

    Whether a signing secret is configured for this endpoint.

  - `tenant_id: str`

    Owner tenant ID.

  - `tenant_type: Literal["project"]`

    Owner tenant type.

    - `"project"`

  - `webhook_url: str`

    URL that receives webhook POST notifications.

  - `created_at: Optional[datetime]`

    Creation datetime

  - `updated_at: Optional[datetime]`

    Update datetime

  - `webhook_events: Optional[List[Literal["batch.cancelled", "batch.error", "batch.pending", 30 more]]]`

    Subscribed events (null = all events).

    - `"batch.cancelled"`

    - `"batch.error"`

    - `"batch.pending"`

    - `"batch.running"`

    - `"batch.success"`

    - `"classify.cancelled"`

    - `"classify.error"`

    - `"classify.partial_success"`

    - `"classify.pending"`

    - `"classify.running"`

    - `"classify.success"`

    - `"extract.cancelled"`

    - `"extract.error"`

    - `"extract.partial_success"`

    - `"extract.pending"`

    - `"extract.success"`

    - `"parse.cancelled"`

    - `"parse.error"`

    - `"parse.partial_success"`

    - `"parse.pending"`

    - `"parse.running"`

    - `"parse.success"`

    - `"sheets.cancelled"`

    - `"sheets.error"`

    - `"sheets.partial_success"`

    - `"sheets.pending"`

    - `"sheets.success"`

    - `"split.cancelled"`

    - `"split.error"`

    - `"split.pending"`

    - `"split.processing"`

    - `"split.success"`

    - `"unmapped_event"`

  - `webhook_headers: Optional[Dict[str, str]]`

    Custom HTTP headers sent with each request.

  - `webhook_output_format: Optional[Literal["json", "string"]]`

    Response format sent to the webhook.

    - `"json"`

    - `"string"`

### Example

```python
import os
from llama_cloud import LlamaCloud

client = LlamaCloud(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
webhook_config_response = client.webhook_configs.create(
    webhook_url="https://example.com/webhooks/llamacloud",
)
print(webhook_config_response.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"
}
```

## List Webhook Configs

`webhook_configs.list(WebhookConfigListParams**kwargs)  -> WebhookConfigListResponse`

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

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

### Parameters

- `organization_id: Optional[str]`

- `project_id: Optional[str]`

### Returns

- `List[WebhookConfigResponse]`

  - `id: str`

    Unique identifier for the webhook configuration.

  - `has_secret: bool`

    Whether a signing secret is configured for this endpoint.

  - `tenant_id: str`

    Owner tenant ID.

  - `tenant_type: Literal["project"]`

    Owner tenant type.

    - `"project"`

  - `webhook_url: str`

    URL that receives webhook POST notifications.

  - `created_at: Optional[datetime]`

    Creation datetime

  - `updated_at: Optional[datetime]`

    Update datetime

  - `webhook_events: Optional[List[Literal["batch.cancelled", "batch.error", "batch.pending", 30 more]]]`

    Subscribed events (null = all events).

    - `"batch.cancelled"`

    - `"batch.error"`

    - `"batch.pending"`

    - `"batch.running"`

    - `"batch.success"`

    - `"classify.cancelled"`

    - `"classify.error"`

    - `"classify.partial_success"`

    - `"classify.pending"`

    - `"classify.running"`

    - `"classify.success"`

    - `"extract.cancelled"`

    - `"extract.error"`

    - `"extract.partial_success"`

    - `"extract.pending"`

    - `"extract.success"`

    - `"parse.cancelled"`

    - `"parse.error"`

    - `"parse.partial_success"`

    - `"parse.pending"`

    - `"parse.running"`

    - `"parse.success"`

    - `"sheets.cancelled"`

    - `"sheets.error"`

    - `"sheets.partial_success"`

    - `"sheets.pending"`

    - `"sheets.success"`

    - `"split.cancelled"`

    - `"split.error"`

    - `"split.pending"`

    - `"split.processing"`

    - `"split.success"`

    - `"unmapped_event"`

  - `webhook_headers: Optional[Dict[str, str]]`

    Custom HTTP headers sent with each request.

  - `webhook_output_format: Optional[Literal["json", "string"]]`

    Response format sent to the webhook.

    - `"json"`

    - `"string"`

### Example

```python
import os
from llama_cloud import LlamaCloud

client = LlamaCloud(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
webhook_config_responses = client.webhook_configs.list()
print(webhook_config_responses)
```

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

`webhook_configs.retrieve(strconfig_id, WebhookConfigRetrieveParams**kwargs)  -> WebhookConfigResponse`

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

Get a single webhook configuration by ID.

### Parameters

- `config_id: str`

- `organization_id: Optional[str]`

- `project_id: Optional[str]`

### Returns

- `class WebhookConfigResponse: …`

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

  - `id: str`

    Unique identifier for the webhook configuration.

  - `has_secret: bool`

    Whether a signing secret is configured for this endpoint.

  - `tenant_id: str`

    Owner tenant ID.

  - `tenant_type: Literal["project"]`

    Owner tenant type.

    - `"project"`

  - `webhook_url: str`

    URL that receives webhook POST notifications.

  - `created_at: Optional[datetime]`

    Creation datetime

  - `updated_at: Optional[datetime]`

    Update datetime

  - `webhook_events: Optional[List[Literal["batch.cancelled", "batch.error", "batch.pending", 30 more]]]`

    Subscribed events (null = all events).

    - `"batch.cancelled"`

    - `"batch.error"`

    - `"batch.pending"`

    - `"batch.running"`

    - `"batch.success"`

    - `"classify.cancelled"`

    - `"classify.error"`

    - `"classify.partial_success"`

    - `"classify.pending"`

    - `"classify.running"`

    - `"classify.success"`

    - `"extract.cancelled"`

    - `"extract.error"`

    - `"extract.partial_success"`

    - `"extract.pending"`

    - `"extract.success"`

    - `"parse.cancelled"`

    - `"parse.error"`

    - `"parse.partial_success"`

    - `"parse.pending"`

    - `"parse.running"`

    - `"parse.success"`

    - `"sheets.cancelled"`

    - `"sheets.error"`

    - `"sheets.partial_success"`

    - `"sheets.pending"`

    - `"sheets.success"`

    - `"split.cancelled"`

    - `"split.error"`

    - `"split.pending"`

    - `"split.processing"`

    - `"split.success"`

    - `"unmapped_event"`

  - `webhook_headers: Optional[Dict[str, str]]`

    Custom HTTP headers sent with each request.

  - `webhook_output_format: Optional[Literal["json", "string"]]`

    Response format sent to the webhook.

    - `"json"`

    - `"string"`

### Example

```python
import os
from llama_cloud import LlamaCloud

client = LlamaCloud(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
webhook_config_response = client.webhook_configs.retrieve(
    config_id="config_id",
)
print(webhook_config_response.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

`webhook_configs.update(strconfig_id, WebhookConfigUpdateParams**kwargs)  -> WebhookConfigResponse`

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

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

### Parameters

- `config_id: str`

- `organization_id: Optional[str]`

- `project_id: Optional[str]`

- `webhook_events: Optional[List[Literal["batch.cancelled", "batch.error", "batch.pending", 30 more]]]`

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

  - `"batch.cancelled"`

  - `"batch.error"`

  - `"batch.pending"`

  - `"batch.running"`

  - `"batch.success"`

  - `"classify.cancelled"`

  - `"classify.error"`

  - `"classify.partial_success"`

  - `"classify.pending"`

  - `"classify.running"`

  - `"classify.success"`

  - `"extract.cancelled"`

  - `"extract.error"`

  - `"extract.partial_success"`

  - `"extract.pending"`

  - `"extract.success"`

  - `"parse.cancelled"`

  - `"parse.error"`

  - `"parse.partial_success"`

  - `"parse.pending"`

  - `"parse.running"`

  - `"parse.success"`

  - `"sheets.cancelled"`

  - `"sheets.error"`

  - `"sheets.partial_success"`

  - `"sheets.pending"`

  - `"sheets.success"`

  - `"split.cancelled"`

  - `"split.error"`

  - `"split.pending"`

  - `"split.processing"`

  - `"split.success"`

  - `"unmapped_event"`

- `webhook_headers: Optional[Dict[str, str]]`

  Updated headers.

- `webhook_output_format: Optional[Literal["json", "string"]]`

  Updated output format.

  - `"json"`

  - `"string"`

- `webhook_signing_secret: Optional[str]`

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

- `webhook_url: Optional[str]`

  Updated webhook URL.

### Returns

- `class WebhookConfigResponse: …`

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

  - `id: str`

    Unique identifier for the webhook configuration.

  - `has_secret: bool`

    Whether a signing secret is configured for this endpoint.

  - `tenant_id: str`

    Owner tenant ID.

  - `tenant_type: Literal["project"]`

    Owner tenant type.

    - `"project"`

  - `webhook_url: str`

    URL that receives webhook POST notifications.

  - `created_at: Optional[datetime]`

    Creation datetime

  - `updated_at: Optional[datetime]`

    Update datetime

  - `webhook_events: Optional[List[Literal["batch.cancelled", "batch.error", "batch.pending", 30 more]]]`

    Subscribed events (null = all events).

    - `"batch.cancelled"`

    - `"batch.error"`

    - `"batch.pending"`

    - `"batch.running"`

    - `"batch.success"`

    - `"classify.cancelled"`

    - `"classify.error"`

    - `"classify.partial_success"`

    - `"classify.pending"`

    - `"classify.running"`

    - `"classify.success"`

    - `"extract.cancelled"`

    - `"extract.error"`

    - `"extract.partial_success"`

    - `"extract.pending"`

    - `"extract.success"`

    - `"parse.cancelled"`

    - `"parse.error"`

    - `"parse.partial_success"`

    - `"parse.pending"`

    - `"parse.running"`

    - `"parse.success"`

    - `"sheets.cancelled"`

    - `"sheets.error"`

    - `"sheets.partial_success"`

    - `"sheets.pending"`

    - `"sheets.success"`

    - `"split.cancelled"`

    - `"split.error"`

    - `"split.pending"`

    - `"split.processing"`

    - `"split.success"`

    - `"unmapped_event"`

  - `webhook_headers: Optional[Dict[str, str]]`

    Custom HTTP headers sent with each request.

  - `webhook_output_format: Optional[Literal["json", "string"]]`

    Response format sent to the webhook.

    - `"json"`

    - `"string"`

### Example

```python
import os
from llama_cloud import LlamaCloud

client = LlamaCloud(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
webhook_config_response = client.webhook_configs.update(
    config_id="config_id",
)
print(webhook_config_response.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

`webhook_configs.delete(strconfig_id, WebhookConfigDeleteParams**kwargs)`

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

Delete a webhook configuration.

### Parameters

- `config_id: str`

- `organization_id: Optional[str]`

- `project_id: Optional[str]`

### Example

```python
import os
from llama_cloud import LlamaCloud

client = LlamaCloud(
    api_key=os.environ.get("LLAMA_CLOUD_API_KEY"),  # This is the default and can be omitted
)
client.webhook_configs.delete(
    config_id="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.

  - `webhook_url: str`

    URL to receive webhook POST notifications.

  - `webhook_events: Optional[List[Literal["batch.cancelled", "batch.error", "batch.pending", 30 more]]]`

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

    - `"batch.cancelled"`

    - `"batch.error"`

    - `"batch.pending"`

    - `"batch.running"`

    - `"batch.success"`

    - `"classify.cancelled"`

    - `"classify.error"`

    - `"classify.partial_success"`

    - `"classify.pending"`

    - `"classify.running"`

    - `"classify.success"`

    - `"extract.cancelled"`

    - `"extract.error"`

    - `"extract.partial_success"`

    - `"extract.pending"`

    - `"extract.success"`

    - `"parse.cancelled"`

    - `"parse.error"`

    - `"parse.partial_success"`

    - `"parse.pending"`

    - `"parse.running"`

    - `"parse.success"`

    - `"sheets.cancelled"`

    - `"sheets.error"`

    - `"sheets.partial_success"`

    - `"sheets.pending"`

    - `"sheets.success"`

    - `"split.cancelled"`

    - `"split.error"`

    - `"split.pending"`

    - `"split.processing"`

    - `"split.success"`

    - `"unmapped_event"`

  - `webhook_headers: Optional[Dict[str, str]]`

    Custom HTTP headers sent with each webhook request.

  - `webhook_output_format: Optional[Literal["json", "string"]]`

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

    - `"json"`

    - `"string"`

  - `webhook_signing_secret: Optional[str]`

    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.

  - `id: str`

    Unique identifier for the webhook configuration.

  - `has_secret: bool`

    Whether a signing secret is configured for this endpoint.

  - `tenant_id: str`

    Owner tenant ID.

  - `tenant_type: Literal["project"]`

    Owner tenant type.

    - `"project"`

  - `webhook_url: str`

    URL that receives webhook POST notifications.

  - `created_at: Optional[datetime]`

    Creation datetime

  - `updated_at: Optional[datetime]`

    Update datetime

  - `webhook_events: Optional[List[Literal["batch.cancelled", "batch.error", "batch.pending", 30 more]]]`

    Subscribed events (null = all events).

    - `"batch.cancelled"`

    - `"batch.error"`

    - `"batch.pending"`

    - `"batch.running"`

    - `"batch.success"`

    - `"classify.cancelled"`

    - `"classify.error"`

    - `"classify.partial_success"`

    - `"classify.pending"`

    - `"classify.running"`

    - `"classify.success"`

    - `"extract.cancelled"`

    - `"extract.error"`

    - `"extract.partial_success"`

    - `"extract.pending"`

    - `"extract.success"`

    - `"parse.cancelled"`

    - `"parse.error"`

    - `"parse.partial_success"`

    - `"parse.pending"`

    - `"parse.running"`

    - `"parse.success"`

    - `"sheets.cancelled"`

    - `"sheets.error"`

    - `"sheets.partial_success"`

    - `"sheets.pending"`

    - `"sheets.success"`

    - `"split.cancelled"`

    - `"split.error"`

    - `"split.pending"`

    - `"split.processing"`

    - `"split.success"`

    - `"unmapped_event"`

  - `webhook_headers: Optional[Dict[str, str]]`

    Custom HTTP headers sent with each request.

  - `webhook_output_format: Optional[Literal["json", "string"]]`

    Response format sent to the webhook.

    - `"json"`

    - `"string"`

### Webhook Config List Response

- `List[WebhookConfigResponse]`

  - `id: str`

    Unique identifier for the webhook configuration.

  - `has_secret: bool`

    Whether a signing secret is configured for this endpoint.

  - `tenant_id: str`

    Owner tenant ID.

  - `tenant_type: Literal["project"]`

    Owner tenant type.

    - `"project"`

  - `webhook_url: str`

    URL that receives webhook POST notifications.

  - `created_at: Optional[datetime]`

    Creation datetime

  - `updated_at: Optional[datetime]`

    Update datetime

  - `webhook_events: Optional[List[Literal["batch.cancelled", "batch.error", "batch.pending", 30 more]]]`

    Subscribed events (null = all events).

    - `"batch.cancelled"`

    - `"batch.error"`

    - `"batch.pending"`

    - `"batch.running"`

    - `"batch.success"`

    - `"classify.cancelled"`

    - `"classify.error"`

    - `"classify.partial_success"`

    - `"classify.pending"`

    - `"classify.running"`

    - `"classify.success"`

    - `"extract.cancelled"`

    - `"extract.error"`

    - `"extract.partial_success"`

    - `"extract.pending"`

    - `"extract.success"`

    - `"parse.cancelled"`

    - `"parse.error"`

    - `"parse.partial_success"`

    - `"parse.pending"`

    - `"parse.running"`

    - `"parse.success"`

    - `"sheets.cancelled"`

    - `"sheets.error"`

    - `"sheets.partial_success"`

    - `"sheets.pending"`

    - `"sheets.success"`

    - `"split.cancelled"`

    - `"split.error"`

    - `"split.pending"`

    - `"split.processing"`

    - `"split.success"`

    - `"unmapped_event"`

  - `webhook_headers: Optional[Dict[str, str]]`

    Custom HTTP headers sent with each request.

  - `webhook_output_format: Optional[Literal["json", "string"]]`

    Response format sent to the webhook.

    - `"json"`

    - `"string"`
