# Webhook Configs

## Create Webhook Config

`WebhookConfigResponse WebhookConfigs.Create(WebhookConfigCreateParamsparameters, CancellationTokencancellationToken = default)`

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

Create a reusable webhook configuration for the current project.

### Parameters

- `WebhookConfigCreateParams parameters`

  - `required string webhookUrl`

    Body param: URL to receive webhook POST notifications.

  - `string? organizationID`

    Query param

  - `string? projectID`

    Query param

  - `IReadOnlyList<WebhookEvent>? webhookEvents`

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

    - `"batch.cancelled"BatchCancelled`

    - `"batch.error"BatchError`

    - `"batch.pending"BatchPending`

    - `"batch.running"BatchRunning`

    - `"batch.success"BatchSuccess`

    - `"classify.cancelled"ClassifyCancelled`

    - `"classify.error"ClassifyError`

    - `"classify.partial_success"ClassifyPartialSuccess`

    - `"classify.pending"ClassifyPending`

    - `"classify.running"ClassifyRunning`

    - `"classify.success"ClassifySuccess`

    - `"extract.cancelled"ExtractCancelled`

    - `"extract.error"ExtractError`

    - `"extract.partial_success"ExtractPartialSuccess`

    - `"extract.pending"ExtractPending`

    - `"extract.success"ExtractSuccess`

    - `"parse.cancelled"ParseCancelled`

    - `"parse.error"ParseError`

    - `"parse.partial_success"ParsePartialSuccess`

    - `"parse.pending"ParsePending`

    - `"parse.running"ParseRunning`

    - `"parse.success"ParseSuccess`

    - `"sheets.cancelled"SheetsCancelled`

    - `"sheets.error"SheetsError`

    - `"sheets.partial_success"SheetsPartialSuccess`

    - `"sheets.pending"SheetsPending`

    - `"sheets.success"SheetsSuccess`

    - `"split.cancelled"SplitCancelled`

    - `"split.error"SplitError`

    - `"split.pending"SplitPending`

    - `"split.processing"SplitProcessing`

    - `"split.success"SplitSuccess`

    - `"unmapped_event"UnmappedEvent`

  - `IReadOnlyDictionary<string, string>? webhookHeaders`

    Body param: Custom HTTP headers sent with each webhook request.

  - `WebhookOutputFormat? webhookOutputFormat`

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

    - `"json"Json`

    - `"string"String`

  - `string? webhookSigningSecret`

    Body param: 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.

  - `required string ID`

    Unique identifier for the webhook configuration.

  - `required Boolean HasSecret`

    Whether a signing secret is configured for this endpoint.

  - `required string TenantID`

    Owner tenant ID.

  - `JsonElement TenantType "project"constant`

    Owner tenant type.

  - `required string WebhookUrl`

    URL that receives webhook POST notifications.

  - `DateTimeOffset? CreatedAt`

    Creation datetime

  - `DateTimeOffset? UpdatedAt`

    Update datetime

  - `IReadOnlyList<WebhookEvent>? WebhookEvents`

    Subscribed events (null = all events).

    - `"batch.cancelled"BatchCancelled`

    - `"batch.error"BatchError`

    - `"batch.pending"BatchPending`

    - `"batch.running"BatchRunning`

    - `"batch.success"BatchSuccess`

    - `"classify.cancelled"ClassifyCancelled`

    - `"classify.error"ClassifyError`

    - `"classify.partial_success"ClassifyPartialSuccess`

    - `"classify.pending"ClassifyPending`

    - `"classify.running"ClassifyRunning`

    - `"classify.success"ClassifySuccess`

    - `"extract.cancelled"ExtractCancelled`

    - `"extract.error"ExtractError`

    - `"extract.partial_success"ExtractPartialSuccess`

    - `"extract.pending"ExtractPending`

    - `"extract.success"ExtractSuccess`

    - `"parse.cancelled"ParseCancelled`

    - `"parse.error"ParseError`

    - `"parse.partial_success"ParsePartialSuccess`

    - `"parse.pending"ParsePending`

    - `"parse.running"ParseRunning`

    - `"parse.success"ParseSuccess`

    - `"sheets.cancelled"SheetsCancelled`

    - `"sheets.error"SheetsError`

    - `"sheets.partial_success"SheetsPartialSuccess`

    - `"sheets.pending"SheetsPending`

    - `"sheets.success"SheetsSuccess`

    - `"split.cancelled"SplitCancelled`

    - `"split.error"SplitError`

    - `"split.pending"SplitPending`

    - `"split.processing"SplitProcessing`

    - `"split.success"SplitSuccess`

    - `"unmapped_event"UnmappedEvent`

  - `IReadOnlyDictionary<string, string>? WebhookHeaders`

    Custom HTTP headers sent with each request.

  - `WebhookOutputFormat? WebhookOutputFormat`

    Response format sent to the webhook.

    - `"json"Json`

    - `"string"String`

