Batch upsert extension reports
Create or update multiple Integrito report-data records in one request. Each item in the JSON array may include an optional id and/or item_id field. When id is present, the matching record is updated by id and item_id (if provided) is written as the new value. When id is absent but item_id is provided, the record owned by the current user with that item_id is updated, or a new record is created with that item_id when none matches. When both are absent, a new record is created. updated_at is set to the current server time on updates; created_at is set on creates. Returns 201 CREATED if at least one item was newly created; returns 200 OK if all items were updates. Returns 400 if any item_id collides with another record owned by the authenticated user or appears more than once for distinct records inside the batch. Returns 403 if any referenced text or report id exists but belongs to another user. Returns 404 if any referenced text or report id does not exist.
Request body
Example request
[
{
"id": 12,
"item_id": "john-course1-quiz5-question9",
"text_id": 345,
"plagiarism": 25.5,
"ai": 10.25
}
]Response
The result of a batch create-or-update operation.
Example response
{
"success": true,
"data": {
"reports": [
{
"id": "12",
"text_id": "345",
"item_id": "john-course1-quiz5-question9",
"plagiarism": 25.5,
"ai": 10.25,
"created_at": "1706199949000"
}
]
}
}