---
title: 删除 Guardrail
url: https://runapi.ai/zh-CN/docs/api/management/guardrails/delete.md
canonical: https://runapi.ai/zh-CN/docs/api/management/guardrails/delete
locale: zh-CN
---

# 删除 Guardrail

软删除 Guardrail 并移除其分配。

## 端点

DELETE /api/v1/guardrails/:id

基础 URL: https://runapi.ai

API 版本: v1

身份验证: Authorization: Bearer YOUR_MANAGEMENT_API_KEY


授权: 需要账户管理员的 Management API 密钥。

## 请求

只能在列出的请求位置发送值。

### 路径参数

```json
{
  "id": {
    "description": "Guardrail prefix ID, for example guardrail_abc123.",
    "required": true,
    "type": "string"
  }
}
```

## 成功响应

HTTP 204 - DELETE /api/v1/guardrails/:id

This response has no body.

## 错误响应 (401)

HTTP 401

```json
{
  "error": "Authentication required"
}
```

## 错误响应 (403)

HTTP 403

```json
{
  "error": "Management API key required"
}
```

## 错误响应 (403)

HTTP 403

```json
{
  "error": "Account admin required"
}
```

## 错误响应 (404)

HTTP 404

```json
{
  "error": "Resource not found"
}
```

## cURL 示例



### curl

```curl
curl -X DELETE https://runapi.ai/api/v1/guardrails/guardrail_123 \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_API_KEY'
```

## 相关参考

- [Guardrails](/docs/api/management/guardrails)
- [Guardrail 对象](/docs/api/management/guardrails/object)
