---
title: "Disable an automation"
method: POST
path: "/v1/sites/{site_id}/automations/{automation_id}/disable"
tags: ["Automations"]
---

# Disable an automation

`POST /v1/sites/{site_id}/automations/{automation_id}/disable`

## Request

- Base URL: `https://api.getsitecontrol.com`
- URL: `https://api.getsitecontrol.com/v1/sites/{site_id}/automations/{automation_id}/disable`
- Auth: HTTP bearer

Turns the automation off and returns it with `changed`. Needs the
`emails.full` permission. The change is recorded under the API key or the
user of the access token. Allowed on a suspended site and on any plan.

Runs already going on pause at their next step and are marked failed if the
automation is not turned back on within an hour; queued triggers that have
not started a run yet are dropped. External trigger
subscriptions are removed by a periodic check within a few minutes. An
automation already off is returned with `changed: false`, and nothing is
written. To turn it on again: `enable_automation`.

## Path parameters

- `site_id` integer, required
- `automation_id` integer, required: Automation id from `list_automations`

## Headers

- `Idempotency-Key` string: Makes a retry of a POST safe: a repeat with the same key, body and GSC-Version returns the stored response with `Idempotency-Replayed: true` instead of running again. The key protects against repeated execution while the key store works. Saving the change and storing the response under the key are not atomic: if the process or the key store fails between them, the change is kept, the key is released after 15 minutes and a retry runs the request again. After a timeout or a 5xx, read the resource to check the result before retrying. 5xx and 429 responses and responses over 256 KB are not stored, so a repeat runs the request again. A key is kept for 24 hours. The same key with another body or version is 422; a repeat while the first request runs is 409.

## Response `200`

Successful Response

