> ## 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}
PATCH /api/public/cms/[modelId]/[id]
PUT   /api/public/cms/[modelId]/[id]
```

يستخدم `PATCH` و`PUT` نفس سلوك التحديث.

## مثال

```bash theme={null}
curl "https://api.plato.ae/api/public/cms/products/entry_123?fields=id,name,published" \
  -X PATCH \
  -H "Authorization: Bearer $PLATO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "values": {
      "published": false
    }
  }'
```

## تحديثات جزئية

أرسل فقط الحقول التي تريد تغييرها.

```json theme={null}
{
  "values": {
    "price": 42
  }
}
```

الحقول غير المضمنة في الطلب تحتفظ بقيمها الحالية.

## التحديثات الميدانية المترجمة

يمكن تحديث الحقول المترجمة بلغة واحدة في كل مرة.

```json theme={null}
{
  "values": {
    "name": {
      "ar": "Classic Burger"
    }
  }
}
```

بالنسبة للحقول المترجمة، يتم دمج التحديث مع قيم اللغة الموجودة.

## إجابة

الرد هو الإدخال المحدث.

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

## تصديق

التحقق من صحة التحديثات:

* مفاتيح الحقول غير معروفة.
* الحقول المطلوبة.
* أنواع قيمة الحقل
* أهداف العلاقة.

في حالة عدم وجود معرف العلاقة في مساحة العمل، تقوم Plato بإرجاع خطأ `400`.
