フォームを更新する
部分更新です。`document` は下書きを丸ごと置き換え、公開中のフォームは公開するまで公開済みのコピーを表示し続けます。`settings` はフィールドごとにマージされ、すぐに有効になります。
実際の呼び出しをワークスペースに対して実行します。
PATCH /forms/{id}
部分更新です。document は下書きを丸ごと置き換え、公開中のフォームは公開するまで公開済みのコピーを表示し続けます。settings はフィールドごとにマージされ、すぐに有効になります。
例
forms:write が必要で、ダブルオプトインをオンにする場合、送信元を指定する場合、確認メールを変更する場合は emails:send も必要です。読み取った updatedAt を expectedUpdatedAt として送ってください。その間に誰かがフォームを保存していた場合、あなたの変更はその人の変更を上書きせずに拒否されます。
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 ではない色や、http または https の URL ではない redirectUrl のように形式が誤っている値は 422 invalid_parameter になり、ボディが受け付けないキーの場合は unknown_parameter になります。ドキュメントや設定が組み合わさって違反するルールは 422 invalid_form です。どちらも document.fields.2.key や settings.redirectUrl のように、該当するフィールドを param で示します。
ドキュメントのフィールドを 1 つだけ変えるには、フォームを読み取って変更し、document 全体を送り返してください。