# `AccessGrid.Webhook`
[🔗](https://github.com/Access-Grid/accessgrid-ex/blob/main/lib/access_grid/webhook.ex#L1)

Webhook subscription that receives event notifications. Returned by
`AccessGrid.Console.list_webhooks/1` and `AccessGrid.Console.create_webhook/2`.

Auth-method-specific fields appear only when applicable:

  * `private_key` is returned ONLY on `auth_method: "bearer_token"` creation
    (sensitive; store on receipt — Rails does not return it again).
  * `client_cert` and `cert_expires_at` are returned on `auth_method: "mtls"`.

Unused fields are `nil` on the struct.

# `t`

```elixir
@type t() :: %AccessGrid.Webhook{
  auth_method: String.t() | nil,
  cert_expires_at: String.t() | nil,
  client_cert: String.t() | nil,
  created_at: String.t() | nil,
  id: String.t() | nil,
  name: String.t() | nil,
  private_key: String.t() | nil,
  subscribed_events: [String.t()],
  url: String.t() | nil
}
```

# `from_response`

```elixir
@spec from_response(map()) :: t()
```

Creates a Webhook struct from an API response map.

---

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