---
title: "Create a new collection"
method: POST
path: "/hub/collections"
tags: ["Collections"]
---

# Create a new collection

`POST /hub/collections`

## Request

- Base URL: `https://api.quiva.ai`
- URL: `https://api.quiva.ai/hub/collections`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-3/docs/hub/collections/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a new collection for organizing nodes or workflows

## Request body

- CreateCollectionRequest
  - `name` string, required: Name of the collection
  - `collection_type` 'node' | 'workflow', required: Type of the collection (node or workflow)
  - `description` string: Optional description of the collection

## Response `201`

Collection created successfully

- CreateCollectionResponse
  - `subject` string: Subject identifier for the collection
  - `name` string: Name of the collection
  - `collection_type` string: Type of the collection (node or workflow)
  - `topic` string: Hash of the collection name
  - `description` string: Description of the collection
  - `modified` integer: Timestamp of last modification

## Other responses

- `400`: Bad request
- `409`: Collection already exists

---

[API](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-3.md) - [All operations](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-3/llms.txt) - [OpenAPI document](https://skmtc.dev/quivaworks/apis/quiva-ai-gateway-3/revisions/f80cd5f3ac1c?raw)
