Skip to content

Course Queries

Note: The Teachify Admin API is currently under development and not yet available for public use. This documentation is provided for preview purposes only.

Overview

The Courses API allows you to retrieve information about courses in your school. You can list all courses, get details for a specific course, and access related data.

Available Queries

courses

Returns a paginated list of courses for the school.

Parameters:

ParameterTypeDescription
subdomainString!School’s subdomain (required)
filterCourseFilterFilter criteria (see Filtering)
pageIntPage number for pagination
perPageIntNumber of items per page (default: 20, max: 50)
limitIntAlternative to perPage

Returns:

  • CoursePage object with:
    • nodes: Array of Course objects
    • currentPage: Current page number
    • hasNextPage: Whether there are more pages
    • hasPreviousPage: Whether there are previous pages
    • nodesCount: Total number of items in the current page
    • totalPages: Total number of pages

Example:

query {
courses(
subdomain: "myschool"
page: 1
perPage: 10
) {
nodes {
id
name
description
slug
featured
}
currentPage
hasNextPage
totalPages
}
}

Course Object

The Course object contains the following fields based on the schema:

FieldTypeDescription
idString!Unique identifier
nameString!Course name
slugString!URL-friendly identifier
descriptionStringCourse description
imageStringCourse image URL
featuredBoolean!Whether the course is featured
invisibleBoolean!Whether the course is hidden
publishedAtIntUnix timestamp when the course was published
courseTypeString!Possible values: paid, public_access, free_redeem or pre_order
contentTypeString!Content type of the course
templateString!Possible values: default, video_on_top
playerThemeString!Possible values: classic, theater
sections[Section!]!List of course sections
categories[Category!]List of course categories
tags[String!]List of course tags
lecturerLecturerPrimary lecturer
lecturers[Lecturer!]All lecturers for the course
assignments[Assignment!]List of course assignments
totalHoursFloatTotal duration of the course in hours
lecturesCountIntNumber of lectures in the course
courseFeaturesCourseFeaturesAdditional course features
preOrderInfoCoursePreOrderInfoPre-order information if applicable
ratingRatingCourse rating information
faqSections[FaqSection!]FAQ sections for the course

Detailed Query Structure

Below is a comprehensive view of fields available in the courses query based on the schema:

query {
courses(
subdomain: "myschool"
filter: {
id: { eq: "course-123" }
tags: ["beginner"]
featured: true
}
page: 1
perPage: 20
) {
nodes {
id # Unique identifier (String!)
name # Course name (String!)
slug # URL-friendly identifier (String!)
description # Course description (String)
image # Course image URL (String)
# Course settings
featured # Whether the course is featured (Boolean!)
invisible # Whether the course is hidden (Boolean!)
publishedAt # When the course was published (Int)
courseType # Type of course (String!)
contentType # Content type (String!)
template # Template style (String!)
playerTheme # Player theme (String!)
# Course content
sections { # Course sections ([Section!]!)
id
title
position
duration
lectures { # Lectures within sections
id
title
position
duration
isFreePreview
isLocked
}
}
# Categorization
categories { # Course categories ([Category!])
id
name
slug
}
tags # Course tags ([String!])
# Instructors
lecturer { # Primary lecturer (Lecturer)
id
name
avatar
slug
}
lecturers { # All lecturers ([Lecturer!])
id
name
avatar
slug
}
# Assignments
assignments { # Course assignments ([Assignment!])
id
name
description
dueAt
}
# Course metrics
totalHours # Total duration in hours (Float)
lecturesCount # Number of lectures (Int)
# Additional information
courseFeatures { # Course features (CourseFeatures)
studentsCount
lecturesCount
videoTotalHours
audioTotalHours
downloadableResourcesCount
certificateOfCompletion
lifetimeAccess
moneyBackGuarantee
}
# Pre-order information
preOrderInfo { # Pre-order details (CoursePreOrderInfo)
startedAt
endedAt
releasedAt
buyersGoal
buyersPledged
moneyGoal
moneyPledged
goalType
achievedPercentage
}
# Ratings
rating { # Course rating (Rating)
average
total
}
# FAQ sections
faqSections { # FAQ sections ([FaqSection!])
id
name
position
faqContents {
id
title
body
position
isPublished
}
}
}
# Pagination information
currentPage # Current page number (Int!)
hasNextPage # Whether there are more pages (Boolean!)
hasPreviousPage # Whether there are previous pages (Boolean!)
nodesCount # Number of items in current page (Int!)
totalPages # Total number of pages (Int!)
}
}

Filtering

The courses query accepts a filter parameter of type CourseFilter. This allows you to narrow down results based on various criteria.

Available Filters

Filter FieldTypeDescription
idStringOperatorFilter by course ID
tags[String!]Filter by course tags
categoryIds[String!]Filter by category IDs
categorySlugs[String!]Filter by category slugs
featuredBooleanFilter for featured courses
preOrderStateStringFilter by pre-order state (upcoming, started, to_be_released, released)
hasAssignmentsBooleanFilter for courses with published assignments

StringOperator

The StringOperator used in filters has these operations:

OperationDescription
eqEqual to
neqNot equal to
inIn a list of values
ninNot in a list of values
likeMatch text values against a pattern using wildcards (case-sensitive)

Filter Examples

Find courses with specific tags:

query {
courses(
subdomain: "myschool"
filter: {
tags: ["beginner", "programming"]
}
) {
nodes {
id
name
tags
}
}
}

Find featured courses in specific categories:

query {
courses(
subdomain: "myschool"
filter: {
featured: true,
categorySlugs: ["programming", "web-development"]
}
) {
nodes {
id
name
featured
categories {
name
slug
}
}
}
}

Find courses by ID:

query {
courses(
subdomain: "myschool"
filter: {
id: { eq: "course-123" }
}
) {
nodes {
id
name
}
}
}