> ## 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 Content Type Versions

> Retrieve the version history for a content type

## 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>
  Content Type 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="object[]">
  Array of version records

  <Expandable title="properties">
    <ResponseField name="version" type="number">Version number</ResponseField>
    <ResponseField name="packageVersion" type="string">Package version used</ResponseField>
    <ResponseField name="layoutComponentId" type="string">Layout component ID at this version</ResponseField>
    <ResponseField name="componentIdsAllowList" type="array">Allowed components at this version</ResponseField>
    <ResponseField name="createdAt" type="string">When this version was created</ResponseField>
    <ResponseField name="createdBy" type="string">Who created this version</ResponseField>
  </Expandable>
</ResponseField>

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

### Example Response

```json theme={null}
{
  "data": [
    {
      "version": 3,
      "packageVersion": "1.0.0",
      "layoutComponentId": "c123",
      "componentIdsAllowList": ["c124", "c125", "c126", "c127"],
      "createdAt": "2024-03-22T10:00:00Z",
      "createdBy": "user123"
    },
    {
      "version": 2,
      "packageVersion": "1.0.0",
      "layoutComponentId": "c123",
      "componentIdsAllowList": ["c124", "c125", "c126"],
      "createdAt": "2024-03-21T10:00:00Z",
      "createdBy": "user456"
    },
    {
      "version": 1,
      "packageVersion": "1.0.0",
      "layoutComponentId": "c123",
      "componentIdsAllowList": ["c124", "c125"],
      "createdAt": "2024-03-20T10:00:00Z",
      "createdBy": "user123"
    }
  ],
  "pagination": {
    "lastKey": "eyJwayI6Ik9SR..."
  }
}
```

<Note>
  Versions are returned in reverse chronological order (newest first).
</Note>

## Code Examples

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

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

  const { data: versions } = await response.json();
  console.log(`Content type has ${versions.length} versions`);

  // Find changes between versions
  const latest = versions[0];
  const previous = versions[1];
  console.log(`Version ${latest.version} added components: ${
    latest.componentIdsAllowList.filter(c => !previous.componentIdsAllowList.includes(c))
  }`);
  ```
</CodeGroup>
