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

# Create Collection

> Create a new component collection

## Path Parameters

<ParamField path="organizationId" type="string" required>
  Organization ID
</ParamField>

<ParamField path="projectId" type="string" required>
  Project ID
</ParamField>

## Request Body

<ParamField body="name" type="string" required>
  Collection display name
</ParamField>

<ParamField body="folderId" type="string">
  Parent folder ID (null for root level)
</ParamField>

### Example Request

```json theme={null}
{
  "name": "UI Components",
  "folderId": null
}
```

## Response

Returns the created Collection object.

```json theme={null}
{
  "id": "coll123",
  "name": "UI Components",
  "folderId": null,
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-20T10:00:00Z"
}
```

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/collections" \
    -H "Authorization: Bearer YOUR_JWT" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "UI Components"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/collections',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_JWT',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        name: 'UI Components'
      })
    }
  );

  const collection = await response.json();
  console.log(`Created collection: ${collection.id}`);
  ```
</CodeGroup>
