Create automation
Set up an automation from a template on one of your stores, with the template’s inputs and a schedule.
- With a schedule (
daily,weeklyand the other cadences), the automation isactiveand its runs are queued at the times the schedule gives, in the store’s timezone unless you sendtimezone. - With
schedule.cadence: manual, it is adraftthat runs only when you run it now. - A template that starts when the store sends an event (it has a
trigger) takes onlyschedule.cadence: manual, and its automation isactiveat once.
The automation is set up even when the template is not ready yet (its readiness says why, such as a
connection your organisation does not have). Its runs then end refused (connection_missing), saying what
to connect, until that connection is there.
The automation is recorded as created by the person you logged in as, through the API (created_via: api-token, with your api_client_id). Answers 404 when the template or the store is not your
organisation’s, and 422 when the store is not connected, or an input or the schedule is not valid.
Needs the automations:write scope.
Authorizations
A bearer token from Login, sent as Authorization: Bearer <token>. Valid for 60 minutes; it acts as the person named at login, within their organisation, and never approves. Rotating or disabling the organisation's API credential ends every token made with it on its next call. See Authentication.
Body
The template's id, such as shopify-catalogue-quality.
^[a-z0-9][a-z0-9-]{1,80}$1 - 120The store or account it runs on. Required unless its template runs on nothing, and refused when it does.
For a template that runs on nothing, the connections it reads, by id, in
the order to read them: each the organisation's own, connected, and of a
kind in the template's connections. Refused for any other template.
1 - 20 elementsx >= 1The timezone its schedule runs in (IANA name, such as Europe/London); the store's when absent.
1 - 64