---
title: "Create a collection"
method: POST
path: "/knowledge-bases/{id}/collections"
tags: ["collections"]
---

# Create a collection

`POST /knowledge-bases/{id}/collections`

Creates a new collection within a knowledge base.

**Rate limit:** 10 requests per minute

## Path parameters

- `id` string, required

## Request body

- CreateCollectionRequestBody
  - `description` string — Description of the collection.
  - `parent_collection_id` string — The id of the collection associated to the article
  - `slug` string — The slug of the collection. Defaults to a slug based on the title.
  - `title` string, required — The title of the collection.
  - `visibility_config` CollectionVisibilityConfig
    - `ai_agent_access` 'inherit' | 'none' | 'specific_agents' — AI agent access control. Defaults to inherit from the parent scope when omitted. `inherit`: Defers the access check to the parent object (Collection or KnowledgeBase). `none`: No AI agents have access to this article. `specific_agents`: Only specific AI agents enumerated in the allowlist have access.
    - `allowed_agent_ids` string[] — List of AI agent IDs that may access this resource when ai_agent_access is set to "specific_agents".
    - `visibility` 'public' | 'customer' | 'internal_only' — The visibility setting.

## Response `200`

- CreateCollectionResponseBody
  - `data` Collection
    - `created_at` string — The created at time of the collection.
    - `description` string — The description of the collection.
    - `icon` string — The icon of the collection.
    - `id` string — The ID of the collection.
    - `parent_collection_id` string — The ID of the parent collection.
    - `slug` string — The slug of the collection.
    - `title` string — The name of the collection.
    - `visibility_config` CollectionVisibilityConfig
      - `ai_agent_access` 'inherit' | 'none' | 'specific_agents' — AI agent access control. Defaults to inherit from the parent scope when omitted. `inherit`: Defers the access check to the parent object (Collection or KnowledgeBase). `none`: No AI agents have access to this article. `specific_agents`: Only specific AI agents enumerated in the allowlist have access.
      - `allowed_agent_ids` string[] — List of AI agent IDs that may access this resource when ai_agent_access is set to "specific_agents".
      - `visibility` 'public' | 'customer' | 'internal_only' — The visibility setting.
  - `request_id` string — The request ID for tracking.

## Other responses

- `400` — The request was invalid or could not be completed.
- `404`
- `500` — An unexpected internal error occurred.

---

[API](https://skmtc.net/usepylon/apis/pylon-api.md) · [All operations](https://skmtc.net/usepylon/apis/pylon-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/usepylon/pylon-api/versions/484a11d5ddb2/schema)
