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

# قم بإنشاء إدخال CMS

> قم بإنشاء إدخال جديد في قاعدة بيانات CMS من واجهة خلفية موثوقة.

إنشاء إدخالات من التعليمات البرمجية من جانب الخادم فقط.

```text theme={null}
POST /api/public/cms/[modelId]/list
```

## مثال

```bash theme={null}
curl "https://api.plato.ae/api/public/cms/products/list?fields=id,name,price" \
  -X POST \
  -H "Authorization: Bearer $PLATO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "values": {
      "name": {
        "en": "Classic Burger",
        "ar": "Classic Burger"
      },
      "price": 38,
      "published": true
    }
  }'
```

## جسم

إرسال قيم الحقول داخل `values`:

```json theme={null}
{
  "values": {
    "title": {
      "en": "Summer Menu"
    },
    "published": true
  }
}
```

يقبل API أيضًا `data` أو كائن مباشر للتوافق، ولكن `values` هو التنسيق الأوضح.

## إجابة

الرد هو الإدخال الذي تم إنشاؤه.

```json theme={null}
{
    "id": "entry_123",
    "name": {
      "en": "Classic Burger",
      "ar": "Classic Burger"
    },
  "price": 38
}
```

تم بنجاح إنشاء حالة الإرجاع `201`.

## الافتراضيات والحقول المطلوبة

عندما يكون للحقل قيمة افتراضية، يمكن لـ Plato تطبيقها أثناء الإنشاء.

إذا كان الحقل المطلوب مفقودًا أو فارغًا، تقوم Plato بإرجاع:

```json theme={null}
{
  "message": "Field 'name' is required."
}
```

## حدد الرد

استخدم `fields` عندما تحتاج فقط إلى جزء من الإدخال الذي تم إنشاؤه:

```text theme={null}
?fields=id,name
```

وهذا يبقي الاستجابة متوقعة وسريعة.
