# `HuggingfaceClient.Hub.Discovery.Collections`
[🔗](https://github.com/huggingface/huggingface_client/blob/v0.1.0/lib/huggingface_client/hub/discovery/collections.ex#L1)

Collections API — list, create, get, add/remove items, delete.

# `add_item`

```elixir
@spec add_item(String.t(), String.t(), String.t(), keyword()) ::
  :ok | {:error, Exception.t()}
```

Adds an item to a collection. See `HuggingfaceClient.add_collection_item/4`.

# `create`

```elixir
@spec create(
  map(),
  keyword()
) :: {:ok, map()} | {:error, Exception.t()}
```

Creates a collection. See `HuggingfaceClient.create_collection/2`.

# `delete`

```elixir
@spec delete(
  String.t(),
  keyword()
) :: :ok | {:error, Exception.t()}
```

Deletes a collection. See `HuggingfaceClient.delete_collection/2`.

# `delete_item`

```elixir
@spec delete_item(String.t(), String.t(), keyword()) :: :ok | {:error, Exception.t()}
```

Removes an item from a collection. See `HuggingfaceClient.delete_collection_item/3`.

# `info`

```elixir
@spec info(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Exception.t()}
```

Returns full collection info. See `HuggingfaceClient.collection_info/2`.

# `list`

```elixir
@spec list(keyword()) :: Enumerable.t()
```

Returns a lazy stream of collections. See `HuggingfaceClient.list_collections/1`.

# `update`

```elixir
@spec update(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Exception.t()}
```

Updates a collection's title, description, or theme.

## Options

- `:title` — new title
- `:description` — new description
- `:private` — visibility
- `:theme` — collection theme string
- `:access_token`

## Example

    {:ok, updated} = HuggingfaceClient.update_collection("my-user/my-collection-slug",
      title: "New Title",
      description: "Updated description",
      access_token: "hf_..."
    )

# `update_item`

```elixir
@spec update_item(
  String.t(),
  keyword()
) :: {:ok, map()} | {:error, Exception.t()}
```

Updates a specific item in a collection (change note or reorder position).

## Options

- `:item_object_id` — the item's object ID within the collection (required)
- `:note` — updated note text for the item
- `:position` — new position index for the item
- `:access_token`

---

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