### Example

```csharp
WebhookConfigCreateParams parameters = new()
{
    WebhookUrl = "https://example.com/webhooks/llamacloud"
};

var webhookConfigResponse = await client.WebhookConfigs.Create(parameters);

Console.WriteLine(webhookConfigResponse);
```

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

`IReadOnlyList<WebhookConfigResponse> WebhookConfigs.List(WebhookConfigListParams?parameters, CancellationTokencancellationToken = default)`

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

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

### Parameters

- `WebhookConfigListParams parameters`

  - `string? organizationID`

  - `string? projectID`

### Example

```csharp
WebhookConfigListParams parameters = new();

var webhookConfigResponses = await client.WebhookConfigs.List(parameters);

Console.WriteLine(webhookConfigResponses);
```

#### 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(WebhookConfigRetrieveParamsparameters, CancellationTokencancellationToken = default)`

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

Get a single webhook configuration by ID.

### Parameters

- `WebhookConfigRetrieveParams parameters`

  - `required string configID`

  - `string? organizationID`

  - `string? projectID`

### Returns

- `class WebhookConfigResponse:`

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

  - `required string ID`

    Unique identifier for the webhook configuration.

  - `required Boolean HasSecret`

    Whether a signing secret is configured for this endpoint.

  - `required string TenantID`

    Owner tenant ID.

  - `JsonElement TenantType "project"constant`

    Owner tenant type.

  - `required string WebhookUrl`

    URL that receives webhook POST notifications.

  - `DateTimeOffset? CreatedAt`

    Creation datetime

  - `DateTimeOffset? UpdatedAt`

    Update datetime

  - `IReadOnlyList<WebhookEvent>? WebhookEvents`

    Subscribed events (null = all events).

    - `"batch.cancelled"BatchCancelled`

    - `"batch.error"BatchError`

    - `"batch.pending"BatchPending`

    - `"batch.running"BatchRunning`

    - `"batch.success"BatchSuccess`

    - `"classify.cancelled"ClassifyCancelled`

    - `"classify.error"ClassifyError`

    - `"classify.partial_success"ClassifyPartialSuccess`

    - `"classify.pending"ClassifyPending`

    - `"classify.running"ClassifyRunning`

    - `"classify.success"ClassifySuccess`

    - `"extract.cancelled"ExtractCancelled`

    - `"extract.error"ExtractError`

    - `"extract.partial_success"ExtractPartialSuccess`

    - `"extract.pending"ExtractPending`

    - `"extract.success"ExtractSuccess`

    - `"parse.cancelled"ParseCancelled`

    - `"parse.error"ParseError`

    - `"parse.partial_success"ParsePartialSuccess`

    - `"parse.pending"ParsePending`

    - `"parse.running"ParseRunning`

    - `"parse.success"ParseSuccess`

    - `"sheets.cancelled"SheetsCancelled`

    - `"sheets.error"SheetsError`

    - `"sheets.partial_success"SheetsPartialSuccess`

    - `"sheets.pending"SheetsPending`

    - `"sheets.success"SheetsSuccess`

    - `"split.cancelled"SplitCancelled`

    - `"split.error"SplitError`

    - `"split.pending"SplitPending`

    - `"split.processing"SplitProcessing`

    - `"split.success"SplitSuccess`

    - `"unmapped_event"UnmappedEvent`

  - `IReadOnlyDictionary<string, string>? WebhookHeaders`

    Custom HTTP headers sent with each request.

  - `WebhookOutputFormat? WebhookOutputFormat`

    Response format sent to the webhook.

    - `"json"Json`

    - `"string"String`

### Example

```csharp
WebhookConfigRetrieveParams parameters = new() { ConfigID = "config_id" };

var webhookConfigResponse = await client.WebhookConfigs.Retrieve(parameters);

Console.WriteLine(webhookConfigResponse);
```

#### 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(WebhookConfigUpdateParamsparameters, CancellationTokencancellationToken = default)`

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

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

### Parameters

