تخطَّ إلى المستندات
API

تحديث نموذج

تحديث جزئي. يستبدل `document` المسودة كاملةً، ويواصل النموذج المنشور عرض نسخته المنشورة حتى تنشر. ويُدمج `settings` حقلًا حقلًا ويسري فورًا.

PATCH/forms/{id}

ينفّذ الاستدعاء الحقيقي على مساحة عملك.

PATCH /forms/{id}

تحديث جزئي. يستبدل document المسودة كاملةً، ويواصل النموذج المنشور عرض نسخته المنشورة حتى تنشر. ويُدمج settings حقلًا حقلًا ويسري فورًا.

مثال

يتطلب forms:write، وemails:send أيضًا حين يفعّل التأكيد المزدوج أو يحدد مُرسِلًا أو يغيّر رسالة التأكيد. أرسل قيمة updatedAt التي قرأتها بوصفها expectedUpdatedAt: فإن حفظ أحدهم النموذج في هذه الأثناء، رُفض تغييرك بدل أن يُكتب فوق ما حفظه.

curl
curl -X PATCH "$OE/forms/frm_3b9d2e7a1c4f80d56e2a9b14" -H "$AUTH" -H 'content-type: application/json' -d '{  "settings": { "successAction": "redirect", "redirectUrl": "https://acme.com/thanks" },  "expectedUpdatedAt": "2026-09-12T08:00:00.000Z"}'
الاستجابة
{  "object": "form",  "id": "frm_3b9d2e7a1c4f80d56e2a9b14",  "name": "Newsletter sign-up",  "description": null,  "status": "live",  "url": "https://openemail.uk/form/frm_3b9d2e7a1c4f80d56e2a9b14",  "subscribeUrl": "https://api.openemail.uk/subscribe/frm_3b9d2e7a1c4f80d56e2a9b14",  "audienceIds": ["aud_4c1b8e2a7d9f05c36b4e8a71"],  "doubleOptIn": true,  "hasUnpublishedChanges": true,  "document": {    "fields": [      {        "id": "fld_k2m8q4w9z1x7",        "type": "email",        "key": "email",        "label": "Email",        "placeholder": "[email protected]",        "help": null,        "required": true,        "defaultValue": null,        "options": [],        "mapsTo": "email",        "width": "full",        "minLength": null,        "maxLength": null,        "min": null,        "max": null      }    ],    "copy": {      "title": "Join our list",      "description": "News from us, about once a month.",      "submitLabel": "Subscribe",      "successTitle": "You are on the list",      "successMessage": "Thanks for signing up.",      "pendingTitle": "Check your inbox",      "pendingMessage": "Open the email we sent and confirm to finish.",      "closedTitle": "This form is closed",      "closedMessage": "It is not taking new sign-ups right now.",      "footer": null    },    "style": {      "accent": "#18181b",      "background": "#f4f4f5",      "surface": "#ffffff",      "text": "#18181b",      "font": "system",      "radius": "md",      "width": "normal",      "layout": "card",      "align": "left",      "logoUrl": null    }  },  "publishedDocument": { "fields": ["…"], "copy": { "title": "Join the list" }, "style": { "accent": "#18181b" } },  "settings": {    "audienceIds": ["aud_4c1b8e2a7d9f05c36b4e8a71"],    "doubleOptIn": true,    "senderAddress": "[email protected]",    "confirmSubject": "Please confirm your subscription",    "confirmMessage": "Confirm your email address to start getting our messages.",    "confirmButton": "Confirm my subscription",    "successAction": "message",    "redirectUrl": null,    "notifyAddresses": ["[email protected]"]  },  "audiences": [{ "id": "aud_4c1b8e2a7d9f05c36b4e8a71", "name": "Newsletter", "builtin": false }],  "senderIssue": null,  "senderProblem": null,  "stats": { "views": 1840, "submissions": 212, "added": 198, "pending": 14, "lastSubmittedAt": "2026-09-30T16:42:11.000Z" },  "publishedAt": "2026-09-12T08:00:00.000Z",  "createdAt": "2026-09-10T14:20:00.000Z",  "updatedAt": "2026-09-12T08:00:00.000Z"}

قيمة expectedUpdatedAt القديمة تعطي 409 version_conflict، ولا يُكتب شيء. اقرأ النموذج من جديد وأعد إجراء التغيير.

القيمة ذات الشكل الخاطئ، مثل لون ليس بصيغة #rrggbb أو redirectUrl ليس عنوان URL من نوع http أو https، تعطي 422 invalid_parameter، أو unknown_parameter لمفتاح لا يقبله متن الطلب. والقاعدة التي يخالفها المستند أو الإعدادات مجتمعةً تعطي 422 invalid_form. وكلاهما يسمّي الحقل في param، مثل document.fields.2.key أو settings.redirectUrl.

لتغيير حقل واحد في المستند، اقرأ النموذج وغيّر الحقل ثم أرسل document كاملًا.

صندوق بريدك،
بشروطك أنت.

بنية بريد إلكتروني للشركات والذكاء الاصطناعي والوكلاء والبريد الشخصي. مبنية للتوسّع والخصوصية والتحكّم. كل ما كان ينبغي للبريد الإلكتروني أن يملكه منذ اليوم الأول.

OpenEmail

بنية بريد إلكتروني للشركات والذكاء الاصطناعي والوكلاء والبريد الشخصي. مبنية للتوسّع والخصوصية والتحكّم. كل ما كان ينبغي للبريد الإلكتروني أن يملكه منذ اليوم الأول.

© 2026 OpenEmail. جميع الحقوق محفوظة.