> For the complete documentation index, see [llms.txt](https://docs.suggestic.com/graphql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suggestic.com/graphql/query/queries/content/content-library.md).

# Content Library

Use the `contentLibrary`query to retrieve a list of content elements.

### Available Arguments

<table data-header-hidden><thead><tr><th width="304.3333333333333">Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Arguments</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td><code>categories</code></td><td>[ID]</td><td><strong>Optional</strong> filter by category, default to all when not present or empty</td></tr><tr><td><code>enablePersonalizedContent</code></td><td>Boolean</td><td><strong>Optional,</strong> Returns content that matches program rule tags at the top of the list. Prioritized content appears first, but other content is still included.</td></tr><tr><td><code>isRead</code></td><td>Boolean</td><td><strong>Optional</strong> to filter by read status.</td></tr></tbody></table>

### Available Fields

| **ield**     | **Description**        | **Type**                                                                                                                                       |
| ------------ | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `categories` | \[ContentCategoryType] | List of [categories](https://app.gitbook.com/o/-LwqSh0rNboNaGEQruZQ/s/-LwqSnBDpAb6mFZYLsuB/~/changes/1886/objects/content/content-categories). |
| `createdAt`  | DateTime               | Content library creation date, format: `YYYY-MM-DDT hh:mm:ssZ`                                                                                 |
| `id`         | ID!                    | Id of content library.                                                                                                                         |
| `imageUrl`   | String                 | Content thumbnail image URL.                                                                                                                   |
| `isBlocked`  | Boolean                | **True** makes the content unavailable to the users, otherwise **False**.                                                                      |
| `isFavorite` | Boolean                | **True** marks the content as favorite, otherwise **False**.                                                                                   |
| `isFeatured` | Boolean                | **True** marks the content as featured, otherwise **False**.                                                                                   |
| `isRead`     | Boolean                | True if the content element has been marked as read or completed.                                                                              |
| `lang`       | JSONString             | Json with content library translated.                                                                                                          |
| `order`      | Int!                   | Used to set category order(The highest value sits on top).                                                                                     |
| `programs`   | \[Program!]            | List of programs the content is available to.                                                                                                  |
| `sourceUrl`  | String                 | Link to the source content.                                                                                                                    |
| `subTitle`   | String                 | Content subtitle.                                                                                                                              |
| `tags`       | \[ContentTagType!]     | List of [tags](https://app.gitbook.com/o/-LwqSh0rNboNaGEQruZQ/s/-LwqSnBDpAb6mFZYLsuB/~/changes/1886/objects/content/content-tag).              |
| `title`      | String                 | Content Title.                                                                                                                                 |
| `updatedAt`  | DateTime               | Content library last update format: `YYYY-MM-DDT hh:mm:ssZ`                                                                                    |

### Example with Category Filter

{% tabs %}
{% tab title="Query" %}

```graphql
{
  contentLibrary(
    categories: ["Q2F0ZWdvcnk6MTBhYjhhN2YtZDk5OC00ZWRjLThhMTItMmViMWJhMDM3NWE4"]
  ) {
    edges {
      node {
        id
        title
        subTitle
        categories {
          id
          name
          image
        }
        tags {
          id
          name
        }
        imageUrl
        sourceUrl
        order
        isFavorite
        isFeatured
        isBlocked
        isRead
      }
    }
  }
}

```

{% endtab %}

{% tab title="Response" %}

```javascript
{
  "data": {
    "contentLibrary": {
      "edges": [
        {
          "id": "Q29udGVudDoyZDJhZjYxOC0xNGJmLTQ1MzAtODlkYS0xNjY4ZTUxMGYzYTg=",
          "title": "Tips for switching to a plant based Diet",
          "subtTitle": null,
          "isBlocked": true,
          "isRead": true,
          "categories": [
            {
              "id": "Q2F0ZWdvcnk6MTBhYjhhN2YtZDk5OC00ZWRjLThhMTItMmViMWJhMDM3NWE4",
              "slug": "lifestyle"
              "name": "Lifestyle"
            }
          ],
          "imageUrl": "https://source.unsplash.com/random/800x600",
          "sourceUrl": "https://webviewcontent.com"
        }
      ]
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Example with Tag and Read Status Filter

{% tabs %}
{% tab title="Query" %}

```graphql
{
 contentLibrary (tags:"something" isRead:true) {
     edges{
         node{
             title
             isRead
             tags{
                 name
                 id
             }
         }
     }
 }
```

{% endtab %}
{% endtabs %}

### Example Obtaining Personalized Content

{% tabs %}
{% tab title="Query" %}

```graphql
 contentLibrary(enablePersonalizedContent: true) {
    edges {
      node {
        id 
        title 
        tags { 
          name 
        }
      }
    }
  }
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.suggestic.com/graphql/query/queries/content/content-library.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
