Skip to main content
PATCH
cURL
Step 1 of 8 in Evaluate an exam. Call it twice: once to upload, once with isFinal to submit.

Rules

  • Send exactly one of documents, fileUrl, or isFinal per request.
  • Files must be .pdf, .jpg, .jpeg, or .png, and at most 20 MB each.
  • Declare each file’s type in its multipart part: application/pdf, image/jpeg, or image/png. The API reads the part’s Content-Type, not the file name. Most other values are rejected with 400 Invalid file type, but the Word .docx type is not, so do not send one by accident.
  • A PDF can have at most 50 pages, and an exam takes one PDF. You cannot mix a PDF with images.
  • Images can arrive across several calls. Each call adds to what is already there.
  • fileUrl replaces an upload: a public HTTPS link that the API fetches itself. It rejects the link unless the file starts with %PDF, and allows one fileUrl per exam. A link that is not a usable URL returns Invalid URL, a localhost or private network address returns Private or local URLs are not allowed, a link that answers with anything other than 200 or 206 returns URL returned status <n>, and a link that cannot be reached at all returns URL is not reachable.
  • Send {"isFinal": true} only after every file is uploaded. That starts question extraction and moves the exam to status 1 In Progress.
In a multipart request, any value of isFinal counts as sending it, including isFinal=false. Sending it alongside documents returns 400 Only one of documents, fileUrl, or isFinal can be processed at a time. Leave the field out until you mean it.
Files are only accepted while the exam’s status is 0 Open. If extraction is already running or has failed, the call still returns 200 and quietly ignores the files. Check documents in the response to confirm what was stored.

Reading the response

Extraction failed? Send {"isFinal": true} again. Files that failed are sent again, and files that already succeeded are skipped.

Next step

Get extracted exam questions

Wait until the questions are ready, then review them.

Authorizations

Authorization
string
header
required

Access token from Get an access token. A missing, invalid, or expired token returns 403.

Path Parameters

id
string<uuid>
required

The exam id returned by Create an exam.

Example:

"d19e6868-98dd-4274-a2a5-4a616dd93ea7"

Body

documents
file[]

Question paper files. One .pdf of up to 50 pages, or any number of .jpg and .png images. Up to 20 MB per file. Each part's Content-Type decides the file type, so declare application/pdf, image/jpeg, or image/png. You cannot mix a PDF with images, and only one PDF is allowed per exam.

fileUrl
string<uri>

Public HTTPS link to a PDF, instead of uploading one. The API fetches the link and rejects it unless the body starts with %PDF. One fileUrl per exam, and never alongside uploaded files.

Example:

"https://example.com/papers/science-set-a.pdf"

isFinal
boolean

Send true to submit the uploaded files for question extraction. Send it on its own.

grade
integer

Correct the grade code.

subject
string

Correct the subject. A name, with the same rules as in Create an exam.

examType
string

Correct the kind of exam. A name, with the same rules as in Create an exam.

examSet
string

Correct the paper set label.

examDate
string<date>

Correct the exam date.

classSection
string

Correct the class section. Accepted, but this endpoint does not save it.

Response

The exam was updated. With isFinal=true, extraction has started and the exam's status is now 1 In Progress.

A new exam. documents is empty until you upload the question paper.

id
string<uuid>

The exam ID. Every later call in the flow needs it.

documents
object[]

Files attached to the exam, oldest first.