- `WebhookConfigUpdateParams parameters`

  - `required string configID`

    Path param

  - `string? organizationID`

    Query param

  - `string? projectID`

    Query param

  - `IReadOnlyList<WebhookEvent>? webhookEvents`

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

    - `"batch.cancelled"BatchCancelled`

    - `"batch.error"BatchError`

    - `"batch.pending"BatchPending`

    - `"batch.running"BatchRunning`

    - `"batch.success"BatchSuccess`

    - `"classify.cancelled"ClassifyCancelled`

    - `"classify.error"ClassifyError`

    - `"classify.partial_success"ClassifyPartialSuccess`

    - `"classify.pending"ClassifyPending`

    - `"classify.running"ClassifyRunning`

    - `"classify.success"ClassifySuccess`

    - `"extract.cancelled"ExtractCancelled`

    - `"extract.error"ExtractError`

    - `"extract.partial_success"ExtractPartialSuccess`

    - `"extract.pending"ExtractPending`

    - `"extract.success"ExtractSuccess`

    - `"parse.cancelled"ParseCancelled`

    - `"parse.error"ParseError`

    - `"parse.partial_success"ParsePartialSuccess`

    - `"parse.pending"ParsePending`

    - `"parse.running"ParseRunning`

    - `"parse.success"ParseSuccess`

    - `"sheets.cancelled"SheetsCancelled`

    - `"sheets.error"SheetsError`

    - `"sheets.partial_success"SheetsPartialSuccess`

    - `"sheets.pending"SheetsPending`

    - `"sheets.success"SheetsSuccess`

    - `"split.cancelled"SplitCancelled`

    - `"split.error"SplitError`

    - `"split.pending"SplitPending`

    - `"split.processing"SplitProcessing`

    - `"split.success"SplitSuccess`

    - `"unmapped_event"UnmappedEvent`

  - `IReadOnlyDictionary<string, string>? webhookHeaders`

    Body param: Updated headers.

  - `WebhookOutputFormat? webhookOutputFormat`

    Body param: Updated output format.

    - `"json"Json`

    - `"string"String`

  - `string? webhookSigningSecret`

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

  - `string? webhookUrl`

    Body param: Updated webhook URL.

### Returns

- `class WebhookConfigResponse:`

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

  - `required string ID`

    Unique identifier for the webhook configuration.

  - `required Boolean HasSecret`

    Whether a signing secret is configured for this endpoint.

  - `required string TenantID`

    Owner tenant ID.

  - `JsonElement TenantType "project"constant`

    Owner tenant type.

  - `required string WebhookUrl`

    URL that receives webhook POST notifications.

  - `DateTimeOffset? CreatedAt`

    Creation datetime

  - `DateTimeOffset? UpdatedAt`

    Update datetime

  - `IReadOnlyList<WebhookEvent>? WebhookEvents`

    Subscribed events (null = all events).

    - `"batch.cancelled"BatchCancelled`

    - `"batch.error"BatchError`

    - `"batch.pending"BatchPending`

    - `"batch.running"BatchRunning`

    - `"batch.success"BatchSuccess`

    - `"classify.cancelled"ClassifyCancelled`

    - `"classify.error"ClassifyError`

    - `"classify.partial_success"ClassifyPartialSuccess`

    - `"classify.pending"ClassifyPending`

    - `"classify.running"ClassifyRunning`

    - `"classify.success"ClassifySuccess`

    - `"extract.cancelled"ExtractCancelled`

    - `"extract.error"ExtractError`

    - `"extract.partial_success"ExtractPartialSuccess`

    - `"extract.pending"ExtractPending`

    - `"extract.success"ExtractSuccess`

    - `"parse.cancelled"ParseCancelled`

    - `"parse.error"ParseError`

    - `"parse.partial_success"ParsePartialSuccess`

    - `"parse.pending"ParsePending`

    - `"parse.running"ParseRunning`

    - `"parse.success"ParseSuccess`

    - `"sheets.cancelled"SheetsCancelled`

    - `"sheets.error"SheetsError`

    - `"sheets.partial_success"SheetsPartialSuccess`

    - `"sheets.pending"SheetsPending`

    - `"sheets.success"SheetsSuccess`

    - `"split.cancelled"SplitCancelled`

    - `"split.error"SplitError`

    - `"split.pending"SplitPending`

    - `"split.processing"SplitProcessing`

    - `"split.success"SplitSuccess`

    - `"unmapped_event"UnmappedEvent`

  - `IReadOnlyDictionary<string, string>? WebhookHeaders`

    Custom HTTP headers sent with each request.

  - `WebhookOutputFormat? WebhookOutputFormat`

    Response format sent to the webhook.

    - `"json"Json`

    - `"string"String`

### Example

```csharp
WebhookConfigUpdateParams parameters = new() { ConfigID = "config_id" };

var webhookConfigResponse = await client.WebhookConfigs.Update(parameters);

Console.WriteLine(webhookConfigResponse);
```

#### 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(WebhookConfigDeleteParamsparameters, CancellationTokencancellationToken = default)`

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

Delete a webhook configuration.

### Parameters

- `WebhookConfigDeleteParams parameters`

  - `required string configID`

  - `string? organizationID`

  - `string? projectID`

