Skip to content
StudyFetch API

Assignment Grader

Grade a new assignment

OpenAPI specification
POST/api/v1/assignment-grader/create

Authentication

x-api-key

Request

curl --globoff --request POST \
  --url 'https://api.example.com/api/v1/assignment-grader/create' \
  --header 'x-api-key: <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data-raw '{
  "title": "<title>"
}'

Replace credential and <field> placeholders with your own values. URL placeholders appear as %3Cfield%3E. Review the example values before sending your request.

Replace https://api.example.com with the API server URL.

Use the sample JSON body as your starting point, and enter values that match the endpoint's schema.

Request body schema or example

{
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Title of the assignment"
    },
    "materialId": {
      "type": "string",
      "description": "Material ID to grade"
    },
    "textToGrade": {
      "type": "string",
      "description": "Text content to grade"
    },
    "userId": {
      "type": "string",
      "description": "User ID for tracking"
    },
    "model": {
      "type": "string",
      "description": "AI model to use"
    },
    "rubric": {
      "description": "Grading rubric",
      "allOf": [
        {
          "type": "object",
          "properties": {
            "criteria": {
              "description": "Grading criteria",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Title of the criterion"
                  },
                  "description": {
                    "type": "string",
                    "description": "Description of the criterion"
                  },
                  "pointsPossible": {
                    "type": "number",
                    "description": "Points possible for this criterion"
                  }
                },
                "required": [
                  "title",
                  "pointsPossible"
                ]
              }
            },
            "assignmentContent": {
              "type": "string",
              "description": "Additional context for the assignment such as a reading passage, source material, or instructions that students were given. The AI grader will use this to evaluate submissions more accurately."
            }
          },
          "required": [
            "criteria"
          ]
        }
      ]
    },
    "rubricTemplateId": {
      "type": "string",
      "description": "Rubric template ID to use"
    },
    "assignmentId": {
      "type": "string",
      "description": "Assignment ID for grouping submissions"
    },
    "studentIdentifier": {
      "type": "string",
      "description": "Student identifier (email or ID)"
    },
    "assignmentContent": {
      "type": "string",
      "description": "Additional context for the assignment such as a reading passage, source material, or instructions that students were given. The AI grader will use this to evaluate submissions more accurately."
    },
    "gradingPromptVersion": {
      "type": "string",
      "description": "Grading prompt version to use. Pass \"QA\" to test the updated lenient prompt. Defaults to the current production prompt.",
      "example": "QA"
    }
  },
  "required": [
    "title"
  ]
}

Responses

201Assignment grading completed
{
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "example": true
    },
    "gradedAssignment": {
      "type": "object",
      "properties": {
        "_id": {
          "type": "string",
          "description": "Assignment grader ID"
        },
        "title": {
          "type": "string",
          "description": "Assignment title"
        },
        "grade": {
          "type": "number",
          "description": "Overall grade percentage"
        },
        "rubric": {
          "type": "object",
          "description": "Grading results"
        },
        "organizationId": {
          "type": "string",
          "description": "Organization ID"
        },
        "userId": {
          "type": "string",
          "description": "User ID"
        },
        "materialId": {
          "type": "string",
          "description": "Material ID"
        },
        "textToGrade": {
          "type": "string",
          "description": "Text that was graded"
        },
        "rubricTemplateId": {
          "type": "string",
          "description": "Rubric template ID"
        },
        "assignmentId": {
          "type": "string",
          "description": "Assignment ID for grouping"
        },
        "studentIdentifier": {
          "type": "string",
          "description": "Student identifier"
        },
        "assignmentContent": {
          "type": "string",
          "description": "Assignment content/context provided for grading"
        },
        "gradingPromptVersion": {
          "type": "string",
          "description": "Grading prompt version used for this submission",
          "example": "default"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string",
          "description": "Creation timestamp"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string",
          "description": "Update timestamp"
        },
        "__v": {
          "type": "number",
          "description": "Version key"
        }
      },
      "required": [
        "_id",
        "title",
        "grade",
        "rubric",
        "organizationId",
        "createdAt",
        "updatedAt",
        "__v"
      ]
    }
  }
}