Skip to main content
PATCH
cURL
Step 2 of 6 in Evaluate an assignment. Call it twice: once to upload the files, once with isFinal to start extraction.

Rules

  • Send documents or isFinal or metadata fields. documents and isFinal together return 400.
  • Files must be multipart/form-data. Use PDF, JPEG, or PNG. Most other types return 400 Invalid file type, but the Word .docx type passes the file-type check, so do not send one by accident.
  • Up to 20 MB per file, and up to 50 pages per PDF.
  • Send either one PDF or a set of images, never both. Images can arrive across several requests.
  • Every file is checked for readability. A blurred photo is rejected, so capture it again and upload it again.
  • Send isFinal as the text true only after the files are uploaded. It starts extraction and moves status to 1 (In Progress).
  • Each path needs its trailing slash. Without it, the API redirects the request and the PATCH loses its body.
Keep PDFs and images apart in your own code. Some PDF-plus-image uploads are rejected with 400 Cannot mix PDF files with image files, and others are accepted without an error. Do not treat a 200 as proof that the set of files is valid.
Files are accepted only while status is 0 (Open). Once extraction starts, an upload is ignored and the call still returns 200. After extraction finishes, a PATCH returns 400 Assignment is already extracted. To change the paper, create a new assignment.
Starting extraction counts toward a daily limit for your API user. Over the limit, this call returns 400 with Rate limit exceeded. You can only send <limit> requests per day. The count resets shortly after midnight, server time, and every request counts, including rejected ones.

Next step

Get an assignment

Poll until status is 2, or wait for the assignment_evaluation_question_paper_extraction webhook.

Authorizations

Authorization
string
header
required

Access token from Get an access token.

Path Parameters

id
string<uuid>
required

The assignment id returned by Create an assignment. Use it exactly as returned: the lowercase form is the only one the nested paths accept.

Example:

"3c9e1f2a-7b4d-4a8e-9f1c-2d5e6a7b8c9d"

Body

multipart/form-data
documents
file[]

Question paper files: one PDF, or one or more JPEG or PNG images. Up to 20 MB per file, and up to 50 pages per PDF. Only one PDF per assignment, and a PDF cannot be mixed with images. You can upload images across several requests. Accepted only while the assignment's status is 0 (Open).

isFinal
enum<string>

Send true to start question extraction. Send it on its own, after the files are uploaded.

Available options:
true,
false
Example:

"true"

assignmentName
string

New name for the assignment.

Maximum string length: 200
Example:

"Unit 3 English essay"

parentInstituteId
string

Your own ID for the parent institute.

Maximum string length: 200
Example:

"100"

instituteId
string

Your own ID for the school or institute.

Maximum string length: 200
Example:

"200"

courseId
string

Your own ID for the course.

Maximum string length: 200
Example:

"300"

grade
string

Grade or class.

Maximum string length: 200
Example:

"7"

section
string

Section or division.

Maximum string length: 200
Example:

"A"

Response

The files were saved, or extraction started. After isFinal, status is 1 (In Progress).

id
string<uuid>

ID of the assignment.

Example:

"3c9e1f2a-7b4d-4a8e-9f1c-2d5e6a7b8c9d"

assignmentName
string

Name of the assignment.

Example:

"Unit 3 English essay"

status
enum<integer>

0 Open, 1 In Progress, 2 Completed, 3 Failed.

Available options:
0,
1,
2,
3
Example:

2

grade
string | null

Grade or class.

Example:

"7"

marks
number<float> | null

Total marks the AI read from the question paper. null until questions are extracted.

Example:

2

section
string | null

Section or division.

Example:

"A"

parentInstituteId
string | null

Your own ID for the parent institute.

Example:

"100"

instituteId
string | null

Your own ID for the school or institute.

Example:

"200"

courseId
string | null

Your own ID for the course.

Example:

"300"

documents
object[]

The question paper files, oldest first.

createdAt
string<date-time>
Example:

"2025-04-06T09:03:42.099207Z"

modifiedAt
string<date-time>
Example:

"2025-04-06T09:06:19.351379Z"