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

Access links to [embed the Kapso inbox](https://docs.kapso.ai/docs/platform/inbox/embedded)
in your own application through an iframe.

The raw token and embed URL are only returned by `create/2`; store them
then.

# `result`

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

# `create`

```elixir
@spec create(KapsoEx.Client.t(), map() | keyword()) :: result()
```

Creates an inbox embed.

Attributes: `scope_type` (required: `"project"`, `"customer"` or
`"phone_number"`), `scope_id`, `name`, `assigned_user_id`,
`allowed_origins`, `default_mode` (`"system"`, `"light"`, `"dark"`),
`language` (`"en"`, `"es"`), `expires_at`.

    InboxEmbeds.create(client, scope_type: "customer", scope_id: customer_id,
      allowed_origins: ["https://app.example.com"], language: "es")

# `get`

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

Gets an inbox embed (without its token or URL).

# `list`

```elixir
@spec list(KapsoEx.Client.t(), map() | keyword()) :: result()
```

Lists inbox embeds, most recent first.

Params: `status`, `scope_type`, `scope_id`, `assigned_user_id`, `page`,
`per_page`.

# `revoke`

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

Revokes the embed token immediately.

# `update`

```elixir
@spec update(KapsoEx.Client.t(), String.t(), map() | keyword()) :: result()
```

Updates an inbox embed. The scope cannot be changed.

---

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