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

# idempotency_key_reuse

> 解決 HTTP 409 衝突：區分請求仍在執行中，或是 Idempotency-Key 被用於不同的輸入內容。

| | |
| - | - |
| **代碼** | `idempotency_key_reuse` |
| **HTTP 狀態** | `409 Conflict` |
| **可重試** | 請讀取回應中的 `retryable` |

## 選擇正確的復原方式

同一個錯誤代碼可能代表兩種不同的情況。請先檢查 `retryable` 再採取行動；僅憑 HTTP 狀態無法判斷是否應該重試。

| 回應 | 意義 | 後續步驟 |
| - | - | - |
| `retryable: false` | 該金鑰已對應到一個輸入內容不同的請求。 | 將請求本文與原始請求進行比較。僅在刻意執行不同的操作時，才使用新的金鑰。 |
| `retryable: true` | 另一個使用該金鑰的請求仍在處理中。 | 保持相同的金鑰與請求。至少等待 `Retry-After` 秒，然後在有限的時間預算內重試。 |

### 輸入內容不同

```json theme={null}
{
  "type": "https://docs.livingsecurity.com/developers/v1/errors/idempotency_key_reuse",
  "title": "Conflict",
  "status": 409,
  "detail": "Idempotency-Key was already used with a different request.",
  "code": "idempotency_key_reuse",
  "request_id": "req_0199a1e0-7c00-7000-8000-000000000001",
  "doc_url": "https://docs.livingsecurity.com/developers/v1/errors/idempotency_key_reuse",
  "retryable": false,
  "param": "Idempotency-Key"
}
```

### 請求仍在處理中

此範例同時包含 HTTP 回應標頭 `Retry-After: 1`。

```json theme={null}
{
  "type": "https://docs.livingsecurity.com/developers/v1/errors/idempotency_key_reuse",
  "title": "Conflict",
  "status": 409,
  "detail": "A concurrent request is still processing this Idempotency-Key. Retry shortly.",
  "code": "idempotency_key_reuse",
  "request_id": "req_0199a1e0-7c00-7000-8000-000000000001",
  "doc_url": "https://docs.livingsecurity.com/developers/v1/errors/idempotency_key_reuse",
  "retryable": true,
  "param": "Idempotency-Key"
}
```

## 保持重試識別的一致性

對於有記載支援冪等性的操作，金鑰的作用範圍限定於組織、服務帳戶、HTTP 方法、資源路徑以及解析後的 API 版本。變更其中任何一項，都會形成不同的重試識別；這無法復原原始操作。在同一個服務帳戶下輪替憑證，並不會改變該識別，但替換後的憑證仍須具備相應權限。

從逾時中復原時，請保持原始的金鑰、請求本文、路徑與版本。請勿僅為了繞過衝突而產生新的金鑰：原始的寫入操作可能已經成功。若已知資源 ID，請擷取該資源，並使用該操作所記載的復原程序。在有記載回應重放的操作中，已完成的重放會帶有 `Idempotent-Replayed: true`。

傳送 `Idempotency-Key` 並不會使操作具備冪等性，除非該操作的參考文件明確支援此標頭。重試保護受該操作的保留政策所限制；它並非針對重複請求的永久保證。

若處理狀態仍未解決，請聯絡 [Living Security Support](mailto:support@livingsecurity.com)，並提供 `request_id`、UTC 時間戳記、方法、路徑與 API 版本。請勿附上 API 金鑰、用戶端密碼或存取權杖。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.