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

Setup links are hosted onboarding pages where a customer connects their
WhatsApp number. See
[Create and configure](https://docs.kapso.ai/docs/platform/setup-links/create-and-configure).

# `result`

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

# `create`

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

Creates a setup link. The response `data.url` is the page to send to the
customer.

Attributes include `success_redirect_url`, `failure_redirect_url`,
`allowed_origins`, `allowed_connection_types`, `provision_phone_number`,
`phone_number_area_code`, `phone_number_country_isos`,
`meta_billing_mode`, `theme_config`, `reconnect_phone_number` and
`language`.

    SetupLinks.create(client, customer_id, %{
      success_redirect_url: "https://app.example.com/whatsapp/connected",
      language: "es"
    })

# `list`

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

Lists a customer's setup links, most recent first.

Params: `status`, `created_after`, `created_before`, `page`, `per_page`.

# `update`

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

Updates a setup link. Besides the `create/3` attributes, accepts
`expires_at` and `status` (for example `"revoked"`).

---

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