Posts Query
Query operations for posts in the Loopwise Admin API
Note: The Loopwise Admin API is currently under development and not yet available for public use. This documentation is provided for preview purposes only.
Overview
The Post API allows you to retrieve blog posts and articles published in your school, along with their categories. Use it to sync content to external systems, build custom front ends, or audit your content library.
Available Queries
posts
Returns a paginated list of posts for the authenticated school.
Parameters:
| Parameter | Type | Description |
|---|---|---|
filter | AdminPostFilter | Filter criteria (see Filtering) |
page | Int | Page number for pagination |
perPage | Int | Number of items per page (default: 20, max: 50) |
Example:
query {
posts(
filter: {
published: true,
tags: ["news"]
},
page: 1,
perPage: 10
) {
nodes {
id
title
slug
accessType
published
publishedAt
tags
category {
id
name
}
}
currentPage
hasNextPage
nodesCount
totalPages
}
}post
Returns a single post by ID, or null if the post does not exist in your school.
Parameters:
| Parameter | Type | Description |
|---|---|---|
id | String! | ID of the post |
Example:
query {
post(id: "post_12345") {
id
title
subtitle
body
excerpt
slug
accessType
published
publishedAt
noindex
coverPhoto
tags
category {
id
name
}
commentCount
unrepliedCommentCount
}
}postCategories
Returns the post categories of your school. Use the returned IDs as categoryId when creating or updating posts, and as categoryIds when filtering posts.
Example:
query {
postCategories {
nodes {
id
name
slug
}
}
}AdminPost Object
| Field | Type | Description |
|---|---|---|
id | String! | Unique identifier |
title | String! | Post title |
subtitle | String | Post subtitle |
body | String! | Post body content as HTML (see Body content format) |
excerpt | String | Post excerpt |
slug | String! | URL slug |
coverPhoto | String | URL of the cover photo |
published | Boolean! | Whether the post is published |
publishedAt | Int | Unix timestamp of the publish time |
noindex | Boolean! | Whether the post is excluded from search engine indexing |
accessType | String! | login_required, paid, or public_access |
author | Lecturer | The post author |
tags | [String!] | Tag names |
category | Category | The post category |
commentCount | Int! | Total number of top-level comments |
unrepliedCommentCount | Int! | Number of top-level comments with no replies |
createdAt | Int! | Unix timestamp |
updatedAt | Int! | Unix timestamp |
Filtering
The filter parameter accepts an AdminPostFilter object:
| Field | Type | Description |
|---|---|---|
id | OperatorString | Filter by post ID |
title | OperatorString | Filter by title (supports eq, contains, like, ...) |
slug | OperatorString | Filter by slug |
accessType | OperatorString | Filter by access type |
published | Boolean | Filter by published flag |
tags | [String!] | Return posts tagged with any of the given tags |
categoryIds | [String!] | Return posts in the given categories, including their subcategories |
publishedAt | OperatorInteger | Filter by publish time (Unix timestamp; supports gt, lt, ...) |
createdAt | OperatorInteger | Filter by creation time |
updatedAt | OperatorInteger | Filter by last update time |
Example — unpublished drafts in a category:
query {
posts(filter: { published: false, categoryIds: ["cat_123"] }) {
nodes {
id
title
}
nodesCount
}
}Required Scope
These queries require the posts:read scope.