پرش به مستندات
API

ساختن یک فرم

یک پیش‌نویس از `document`، از یک `starter`، یا اگر هیچ‌کدام را نفرستید از یک فرم ایمیل تک‌فیلدی می‌سازد، و کل فرم را برمی‌گرداند. برای فعال کردنش در همان فراخوانی `publish: true` بفرستید.

POST/forms

فراخوانی واقعی را روی فضای کاری شما اجرا می‌کند.

POST /forms

یک پیش‌نویس از document، از یک starter، یا اگر هیچ‌کدام را نفرستید از یک فرم ایمیل تک‌فیلدی می‌سازد، و کل فرم را برمی‌گرداند. برای فعال کردنش در همان فراخوانی publish: true بفرستید.

نمونه

به forms:write نیاز دارد، و وقتی تأیید دوگانه را روشن کند، فرستنده‌ای تعیین کند یا ایمیل تأیید را تنظیم کند، به emails:send هم نیاز دارد.

curl
curl -X POST "$OE/forms" -H "$AUTH" -H 'content-type: application/json' -d '{  "name": "Newsletter sign-up",  "starter": "newsletter",  "settings": {    "audienceIds": ["aud_4c1b8e2a7d9f05c36b4e8a71"],    "doubleOptIn": true,    "senderAddress": "[email protected]"  },  "publish": true}'
پاسخ
{  "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"}

settings هر زیرمجموعه‌ای از تنظیمات را می‌پذیرد، و بقیه پیش‌فرض خود را نگه می‌دارند.

هر گروه مخاطبان در settings.audienceIds، و در یک فیلد audiences، باید گروه مخاطبانی در این فضای کاری باشد که به آن دسترسی دارید، وگرنه پاسخ 404 audience_not_found است.

فرمی با تأیید دوگانه به settings.senderAddress نیاز دارد، نشانی‌ای که اجازهٔ ارسال از آن را دارید. فرستنده‌ای که نمی‌تواند ارسال کند با 422 form_sender_refused رد می‌شود.

وقتی publish برابر true است و فرم نمی‌تواند منتشر شود، چیزی ساخته نمی‌شود.

هر فضای کاری به‌طور پیش‌فرض 100 فرم نگه می‌دارد. فرم بعدی با 422 workspace_limit_reached رد می‌شود.

صندوق ورودی شما،
با شرایط خودتان.

زیرساخت ایمیل برای کسب‌وکارها، هوش مصنوعی، عامل‌ها و ایمیل شخصی. ساخته‌شده برای مقیاس، حریم خصوصی و کنترل. هر چه ایمیل باید از روز نخست می‌داشت.

© 2026 OpenEmail. همه حقوق محفوظ است.