---
title: "Create a new test case"
method: POST
path: "/case/{code}"
tags: ["cases"]
---

# Create a new test case

`POST /case/{code}`

This method allows to create a new test case in selected project.

## Path parameters

- `code` string, required

## Request body

- TestCaseCreate
  - `description` string
  - `preconditions` string
  - `postconditions` string
  - `title` string, required
  - `severity` integer
  - `priority` integer
  - `behavior` integer
  - `type` integer
  - `layer` integer
  - `is_flaky` integer
  - `suite_id` integer
  - `milestone_id` integer
  - `automation` integer — Deprecated, use `isManual` and `isToBeAutomated` instead. Encodes the test case automation state as a single integer: `0` = manual, `1` = manual planned to be automated, `2` = automated. If both `automation` and `isManual`/`isToBeAutomated` are provided, `isManual` and `isToBeAutomated` take precedence.
  - `isManual` boolean — `true` if the case is manual, `false` if it is automated. Combined with `isToBeAutomated`, replaces the deprecated `automation` field.
  - `isToBeAutomated` boolean — `true` if a manual case is planned to be automated, `false` otherwise. Only meaningful when `isManual` is `true`; ignored when `isManual` is `false`.
  - `status` integer
  - `steps_type` 'classic' | 'gherkin' — Determines the format of the steps field. When "classic", steps use the standard action/expected_result/data format. When "gherkin", steps use the {value: "Given...\nWhen...\nThen..."} format.
  - `attachments` string[] — A list of Attachment hashes.
  - `steps` TestStepCreate[]
    - `action` string — Step action text. Used for classic steps. For gherkin steps, use the "value" property instead.
    - `expected_result` string
    - `data` string
    - `value` string — Gherkin scenario text. Used when steps_type is "gherkin". Example: "Given a user exists\nWhen they log in\nThen they see the dashboard"
    - `position` integer
    - `attachments` string[] — A list of Attachment hashes.
    - `steps` object[] — Nested steps may be passed here. Use same structure for them.
  - `tags` string[]
  - `params` object, nullable — Deprecated, use `parameters` instead.
  - `parameters` union[], nullable
    - union
      - object — Shared parameter
        - `shared_id` string, uuid, required
      - object — Single parameter
        - `title` string, required
        - `values` string[], required
      - object — Group parameter
        - `items` 1[], required — unresolved $ref
  - `custom_field` CustomField — unresolved $ref
  - `created_at` string
  - `updated_at` string

## Response `200`

A result.

- IdResponse
  - `status` boolean
  - `result` object
    - `id` integer

## Other responses

- `400` — Bad Request.
- `401` — Unauthorized.
- `403` — Forbidden.
- `404` — Not Found.
- `422` — Unprocessable Entity.
- `429` — Too Many Requests.

---

[API](https://skmtc.dev/qase/apis/qase-io-testops-api-v1.md) · [All operations](https://skmtc.dev/qase/apis/qase-io-testops-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/qase/qase-io-testops-api-v1/revisions/12ddc644fac5/schema)
