Skip to main content
POST
/
api
/
v1
/
assignment-grader
/
create
Grade a new assignment
const url = 'https://studyfetchapi.com/api/v1/assignment-grader/create';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"title":"<string>","materialId":"<string>","textToGrade":"<string>","userId":"<string>","model":"<string>","rubric":{"criteria":[{"title":"<string>","description":"<string>","pointsPossible":123}]},"rubricTemplateId":"<string>","assignmentId":"<string>","studentIdentifier":"<string>"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
{
  "success": true,
  "gradedAssignment": {
    "_id": "<string>",
    "title": "<string>",
    "grade": 123,
    "rubric": {},
    "organizationId": "<string>",
    "userId": "<string>",
    "materialId": "<string>",
    "textToGrade": "<string>",
    "rubricTemplateId": "<string>",
    "assignmentId": "<string>",
    "studentIdentifier": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "__v": 123
  }
}

Authorizations

x-api-key
string
header
required

API Key for authentication

Body

application/json
title
string
required

Title of the assignment

materialId
string

Material ID to grade

textToGrade
string

Text content to grade

userId
string

User ID for tracking

model
string

AI model to use

rubric
object

Grading rubric

rubricTemplateId
string

Rubric template ID to use

assignmentId
string

Assignment ID for grouping submissions

studentIdentifier
string

Student identifier (email or ID)

Response

201 - application/json

Assignment grading completed

success
boolean
Example:

true

gradedAssignment
object
I