---
title: "Create an automation rule"
method: POST
path: "/automation-rules"
tags: ["Automation"]
---

# Create an automation rule

`POST /automation-rules`

## Request

- Base URL: `https://muro.chat/api/v1`
- URL: `https://muro.chat/api/v1/automation-rules`
- Auth: HTTP bearer

## Request body

- AutomationRuleInput
  - `name` string, required
  - `trigger` 'conversation.created' | 'message.created', required
  - `conditions` RuleConditions
    - `match` 'all' | 'any'
    - `items` object[]
      - `field` 'content' | 'email' | 'name' | 'website_id' | 'tag'
      - `op` 'contains' | 'equals' | 'regex' | 'exists'
      - `value` string
  - `actions` object[], required
  - `enabled` boolean
  - `priority` integer

## Response `201`

Created.

- AutomationRule
  - `object` 'automation_rule'
  - `id` string
  - `name` string
  - `enabled` boolean
  - `priority` integer
  - `trigger` 'conversation.created' | 'message.created'
  - `conditions` RuleConditions
    - `match` 'all' | 'any'
    - `items` object[]
      - `field` 'content' | 'email' | 'name' | 'website_id' | 'tag'
      - `op` 'contains' | 'equals' | 'regex' | 'exists'
      - `value` string
  - `actions` object[]
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400`: Invalid rule.

---

[API](https://skmtc.dev/muro/apis/muro-rest-api.md) · [All operations](https://skmtc.dev/muro/apis/muro-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/muro/apis/muro-rest-api/revisions/94ccdc79d61a?raw)
