تخطَّ إلى المستندات
API

نشر أتمتة

يثبّت المسودة بوصفها النسخة التالية ويشغّل الأتمتة. يدخل الأشخاص من هذه اللحظة، ولا يُضاف من استوفى شرط المشغِّل قبل ذلك.

POST/automations/{id}/publish

ينفّذ الاستدعاء الحقيقي على مساحة عملك.

POST /automations/{id}/publish

يثبّت المسودة بوصفها النسخة التالية ويشغّل الأتمتة. يدخل الأشخاص من هذه اللحظة، ولا يُضاف من استوفى شرط المشغِّل قبل ذلك.

مثال

يتطلب automations:write وemails:send.

curl
curl -X POST "$OE/automations/aut_7c2e9a1f4b8d30c65e1a9f27/publish" -H "$AUTH"
الاستجابة
{  "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": []}

المسودة التي فيها مشكلة مانعة تُرفض بـ 422 invalid_automation، وتسرد الاستجابة كل مشكلة في error.problems.

تحتاج كل خطوة بريد إلى قالب منشور فيه رابط إلغاء الاشتراك، وإلى مُرسِل يحق لهذا المفتاح أو التطبيق الإرسال باسمه. والقالب الذي لا يمكن تعبئته من دون اسم جهة الاتصال مشكلة أيضًا، لأن جهات اتصال كثيرة لا اسم لها: أعطِ القيمة بديلًا احتياطيًا.

النشر حين تكون كل الأتمتات المنشورة التي تشملها الخطة مستخدمة يجيب بـ 403 automation_limit_reached.

نشر مسودة لم تتغيّر مرة أخرى لا ينشئ نسخة جديدة. لكنه يعيد تشغيل الأتمتة المتوقفة مؤقتًا.

المرجع