---
title: "Update a check (REST)"
method: PATCH
path: "/checks/{checkId}"
tags: ["Checks"]
---

# Update a check (REST)

`PATCH /checks/{checkId}`

## Request

- Base URL: `https://codequiry.com/api/v1`
- URL: `https://codequiry.com/api/v1/checks/{checkId}`
- Auth: API key in header `apikey`

## Path parameters

- `checkId` integer, required

## Request body

- object
  - `name` string
  - `language` integer: Language id from GET /languages. Use 999 for Auto Detect. An unknown or invalid id falls back to Auto Detect and still returns 200.

## Response `200`

Updated check

- object
  - `success` boolean
  - `message` string
  - `check` Check: A check (internally an assignment). Endpoints return the full assignment row, so more fields are present than are listed here; only the stable, documented ones are shown.
    - `stats` object, nullable: Present only when the list was requested with with_stats=1. Averages and maxima are over finished submissions and are null when there are none.
      - `submissions` integer
      - `completed` integer
      - `failed` integer
      - `avg_group` number, nullable
      - `max_group` number, nullable
      - `avg_web` number, nullable
      - `max_web` number, nullable
      - `flagged` integer: Finished submissions at or above 75% Group or Web.
      - `avg_ai` number, nullable
      - `max_ai` number, nullable
      - `ai_submissions` integer
      - `ai_flagged` integer: Submissions whose mean AI probability is 75% or more.
      - `matches` integer: Match total as the dashboard counts it: peer fragments, web sources (one per source) and AI blocks.
    - `id` integer
    - `name` string
    - `status_id` integer
    - `language_id` integer
    - `test_type` integer
    - `ai_run` integer: 1 if AI-generated-code detection runs for this check.
    - `base_code_detection` integer: 1 if base/boilerplate-code detection is enabled.
    - `created_at` string
    - `updated_at` string
    - `assignmentstatuses` object: Expanded status, included only by GET/POST /checks. Not returned by /check/create, /check/get or /check/update - use status_id there, or the top-level status string that /check/get returns.
      - `id` integer
      - `status` string

## Other responses

- `401`: Missing or invalid API key. The API key is checked before any endpoint logic runs, so this is returned for every operation.
- `402`: The account is suspended for an unpaid invoice. Every endpoint returns this until the invoice is paid from the billing dashboard; it is not retryable and the request was not performed.
- `403`: Not permitted (e.g. free-trial limitation, or a read-only demo check).
- `404`: Resource not found or not owned by this account.
- `422`: Request validation failed.
- `429`: Rate limit exceeded: more than 60 requests in one minute from this IP. Retry after the number of seconds in the Retry-After header. Successful responses carry X-RateLimit-Limit and X-RateLimit-Remaining too, so you can pace a client without waiting to be refused.

---

[API](https://skmtc.dev/codequiry/apis/codequiry-api.md) · [All operations](https://skmtc.dev/codequiry/apis/codequiry-api/llms.txt) · [OpenAPI document](https://skmtc.dev/codequiry/apis/codequiry-api/revisions/6297e91d9665?raw)
