> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pathors.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 更新測試案例

> 依 ID 更新測試案例

## 請求

```bash theme={null}
PUT https://api.pathors.com/v1/projects/{projectId}/test-cases/{testCaseId}
```

### 路徑參數

<ParamField path="projectId" type="string" required>專案 ID</ParamField>

<ParamField path="testCaseId" type="string" required>測試案例 ID</ParamField>

### 標頭

<ParamField header="Authorization" type="string" required>
  使用您的 Developer Key 進行 Bearer 令牌認證
</ParamField>

### 請求主體

<ParamField body="name" type="string">
  測試案例更新後的名稱
</ParamField>

<ParamField body="systemPrompt" type="string">
  更新後的系統提示
</ParamField>

<ParamField body="maxTurns" type="integer">
  更新後對話的最大輪數（最小值為 1）
</ParamField>

<ParamField body="variables" type="object">
  更新後的變數鍵值對
</ParamField>

## 回應

<ResponseField name="data" type="object">
  更新後的測試案例物件。
</ResponseField>

### 範例

```bash theme={null}
curl -X PUT https://api.pathors.com/v1/projects/{projectId}/test-cases/{testCaseId} \
  -H "Authorization: Bearer dk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated greeting flow",
    "maxTurns": 10
  }'
```

```json theme={null}
{
  "data": {
    "id": "test-case-uuid",
    "projectId": "project-uuid",
    "name": "Updated greeting flow",
    "systemPrompt": "You are a helpful assistant",
    "maxTurns": 10,
    "variables": {},
    "acceptanceCriteria": [],
    "createdAt": "2026-03-23T00:00:00.000Z",
    "updatedAt": "2026-03-23T00:00:00.000Z"
  }
}
```
