---
title: تحديث حارس | RunAPI
description: استبدل حقول الضابط الوقائي المُزوَّدة مع إبقاء الحقول المحذوفة دون تغيير.
url: https://runapi.ai/ar/docs/api/management/guardrails/update.md
canonical: https://runapi.ai/ar/docs/api/management/guardrails/update
locale: ar
---

> نسخة HTML: https://runapi.ai/ar/docs/api/management/guardrails/update
> فهرس الموقع للوكلاء: https://runapi.ai/llms.txt

# تحديث حارس

استبدل حقول الضابط الوقائي المُزوَّدة مع إبقاء الحقول المحذوفة دون تغيير.

## نقطة النهاية

PATCH /api/v1/guardrails/:id

عنوان URL الأساسي: https://runapi.ai

إصدار API: v1

المصادقة: Authorization: Bearer YOUR_MANAGEMENT_API_KEY


التفويض: يتطلب مفتاح Management API لمسؤول الحساب.

## الطلب

أرسل القيم فقط في موقع الطلب المُدرج.

### جسم JSON

```json
{
  "allowed_models": {
    "description": "قائمة السماح بالنماذج البديلة.",
    "required": false,
    "type": "array | null"
  },
  "allowed_providers": {
    "description": "قائمة السماح بأسماء المزوّدين البديلة.",
    "required": false,
    "type": "array | null"
  },
  "blocked_models": {
    "description": "قائمة الحظر بالنماذج البديلة.",
    "required": false,
    "type": "array | null"
  },
  "blocked_providers": {
    "description": "قائمة الحظر بأسماء المزوّدين البديلة.",
    "required": false,
    "type": "array | null"
  },
  "credit_limit_cents": {
    "description": "إجمالي حد الإنفاق بسنتات الدولار الأمريكي.",
    "required": false,
    "type": "integer | null"
  },
  "credit_limit_reset_interval": {
    "description": "دورية إعادة تعيين حد الإنفاق الإجمالي.",
    "enum": [
      "daily",
      "weekly",
      "monthly"
    ],
    "required": false,
    "type": "string | null"
  },
  "description": {
    "description": "وصف بديل بصياغة حرة.",
    "required": false,
    "type": "string"
  },
  "enabled": {
    "description": "ما إذا كان يتم تطبيق الحاجز الواقي.",
    "required": false,
    "type": "boolean"
  },
  "model_budgets": {
    "description": "قواعد الميزانية البديلة لكل نموذج.",
    "required": false,
    "type": "array | null"
  },
  "name": {
    "description": "اسم بديل للضابط الوقائي.",
    "required": false,
    "type": "string"
  }
}
```

### معاملات المسار

```json
{
  "id": {
    "description": "معرّف بادئة Guardrail، على سبيل المثال guardrail_abc123.",
    "required": true,
    "type": "string"
  }
}
```

## استجابة النجاح

HTTP 200 - PATCH /api/v1/guardrails/:id

```json
{
  "allowed_models": [
    "gpt-5.4"
  ],
  "allowed_providers": [],
  "assignment_count": 1,
  "blocked_models": [],
  "blocked_providers": [],
  "created_at": "2026-07-27T10:00:00.000Z",
  "credit_limit_cents": 50000,
  "credit_limit_reset_interval": "monthly",
  "description": "Production policy",
  "enabled": false,
  "id": "guardrail_123",
  "model_budgets": [
    {
      "credit_limit_cents": 10000,
      "credit_limit_reset_interval": "monthly",
      "match_mode": "include",
      "models": [
        "gpt-5.4"
      ]
    }
  ],
  "name": "Production budget"
}
```

## استجابة الخطأ (401)

HTTP 401

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

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

## استجابة الخطأ (403)

HTTP 403

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

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

## استجابة الخطأ (403)

HTTP 403

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

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

## استجابة الخطأ (400)

HTTP 400

### مخطط الاستجابة

```json
{
  "oneOf": [
    {
      "properties": {
        "error": {
          "description": "رسالة خطأ قابلة للقراءة البشرية.",
          "type": "string"
        }
      },
      "required": [
        "error"
      ],
      "type": "object",
      "unevaluatedProperties": false
    },
    {
      "properties": {
        "error": {
          "description": "ملخص التحقق القابل للقراءة البشرية.",
          "type": "string"
        },
        "errors": {
          "additionalProperties": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": "رسائل التحقق مفتاحها حقل الطلب العام، مع مصفوفة من السلاسل القابلة للقراءة البشرية لكل حقل.",
          "type": "object"
        }
      },
      "required": [
        "error",
        "errors"
      ],
      "type": "object",
      "unevaluatedProperties": false
    }
  ]
}
```

