---
title: إنشاء تعيين حارس | RunAPI
description: اربط حارساً واحداً بمفتاح API قياسي أو عضو حساب.
url: https://runapi.ai/ar/docs/api/management/guardrail-assignments/create.md
canonical: https://runapi.ai/ar/docs/api/management/guardrail-assignments/create
locale: ar
---

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

# إنشاء تعيين حارس

اربط حارساً واحداً بمفتاح API قياسي أو عضو حساب.

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

POST /api/v1/guardrail_assignments

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

إصدار API: v1

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


التفويض: يمكن لمسؤولي الحساب تعيين أي هدف مؤهل. لا يمكن للمستخدمين غير المسؤولين تعيين سوى مفاتيح API القياسية الخاصة بهم.

## الطلب

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

### جسم JSON

```json
{
  "account_user_id": {
    "description": "معرّف بادئة عضو الحساب. يتطلب هذا الهدف مسؤول حساب.",
    "required": false,
    "type": "string"
  },
  "api_token_id": {
    "description": "معرّف بادئة مفتاح API القياسي. وفِّر معرّف هدف واحداً بالضبط.",
    "required": false,
    "type": "string"
  },
  "guardrail_id": {
    "description": "معرّف بادئة Guardrail.",
    "required": true,
    "type": "string"
  }
}
```

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

HTTP 201 - POST /api/v1/guardrail_assignments

```json
{
  "account_user_id": null,
  "api_token_id": "token_123",
  "created_at": "2026-07-27T10:00:00.000Z",
  "guardrail_id": "guardrail_123",
  "id": "guardrail_assignment_123"
}
```

## استجابة الخطأ (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"
}
```

## استجابة الخطأ (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"
}
```

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

HTTP 403

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

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

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

```json
{
  "error": "Forbidden"
}
```

## استجابة الخطأ (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 POST https://runapi.ai/api/v1/guardrail_assignments \
  -H 'Authorization: Bearer YOUR_MANAGEMENT_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"guardrail_id":"guardrail_123","api_token_id":"token_123"}'
```

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

- [تعيينات الحواجز](https://runapi.ai/ar/docs/api/management/guardrail-assignments.md)
- [كائن Guardrail Assignment](https://runapi.ai/ar/docs/api/management/guardrail-assignments/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": "اربط حارساً واحداً بمفتاح API قياسي أو عضو حساب.",
    "url": "https://runapi.ai/ar/docs/api/management/guardrail-assignments/create",
    "mainEntityOfPage": "https://runapi.ai/ar/docs/api/management/guardrail-assignments/create"
  }
]
```
