दस्तावेज़ पर जाएँ
API

टेम्पलेट बनाएँ

जब तक आप प्रकाशित करने को न कहें, यह ड्राफ़्ट रहता है। ड्राफ़्ट का पूर्वावलोकन किया जा सकता है और उसे भेजा नहीं जा सकता।

POSTapi.openemail.uk/templates

असली कॉल आपकी अपनी कुंजी से आपके वर्कस्पेस पर चलाता है।

POST /templates

जब तक आप प्रकाशित करने को न कहें, यह ड्राफ़्ट रहता है। ड्राफ़्ट का पूर्वावलोकन किया जा सकता है और उसे भेजा नहीं जा सकता।

उदाहरण

templates:write चाहिए। 201 लौटाता है। slug छोड़ देने पर नाम से बनता है, और कोड में पिन करने लायक हैंडल वही है, क्योंकि नाम तो वही चीज़ है जिसे कोई बदल देता है।

curl
curl -X POST "$OE/templates" -H "$AUTH" -H "Content-Type: application/json" \  -d '{    "name": "Order shipped",    "engine": "html",    "subject": "Order {{orderId}} is on its way",    "html": "<p>Hello {{customer}}, {{orderId}} left the warehouse.</p>",    "props": [      { "key": "orderId", "kind": "text", "required": true },      { "key": "customer", "kind": "text", "default": "there" }    ],    "publish": true  }'
प्रतिक्रिया
{  "object": "template",  "id": "tpl_9c1f0a4b7e05d3862c1f0a44",  "name": "Order shipped",  "slug": "order-shipped",  "description": null,  "status": "active",  "publishedVersion": 1,  "latestVersion": 1,  "subject": "Order {{orderId}} is on its way",  "engine": "html",  "slots": [],  "props": [    { "key": "orderId", "kind": "text", "required": true, "default": null },    { "key": "customer", "kind": "text", "required": false, "default": "there" }  ],  "createdAt": "2026-08-30T10:41:02.000Z",  "updatedAt": "2026-08-30T10:41:02.000Z"}

डिप्लॉय स्क्रिप्ट से publish: true सेट करें। इसके बिना आपको संस्करण 1 ड्राफ़्ट के रूप में मिलता है, जो तब सही है जब कोई व्यक्ति पहले कॉपी पढ़ने वाला हो, और किसी भी स्वचालित चीज़ में ग़लत।

दोहरा नाम template_name_taken है और दोहरा slug template_slug_taken, दोनों 409, और अकाउंट पर नहीं बल्कि connection पर।

एक connection 200 टेम्पलेट रखता है। 201वाँ template_limit_reached है, जो बेक़ाबू स्क्रिप्ट के ख़िलाफ़ पहरा है, प्लान की सीमा नहीं।