Code Plagiarism
Detection API
Build plagiarism detection into your apps. Check code against 20+ billion sources.
Update Check Details
Modify the name or programming language of an existing plagiarism check. Useful for correcting mistakes or updating check metadata before starting analysis.
API Endpoint
PATCH /checks/{checkId}) with the check ID in the URL, or the POST form (POST /check/update) with check_id in the request body. The name and language fields are sent in the body either way.
Authentication
Include your API key in the request header:
apikey: YOUR_API_KEY_HERE
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
checkId (path) / check_id (body) |
Integer | Required | The unique identifier of the check to update. Provide it as the {checkId} URL segment (REST form) or as check_id in the body (POST form). |
name |
String | Optional | New name for the check (3-255 characters) |
language |
Integer | Optional | New programming language ID (see Languages API) |
name and language are optional and may be sent together. If neither is provided, the request still returns 200 OK with the check unchanged.
Success Response
HTTP Status: 200 OK
{
"success": true,
"message": "Check updated successfully",
"check": {
"id": 2810,
"name": "Python Assignment - Week 6 (Updated)",
"status_id": 1,
"language_id": 14,
"created_at": "2024-01-15 14:30:22",
"updated_at": "2024-01-16 09:15:33"
}
}
Response Fields
- success — Boolean indicating the update was successful
- message — Confirmation message
- check — The full updated check (assignment) object as stored, including
id,name,status_id,language_id, timestamps, and all other model attributes - check.id — Unique check identifier
- check.name — Current check name
- check.status_id — Current status of the check
- check.language_id — Current language ID
Error Responses
Invalid or missing API key.
Attempting to modify a demo assignment ("Demo assignments cannot be modified.").
The specified check does not exist or does not belong to your account ("Invalid check_id provided.").
Missing check ID ("check_id is required"), validation failure (name 3-255 chars, language must be an integer; response includes a validation_errors object), an invalid language ID (response includes an available_languages list), or no API Checks folder exists.
Code Examples
cURL (REST path form)
curl -X PATCH "https://codequiry.com/api/v1/checks/2810" \
-H "apikey: YOUR_API_KEY_HERE" \
-d "name=Python Assignment - Week 6 (Updated)" \
-d "language=14"
cURL (POST body form)
curl -X POST "https://codequiry.com/api/v1/check/update" \
-H "apikey: YOUR_API_KEY_HERE" \
-d "check_id=2810" \
-d "name=Python Assignment - Week 6 (Updated)" \
-d "language=14"
JavaScript
async function updateCheck(checkId, updates) {
const response = await fetch('https://codequiry.com/api/v1/check/update', {
method: 'POST',
headers: {
'apikey': 'YOUR_API_KEY_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({ check_id: checkId, ...updates })
});
const data = await response.json();
if (data.success) {
console.log(`Updated: ${data.check.name}`);
}
return data;
}
// Update name only
await updateCheck(2810, { name: 'New Assignment Name' });
// Update language only
await updateCheck(2810, { language: 39 }); // Switch to JavaScript
// Update both
await updateCheck(2810, { name: 'JS Project', language: 39 });