Skip to content

Delete Post

The deletePost mutation allows you to delete a post from your Teachify school. This is a soft delete operation, meaning the post data is retained but marked as deleted.

Input Parameters

FieldTypeDescription
idString!ID of the post to delete

Return Type

type AdminPostDeletePayload {
# Array of error messages, if any occurred during the operation
errors: [String!]
# Boolean indicating whether the deletion was successful
success: Boolean
}

Example

mutation DeletePost {
deletePost(id: "post_12345") {
success
errors
}
}

Sample Response

{
"data": {
"deletePost": {
"success": true,
"errors": []
}
}
}

Error Response

If the deletion fails, you might receive a response like this:

{
"data": {
"deletePost": {
"success": false,
"errors": ["Post not found"]
}
}
}

Common Errors

ErrorDescription
Post not foundThe specified post ID does not exist
Post already deletedThe post has already been deleted
Insufficient permissionsYou don’t have permission to delete this post

Important Notes

  • This is a soft delete operation - the post data is retained in the system but marked as deleted
  • Deleted posts will not appear in regular queries
  • The post can potentially be restored by system administrators if needed
  • All associated data (comments, ratings, etc.) will also be hidden when the post is deleted

For more information about the Teachify Admin API, please refer to the API Overview.