smartchat

Drafts and activation

#Automations

  • An automation that you create through the API without a status is a draft. A draft does nothing.
  • To switch it on, set the status to active. This needs the permission automations:run; automations:write alone only prepares drafts. The same permission is needed to change the trigger, the steps or the rules of an automation that is already active. Steps that call an address need webhooks:write, steps in connected apps and vault secrets need connections:run.
  • An automation that was active cannot go back to draft (that would remove waiting messages). Use paused.
  • You may activate an automation even if a template it uses is not approved yet. The automation is active; messages that need the template wait until it is approved. The answer contains a hint about this.
  • Starting an automation by hand with data (a live run) needs its own permission, automations:run.

#Newsletters

  • A newsletter starts as a draft. A draft can be changed and previewed. Nothing is sent.
  • Sending a newsletter is one step. It needs the permission newsletters:send and an Idempotency-Key. There is no second confirmation call. See Send a newsletter.
  • A newsletter that is scheduled or sent cannot be changed (newsletter_locked). Cancel it first.

#Landing page

  • You can read the landing page and edit its draft.
  • Making the draft live needs its own permission, landing:publish. It takes two calls: a preview without plan_id, then the same call with the plan_id of the preview. See Edit the landing page.
  • The live page is never taken offline. The previous live version is kept and can be restored with restore_landing_page.
  • Required parts of a landing page are fixed; an edit that would remove them is rejected (landing_ops_rejected) and nothing is changed.

#Preview, then confirm

Calls with a large or lasting effect work in two steps. The first call is a preview (a dry run): it changes nothing and answers with a plan_id. The second call carries the plan_id and does the work. A plan is valid for 10 minutes, can be used once, and only for the same request. Each of the two calls has its own Idempotency-Key. This is used by publishing the landing page, by submitting templates and by starting an automation by hand.

#Templates

  • A template draft can be created and changed with templates:write.
  • Submitting a template to WhatsApp for approval needs its own permission, templates:submit, and uses the preview and plan described above. WhatsApp decides within a few minutes to 24 hours.