# `CorvoNfse.Resources.Webhooks`
[🔗](https://github.com/corvo-technology/corvo-nfse-elixir/blob/main/lib/corvo_nfse/resources/webhooks.ex#L1)

Webhook configuration and delivery inspection.

Endpoint secret verification lives in `CorvoNfse.Webhooks`.

    CorvoNfse.Resources.Webhooks.create(client, %{
      url: "https://example.com/hooks/corvo",
      events: ["nfse.invoice.authorized"]
    })

# `list_option`

```elixir
@type list_option() :: {:limit, pos_integer()} | {:cursor, String.t()}
```

# `create`

```elixir
@spec create(CorvoNfse.Client.t(), CorvoNfse.Types.Webhook.create_params()) ::
  {:ok, map()} | {:error, CorvoNfse.Error.t()}
```

Creates a webhook config (`POST /v1/webhooks`).

The response includes the endpoint `secret` used to verify signatures -
store it before discarding the result.

# `list`

```elixir
@spec list(CorvoNfse.Client.t(), [list_option()]) ::
  {:ok, CorvoNfse.Types.Common.page()} | {:error, CorvoNfse.Error.t()}
```

Lists webhook configs (`GET /v1/webhooks`).

# `remove`

```elixir
@spec remove(CorvoNfse.Client.t(), String.t()) ::
  {:ok, map()} | {:error, CorvoNfse.Error.t()}
```

Deletes a webhook config (`DELETE /v1/webhooks/:id`).

# `test`

```elixir
@spec test(CorvoNfse.Client.t(), String.t()) ::
  {:ok, map()} | {:error, CorvoNfse.Error.t()}
```

Sends a `webhook.test` event (`POST /v1/webhooks/:id/test`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
