---
search:
  tags:
    - V1
    - PUT
seo:
  description: >-
    Replace a case in the draft. For a… Reference for the PUT
    /v1/projects/{projectId}/test-suites/{testSuiteId}/cases/{caseId} endpoint
    in the Judgeval API.
sidebar:
  label: Replace a case in the draft
  badge: PUT
title: Replace a case in the draft
type: openapi-operation
---
Replace a case in the draft. For a published case, call create_test_suite_draft first.

`PUT /v1/projects/{projectId}/test-suites/{testSuiteId}/cases/{caseId}`

**Request body** (`application/json`, required)

- `name` (string | null)
- `input` (any, required) — What the agent gets.
- `expected` (object)
- `tags` (string[])
- `metadata` (object)

Request body example:

```json
{
  "name": "string",
  "input": null,
  "expected": {},
  "tags": [
    "string"
  ],
  "metadata": {}
}
```

**Responses**

- `200` — Response for status 200
- `404` — Response for status 404
- `409` — Response for status 409
- `422` — Response for status 422

Response example, 200:

```json
{
  "case_id": "string"
}
```
