---
title: "POST /api/automation-rules/"
method: POST
path: "/api/automation-rules/"
tags: ["Automation Rules"]
---

# POST /api/automation-rules/

`POST /api/automation-rules/`

Create an automation rule for the current company. The rule is saved as a draft unless status is set to active. Conditions must include at least one positive condition — a rule made only of negations matches nearly every order line.

## Request body

- object
  - `name` string, required
  - `description` string, nullable
  - `workflowId` string
  - `workflowTemplateKey` string
  - `stepConfigs` object
  - `triggerCron` string
  - `timezone` string
  - `status` 'draft' | 'active'
  - `conditions` Schema0Input, required — unresolved $ref

## Response `200`

Default Response

- object
  - `metadata` object, required
    - `success` boolean, required — True when the request succeeded.
  - `data` object, required
    - `id` string, required
    - `companyId` string, required
    - `name` string, required
    - `description` string, nullable, required
    - `resourceType` string, required
    - `status` 'draft' | 'active' | 'paused' | 'archived', required
    - `workflowId` string, required
    - `workflowKey` string, required
    - `triggerCron` string, required
    - `timezone` string, required
    - `nextRunAt` string, nullable, required
    - `lastRunAt` string, nullable, required
    - `rootGroupId` string, nullable, required
    - `conditions` Schema0, required — unresolved $ref
    - `createdAt` string, nullable, required
    - `updatedAt` string, nullable, required

## Other responses

- `400` — Default Response
- `401` — Default Response
- `403` — Default Response

## Changes

> 22 revisions in range; 1 not diffed.

- **2026-08-31** `97e51f27dc77` — 8 breaking, 1 warning, 10 info
  - request property `description` list-of-types was narrowed by removing types `null` from media type `application/json`
  - the response property `data/conditions` became nullable for the status `200`
  - the response property `data/createdAt` became nullable for the status `200`
  - the response property `data/description` became nullable for the status `200`
  - …15 more
- **2026-08-12** `ac2cf3c5eae2` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/retraced/apis/api-reference/changes/api/automation-rules/post.md)

---

[API](https://skmtc.dev/retraced/apis/api-reference.md) · [All operations](https://skmtc.dev/retraced/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/retraced/api-reference/revisions/97e51f27dc77/schema)
