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

WhatsApp contacts of the project.

`identifier` may be the contact's UUID, phone number (WhatsApp ID) or
business-scoped user ID.

# `result`

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

# `create`

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

Creates a contact. Attributes: `wa_id` (required), `profile_name`,
`display_name`, `customer_id`, `metadata`.

# `erase`

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

Permanently erases a contact and all its data (conversations, messages,
media). This cannot be undone.

# `get`

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

Gets a contact.

# `get_marketing_preference`

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

Gets the contact's marketing preference on one number.

# `list`

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

Lists contacts.

Params: `customer_id`, `customer_external_id`, `has_customer`,
`profile_name_contains`, `wa_id_contains`, `business_scoped_user_id`,
`created_after`, `created_before`, and either `page`/`per_page` or
`limit`/`before`/`after`. Use cursors for deep pagination.

# `list_marketing_preferences`

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

Lists the contact's marketing preference on each of your numbers. An
empty list means the contact never opted out.

# `update`

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

Updates a contact's profile or metadata. Attributes as in `create/2`.

---

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