> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vzaps.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Configure webhooks, inspect logs, and retry deliveries with the .NET SDK

Use `client.Webhooks` to configure the URL that receives instance events and to inspect delivery logs.

## `client.Webhooks.GetAsync<TResponse>(instanceId, options?)`

Returns the current webhook configuration for the instance.

```csharp theme={null}
await client.Webhooks.GetAsync<object>("VZ...", new InstanceRequestOptions
{
    InstanceToken = "instance-token",
});
```

**Return:** envelope `{ Code, Success, Data }` with `Webhook` and `subscribe` (events).

## `client.Webhooks.SetAsync<TResponse>(request)`

Sets the webhook URL and subscribed events.

```csharp theme={null}
await client.Webhooks.SetAsync<object>(new WebhookSetRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    WebhookURL = "https://example.com/vzaps/webhook",
    Events = new[] { "Message", "Connected", "Disconnected" },
});
```

**Return:** envelope `{ Code, Success, Data }` with configured `Webhook` and `Events`.

## `client.Webhooks.SearchLogsAsync<TResponse>(request)`

Searches webhook delivery logs.

```csharp theme={null}
await client.Webhooks.SearchLogsAsync<object>(new WebhookLogSearchRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
});
```

**Return:** envelope `{ Code, Success, Data }` with paginated logs (`content[]`, totals).

## `client.Webhooks.GetLogAsync<TResponse>(request)`

Reads a specific log.

```csharp theme={null}
await client.Webhooks.GetLogAsync<object>(new WebhookLogRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    LogId = "log_123",
});
```

**Return:** envelope `{ Code, Success, Data }` with one delivery log (status, payload, attempts, etc.).

## `client.Webhooks.RetryLogAsync<TResponse>(request)`

Retries a delivery registered in the log.

```csharp theme={null}
await client.Webhooks.RetryLogAsync<object>(new WebhookLogRequest
{
    InstanceId = "VZ...",
    InstanceToken = "instance-token",
    LogId = "log_123",
});
```

**Return:** envelope `{ Code, Success, Data }` confirming callback retry.

## When to use webhooks

Use webhooks for persistent server-to-server integration. Use [Realtime](/en/sdk/dotnet/realtime) when your process needs to keep an active WebSocket connection and handle events in real time.
