v1

latestOpenAPI 3.0.0Apache 2.02026-08-0610023171.4 KB
Extension Reports

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.

post/api/v1/extension/reports/batch-upsert/

Request body

idinteger nullable

Existing report ID. When present, the record with this id is looked up and updated (item_id in the body is written as the new value but is not used for lookup). Pass only id or item_id when an update is needed.

item_idstring nullable

External item identifier. When id is absent, used as the upsert lookup key for records owned by the current user: matches update an existing record, misses create a new record with this item_id. Must be unique among records owned by the authenticated user; null is allowed multiple times per user.

text_idinteger required

ID of the text this report belongs to. Must be owned by the authenticated user.

plagiarismnumber float nullable

Plagiarism percentage (0–100). Omit or pass null to store null.

plagiarism_errorstring nullable

Error message from the plagiarism check. Omit or pass null to store null.

ainumber float nullable

AI-detection score (0–100). Omit or pass null to store null.

ai_errorstring nullable

Error message from the AI check. Omit or pass null to store null.

checkingboolean

Whether the record is currently being checked. Defaults to false.

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.

successboolean

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"
      }
    ]
  }
}