Loopwise Docs
Admin APIQueries

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:

ParameterTypeDescription
filterAdminPostFilterFilter criteria (see Filtering)
pageIntPage number for pagination
perPageIntNumber 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:

ParameterTypeDescription
idString!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

FieldTypeDescription
idString!Unique identifier
titleString!Post title
subtitleStringPost subtitle
bodyString!Post body content as HTML (see Body content format)
excerptStringPost excerpt
slugString!URL slug
coverPhotoStringURL of the cover photo
publishedBoolean!Whether the post is published
publishedAtIntUnix timestamp of the publish time
noindexBoolean!Whether the post is excluded from search engine indexing
accessTypeString!login_required, paid, or public_access
authorLecturerThe post author
tags[String!]Tag names
categoryCategoryThe post category
commentCountInt!Total number of top-level comments
unrepliedCommentCountInt!Number of top-level comments with no replies
createdAtInt!Unix timestamp
updatedAtInt!Unix timestamp

Filtering

The filter parameter accepts an AdminPostFilter object:

FieldTypeDescription
idOperatorStringFilter by post ID
titleOperatorStringFilter by title (supports eq, contains, like, ...)
slugOperatorStringFilter by slug
accessTypeOperatorStringFilter by access type
publishedBooleanFilter 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
publishedAtOperatorIntegerFilter by publish time (Unix timestamp; supports gt, lt, ...)
createdAtOperatorIntegerFilter by creation time
updatedAtOperatorIntegerFilter 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.

On this page