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

Query conversations across the project, close or reopen them, and assign
them to team members.

# `result`

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

# `create_assignment`

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

Assigns a conversation to a team member. Attributes: `user_id`
(required), `notes`. Only one active assignment is allowed.

# `get`

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

Gets a conversation.

# `get_assignment`

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

Gets an assignment.

# `list`

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

Lists conversations, latest activity first, with cursor pagination.

Params: `phone_number_id`, `phone_number`, `status`, `assigned_user_id`,
`unassigned`, `created_after`, `created_before`, `last_active_after`,
`last_active_before`, `limit`, `before`, `after`.

# `list_assignments`

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

Lists a conversation's assignments, most recent first. Params: `page`, `per_page`.

# `update_assignment`

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

Updates an assignment: change `notes`, reassign with `user_id`, or
unassign with `active: false`.

# `update_status`

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

Closes (`"ended"`) or reopens (`"active"`) a conversation.

---

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