- AutomationSwitch
  - `automation` Automation, required
    - `id` integer, required: Pass it as `automation_id`
    - `name` string, nullable: Name as shown in the dashboard
    - `is_active` boolean, required: true: the automation is on
    - `trigger` union: null when the automation has no trigger. New `type` values may be added; strict clients must accept unknown ones
      - AutomationTriggerWidgetSubmit
        - `type` 'widget_submit', required: `widget_submit`: a visitor submits a form of a chosen widget.
        - `widget_ids` integer[], nullable: The widgets whose forms start it, ids from `list_widgets`; empty while none is chosen
      - AutomationTriggerSegmentJoin
        - `type` 'segment_join', required: `segment_join`: a contact joins a chosen segment.
        - `segment_id` integer, nullable: The segment whose new members start it, from `list_segments`
      - AutomationTriggerEmailClick
        - `type` 'email_click', required: `email_click`: a contact clicks a link in an e-mail.
        - `urls` string[], nullable: The links whose clicks start it, any link when empty
      - AutomationTriggerWebhook
        - `type` 'webhook', required: `webhook`: a request to the automation's own webhook URL, or `run_automation`.
        - `webhook_url` string, nullable: Where to send the request
      - AutomationTriggerShopifyCustomerWinback
        - `type` 'shopify_customer_winback', required: `shopify_customer_winback`: a customer has not ordered for a chosen number of days.
        - `days_since_last_order` integer, nullable: Days without an order that start it
      - AutomationTriggerPlain
        - `type` 'manual' | 'shopify_order_paid' | 'shopify_order_fulfilled' | 'shopify_checkout_abandoned' | 'shopify_customer_subscribed' | 'other', required: `manual`: another automation, a contact import, the dashboard or `run_automation`. `shopify_order_paid`: an order is paid. `shopify_order_fulfilled`: an order is fulfilled. `shopify_checkout_abandoned`: a checkout is abandoned. `shopify_customer_subscribed`: a customer subscribes to e-mail marketing. `other`: a trigger the dashboard does not offer.
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required: Last change of the automation, its state or its structure; a move to a folder, new runs and changes of its e-mails do not move it
    - `created_by` Author: A user of the account, as the admin shows them.
      - `id` integer, nullable: null for Support or for a user who was deleted
      - `name` string, nullable: null when the user has no name
      - `email` string, nullable: The user's sign-in e-mail; null for Support
    - `edited_at` string, date-time, nullable: Last change made in the editor
    - `edited_by` Author: A user of the account, as the admin shows them.
      - `id` integer, nullable: null for Support or for a user who was deleted
      - `name` string, nullable: null when the user has no name
      - `email` string, nullable: The user's sign-in e-mail; null for Support
    - `folder` Folder, required
      - `id` integer, required: 0 is General, where items outside any folder are
      - `name` string, required
    - `conditions` object, nullable: The entry condition: a contact who does not match it when the trigger fires is not run (the run is `ineligible`). null when there is none. The tree is the one of segments, with the same operators and variables: Which contacts belong to the segment: a tree of conditions, applied to the contacts as they are at the moment it is used. Conditions are the condition language of the Getsitecontrol admin, with its own variable names and codes; they are not the field names and values of `Contact`. A segment written here can be edited in the admin, and the variables below are the ones the admin's condition editor offers. A node is an object with exactly `op` and `args`. A group has `op` `and` or `or` and nodes in `args`; a leaf has the variable `{{$contact.<name>}}` as the first argument, then its values: none for `*` (is set) and `undefined` (is not set), two for `between` and `!between`, one for the rest. To negate, use the opposite operator; there is no `not` node. The admin editor shows a root group whose `args` are groups, each holding leaves, as in the example; write that shape so the segment stays editable there. `{"op": "and", "args": []}` matches every contact of the site. Conditions are saved as sent. Values are integers, strings or, for `ina` and `!ina`, a list of them. | Operator | Meaning | |---|---| | `=`, `!=` | equals, differs | | `ina`, `!ina` | any of the list, none of it | | `<`, `>`, `between`, `!between` | compare; `between` includes both ends | | `^`, `$`, `in`, `match` (and `!`-forms) | starts with, ends with, contains, wildcard `*` without case | | `*`, `undefined` | is set, is not set | Text operators other than `match` are case sensitive, except on `$contact.email`: a contact's email is stored lowercase and compared without case by every operator. In `^`, `$`, `in`, `match` and their negations `_` matches any single character and `%` is a plain character. | Variable | Operators | Value | |---|---|---| | `$contact.email`, `phone`, `firstName`, `lastName` | text operators, `=`, `!=`, `ina`, `!ina`, `*`, `undefined` | string | | `$contact.country` | `=`, `!=`, `ina`, `!ina`, `*`, `undefined` | ISO 3166-1 alpha-2, upper case | | `$contact.date` | `=`, `!=`, `<`, `>`, `between`, `!between`, `*`, `undefined` | date the contact was added | | `$contact.isSubscribed` | `=` | marketing status: `S` subscribed, `U` unsubscribed, `B` bounced | | `$contact.emailQuality` | `=`, `!=`, `ina`, `!ina`, `*`, `undefined` | `Corp+`, `Corp` corporate, `Pers+`, `Pers` personal (`+` is the higher grade), `Edu` education, `Gov` government, `Risk` risky, `Temp` disposable, `Unk` unknown | | `$contact.tags` | `=`, `!=`, `ina`, `!ina`, `*`, `undefined` | tag ids from `list_tags` | | `$contact.segments` | `=`, `!=`, `ina`, `!ina` | ids from `list_segments`, as integers | | `$contact.emailSend`, `emailOpen`, `emailClick` | `=`, `!=`, `ina`, `!ina`, `*`, `undefined` | e-mail id, as `email_id` of a broadcast | | `$contact.emailSendCount`, `emailOpenCount`, `emailClickCount` | `=`, `!=`, `<`, `>`, `between`, `!between`, `*`, `undefined` | integer, not negative | | `$contact.emailSendDate`, `emailOpenDate`, `emailClickDate` | as `$contact.date` | the latest event | | `$contact.$shopifySpent`, `$shopifyOrders` | as the counts | integer | | `$contact.$shopifyOrderDate` | as `$contact.date` | the latest order | | `$contact.<field id>` | by the field type from `list_contact_fields`: text, integer, number, date or datetime | as the field; boolean and other fields are refused | `ina` and `!ina` on tags and segments take at least one id. On `$contact.tags`, `=` means the contact has that tag among its tags. `$contact.isSubscribed` compares the stored status code as the admin does: `S` does not match a contact who confirmed double opt-in, `U` does not match one who never subscribed or awaits double opt-in, and `B` matches every bounced contact. The contact statuses `subscribed`, `unsubscribed` and `bounced` are the broader groups. Ids are integers or strings of digits. A number is a 32-bit integer or a string holding one. A date is `YYYY-MM-DD` or ISO 8601 with an offset. For `$contact.date`, `$shopifyOrderDate` and datetime fields, a value at midnight is a whole day: `=` and `!=` cover the day, and the second value of `between` runs to its end. Date fields and `$contact.email*Date` compare with midnight exactly. Nested segments may not form a cycle. A list must reference each nested segment once, and not one nested inside another. Conditions are checked the way they run: nested segments must exist and the whole tree must compile, so an unknown variable or a value of the wrong type is refused. Conditions saved in the admin are returned as they are and may use other variables and values.
    - `steps` union[], required: What the automation does to a contact, in order. New `type` values may be added; strict clients must accept unknown ones
      - union
        - AutomationStepSendEmail
          - `type` 'send_email', required
          - `id` integer, required: The step's own id, kept while it exists
          - `is_active` boolean, required: false: the step is turned off and skipped by every run
          - `conditions` object, nullable: Its own condition, in the format of the automation's `conditions`: a contact who does not match skips this step and goes on to the next one. null when there is none
          - `email_id` integer, nullable: The e-mail it sends; its subject and body: `get_email`
        - AutomationStepTags
          - `type` 'add_tags' | 'remove_tags', required
          - `id` integer, required: The step's own id, kept while it exists
          - `is_active` boolean, required: false: the step is turned off and skipped by every run
          - `conditions` object, nullable: Its own condition, in the format of the automation's `conditions`: a contact who does not match skips this step and goes on to the next one. null when there is none
          - `tag_ids` integer[], nullable: The tags, from `list_tags`
        - AutomationStepDelay
          - `type` 'delay', required
          - `id` integer, required: The step's own id, kept while it exists
          - `is_active` boolean, required: false: the step is turned off and skipped by every run
          - `conditions` object, nullable: Its own condition, in the format of the automation's `conditions`: a contact who does not match skips this step and goes on to the next one. null when there is none
          - `seconds` integer, nullable: How long to wait
        - AutomationStepStartAutomation
          - `type` 'start_automation', required: `start_automation`: starts another automation for the contact.
          - `id` integer, required: The step's own id, kept while it exists
          - `is_active` boolean, required: false: the step is turned off and skipped by every run
          - `conditions` object, nullable: Its own condition, in the format of the automation's `conditions`: a contact who does not match skips this step and goes on to the next one. null when there is none
          - `automation_id` integer, nullable: The automation it starts
        - AutomationStepPlain
          - `type` 'condition' | 'other', required: `condition`: the entry condition, in runs only. `other`: a step the dashboard does not offer.
          - `id` integer, required: The step's own id, kept while it exists
          - `is_active` boolean, required: false: the step is turned off and skipped by every run
          - `conditions` object, nullable: Its own condition, in the format of the automation's `conditions`: a contact who does not match skips this step and goes on to the next one. null when there is none
    - `truncated` string[]: Parts shortened in the list, as paths; the card has them whole. Empty when nothing was cut
  - `changed` boolean, required: false when the automation already was in the requested state; nothing was written then

## Other responses

- `400`: Unsupported GSC-Version
- `401`: Missing or invalid API key or access token
- `403`: Access denied
- `404`: Not found
- `409`: Conflict
- `413`: Request body too large
- `422`: Validation failed
- `429`: Rate limited
- `503`: Temporarily unavailable; retry later

---

[API](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api.md) - [All operations](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getsitecontrol/apis/getsitecontrol-public-api/revisions/084fcad80e75?raw)
