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

ऑटोमेशन बनाएँ

किसी `definition` से, किसी `starter` से, या दोनों न भेजने पर ख़ाली ड्राफ़्ट बनाता है, और पूरा ऑटोमेशन लौटाता है। आपके प्रकाशित करने तक कुछ नहीं चलता।

POST/automations

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

POST /automations

किसी definition से, किसी starter से, या दोनों न भेजने पर ख़ाली ड्राफ़्ट बनाता है, और पूरा ऑटोमेशन लौटाता है। आपके प्रकाशित करने तक कुछ नहीं चलता।

उदाहरण

automations:write चाहिए।

curl
curl -X POST "$OE/automations" -H "$AUTH" -H 'content-type: application/json' -d '{  "name": "Welcome series",  "starter": "welcome-series",  "settings": { "timezone": "Europe/London" }}'
प्रतिक्रिया
{  "object": "automation",  "id": "aut_7c2e9a1f4b8d30c65e1a9f27",  "name": "Welcome series",  "description": null,  "status": "live",  "triggerKind": "audience_joined",  "stepCount": 4,  "emailCount": 2,  "hasUnpublishedChanges": false,  "publishedVersion": 2,  "pausedReason": null,  "lastError": null,  "counts": { "active": 38, "completed": 412, "exited": 9 },  "createdBy": "q7Vd3kX9mT2pLw8RzN4bYc6HfJ1sGa5E",  "publishedAt": "2026-10-02T09:14:00.000Z",  "pausedAt": null,  "archivedAt": null,  "createdAt": "2026-10-01T16:40:12.000Z",  "updatedAt": "2026-10-02T09:14:00.000Z",  "definition": {    "trigger": { "kind": "audience_joined", "audienceId": "aud_4c1b8e2a7d9f05c36b4e8a71", "includeImported": false },    "entry": "welcome",    "steps": [      {        "key": "welcome",        "kind": "send_email",        "next": "pause",        "templateId": "tpl_9c1f0a4b7e05d3862c1f0a44",        "templateVersion": null,        "from": { "email": "[email protected]", "name": "Acme" },        "replyTo": null,        "subject": null,        "props": { "firstName": { "source": "contact", "field": "firstName" } }      },      { "key": "pause", "kind": "wait", "next": "opened", "wait": { "mode": "duration", "amount": 3, "unit": "days" } },      {        "key": "opened",        "kind": "branch",        "condition": { "kind": "email_opened", "stepKey": "welcome" },        "yes": null,        "no": "nudge"      },      {        "key": "nudge",        "kind": "send_email",        "next": null,        "templateId": "tpl_8f3a1c2e9b7d4a60",        "templateVersion": null,        "from": { "email": "[email protected]", "name": "Acme" },        "replyTo": null,        "subject": "{{firstName|Hello}}, did you see this?",        "props": {}      }    ]  },  "published": { "trigger": { "kind": "audience_joined", "…": "…" }, "entry": "welcome", "steps": ["…"] },  "settings": {    "timezone": "Europe/London",    "sendWindow": { "days": [1, 2, 3, 4, 5], "startMinute": 540, "endMinute": 1020 },    "reentryDays": null,    "exitOnLeave": true,    "listAudienceId": null  },  "problems": []}

ड्राफ़्ट अधूरा हो सकता है। जो कुछ कम है वह problems में लौटता है, और सिर्फ़ प्रकाशित करते समय पूरी परिभाषा ज़रूरी होती है।

जो परिभाषा ढाँचे को ही तोड़ती है, जैसे एक ही कुंजी वाले दो चरण या दो जगहों से पहुँचा जाने वाला चरण, उसे 422 invalid_automation के साथ मना किया जाता है।

settings सेटिंग्स का कोई भी हिस्सा लेता है, और बाक़ी अपने डिफ़ॉल्ट पर रहती हैं। timezone का डिफ़ॉल्ट UTC है।

एक वर्कस्पेस डिफ़ॉल्ट रूप से 100 ऑटोमेशन रख सकता है। अगले को 422 workspace_limit_reached के साथ मना किया जाता है।

संदर्भ