# Create collection

> Create a new collection. Use `type: "folder"` for simple grouping,
`type: "playlist"` for ordered videos with progress tracking.

```json
{
  "/collections": {
    "post": {
      "tags": [
        "Collections"
      ],
      "summary": "Create collection",
      "operationId": "createCollection",
      "description": "Create a new collection. Use `type: \"folder\"` for simple grouping,\n`type: \"playlist\"` for ordered videos with progress tracking.",
      "security": [
        {
          "bearerAuth": []
        }
      ],
      "requestBody": {
        "required": true,
        "description": "Create collection data",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string"
                },
                "description": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "thumbnailUrl": {
                  "anyOf": [
                    {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "organizationId": {
                  "type": "string",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
                  "format": "uuid"
                },
                "type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "folder",
                        "playlist"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "isPublic": {
                  "anyOf": [
                    {
                      "type": "boolean"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "name",
                "organizationId"
              ],
              "additionalProperties": true
            }
          }
        }
      },
      "responses": {
        "201": {
          "description": "Collection created successfully",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "thumbnailUrl": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "organizationId": {
                    "type": "string",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
                    "format": "uuid"
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "folder",
                      "playlist"
                    ]
                  },
                  "isPublic": {
                    "type": "boolean"
                  },
                  "videoCount": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "enum": [
                          "Infinity",
                          "-Infinity",
                          "NaN"
                        ]
                      }
                    ]
                  },
                  "createdAt": {
                    "type": "string"
                  },
                  "updatedAt": {
                    "type": "string"
                  }
                },
                "required": [
                  "id",
                  "name",
                  "description",
                  "thumbnailUrl",
                  "organizationId",
                  "type",
                  "isPublic",
                  "videoCount",
                  "createdAt",
                  "updatedAt"
                ],
                "additionalProperties": true
              }
            }
          }
        },
        "400": {
          "description": "- Invalid request body"
        },
        "401": {
          "description": "- Unauthorized"
        },
        "403": {
          "description": "- Not a member of the organization"
        }
      }
    }
  }
}
```
