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:
Parameter | Type | Description |
---|---|---|
subdomain | String! | School’s subdomain (required) |
filter | CourseFilter | Filter criteria (see Filtering) |
page | Int | Page number for pagination |
perPage | Int | Number of items per page (default: 20, max: 50) |
limit | Int | Alternative to perPage |
Returns:
- CoursePage object with:
nodes
: Array of Course objectscurrentPage
: Current page numberhasNextPage
: Whether there are more pageshasPreviousPage
: Whether there are previous pagesnodesCount
: Total number of items in the current pagetotalPages
: 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:
Field | Type | Description |
---|---|---|
id | String! | Unique identifier |
name | String! | Course name |
slug | String! | URL-friendly identifier |
description | String | Course description |
image | String | Course image URL |
featured | Boolean! | Whether the course is featured |
invisible | Boolean! | Whether the course is hidden |
publishedAt | Int | Unix timestamp when the course was published |
courseType | String! | Possible values: paid, public_access, free_redeem or pre_order |
contentType | String! | Content type of the course |
template | String! | Possible values: default, video_on_top |
playerTheme | String! | Possible values: classic, theater |
sections | [Section!]! | List of course sections |
categories | [Category!] | List of course categories |
tags | [String!] | List of course tags |
lecturer | Lecturer | Primary lecturer |
lecturers | [Lecturer!] | All lecturers for the course |
assignments | [Assignment!] | List of course assignments |
totalHours | Float | Total duration of the course in hours |
lecturesCount | Int | Number of lectures in the course |
courseFeatures | CourseFeatures | Additional course features |
preOrderInfo | CoursePreOrderInfo | Pre-order information if applicable |
rating | Rating | Course 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 Field | Type | Description |
---|---|---|
id | StringOperator | Filter by course ID |
tags | [String!] | Filter by course tags |
categoryIds | [String!] | Filter by category IDs |
categorySlugs | [String!] | Filter by category slugs |
featured | Boolean | Filter for featured courses |
preOrderState | String | Filter by pre-order state (upcoming, started, to_be_released, released) |
hasAssignments | Boolean | Filter for courses with published assignments |
StringOperator
The StringOperator
used in filters has these operations:
Operation | Description |
---|---|
eq | Equal to |
neq | Not equal to |
in | In a list of values |
nin | Not in a list of values |
like | Match 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 } }}