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

> Retrieve a list of all packages for a project

## Query Parameters

<ParamField query="limit" type="number" default="1000">
  Items per page (max 1000)
</ParamField>

<ParamField query="lastKey" type="string">
  Pagination cursor from previous response
</ParamField>

## Response

<ResponseField name="data" type="Package[]">
  Array of package objects
</ResponseField>

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

### Example Response

```json theme={null}
{
  "data": [
    {
      "id": "pkg789",
      "projectId": "proj123",
      "version": "2.0.0",
      "components": [
        { "id": "comp123", "name": "ProductCard", "type": "view", "version": 3 },
        { "id": "comp124", "name": "ArticleLayout", "type": "layout", "version": 2 }
      ],
      "assets": [...],
      "dependencies": [...],
      "metadata": {
        "author": "jane.doe@metabind.ai",
        "description": "Major update with new components"
      },
      "createdAt": "2024-03-25T10:00:00Z",
      "updatedAt": "2024-03-25T10:00:00Z"
    },
    {
      "id": "pkg456",
      "projectId": "proj123",
      "version": "1.1.0",
      "components": [...],
      "assets": [...],
      "dependencies": [...],
      "metadata": {
        "author": "john.smith@metabind.ai",
        "description": "Bug fixes and improvements"
      },
      "createdAt": "2024-03-22T10:00:00Z",
      "updatedAt": "2024-03-22T10:00:00Z"
    },
    {
      "id": "pkg123",
      "projectId": "proj123",
      "version": "1.0.0",
      "components": [...],
      "assets": [...],
      "dependencies": [...],
      "metadata": {
        "author": "jane.doe@metabind.ai",
        "description": "Initial release"
      },
      "createdAt": "2024-03-20T10:00:00Z",
      "updatedAt": "2024-03-20T10:00:00Z"
    }
  ],
  "pagination": {
    "lastKey": "eyJ2ZXJzaW9uIjoiMS4wLjAifQ=="
  }
}
```

<Note>
  Packages are returned in reverse chronological order (newest first) by default.
</Note>

## Code Examples

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

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

  const { data: packages, pagination } = await response.json();
  console.log(`Found ${packages.length} packages`);
  ```
</CodeGroup>
