> ## 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 Component Versions

> Retrieve version history for a component

## Path Parameters

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

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

<ParamField path="id" type="string" required>
  Component ID
</ParamField>

## Query Parameters

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

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

## Response

<ResponseField name="data" type="ComponentVersion[]">
  Array of version objects
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination information
</ResponseField>

### Example Response

```json theme={null}
{
  "data": [
    {
      "version": 3,
      "status": "published",
      "content": "const metadata = () => ({...});\nconst body = (props) => {...};",
      "compiled": "const metadata = () => ({...});\nconst body = (props) => {...};",
      "schema": {...},
      "createdAt": "2024-03-22T10:00:00Z",
      "createdBy": "user123",
      "packageVersion": "2.0.0"
    },
    {
      "version": 2,
      "status": "published",
      "content": "...",
      "compiled": "...",
      "schema": {...},
      "createdAt": "2024-03-15T10:00:00Z",
      "createdBy": "user123",
      "packageVersion": "1.1.0"
    },
    {
      "version": 1,
      "status": "published",
      "content": "...",
      "compiled": "...",
      "schema": {...},
      "createdAt": "2024-03-10T10:00:00Z",
      "createdBy": "user456",
      "packageVersion": "1.0.0"
    }
  ],
  "pagination": {
    "limit": 20,
    "lastKey": null
  }
}
```

<Note>
  Component versions are created when the component is included in a package. Each version is immutable and tied to a specific package version.
</Note>

## Code Examples

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

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

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