# `Wardrik.Hook`

Delivers a service's request to an agent's webhook trigger.

    :ok = Wardrik.Hook.deliver(scope, "acme/triage", "issues", body: body, headers: headers)

# `deliver`

```elixir
@spec deliver(Wardrik.Scope.t(), String.t() | struct(), String.t() | struct(), term()) ::
  term() | :ok | {:error, Wardrik.Error.t()}
```

Deliver a webhook request to a trigger

Asks the agent about a request a service sent its webhook trigger, once the request proves itself with the trigger's secret, and only once. One that doesn't answers not_found, as a trigger there isn't does. unavailable means the agent can't be asked now; the service should send it again later.

`POST /v1/hooks/{agent}/{trigger}`

# `deliver_with_secret`

```elixir
@spec deliver_with_secret(
  Wardrik.Scope.t(),
  String.t() | struct(),
  String.t() | struct(),
  String.t() | struct(),
  term()
) :: term() | :ok | {:error, Wardrik.Error.t()}
```

Deliver a webhook request, with the secret in its path

As hook.deliver, for a service that only takes a URL: the secret ends the path. Keep that URL as private as a token.

`POST /v1/hooks/{agent}/{trigger}/{secret}`

---

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