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

एक संस्करण पढ़ें

एक रिवीज़न, उसकी body सहित, ताकि पुराने संस्करण में क्या है यह उसे restore किए बिना देखा जा सके।

GETapi.openemail.uk/templates/{id}/versions/{version}

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

GET /templates/{id}/versions/{version}

एक रिवीज़न, उसकी body सहित, ताकि पुराने संस्करण में क्या है यह उसे restore किए बिना देखा जा सके।

उदाहरण

templates:read चाहिए। संस्करण सूची bodies छोड़ देती है। वे यहाँ हैं।

curl
curl "$OE/templates/order-shipped/versions/3" -H "$AUTH"
प्रतिक्रिया
{  "object": "template_version",  "id": "tplv_5d31c2a8…",  "templateId": "tpl_9c1f0a4b7e05d3862c1f0a44",  "version": 3,  "state": "published",  "engine": "blocks",  "subject": "Order {{orderId}} is on its way",  "slots": [],  "props": [{ "key": "orderId", "kind": "text", "required": true, "default": null }],  "document": {    "preview": "Your order is on its way",    "tailwind": false,    "fonts": [],    "body": [{ "kind": "Heading", "text": "Order {{orderId}} is on its way" }],    "slots": [],    "props": [{ "key": "orderId", "kind": "text", "required": true, "default": null }]  },  "html": null,  "publishedAt": "2026-07-14T09:12:44.000Z",  "createdAt": "2026-07-14T09:10:02.000Z"}

किसी संस्करण को पढ़ने से कुछ नहीं बदलता। उसे restore करने पर draft खिसक जाता है, इसलिए तुलना, audit, या जिस design को आप बदल चुके हैं उसमें से कोई block निकालने के लिए यही कॉल है। उसे वापस लाना अब भी POST /templates/{id}/versions/{version}/restore का काम है।

document और html में से केवल एक में ही कुछ होता है, और कौन सा, यह engine बताता है। html वही markup है जैसा भेजा गया था, publish के समय होने वाले sanitising से पहले का, यानी PATCH में वापस यही भेजना है, वह नहीं जो पाने वाले तक पहुँचा।

जिस नंबर को किसी ने publish नहीं किया, या जो हटा दिया गया, वह 404 template_version_not_found देता है। नंबर दोबारा इस्तेमाल नहीं होते, इसलिए हटाया गया नंबर हटा ही रहता है।