# `KapsoEx.Platform.Notifications`
[🔗](https://github.com/rocket4ce/kapso_ex/blob/v0.1.0/lib/kapso_ex/platform/notifications.ex#L1)

Route Kapso notification events to team destinations (shared email
addresses or Slack channels).

# `result`

```elixir
@type result() :: {:ok, map() | nil} | {:error, KapsoEx.Error.t()}
```

# `create_email_destination`

```elixir
@spec create_email_destination(KapsoEx.Client.t(), String.t(), keyword()) :: result()
```

Creates a shared email destination and sends a verification email
(valid for 7 days). It receives notifications once confirmed.

## Options

  * `:label` - display name of the destination.

# `delete_destination`

```elixir
@spec delete_destination(KapsoEx.Client.t(), String.t()) :: result()
```

Removes a destination, its routes and pending deliveries.

# `delete_route`

```elixir
@spec delete_route(KapsoEx.Client.t(), String.t()) :: result()
```

Deletes a route and cancels its pending deliveries.

# `list_destinations`

```elixir
@spec list_destinations(KapsoEx.Client.t()) :: result()
```

Lists shared email and Slack channel destinations, including pending ones.

# `list_event_types`

```elixir
@spec list_event_types(KapsoEx.Client.t()) :: result()
```

Lists the event types you can route. Use their `key` in `upsert_route/3`.

# `list_routes`

```elixir
@spec list_routes(KapsoEx.Client.t()) :: result()
```

Lists routes (event type to destination), oldest first.

# `upsert_route`

```elixir
@spec upsert_route(KapsoEx.Client.t(), String.t(), String.t()) :: result()
```

Routes `event_key` to a destination. Returns the existing route when it already exists.

---

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