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

> Retrieve a list of content items with filtering and sorting

The Content API provides flexible search with both simple query parameters and advanced filtering through request bodies.

## Path Parameters

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

<ParamField path="projectId" type="string" required>
  Project 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>

<ParamField query="typeId" type="string">
  Filter by ContentType ID
</ParamField>

<ParamField query="tags" type="string">
  Filter by tag IDs (comma-separated)
</ParamField>

<ParamField query="status" type="string">
  Filter by status: `draft`, `modified`, `published`, `unpublished`, or `deleted`
</ParamField>

<ParamField query="search" type="string">
  Case-insensitive name prefix match. Ignored when `typeId`, `tags`, or `status` is set.
</ParamField>

<ParamField query="query" type="string">
  Natural language query for semantic search
</ParamField>

<ParamField query="isTemplate" type="string">
  Filter by template status (`true` or `false`)
</ParamField>

## Response

<ResponseField name="data" type="Content[]">
  Array of content objects
</ResponseField>

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

### Example Response

```json theme={null}
{
  "data": [
    {
      "id": "cont124",
      "typeId": "ct123",
      "version": 1,
      "lastPublishedVersion": 1,
      "packageVersion": "1.0.0",
      "name": "Getting Started Guide",
      "status": "published",
      "isTemplate": false,
      "content": { ... },
      "tags": ["tag123"],
      "metadata": {
        "createdBy": "user123",
        "locale": "en-US"
      },
      "createdAt": "2024-03-21T10:00:00Z",
      "updatedAt": "2024-03-21T14:30:00Z"
    }
  ],
  "pagination": {
    "lastKey": "eyJwayI6Ik9SR..."
  }
}
```

## Advanced Filtering (POST Method)

For complex queries, use the POST method with a JSON request body:

```http theme={null}
POST /app/v1/organizations/{organizationId}/projects/{projectId}/content/search
```

### Request Body

```json theme={null}
{
  "filter": {
    "typeId": {
      "eq": "ct123"
    },
    "tags": {
      "all": ["tag123", "tag456"]
    },
    "status": {
      "eq": "published"
    },
    "updatedAt": {
      "gte": "2024-01-01T00:00:00Z",
      "lte": "2024-12-31T23:59:59Z"
    }
  },
  "sort": [
    { "field": "updatedAt", "order": "desc" }
  ],
  "pagination": { "limit": 20 }
}
```

### Filter Operators

| Operator | Description | Example |
| - | - | - |
| `eq` | Equals | `{"status": {"eq": "published"}}` |
| `neq` | Not equals | `{"status": {"neq": "deleted"}}` |
| `in` | In array | `{"typeId": {"in": ["article", "blog"]}}` |
| `all` | Contains all values (tags) | `{"tags": {"all": ["featured", "news"]}}` |
| `any` | Contains any values (tags) | `{"tags": {"any": ["tech", "ai"]}}` |
| `gte` | Greater than or equal (date) | `{"updatedAt": {"gte": "2024-01-01"}}` |
| `lte` | Less than or equal (date) | `{"updatedAt": {"lte": "2024-12-31"}}` |
| `gt` | Greater than (date) | `{"updatedAt": {"gt": "2024-01-01"}}` |
| `lt` | Less than (date) | `{"updatedAt": {"lt": "2024-12-31"}}` |
| `like` | Pattern matching (name) | `{"name": {"like": "intro"}}` |

### Available Sort Fields

| Field | Description |
| - | - |
| `updatedAt` | Sort by last modification date (only field supported) |

<Note>
  When no sort is specified, content is sorted by `updatedAt:desc` by default.
</Note>

## Code Examples

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

  ```bash cURL (Advanced) theme={null}
  curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/search" \
    -H "Authorization: Bearer YOUR_JWT" \
    -H "Content-Type: application/json" \
    -d '{
      "filter": {
        "tags": { "all": ["tag123", "tag456"] },
        "status": { "eq": "published" }
      },
      "sort": [{ "field": "updatedAt", "order": "desc" }]
    }'
  ```

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

  // Advanced query
  const advancedResponse = await fetch(
    'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/content/search',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_JWT',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        filter: {
          tags: { all: ['tag123', 'tag456'] },
          status: { eq: 'published' }
        }
      })
    }
  );

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.