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

WhatsApp numbers connected to your Kapso project.

For Meta's view of a number (quality rating, PIN, ...) see
`KapsoEx.WhatsApp.PhoneNumbers`.

# `result`

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

# `connect`

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

Connects a number you configured in Meta to a customer, using Meta
credentials.

Attributes: `name`, `phone_number_id`, `business_account_id`,
`access_token` (required), `kind` (`"production"` or `"sandbox"`),
`webhook_verify_token`, `webhook_destination_url`,
`inbound_processing_enabled`, `calls_enabled`.

# `delete`

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

Removes a phone number from the project.

# `get`

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

Gets a phone number.

# `health`

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

Checks the number's health through Meta's APIs and Kapso services.
Returns `%{"status" => "healthy" | "degraded" | "unhealthy" | "error", "checks" => ...}`.

# `list`

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

Lists phone numbers, most recent first.

Params: `phone_number_id`, `business_account_id`, `customer_id`,
`messaging_enabled`, `name_contains`, `created_after`, `created_before`,
`page`, `per_page`.

# `update`

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

Updates a phone number. Attributes as in `connect/3`.

---

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