Teachify Admin API Mutations
Overview
Section titled “Overview”The Teachify Admin API provides a variety of mutation operations to modify data in your school. These mutations enable you to create, update, and delete resources programmatically, giving you powerful automation capabilities.
Core Concepts
Section titled “Core Concepts”- Input Types: How to structure input data for mutations
- Input Validation: Understanding validation rules and error handling
Available Resources
Section titled “Available Resources”The API provides mutations for the following resources:
- Courses: Create, update, and delete courses
- Posts: Create, update, and delete posts
- Assignments: Create and grade assignments
- Events: Manage calendar events
- Subscriptions: Manage membership subscriptions
- Send Custom Email: Send custom emails to users
Common Patterns
Section titled “Common Patterns”Error Handling
Section titled “Error Handling”All mutations return an errors field that contains any validation or processing errors:
mutation { createCourse(input: { name: "" }) { errors { field message } course { id name } }}Response:
{ "data": { "createCourse": { "errors": [ { "field": "name", "message": "Name cannot be empty" } ], "course": null } }}Input Objects
Section titled “Input Objects”Most mutations accept a single input parameter containing all required fields:
mutation { createCourse(input: { name: "Introduction to GraphQL" description: "Learn the basics of GraphQL" startDate: "2023-06-01" }) { course { id name } errors { field message } }}Basic Example
Section titled “Basic Example”Here’s a simple example of creating a new course:
mutation { createCourse(input: { name: "GraphQL Fundamentals" description: "Learn how to use GraphQL APIs" published: true }) { course { id name description } errors { field message } }}For detailed information about specific mutations, explore the resource pages linked above.
Authentication
Section titled “Authentication”All mutation operations require authentication with an API key. See the Authentication section for details on how to authenticate your requests.
For more information about the Teachify Admin API, please refer to the API Overview.