> ## 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.

# List Components

> Retrieve a paginated list of components

## Query Parameters

<ParamField query="limit" type="number" default="10">
  Items per page
</ParamField>

<ParamField query="lastKey" type="string">
  Cursor for pagination (from previous response)
</ParamField>

<ParamField query="type" type="string">
  Filter by component type: `view` or `layout`
</ParamField>

<ParamField query="search" type="string">
  Search term for name
</ParamField>

<ParamField query="query" type="string">
  Semantic search query
</ParamField>

<ParamField query="includeAssets" type="boolean" default="false">
  Include component assets inline in the response
</ParamField>

## Response

<ResponseField name="data" type="Component[]">
  Array of component objects
</ResponseField>

<ResponseField name="pagination" type="object">
  <Expandable title="properties">
    <ResponseField name="limit" type="number">Items per page</ResponseField>
    <ResponseField name="lastKey" type="string">Cursor for next page (if more results exist)</ResponseField>
  </Expandable>
</ResponseField>

### Example Response

```json theme={null}
{
  "data": [
    {
      "id": "c123",
      "name": "ArticleLayout",
      "title": "Article Layout",
      "description": "Standard article layout...",
      "type": "layout",
      "status": "published",
      "version": 3,
      "lastPublishedVersion": 3,
      "content": "...",
      "compiled": "...",
      "schema": {...},
      "createdAt": "2024-03-20T10:00:00Z",
      "updatedAt": "2024-03-21T14:30:00Z"
    }
  ],
  "pagination": {
    "limit": 10,
    "lastKey": "eyJpZCI6ImMxMjQifQ=="
  }
}
```

### Response with Assets

When `includeAssets=true`:

```json theme={null}
{
  "data": [
    {
      "id": "c123",
      "name": "ArticleLayout",
      "type": "layout",
      "status": "published",
      "assets": [
        {
          "id": "asset123",
          "name": "hero-image.jpg",
          "type": "image/jpeg",
          "url": "https://cdn.metabind.ai/.../hero-image.jpg",
          "size": 2048576,
          "status": "active",
          "metadata": {
            "width": 1920,
            "height": 1080
          }
        }
      ],
      "createdAt": "2024-03-20T10:00:00Z",
      "updatedAt": "2024-03-21T14:30:00Z"
    }
  ],
  "pagination": {...}
}
```

<Note>
  When `includeAssets=true`, only the first 100 assets per component are included.
</Note>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components?status=published&type=layout" \
    -H "Authorization: Bearer YOUR_JWT"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components?status=published',
    {
      headers: {
        'Authorization': 'Bearer YOUR_JWT'
      }
    }
  );

  const { data, pagination } = await response.json();
  ```
</CodeGroup>