### Example

```csharp
WebhookConfigDeleteParams parameters = new() { ConfigID = "config_id" };

await client.WebhookConfigs.Delete(parameters);
```

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

  - `required string WebhookUrl`

    URL to receive webhook POST notifications.

  - `IReadOnlyList<WebhookEvent>? WebhookEvents`

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

    - `"batch.cancelled"BatchCancelled`

    - `"batch.error"BatchError`

    - `"batch.pending"BatchPending`

    - `"batch.running"BatchRunning`

    - `"batch.success"BatchSuccess`

    - `"classify.cancelled"ClassifyCancelled`

    - `"classify.error"ClassifyError`

    - `"classify.partial_success"ClassifyPartialSuccess`

    - `"classify.pending"ClassifyPending`

    - `"classify.running"ClassifyRunning`

    - `"classify.success"ClassifySuccess`

    - `"extract.cancelled"ExtractCancelled`

    - `"extract.error"ExtractError`

    - `"extract.partial_success"ExtractPartialSuccess`

    - `"extract.pending"ExtractPending`

    - `"extract.success"ExtractSuccess`

    - `"parse.cancelled"ParseCancelled`

    - `"parse.error"ParseError`

    - `"parse.partial_success"ParsePartialSuccess`

    - `"parse.pending"ParsePending`

    - `"parse.running"ParseRunning`

    - `"parse.success"ParseSuccess`

    - `"sheets.cancelled"SheetsCancelled`

    - `"sheets.error"SheetsError`

    - `"sheets.partial_success"SheetsPartialSuccess`

    - `"sheets.pending"SheetsPending`

    - `"sheets.success"SheetsSuccess`

    - `"split.cancelled"SplitCancelled`

    - `"split.error"SplitError`

    - `"split.pending"SplitPending`

    - `"split.processing"SplitProcessing`

    - `"split.success"SplitSuccess`

    - `"unmapped_event"UnmappedEvent`

  - `IReadOnlyDictionary<string, string>? WebhookHeaders`

    Custom HTTP headers sent with each webhook request.

  - `WebhookOutputFormat? WebhookOutputFormat`

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

    - `"json"Json`

    - `"string"String`

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

  - `required string ID`

    Unique identifier for the webhook configuration.

  - `required Boolean HasSecret`

    Whether a signing secret is configured for this endpoint.

  - `required string TenantID`

    Owner tenant ID.

  - `JsonElement TenantType "project"constant`

    Owner tenant type.

  - `required string WebhookUrl`

    URL that receives webhook POST notifications.

  - `DateTimeOffset? CreatedAt`

    Creation datetime

  - `DateTimeOffset? UpdatedAt`

    Update datetime

  - `IReadOnlyList<WebhookEvent>? WebhookEvents`

    Subscribed events (null = all events).

    - `"batch.cancelled"BatchCancelled`

    - `"batch.error"BatchError`

    - `"batch.pending"BatchPending`

    - `"batch.running"BatchRunning`

    - `"batch.success"BatchSuccess`

    - `"classify.cancelled"ClassifyCancelled`

    - `"classify.error"ClassifyError`

    - `"classify.partial_success"ClassifyPartialSuccess`

    - `"classify.pending"ClassifyPending`

    - `"classify.running"ClassifyRunning`

    - `"classify.success"ClassifySuccess`

    - `"extract.cancelled"ExtractCancelled`

    - `"extract.error"ExtractError`

    - `"extract.partial_success"ExtractPartialSuccess`

    - `"extract.pending"ExtractPending`

    - `"extract.success"ExtractSuccess`

    - `"parse.cancelled"ParseCancelled`

    - `"parse.error"ParseError`

    - `"parse.partial_success"ParsePartialSuccess`

    - `"parse.pending"ParsePending`

    - `"parse.running"ParseRunning`

    - `"parse.success"ParseSuccess`

    - `"sheets.cancelled"SheetsCancelled`

    - `"sheets.error"SheetsError`

    - `"sheets.partial_success"SheetsPartialSuccess`

    - `"sheets.pending"SheetsPending`

    - `"sheets.success"SheetsSuccess`

    - `"split.cancelled"SplitCancelled`

    - `"split.error"SplitError`

    - `"split.pending"SplitPending`

    - `"split.processing"SplitProcessing`

    - `"split.success"SplitSuccess`

    - `"unmapped_event"UnmappedEvent`

  - `IReadOnlyDictionary<string, string>? WebhookHeaders`

    Custom HTTP headers sent with each request.

  - `WebhookOutputFormat? WebhookOutputFormat`

    Response format sent to the webhook.

    - `"json"Json`

    - `"string"String`