### مثال على الاستجابة

```json
{
  "error": "page must be an integer"
}
```

## استجابة الخطأ (404)

HTTP 404

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "رسالة خطأ قابلة للقراءة البشرية.",
      "type": "string"
    }
  },
  "required": [
    "error"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

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

## استجابة الخطأ (422)

HTTP 422

### مخطط الاستجابة

```json
{
  "properties": {
    "error": {
      "description": "ملخص التحقق القابل للقراءة البشرية.",
      "type": "string"
    },
    "errors": {
      "additionalProperties": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "description": "رسائل التحقق مفتاحها حقل الطلب العام، مع مصفوفة من السلاسل القابلة للقراءة البشرية لكل حقل.",
      "type": "object"
    }
  },
  "required": [
    "error",
    "errors"
  ],
  "type": "object",
  "unevaluatedProperties": false
}
```

### مثال على الاستجابة

```json
{
  "error": "Validation failed",
  "errors": {
    "base": [
      "Validation failed"
    ]
  }
}
```

## مثال cURL



### curl

```curl
curl -X PATCH https://runapi.ai/api/v1/guardrails/guardrail_123 \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"enabled":false}'
```

## المرجع ذو الصلة

- [الحواجز](https://runapi.ai/ar/docs/api/management/guardrails.md)
- [كائن Guardrail](https://runapi.ai/ar/docs/api/management/guardrails/object.md)

---

## المزيد من RunAPI

- [الرئيسية](https://runapi.ai/ar/.md)
- [كتالوج النماذج](https://runapi.ai/ar/models.md)
- [الأسعار](https://runapi.ai/ar/pricing.md)
- [مزودو الخدمة](https://runapi.ai/ar/models)
- [التوثيق](https://runapi.ai/ar/docs/guides)
- [حزم SDK](https://runapi.ai/ar/sdk.md)
- [CLI](https://runapi.ai/ar/cli.md)
- [خادم MCP](https://runapi.ai/ar/mcp.md)
- [Claude Code مقابل Cursor](https://runapi.ai/ar/claude-code-vs-cursor.md)
- [إعداد Cursor API](https://runapi.ai/ar/cursor-api-setup.md)
- [RunAPI مقابل OpenRouter](https://runapi.ai/ar/openrouter-alternative.md)
- [المؤسسات](https://runapi.ai/ar/contact.md)
- [اتصل بنا](https://runapi.ai/ar/contact.md)
- [الشروط](https://runapi.ai/ar/terms.md)
- [الخصوصية](https://runapi.ai/ar/privacy.md)
- [فهرس الموقع للوكلاء](https://runapi.ai/llms.txt)

التواصل: contact@runapi.ai

## البيانات المنظمة

```json
[
  {
    "@context": "https://schema.org",
    "inLanguage": "ar",
    "@type": "WebSite",
    "name": "RunAPI",
    "url": "https://runapi.ai/ar",
    "potentialAction": {
      "@type": "SearchAction",
      "target": {
        "@type": "EntryPoint",
        "urlTemplate": "https://runapi.ai/ar/models?q={search_term_string}"
      },
      "query-input": "required name=search_term_string"
    }
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ar",
    "@type": "Organization",
    "name": "RunAPI",
    "url": "https://runapi.ai/ar",
    "logo": {
      "@type": "ImageObject",
      "url": "https://runapi.ai/aricon.svg"
    },
    "sameAs": [
      "https://github.com/runapi-ai"
    ]
  },
  {
    "@context": "https://schema.org",
    "inLanguage": "ar",
    "@type": "TechArticle",
    "headline": "تحديث حارس",
    "description": "استبدل حقول الضابط الوقائي المُزوَّدة مع إبقاء الحقول المحذوفة دون تغيير.",
    "url": "https://runapi.ai/ar/docs/api/management/guardrails/update",
    "mainEntityOfPage": "https://runapi.ai/ar/docs/api/management/guardrails/update"
  }
]
```
