مرجع عام

Roles

كل نقاط النهاية في هذه المجموعة. افتح أي واحدة لعرض معاملاتها ومثال عملي عليها.

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

اعرض الصفحة بصيغة Markdown

Roles

7
GET /api/v1/roles List roles prm_roles_manage

Every role visible to the tenant, with its permission count and the exact code set it grants. System roles sort first.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_roles_manage Manage roles & permissions

Un-paginated. template_key is the provisioning slug a seeded role came from, and is null for a hand-made one — it is populated by this list only, not by the role pickers.

الاستجابة 200 OK
{
  "data": [
    {
      "id": 2,
      "tenant_id": 12,
      "name": "support",
      "description": "Read subscribers, reply to tickets",
      "is_system": false,
      "template_key": "support",
      "immutable": false,
      "permission_count": 14,
      "permissions": ["prm_tickets_reply", "prm_tickets_view", "prm_users_index"]
    }
  ]
}
POST /api/v1/roles Create a role prm_roles_manage

Creates a named permission set. A caller may only grant codes they hold themselves, so a role cannot be used to mint authority its author does not have.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_roles_manage Manage roles & permissions
حد المعدل
t_mutate

The containment rule is the point of this endpoint. You cannot author a role carrying a permission you lack, and you cannot assign someone else's role that carries one either — the assign path runs the same check, because otherwise the author check would be trivially bypassed.

المعاملات

المعامل الوصف
nameمطلوب body · string Unique within the tenant. Reserved names are refused.
permissions body · array Permission codes from the catalogue. Unknown codes are rejected, not dropped.
POST /api/v1/roles/bulk-delete Manage roles & permissions prm_roles_manage
المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_roles_manage Manage roles & permissions
حد المعدل
t_mutate

مقروء مباشرة من الموجّه الذي يخدم هذه النسخة. لم يُضَف بعد وصف مكتوب لنقطة النهاية هذه.

DELETE /api/v1/roles/{id} Delete a role prm_roles_manage

Removes the role. System and immutable roles are refused, and so is a role that is still assigned.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_roles_manage Manage roles & permissions
حد المعدل
t_mutate

المعاملات

المعامل الوصف
idمطلوب path · integer Role id.
GET /api/v1/roles/{id} Fetch one role prm_roles_manage

The role and the exact set of permission codes it grants.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_roles_manage Manage roles & permissions

المعاملات

المعامل الوصف
idمطلوب path · integer Role id.
PATCH /api/v1/roles/{id} Update a role prm_roles_manage

Edits the name, description and permission set. The immutable administrator role cannot be edited at all.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_roles_manage Manage roles & permissions
حد المعدل
t_mutate

Changing a role changes the authority of every manager holding it, and every API token those managers own, on the next request. There is no notification and no record against the affected tokens.

المعاملات

المعامل الوصف
idمطلوب path · integer Role id.
PUT /api/v1/roles/{id}/portal-permissions Set a role's subscriber-portal permissions prm_roles_manage

The separate set that governs what a SUBSCRIBER may do in the self-service portal, not what a manager may do in the admin API. Different catalogue, different meaning.

المصادقة
رمز موظّف أو جلسة
تتطلب صلاحية
prm_roles_manage Manage roles & permissions
حد المعدل
t_mutate

These are not prm_* codes and they do not affect the admin API at all. Confusing the two sets is the usual cause of "I gave the role the permission and nothing changed".

المعاملات

المعامل الوصف
idمطلوب path · integer Role id.

مكتوب لتقرأه الأدوات الآلية أيضًا

المرجع عام ولا يتطلب حسابًا، فتستطيع أداة لم تَرَ X-Radius من قبل أن تصل إلى أول استدعاء صحيح بنفسها.

/llms.txt
فهرس لكل صفحة، مع ملخّص من سطر واحد.
/llms-full.txt
المرجع كاملًا في ملف Markdown واحد، دون تنقّل يحتاج إلى زحف.
/openapi.json
‏OpenAPI 3.1، مُولَّد من الموجّه الذي يخدم هذه النسخة.
/skill.md
ملف مهارة جاهز لمساعد آلي: المصادقة وشكل الاستجابة ورموز الأخطاء في صفحة واحدة.
<page-url>.md
أضف ‎.md إلى رابط أي صفحة في المرجع لتحصل على الصفحة نفسها بصيغة Markdown.
Accept: text/markdown
أرسل هذه الترويسة على الرابط المعتاد فتصلك الإجابة بصيغة Markdown بدلًا من الصفحة.
سلّم هذا السطر إلى مساعدك الآلي
اقرأ https://x-radius.com/llms.txt، ثم اجلب نقطة النهاية التي تحتاجها بصيغة Markdown بإضافة ‎.md إلى رابطها.

جرّبه على شبكتك.

50 مشترك لمدة 7 أيام، من غير ما تدفع حاجة.