---
title: "Create an automatic risk"
method: POST
path: "/v1/cases/{id}/risks"
tags: ["Cases"]
---

# Create an automatic risk

`POST /v1/cases/{id}/risks`

Create an automatic risk on a Case.

---

#### See also  
Learn more about [Cases](./cases-guide)

## Path parameters

- `id` string, uuid, required

## Request body

- RiskCreate
  - `level` 'not_defined' | 'low' | 'medium' | 'high' | 'critical' | 'prohibited', required
  - `score` number
  - `components` object
  - `flags` object

## Response `201`

Risk has been created

**ℹ️ Click to see full payload**

- Risk
  - `id` string, required
  - `mode` 'automatic' | 'manual', required
  - `level` 'not_defined' | 'low' | 'medium' | 'high' | 'critical' | 'prohibited', required
  - `comment` string, nullable, required
  - `score` number, nullable, required
  - `components` object, nullable, required — Object in a format of `key` (string) / `value` (number)
  - `flags` object, nullable, required — Object in a format of `key` (string) / `value` (boolean)
  - `created_at` string, date-time, required — Creation date Date time in format [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) (`yyyy-MM-ddTHH:mm:ss.S+X` eg `2023-01-31T13:30:00.000Z`)
  - `updated_at` string, date-time, required — Latest update date Date time in format [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) (`yyyy-MM-ddTHH:mm:ss.S+X` eg `2023-01-31T13:30:00.000Z`)

## Other responses

- `400` — The request is either malformed or contain invalid parameters. - Make sure the body payload matches the expected schema - Automatic risk cannot be created when workspace has online risk engines.
- `404` — No case can be found.

---

[API](https://skmtc.dev/dotfile/apis/api-specifications.md) · [All operations](https://skmtc.dev/dotfile/apis/api-specifications/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/dotfile/api-specifications/revisions/36393567057b/schema)
