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

# Create Sub-Collection

> Create a new sub-collection inside an existing collection

Creates a new named sub-collection under the specified parent collection. Returns `400` if the parent collection doesn't exist or isn't one of the user's own collections.

## Path Parameters

**collectionId** `string` *required*

The ID of the parent collection. Use the root collection's ID to create a top-level folder.

## Body Parameters

**collectionName** `string` *required*

The name for the new collection.

## Response

Returns the newly created [Collection](https://docs.sublay.io/v7/data-models/collection.md) object with `status 201`.

## Error Responses

> [accordion] Invalid Parent — 400 Bad Request
>
> ```json theme={null}
> { "error": "Invalid parent collection ID for sub-collection", "code": "collection/invalid-parent" }
> ```

> [accordion] Server Error — 500
>
> ```json theme={null}
> { "error": "Server error", "code": "collection/server-error" }
> ```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.