Skip to content

Teachify Admin API Mutations

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

Available Resources

The API provides mutations for the following resources:

Common Patterns

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

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

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

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.