> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aigmented.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Collections

> Create and manage knowledge collections

Collections are containers for your knowledge. Upload documents to a collection, and Aigmented extracts structured knowledge cards that you can search and query.

## List collections

```bash theme={null}
curl https://aigmented.io/api/v1/collections/list \
  -H "Authorization: Bearer sk-YOUR_API_KEY"
```

Returns all collections for your team:

```json theme={null}
{
  "message": "List of collections",
  "data": [
    {
      "id": 49,
      "name": "Product Documentation",
      "status": "processed",
      "_count": {
        "knowledgeCards": 1248,
        "fileInstances": 4
      }
    }
  ]
}
```

## Get collection details

```bash theme={null}
curl https://aigmented.io/api/v1/collections/49 \
  -H "Authorization: Bearer sk-YOUR_API_KEY"
```

## Create a collection

```bash theme={null}
curl -X POST https://aigmented.io/api/v1/collections/add \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Q4 2024 Contracts" }'
```

## Delete a collection

```bash theme={null}
curl -X DELETE https://aigmented.io/api/v1/collections/49 \
  -H "Authorization: Bearer sk-YOUR_API_KEY"
```

<Warning>
  Deleting a collection removes all associated knowledge cards. This action cannot be undone.
</Warning>

## Collection statuses

| Status                     | Meaning                                           |
| -------------------------- | ------------------------------------------------- |
| `new`                      | Collection created, no files processed yet        |
| `processing`               | Files are being parsed and knowledge extracted    |
| `processed`                | All files processed successfully                  |
| `processed_with_conflicts` | Processed but some knowledge cards have conflicts |
| `error`                    | Processing failed                                 |

## List knowledge cards

```bash theme={null}
curl "https://aigmented.io/api/v1/collections/49/knowledge-cards?page=1&limit=20" \
  -H "Authorization: Bearer sk-YOUR_API_KEY"
```

Supports pagination (`page`, `limit`), filtering by type (`type`), and full-text search (`search`).
